react / react-0.13.3 / examples / basic-commonjs / node_modules / browserify / node_modules / umd / node_modules / ruglify / test / fixture / jquery.js
80759 views/*!1* jQuery JavaScript Library v1.9.12* http://jquery.com/3*4* Includes Sizzle.js5* http://sizzlejs.com/6*7* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors8* Released under the MIT license9* http://jquery.org/license10*11* Date: 2013-2-412*/13(function( window, undefined ) {1415// Can't do this because several apps including ASP.NET trace16// the stack via arguments.caller.callee and Firefox dies if17// you try to trace through "use strict" call chains. (#13335)18// Support: Firefox 18+19//"use strict";20var21// The deferred used on DOM ready22readyList,2324// A central reference to the root jQuery(document)25rootjQuery,2627// Support: IE<928// For `typeof node.method` instead of `node.method !== undefined`29core_strundefined = typeof undefined,3031// Use the correct document accordingly with window argument (sandbox)32document = window.document,33location = window.location,3435// Map over jQuery in case of overwrite36_jQuery = window.jQuery,3738// Map over the $ in case of overwrite39_$ = window.$,4041// [[Class]] -> type pairs42class2type = {},4344// List of deleted data cache ids, so we can reuse them45core_deletedIds = [],4647core_version = "1.9.1",4849// Save a reference to some core methods50core_concat = core_deletedIds.concat,51core_push = core_deletedIds.push,52core_slice = core_deletedIds.slice,53core_indexOf = core_deletedIds.indexOf,54core_toString = class2type.toString,55core_hasOwn = class2type.hasOwnProperty,56core_trim = core_version.trim,5758// Define a local copy of jQuery59jQuery = function( selector, context ) {60// The jQuery object is actually just the init constructor 'enhanced'61return new jQuery.fn.init( selector, context, rootjQuery );62},6364// Used for matching numbers65core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,6667// Used for splitting on whitespace68core_rnotwhite = /\S+/g,6970// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)71rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,7273// A simple way to check for HTML strings74// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)75// Strict HTML recognition (#11290: must start with <)76rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,7778// Match a standalone tag79rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,8081// JSON RegExp82rvalidchars = /^[\],:{}\s]*$/,83rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,84rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,85rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,8687// Matches dashed string for camelizing88rmsPrefix = /^-ms-/,89rdashAlpha = /-([\da-z])/gi,9091// Used by jQuery.camelCase as callback to replace()92fcamelCase = function( all, letter ) {93return letter.toUpperCase();94},9596// The ready event handler97completed = function( event ) {9899// readyState === "complete" is good enough for us to call the dom ready in oldIE100if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {101detach();102jQuery.ready();103}104},105// Clean-up method for dom ready events106detach = function() {107if ( document.addEventListener ) {108document.removeEventListener( "DOMContentLoaded", completed, false );109window.removeEventListener( "load", completed, false );110111} else {112document.detachEvent( "onreadystatechange", completed );113window.detachEvent( "onload", completed );114}115};116117jQuery.fn = jQuery.prototype = {118// The current version of jQuery being used119jquery: core_version,120121constructor: jQuery,122init: function( selector, context, rootjQuery ) {123var match, elem;124125// HANDLE: $(""), $(null), $(undefined), $(false)126if ( !selector ) {127return this;128}129130// Handle HTML strings131if ( typeof selector === "string" ) {132if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {133// Assume that strings that start and end with <> are HTML and skip the regex check134match = [ null, selector, null ];135136} else {137match = rquickExpr.exec( selector );138}139140// Match html or make sure no context is specified for #id141if ( match && (match[1] || !context) ) {142143// HANDLE: $(html) -> $(array)144if ( match[1] ) {145context = context instanceof jQuery ? context[0] : context;146147// scripts is true for back-compat148jQuery.merge( this, jQuery.parseHTML(149match[1],150context && context.nodeType ? context.ownerDocument || context : document,151true152) );153154// HANDLE: $(html, props)155if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {156for ( match in context ) {157// Properties of context are called as methods if possible158if ( jQuery.isFunction( this[ match ] ) ) {159this[ match ]( context[ match ] );160161// ...and otherwise set as attributes162} else {163this.attr( match, context[ match ] );164}165}166}167168return this;169170// HANDLE: $(#id)171} else {172elem = document.getElementById( match[2] );173174// Check parentNode to catch when Blackberry 4.6 returns175// nodes that are no longer in the document #6963176if ( elem && elem.parentNode ) {177// Handle the case where IE and Opera return items178// by name instead of ID179if ( elem.id !== match[2] ) {180return rootjQuery.find( selector );181}182183// Otherwise, we inject the element directly into the jQuery object184this.length = 1;185this[0] = elem;186}187188this.context = document;189this.selector = selector;190return this;191}192193// HANDLE: $(expr, $(...))194} else if ( !context || context.jquery ) {195return ( context || rootjQuery ).find( selector );196197// HANDLE: $(expr, context)198// (which is just equivalent to: $(context).find(expr)199} else {200return this.constructor( context ).find( selector );201}202203// HANDLE: $(DOMElement)204} else if ( selector.nodeType ) {205this.context = this[0] = selector;206this.length = 1;207return this;208209// HANDLE: $(function)210// Shortcut for document ready211} else if ( jQuery.isFunction( selector ) ) {212return rootjQuery.ready( selector );213}214215if ( selector.selector !== undefined ) {216this.selector = selector.selector;217this.context = selector.context;218}219220return jQuery.makeArray( selector, this );221},222223// Start with an empty selector224selector: "",225226// The default length of a jQuery object is 0227length: 0,228229// The number of elements contained in the matched element set230size: function() {231return this.length;232},233234toArray: function() {235return core_slice.call( this );236},237238// Get the Nth element in the matched element set OR239// Get the whole matched element set as a clean array240get: function( num ) {241return num == null ?242243// Return a 'clean' array244this.toArray() :245246// Return just the object247( num < 0 ? this[ this.length + num ] : this[ num ] );248},249250// Take an array of elements and push it onto the stack251// (returning the new matched element set)252pushStack: function( elems ) {253254// Build a new jQuery matched element set255var ret = jQuery.merge( this.constructor(), elems );256257// Add the old object onto the stack (as a reference)258ret.prevObject = this;259ret.context = this.context;260261// Return the newly-formed element set262return ret;263},264265// Execute a callback for every element in the matched set.266// (You can seed the arguments with an array of args, but this is267// only used internally.)268each: function( callback, args ) {269return jQuery.each( this, callback, args );270},271272ready: function( fn ) {273// Add the callback274jQuery.ready.promise().done( fn );275276return this;277},278279slice: function() {280return this.pushStack( core_slice.apply( this, arguments ) );281},282283first: function() {284return this.eq( 0 );285},286287last: function() {288return this.eq( -1 );289},290291eq: function( i ) {292var len = this.length,293j = +i + ( i < 0 ? len : 0 );294return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );295},296297map: function( callback ) {298return this.pushStack( jQuery.map(this, function( elem, i ) {299return callback.call( elem, i, elem );300}));301},302303end: function() {304return this.prevObject || this.constructor(null);305},306307// For internal use only.308// Behaves like an Array's method, not like a jQuery method.309push: core_push,310sort: [].sort,311splice: [].splice312};313314// Give the init function the jQuery prototype for later instantiation315jQuery.fn.init.prototype = jQuery.fn;316317jQuery.extend = jQuery.fn.extend = function() {318var src, copyIsArray, copy, name, options, clone,319target = arguments[0] || {},320i = 1,321length = arguments.length,322deep = false;323324// Handle a deep copy situation325if ( typeof target === "boolean" ) {326deep = target;327target = arguments[1] || {};328// skip the boolean and the target329i = 2;330}331332// Handle case when target is a string or something (possible in deep copy)333if ( typeof target !== "object" && !jQuery.isFunction(target) ) {334target = {};335}336337// extend jQuery itself if only one argument is passed338if ( length === i ) {339target = this;340--i;341}342343for ( ; i < length; i++ ) {344// Only deal with non-null/undefined values345if ( (options = arguments[ i ]) != null ) {346// Extend the base object347for ( name in options ) {348src = target[ name ];349copy = options[ name ];350351// Prevent never-ending loop352if ( target === copy ) {353continue;354}355356// Recurse if we're merging plain objects or arrays357if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {358if ( copyIsArray ) {359copyIsArray = false;360clone = src && jQuery.isArray(src) ? src : [];361362} else {363clone = src && jQuery.isPlainObject(src) ? src : {};364}365366// Never move original objects, clone them367target[ name ] = jQuery.extend( deep, clone, copy );368369// Don't bring in undefined values370} else if ( copy !== undefined ) {371target[ name ] = copy;372}373}374}375}376377// Return the modified object378return target;379};380381jQuery.extend({382noConflict: function( deep ) {383if ( window.$ === jQuery ) {384window.$ = _$;385}386387if ( deep && window.jQuery === jQuery ) {388window.jQuery = _jQuery;389}390391return jQuery;392},393394// Is the DOM ready to be used? Set to true once it occurs.395isReady: false,396397// A counter to track how many items to wait for before398// the ready event fires. See #6781399readyWait: 1,400401// Hold (or release) the ready event402holdReady: function( hold ) {403if ( hold ) {404jQuery.readyWait++;405} else {406jQuery.ready( true );407}408},409410// Handle when the DOM is ready411ready: function( wait ) {412413// Abort if there are pending holds or we're already ready414if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {415return;416}417418// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).419if ( !document.body ) {420return setTimeout( jQuery.ready );421}422423// Remember that the DOM is ready424jQuery.isReady = true;425426// If a normal DOM Ready event fired, decrement, and wait if need be427if ( wait !== true && --jQuery.readyWait > 0 ) {428return;429}430431// If there are functions bound, to execute432readyList.resolveWith( document, [ jQuery ] );433434// Trigger any bound ready events435if ( jQuery.fn.trigger ) {436jQuery( document ).trigger("ready").off("ready");437}438},439440// See test/unit/core.js for details concerning isFunction.441// Since version 1.3, DOM methods and functions like alert442// aren't supported. They return false on IE (#2968).443isFunction: function( obj ) {444return jQuery.type(obj) === "function";445},446447isArray: Array.isArray || function( obj ) {448return jQuery.type(obj) === "array";449},450451isWindow: function( obj ) {452return obj != null && obj == obj.window;453},454455isNumeric: function( obj ) {456return !isNaN( parseFloat(obj) ) && isFinite( obj );457},458459type: function( obj ) {460if ( obj == null ) {461return String( obj );462}463return typeof obj === "object" || typeof obj === "function" ?464class2type[ core_toString.call(obj) ] || "object" :465typeof obj;466},467468isPlainObject: function( obj ) {469// Must be an Object.470// Because of IE, we also have to check the presence of the constructor property.471// Make sure that DOM nodes and window objects don't pass through, as well472if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {473return false;474}475476try {477// Not own constructor property must be Object478if ( obj.constructor &&479!core_hasOwn.call(obj, "constructor") &&480!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {481return false;482}483} catch ( e ) {484// IE8,9 Will throw exceptions on certain host objects #9897485return false;486}487488// Own properties are enumerated firstly, so to speed up,489// if last one is own, then all properties are own.490491var key;492for ( key in obj ) {}493494return key === undefined || core_hasOwn.call( obj, key );495},496497isEmptyObject: function( obj ) {498var name;499for ( name in obj ) {500return false;501}502return true;503},504505error: function( msg ) {506throw new Error( msg );507},508509// data: string of html510// context (optional): If specified, the fragment will be created in this context, defaults to document511// keepScripts (optional): If true, will include scripts passed in the html string512parseHTML: function( data, context, keepScripts ) {513if ( !data || typeof data !== "string" ) {514return null;515}516if ( typeof context === "boolean" ) {517keepScripts = context;518context = false;519}520context = context || document;521522var parsed = rsingleTag.exec( data ),523scripts = !keepScripts && [];524525// Single tag526if ( parsed ) {527return [ context.createElement( parsed[1] ) ];528}529530parsed = jQuery.buildFragment( [ data ], context, scripts );531if ( scripts ) {532jQuery( scripts ).remove();533}534return jQuery.merge( [], parsed.childNodes );535},536537parseJSON: function( data ) {538// Attempt to parse using the native JSON parser first539if ( window.JSON && window.JSON.parse ) {540return window.JSON.parse( data );541}542543if ( data === null ) {544return data;545}546547if ( typeof data === "string" ) {548549// Make sure leading/trailing whitespace is removed (IE can't handle it)550data = jQuery.trim( data );551552if ( data ) {553// Make sure the incoming data is actual JSON554// Logic borrowed from http://json.org/json2.js555if ( rvalidchars.test( data.replace( rvalidescape, "@" )556.replace( rvalidtokens, "]" )557.replace( rvalidbraces, "")) ) {558559return ( new Function( "return " + data ) )();560}561}562}563564jQuery.error( "Invalid JSON: " + data );565},566567// Cross-browser xml parsing568parseXML: function( data ) {569var xml, tmp;570if ( !data || typeof data !== "string" ) {571return null;572}573try {574if ( window.DOMParser ) { // Standard575tmp = new DOMParser();576xml = tmp.parseFromString( data , "text/xml" );577} else { // IE578xml = new ActiveXObject( "Microsoft.XMLDOM" );579xml.async = "false";580xml.loadXML( data );581}582} catch( e ) {583xml = undefined;584}585if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {586jQuery.error( "Invalid XML: " + data );587}588return xml;589},590591noop: function() {},592593// Evaluates a script in a global context594// Workarounds based on findings by Jim Driscoll595// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context596globalEval: function( data ) {597if ( data && jQuery.trim( data ) ) {598// We use execScript on Internet Explorer599// We use an anonymous function so that context is window600// rather than jQuery in Firefox601( window.execScript || function( data ) {602window[ "eval" ].call( window, data );603} )( data );604}605},606607// Convert dashed to camelCase; used by the css and data modules608// Microsoft forgot to hump their vendor prefix (#9572)609camelCase: function( string ) {610return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );611},612613nodeName: function( elem, name ) {614return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();615},616617// args is for internal usage only618each: function( obj, callback, args ) {619var value,620i = 0,621length = obj.length,622isArray = isArraylike( obj );623624if ( args ) {625if ( isArray ) {626for ( ; i < length; i++ ) {627value = callback.apply( obj[ i ], args );628629if ( value === false ) {630break;631}632}633} else {634for ( i in obj ) {635value = callback.apply( obj[ i ], args );636637if ( value === false ) {638break;639}640}641}642643// A special, fast, case for the most common use of each644} else {645if ( isArray ) {646for ( ; i < length; i++ ) {647value = callback.call( obj[ i ], i, obj[ i ] );648649if ( value === false ) {650break;651}652}653} else {654for ( i in obj ) {655value = callback.call( obj[ i ], i, obj[ i ] );656657if ( value === false ) {658break;659}660}661}662}663664return obj;665},666667// Use native String.trim function wherever possible668trim: core_trim && !core_trim.call("\uFEFF\xA0") ?669function( text ) {670return text == null ?671"" :672core_trim.call( text );673} :674675// Otherwise use our own trimming functionality676function( text ) {677return text == null ?678"" :679( text + "" ).replace( rtrim, "" );680},681682// results is for internal usage only683makeArray: function( arr, results ) {684var ret = results || [];685686if ( arr != null ) {687if ( isArraylike( Object(arr) ) ) {688jQuery.merge( ret,689typeof arr === "string" ?690[ arr ] : arr691);692} else {693core_push.call( ret, arr );694}695}696697return ret;698},699700inArray: function( elem, arr, i ) {701var len;702703if ( arr ) {704if ( core_indexOf ) {705return core_indexOf.call( arr, elem, i );706}707708len = arr.length;709i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;710711for ( ; i < len; i++ ) {712// Skip accessing in sparse arrays713if ( i in arr && arr[ i ] === elem ) {714return i;715}716}717}718719return -1;720},721722merge: function( first, second ) {723var l = second.length,724i = first.length,725j = 0;726727if ( typeof l === "number" ) {728for ( ; j < l; j++ ) {729first[ i++ ] = second[ j ];730}731} else {732while ( second[j] !== undefined ) {733first[ i++ ] = second[ j++ ];734}735}736737first.length = i;738739return first;740},741742grep: function( elems, callback, inv ) {743var retVal,744ret = [],745i = 0,746length = elems.length;747inv = !!inv;748749// Go through the array, only saving the items750// that pass the validator function751for ( ; i < length; i++ ) {752retVal = !!callback( elems[ i ], i );753if ( inv !== retVal ) {754ret.push( elems[ i ] );755}756}757758return ret;759},760761// arg is for internal usage only762map: function( elems, callback, arg ) {763var value,764i = 0,765length = elems.length,766isArray = isArraylike( elems ),767ret = [];768769// Go through the array, translating each of the items to their770if ( isArray ) {771for ( ; i < length; i++ ) {772value = callback( elems[ i ], i, arg );773774if ( value != null ) {775ret[ ret.length ] = value;776}777}778779// Go through every key on the object,780} else {781for ( i in elems ) {782value = callback( elems[ i ], i, arg );783784if ( value != null ) {785ret[ ret.length ] = value;786}787}788}789790// Flatten any nested arrays791return core_concat.apply( [], ret );792},793794// A global GUID counter for objects795guid: 1,796797// Bind a function to a context, optionally partially applying any798// arguments.799proxy: function( fn, context ) {800var args, proxy, tmp;801802if ( typeof context === "string" ) {803tmp = fn[ context ];804context = fn;805fn = tmp;806}807808// Quick check to determine if target is callable, in the spec809// this throws a TypeError, but we will just return undefined.810if ( !jQuery.isFunction( fn ) ) {811return undefined;812}813814// Simulated bind815args = core_slice.call( arguments, 2 );816proxy = function() {817return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );818};819820// Set the guid of unique handler to the same of original handler, so it can be removed821proxy.guid = fn.guid = fn.guid || jQuery.guid++;822823return proxy;824},825826// Multifunctional method to get and set values of a collection827// The value/s can optionally be executed if it's a function828access: function( elems, fn, key, value, chainable, emptyGet, raw ) {829var i = 0,830length = elems.length,831bulk = key == null;832833// Sets many values834if ( jQuery.type( key ) === "object" ) {835chainable = true;836for ( i in key ) {837jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );838}839840// Sets one value841} else if ( value !== undefined ) {842chainable = true;843844if ( !jQuery.isFunction( value ) ) {845raw = true;846}847848if ( bulk ) {849// Bulk operations run against the entire set850if ( raw ) {851fn.call( elems, value );852fn = null;853854// ...except when executing function values855} else {856bulk = fn;857fn = function( elem, key, value ) {858return bulk.call( jQuery( elem ), value );859};860}861}862863if ( fn ) {864for ( ; i < length; i++ ) {865fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );866}867}868}869870return chainable ?871elems :872873// Gets874bulk ?875fn.call( elems ) :876length ? fn( elems[0], key ) : emptyGet;877},878879now: function() {880return ( new Date() ).getTime();881}882});883884jQuery.ready.promise = function( obj ) {885if ( !readyList ) {886887readyList = jQuery.Deferred();888889// Catch cases where $(document).ready() is called after the browser event has already occurred.890// we once tried to use readyState "interactive" here, but it caused issues like the one891// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15892if ( document.readyState === "complete" ) {893// Handle it asynchronously to allow scripts the opportunity to delay ready894setTimeout( jQuery.ready );895896// Standards-based browsers support DOMContentLoaded897} else if ( document.addEventListener ) {898// Use the handy event callback899document.addEventListener( "DOMContentLoaded", completed, false );900901// A fallback to window.onload, that will always work902window.addEventListener( "load", completed, false );903904// If IE event model is used905} else {906// Ensure firing before onload, maybe late but safe also for iframes907document.attachEvent( "onreadystatechange", completed );908909// A fallback to window.onload, that will always work910window.attachEvent( "onload", completed );911912// If IE and not a frame913// continually check to see if the document is ready914var top = false;915916try {917top = window.frameElement == null && document.documentElement;918} catch(e) {}919920if ( top && top.doScroll ) {921(function doScrollCheck() {922if ( !jQuery.isReady ) {923924try {925// Use the trick by Diego Perini926// http://javascript.nwbox.com/IEContentLoaded/927top.doScroll("left");928} catch(e) {929return setTimeout( doScrollCheck, 50 );930}931932// detach all dom ready events933detach();934935// and execute any waiting functions936jQuery.ready();937}938})();939}940}941}942return readyList.promise( obj );943};944945// Populate the class2type map946jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {947class2type[ "[object " + name + "]" ] = name.toLowerCase();948});949950function isArraylike( obj ) {951var length = obj.length,952type = jQuery.type( obj );953954if ( jQuery.isWindow( obj ) ) {955return false;956}957958if ( obj.nodeType === 1 && length ) {959return true;960}961962return type === "array" || type !== "function" &&963( length === 0 ||964typeof length === "number" && length > 0 && ( length - 1 ) in obj );965}966967// All jQuery objects should point back to these968rootjQuery = jQuery(document);969// String to Object options format cache970var optionsCache = {};971972// Convert String-formatted options into Object-formatted ones and store in cache973function createOptions( options ) {974var object = optionsCache[ options ] = {};975jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {976object[ flag ] = true;977});978return object;979}980981/*982* Create a callback list using the following parameters:983*984* options: an optional list of space-separated options that will change how985* the callback list behaves or a more traditional option object986*987* By default a callback list will act like an event callback list and can be988* "fired" multiple times.989*990* Possible options:991*992* once: will ensure the callback list can only be fired once (like a Deferred)993*994* memory: will keep track of previous values and will call any callback added995* after the list has been fired right away with the latest "memorized"996* values (like a Deferred)997*998* unique: will ensure a callback can only be added once (no duplicate in the list)999*1000* stopOnFalse: interrupt callings when a callback returns false1001*1002*/1003jQuery.Callbacks = function( options ) {10041005// Convert options from String-formatted to Object-formatted if needed1006// (we check in cache first)1007options = typeof options === "string" ?1008( optionsCache[ options ] || createOptions( options ) ) :1009jQuery.extend( {}, options );10101011var // Flag to know if list is currently firing1012firing,1013// Last fire value (for non-forgettable lists)1014memory,1015// Flag to know if list was already fired1016fired,1017// End of the loop when firing1018firingLength,1019// Index of currently firing callback (modified by remove if needed)1020firingIndex,1021// First callback to fire (used internally by add and fireWith)1022firingStart,1023// Actual callback list1024list = [],1025// Stack of fire calls for repeatable lists1026stack = !options.once && [],1027// Fire callbacks1028fire = function( data ) {1029memory = options.memory && data;1030fired = true;1031firingIndex = firingStart || 0;1032firingStart = 0;1033firingLength = list.length;1034firing = true;1035for ( ; list && firingIndex < firingLength; firingIndex++ ) {1036if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {1037memory = false; // To prevent further calls using add1038break;1039}1040}1041firing = false;1042if ( list ) {1043if ( stack ) {1044if ( stack.length ) {1045fire( stack.shift() );1046}1047} else if ( memory ) {1048list = [];1049} else {1050self.disable();1051}1052}1053},1054// Actual Callbacks object1055self = {1056// Add a callback or a collection of callbacks to the list1057add: function() {1058if ( list ) {1059// First, we save the current length1060var start = list.length;1061(function add( args ) {1062jQuery.each( args, function( _, arg ) {1063var type = jQuery.type( arg );1064if ( type === "function" ) {1065if ( !options.unique || !self.has( arg ) ) {1066list.push( arg );1067}1068} else if ( arg && arg.length && type !== "string" ) {1069// Inspect recursively1070add( arg );1071}1072});1073})( arguments );1074// Do we need to add the callbacks to the1075// current firing batch?1076if ( firing ) {1077firingLength = list.length;1078// With memory, if we're not firing then1079// we should call right away1080} else if ( memory ) {1081firingStart = start;1082fire( memory );1083}1084}1085return this;1086},1087// Remove a callback from the list1088remove: function() {1089if ( list ) {1090jQuery.each( arguments, function( _, arg ) {1091var index;1092while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {1093list.splice( index, 1 );1094// Handle firing indexes1095if ( firing ) {1096if ( index <= firingLength ) {1097firingLength--;1098}1099if ( index <= firingIndex ) {1100firingIndex--;1101}1102}1103}1104});1105}1106return this;1107},1108// Check if a given callback is in the list.1109// If no argument is given, return whether or not list has callbacks attached.1110has: function( fn ) {1111return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );1112},1113// Remove all callbacks from the list1114empty: function() {1115list = [];1116return this;1117},1118// Have the list do nothing anymore1119disable: function() {1120list = stack = memory = undefined;1121return this;1122},1123// Is it disabled?1124disabled: function() {1125return !list;1126},1127// Lock the list in its current state1128lock: function() {1129stack = undefined;1130if ( !memory ) {1131self.disable();1132}1133return this;1134},1135// Is it locked?1136locked: function() {1137return !stack;1138},1139// Call all callbacks with the given context and arguments1140fireWith: function( context, args ) {1141args = args || [];1142args = [ context, args.slice ? args.slice() : args ];1143if ( list && ( !fired || stack ) ) {1144if ( firing ) {1145stack.push( args );1146} else {1147fire( args );1148}1149}1150return this;1151},1152// Call all the callbacks with the given arguments1153fire: function() {1154self.fireWith( this, arguments );1155return this;1156},1157// To know if the callbacks have already been called at least once1158fired: function() {1159return !!fired;1160}1161};11621163return self;1164};1165jQuery.extend({11661167Deferred: function( func ) {1168var tuples = [1169// action, add listener, listener list, final state1170[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],1171[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],1172[ "notify", "progress", jQuery.Callbacks("memory") ]1173],1174state = "pending",1175promise = {1176state: function() {1177return state;1178},1179always: function() {1180deferred.done( arguments ).fail( arguments );1181return this;1182},1183then: function( /* fnDone, fnFail, fnProgress */ ) {1184var fns = arguments;1185return jQuery.Deferred(function( newDefer ) {1186jQuery.each( tuples, function( i, tuple ) {1187var action = tuple[ 0 ],1188fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];1189// deferred[ done | fail | progress ] for forwarding actions to newDefer1190deferred[ tuple[1] ](function() {1191var returned = fn && fn.apply( this, arguments );1192if ( returned && jQuery.isFunction( returned.promise ) ) {1193returned.promise()1194.done( newDefer.resolve )1195.fail( newDefer.reject )1196.progress( newDefer.notify );1197} else {1198newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );1199}1200});1201});1202fns = null;1203}).promise();1204},1205// Get a promise for this deferred1206// If obj is provided, the promise aspect is added to the object1207promise: function( obj ) {1208return obj != null ? jQuery.extend( obj, promise ) : promise;1209}1210},1211deferred = {};12121213// Keep pipe for back-compat1214promise.pipe = promise.then;12151216// Add list-specific methods1217jQuery.each( tuples, function( i, tuple ) {1218var list = tuple[ 2 ],1219stateString = tuple[ 3 ];12201221// promise[ done | fail | progress ] = list.add1222promise[ tuple[1] ] = list.add;12231224// Handle state1225if ( stateString ) {1226list.add(function() {1227// state = [ resolved | rejected ]1228state = stateString;12291230// [ reject_list | resolve_list ].disable; progress_list.lock1231}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );1232}12331234// deferred[ resolve | reject | notify ]1235deferred[ tuple[0] ] = function() {1236deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );1237return this;1238};1239deferred[ tuple[0] + "With" ] = list.fireWith;1240});12411242// Make the deferred a promise1243promise.promise( deferred );12441245// Call given func if any1246if ( func ) {1247func.call( deferred, deferred );1248}12491250// All done!1251return deferred;1252},12531254// Deferred helper1255when: function( subordinate /* , ..., subordinateN */ ) {1256var i = 0,1257resolveValues = core_slice.call( arguments ),1258length = resolveValues.length,12591260// the count of uncompleted subordinates1261remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,12621263// the master Deferred. If resolveValues consist of only a single Deferred, just use that.1264deferred = remaining === 1 ? subordinate : jQuery.Deferred(),12651266// Update function for both resolve and progress values1267updateFunc = function( i, contexts, values ) {1268return function( value ) {1269contexts[ i ] = this;1270values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;1271if( values === progressValues ) {1272deferred.notifyWith( contexts, values );1273} else if ( !( --remaining ) ) {1274deferred.resolveWith( contexts, values );1275}1276};1277},12781279progressValues, progressContexts, resolveContexts;12801281// add listeners to Deferred subordinates; treat others as resolved1282if ( length > 1 ) {1283progressValues = new Array( length );1284progressContexts = new Array( length );1285resolveContexts = new Array( length );1286for ( ; i < length; i++ ) {1287if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {1288resolveValues[ i ].promise()1289.done( updateFunc( i, resolveContexts, resolveValues ) )1290.fail( deferred.reject )1291.progress( updateFunc( i, progressContexts, progressValues ) );1292} else {1293--remaining;1294}1295}1296}12971298// if we're not waiting on anything, resolve the master1299if ( !remaining ) {1300deferred.resolveWith( resolveContexts, resolveValues );1301}13021303return deferred.promise();1304}1305});1306jQuery.support = (function() {13071308var support, all, a,1309input, select, fragment,1310opt, eventName, isSupported, i,1311div = document.createElement("div");13121313// Setup1314div.setAttribute( "className", "t" );1315div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";13161317// Support tests won't run in some limited or non-browser environments1318all = div.getElementsByTagName("*");1319a = div.getElementsByTagName("a")[ 0 ];1320if ( !all || !a || !all.length ) {1321return {};1322}13231324// First batch of tests1325select = document.createElement("select");1326opt = select.appendChild( document.createElement("option") );1327input = div.getElementsByTagName("input")[ 0 ];13281329a.style.cssText = "top:1px;float:left;opacity:.5";1330support = {1331// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)1332getSetAttribute: div.className !== "t",13331334// IE strips leading whitespace when .innerHTML is used1335leadingWhitespace: div.firstChild.nodeType === 3,13361337// Make sure that tbody elements aren't automatically inserted1338// IE will insert them into empty tables1339tbody: !div.getElementsByTagName("tbody").length,13401341// Make sure that link elements get serialized correctly by innerHTML1342// This requires a wrapper element in IE1343htmlSerialize: !!div.getElementsByTagName("link").length,13441345// Get the style information from getAttribute1346// (IE uses .cssText instead)1347style: /top/.test( a.getAttribute("style") ),13481349// Make sure that URLs aren't manipulated1350// (IE normalizes it by default)1351hrefNormalized: a.getAttribute("href") === "/a",13521353// Make sure that element opacity exists1354// (IE uses filter instead)1355// Use a regex to work around a WebKit issue. See #51451356opacity: /^0.5/.test( a.style.opacity ),13571358// Verify style float existence1359// (IE uses styleFloat instead of cssFloat)1360cssFloat: !!a.style.cssFloat,13611362// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)1363checkOn: !!input.value,13641365// Make sure that a selected-by-default option has a working selected property.1366// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)1367optSelected: opt.selected,13681369// Tests for enctype support on a form (#6743)1370enctype: !!document.createElement("form").enctype,13711372// Makes sure cloning an html5 element does not cause problems1373// Where outerHTML is undefined, this still works1374html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",13751376// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode1377boxModel: document.compatMode === "CSS1Compat",13781379// Will be defined later1380deleteExpando: true,1381noCloneEvent: true,1382inlineBlockNeedsLayout: false,1383shrinkWrapBlocks: false,1384reliableMarginRight: true,1385boxSizingReliable: true,1386pixelPosition: false1387};13881389// Make sure checked status is properly cloned1390input.checked = true;1391support.noCloneChecked = input.cloneNode( true ).checked;13921393// Make sure that the options inside disabled selects aren't marked as disabled1394// (WebKit marks them as disabled)1395select.disabled = true;1396support.optDisabled = !opt.disabled;13971398// Support: IE<91399try {1400delete div.test;1401} catch( e ) {1402support.deleteExpando = false;1403}14041405// Check if we can trust getAttribute("value")1406input = document.createElement("input");1407input.setAttribute( "value", "" );1408support.input = input.getAttribute( "value" ) === "";14091410// Check if an input maintains its value after becoming a radio1411input.value = "t";1412input.setAttribute( "type", "radio" );1413support.radioValue = input.value === "t";14141415// #11217 - WebKit loses check when the name is after the checked attribute1416input.setAttribute( "checked", "t" );1417input.setAttribute( "name", "t" );14181419fragment = document.createDocumentFragment();1420fragment.appendChild( input );14211422// Check if a disconnected checkbox will retain its checked1423// value of true after appended to the DOM (IE6/7)1424support.appendChecked = input.checked;14251426// WebKit doesn't clone checked state correctly in fragments1427support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;14281429// Support: IE<91430// Opera does not clone events (and typeof div.attachEvent === undefined).1431// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()1432if ( div.attachEvent ) {1433div.attachEvent( "onclick", function() {1434support.noCloneEvent = false;1435});14361437div.cloneNode( true ).click();1438}14391440// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)1441// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php1442for ( i in { submit: true, change: true, focusin: true }) {1443div.setAttribute( eventName = "on" + i, "t" );14441445support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;1446}14471448div.style.backgroundClip = "content-box";1449div.cloneNode( true ).style.backgroundClip = "";1450support.clearCloneStyle = div.style.backgroundClip === "content-box";14511452// Run tests that need a body at doc ready1453jQuery(function() {1454var container, marginDiv, tds,1455divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",1456body = document.getElementsByTagName("body")[0];14571458if ( !body ) {1459// Return for frameset docs that don't have a body1460return;1461}14621463container = document.createElement("div");1464container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";14651466body.appendChild( container ).appendChild( div );14671468// Support: IE81469// Check if table cells still have offsetWidth/Height when they are set1470// to display:none and there are still other visible table cells in a1471// table row; if so, offsetWidth/Height are not reliable for use when1472// determining if an element has been hidden directly using1473// display:none (it is still safe to use offsets if a parent element is1474// hidden; don safety goggles and see bug #4512 for more information).1475div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";1476tds = div.getElementsByTagName("td");1477tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";1478isSupported = ( tds[ 0 ].offsetHeight === 0 );14791480tds[ 0 ].style.display = "";1481tds[ 1 ].style.display = "none";14821483// Support: IE81484// Check if empty table cells still have offsetWidth/Height1485support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );14861487// Check box-sizing and margin behavior1488div.innerHTML = "";1489div.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%;";1490support.boxSizing = ( div.offsetWidth === 4 );1491support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );14921493// Use window.getComputedStyle because jsdom on node.js will break without it.1494if ( window.getComputedStyle ) {1495support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";1496support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";14971498// Check if div with explicit width and no margin-right incorrectly1499// gets computed margin-right based on width of container. (#3333)1500// Fails in WebKit before Feb 2011 nightlies1501// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right1502marginDiv = div.appendChild( document.createElement("div") );1503marginDiv.style.cssText = div.style.cssText = divReset;1504marginDiv.style.marginRight = marginDiv.style.width = "0";1505div.style.width = "1px";15061507support.reliableMarginRight =1508!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );1509}15101511if ( typeof div.style.zoom !== core_strundefined ) {1512// Support: IE<81513// Check if natively block-level elements act like inline-block1514// elements when setting their display to 'inline' and giving1515// them layout1516div.innerHTML = "";1517div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";1518support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );15191520// Support: IE61521// Check if elements with layout shrink-wrap their children1522div.style.display = "block";1523div.innerHTML = "<div></div>";1524div.firstChild.style.width = "5px";1525support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );15261527if ( support.inlineBlockNeedsLayout ) {1528// Prevent IE 6 from affecting layout for positioned elements #110481529// Prevent IE from shrinking the body in IE 7 mode #128691530// Support: IE<81531body.style.zoom = 1;1532}1533}15341535body.removeChild( container );15361537// Null elements to avoid leaks in IE1538container = div = tds = marginDiv = null;1539});15401541// Null elements to avoid leaks in IE1542all = select = fragment = opt = a = input = null;15431544return support;1545})();15461547var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,1548rmultiDash = /([A-Z])/g;15491550function internalData( elem, name, data, pvt /* Internal Use Only */ ){1551if ( !jQuery.acceptData( elem ) ) {1552return;1553}15541555var thisCache, ret,1556internalKey = jQuery.expando,1557getByName = typeof name === "string",15581559// We have to handle DOM nodes and JS objects differently because IE6-71560// can't GC object references properly across the DOM-JS boundary1561isNode = elem.nodeType,15621563// Only DOM nodes need the global jQuery cache; JS object data is1564// attached directly to the object so GC can occur automatically1565cache = isNode ? jQuery.cache : elem,15661567// Only defining an ID for JS objects if its cache already exists allows1568// the code to shortcut on the same path as a DOM node with no cache1569id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;15701571// Avoid doing any more work than we need to when trying to get data on an1572// object that has no data at all1573if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {1574return;1575}15761577if ( !id ) {1578// Only DOM nodes need a new unique ID for each element since their data1579// ends up in the global cache1580if ( isNode ) {1581elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;1582} else {1583id = internalKey;1584}1585}15861587if ( !cache[ id ] ) {1588cache[ id ] = {};15891590// Avoids exposing jQuery metadata on plain JS objects when the object1591// is serialized using JSON.stringify1592if ( !isNode ) {1593cache[ id ].toJSON = jQuery.noop;1594}1595}15961597// An object can be passed to jQuery.data instead of a key/value pair; this gets1598// shallow copied over onto the existing cache1599if ( typeof name === "object" || typeof name === "function" ) {1600if ( pvt ) {1601cache[ id ] = jQuery.extend( cache[ id ], name );1602} else {1603cache[ id ].data = jQuery.extend( cache[ id ].data, name );1604}1605}16061607thisCache = cache[ id ];16081609// jQuery data() is stored in a separate object inside the object's internal data1610// cache in order to avoid key collisions between internal data and user-defined1611// data.1612if ( !pvt ) {1613if ( !thisCache.data ) {1614thisCache.data = {};1615}16161617thisCache = thisCache.data;1618}16191620if ( data !== undefined ) {1621thisCache[ jQuery.camelCase( name ) ] = data;1622}16231624// Check for both converted-to-camel and non-converted data property names1625// If a data property was specified1626if ( getByName ) {16271628// First Try to find as-is property data1629ret = thisCache[ name ];16301631// Test for null|undefined property data1632if ( ret == null ) {16331634// Try to find the camelCased property1635ret = thisCache[ jQuery.camelCase( name ) ];1636}1637} else {1638ret = thisCache;1639}16401641return ret;1642}16431644function internalRemoveData( elem, name, pvt ) {1645if ( !jQuery.acceptData( elem ) ) {1646return;1647}16481649var i, l, thisCache,1650isNode = elem.nodeType,16511652// See jQuery.data for more information1653cache = isNode ? jQuery.cache : elem,1654id = isNode ? elem[ jQuery.expando ] : jQuery.expando;16551656// If there is already no cache entry for this object, there is no1657// purpose in continuing1658if ( !cache[ id ] ) {1659return;1660}16611662if ( name ) {16631664thisCache = pvt ? cache[ id ] : cache[ id ].data;16651666if ( thisCache ) {16671668// Support array or space separated string names for data keys1669if ( !jQuery.isArray( name ) ) {16701671// try the string as a key before any manipulation1672if ( name in thisCache ) {1673name = [ name ];1674} else {16751676// split the camel cased version by spaces unless a key with the spaces exists1677name = jQuery.camelCase( name );1678if ( name in thisCache ) {1679name = [ name ];1680} else {1681name = name.split(" ");1682}1683}1684} else {1685// If "name" is an array of keys...1686// When data is initially created, via ("key", "val") signature,1687// keys will be converted to camelCase.1688// Since there is no way to tell _how_ a key was added, remove1689// both plain key and camelCase key. #127861690// This will only penalize the array argument path.1691name = name.concat( jQuery.map( name, jQuery.camelCase ) );1692}16931694for ( i = 0, l = name.length; i < l; i++ ) {1695delete thisCache[ name[i] ];1696}16971698// If there is no data left in the cache, we want to continue1699// and let the cache object itself get destroyed1700if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {1701return;1702}1703}1704}17051706// See jQuery.data for more information1707if ( !pvt ) {1708delete cache[ id ].data;17091710// Don't destroy the parent cache unless the internal data object1711// had been the only thing left in it1712if ( !isEmptyDataObject( cache[ id ] ) ) {1713return;1714}1715}17161717// Destroy the cache1718if ( isNode ) {1719jQuery.cleanData( [ elem ], true );17201721// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)1722} else if ( jQuery.support.deleteExpando || cache != cache.window ) {1723delete cache[ id ];17241725// When all else fails, null1726} else {1727cache[ id ] = null;1728}1729}17301731jQuery.extend({1732cache: {},17331734// Unique for each copy of jQuery on the page1735// Non-digits removed to match rinlinejQuery1736expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),17371738// The following elements throw uncatchable exceptions if you1739// attempt to add expando properties to them.1740noData: {1741"embed": true,1742// Ban all objects except for Flash (which handle expandos)1743"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",1744"applet": true1745},17461747hasData: function( elem ) {1748elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];1749return !!elem && !isEmptyDataObject( elem );1750},17511752data: function( elem, name, data ) {1753return internalData( elem, name, data );1754},17551756removeData: function( elem, name ) {1757return internalRemoveData( elem, name );1758},17591760// For internal use only.1761_data: function( elem, name, data ) {1762return internalData( elem, name, data, true );1763},17641765_removeData: function( elem, name ) {1766return internalRemoveData( elem, name, true );1767},17681769// A method for determining if a DOM node can handle the data expando1770acceptData: function( elem ) {1771// Do not set data on non-element because it will not be cleared (#8335).1772if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {1773return false;1774}17751776var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];17771778// nodes accept data unless otherwise specified; rejection can be conditional1779return !noData || noData !== true && elem.getAttribute("classid") === noData;1780}1781});17821783jQuery.fn.extend({1784data: function( key, value ) {1785var attrs, name,1786elem = this[0],1787i = 0,1788data = null;17891790// Gets all values1791if ( key === undefined ) {1792if ( this.length ) {1793data = jQuery.data( elem );17941795if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {1796attrs = elem.attributes;1797for ( ; i < attrs.length; i++ ) {1798name = attrs[i].name;17991800if ( !name.indexOf( "data-" ) ) {1801name = jQuery.camelCase( name.slice(5) );18021803dataAttr( elem, name, data[ name ] );1804}1805}1806jQuery._data( elem, "parsedAttrs", true );1807}1808}18091810return data;1811}18121813// Sets multiple values1814if ( typeof key === "object" ) {1815return this.each(function() {1816jQuery.data( this, key );1817});1818}18191820return jQuery.access( this, function( value ) {18211822if ( value === undefined ) {1823// Try to fetch any internally stored data first1824return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;1825}18261827this.each(function() {1828jQuery.data( this, key, value );1829});1830}, null, value, arguments.length > 1, null, true );1831},18321833removeData: function( key ) {1834return this.each(function() {1835jQuery.removeData( this, key );1836});1837}1838});18391840function dataAttr( elem, key, data ) {1841// If nothing was found internally, try to fetch any1842// data from the HTML5 data-* attribute1843if ( data === undefined && elem.nodeType === 1 ) {18441845var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();18461847data = elem.getAttribute( name );18481849if ( typeof data === "string" ) {1850try {1851data = data === "true" ? true :1852data === "false" ? false :1853data === "null" ? null :1854// Only convert to a number if it doesn't change the string1855+data + "" === data ? +data :1856rbrace.test( data ) ? jQuery.parseJSON( data ) :1857data;1858} catch( e ) {}18591860// Make sure we set the data so it isn't changed later1861jQuery.data( elem, key, data );18621863} else {1864data = undefined;1865}1866}18671868return data;1869}18701871// checks a cache object for emptiness1872function isEmptyDataObject( obj ) {1873var name;1874for ( name in obj ) {18751876// if the public data object is empty, the private is still empty1877if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {1878continue;1879}1880if ( name !== "toJSON" ) {1881return false;1882}1883}18841885return true;1886}1887jQuery.extend({1888queue: function( elem, type, data ) {1889var queue;18901891if ( elem ) {1892type = ( type || "fx" ) + "queue";1893queue = jQuery._data( elem, type );18941895// Speed up dequeue by getting out quickly if this is just a lookup1896if ( data ) {1897if ( !queue || jQuery.isArray(data) ) {1898queue = jQuery._data( elem, type, jQuery.makeArray(data) );1899} else {1900queue.push( data );1901}1902}1903return queue || [];1904}1905},19061907dequeue: function( elem, type ) {1908type = type || "fx";19091910var queue = jQuery.queue( elem, type ),1911startLength = queue.length,1912fn = queue.shift(),1913hooks = jQuery._queueHooks( elem, type ),1914next = function() {1915jQuery.dequeue( elem, type );1916};19171918// If the fx queue is dequeued, always remove the progress sentinel1919if ( fn === "inprogress" ) {1920fn = queue.shift();1921startLength--;1922}19231924hooks.cur = fn;1925if ( fn ) {19261927// Add a progress sentinel to prevent the fx queue from being1928// automatically dequeued1929if ( type === "fx" ) {1930queue.unshift( "inprogress" );1931}19321933// clear up the last queue stop function1934delete hooks.stop;1935fn.call( elem, next, hooks );1936}19371938if ( !startLength && hooks ) {1939hooks.empty.fire();1940}1941},19421943// not intended for public consumption - generates a queueHooks object, or returns the current one1944_queueHooks: function( elem, type ) {1945var key = type + "queueHooks";1946return jQuery._data( elem, key ) || jQuery._data( elem, key, {1947empty: jQuery.Callbacks("once memory").add(function() {1948jQuery._removeData( elem, type + "queue" );1949jQuery._removeData( elem, key );1950})1951});1952}1953});19541955jQuery.fn.extend({1956queue: function( type, data ) {1957var setter = 2;19581959if ( typeof type !== "string" ) {1960data = type;1961type = "fx";1962setter--;1963}19641965if ( arguments.length < setter ) {1966return jQuery.queue( this[0], type );1967}19681969return data === undefined ?1970this :1971this.each(function() {1972var queue = jQuery.queue( this, type, data );19731974// ensure a hooks for this queue1975jQuery._queueHooks( this, type );19761977if ( type === "fx" && queue[0] !== "inprogress" ) {1978jQuery.dequeue( this, type );1979}1980});1981},1982dequeue: function( type ) {1983return this.each(function() {1984jQuery.dequeue( this, type );1985});1986},1987// Based off of the plugin by Clint Helfers, with permission.1988// http://blindsignals.com/index.php/2009/07/jquery-delay/1989delay: function( time, type ) {1990time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;1991type = type || "fx";19921993return this.queue( type, function( next, hooks ) {1994var timeout = setTimeout( next, time );1995hooks.stop = function() {1996clearTimeout( timeout );1997};1998});1999},2000clearQueue: function( type ) {2001return this.queue( type || "fx", [] );2002},2003// Get a promise resolved when queues of a certain type2004// are emptied (fx is the type by default)2005promise: function( type, obj ) {2006var tmp,2007count = 1,2008defer = jQuery.Deferred(),2009elements = this,2010i = this.length,2011resolve = function() {2012if ( !( --count ) ) {2013defer.resolveWith( elements, [ elements ] );2014}2015};20162017if ( typeof type !== "string" ) {2018obj = type;2019type = undefined;2020}2021type = type || "fx";20222023while( i-- ) {2024tmp = jQuery._data( elements[ i ], type + "queueHooks" );2025if ( tmp && tmp.empty ) {2026count++;2027tmp.empty.add( resolve );2028}2029}2030resolve();2031return defer.promise( obj );2032}2033});2034var nodeHook, boolHook,2035rclass = /[\t\r\n]/g,2036rreturn = /\r/g,2037rfocusable = /^(?:input|select|textarea|button|object)$/i,2038rclickable = /^(?:a|area)$/i,2039rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,2040ruseDefault = /^(?:checked|selected)$/i,2041getSetAttribute = jQuery.support.getSetAttribute,2042getSetInput = jQuery.support.input;20432044jQuery.fn.extend({2045attr: function( name, value ) {2046return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );2047},20482049removeAttr: function( name ) {2050return this.each(function() {2051jQuery.removeAttr( this, name );2052});2053},20542055prop: function( name, value ) {2056return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );2057},20582059removeProp: function( name ) {2060name = jQuery.propFix[ name ] || name;2061return this.each(function() {2062// try/catch handles cases where IE balks (such as removing a property on window)2063try {2064this[ name ] = undefined;2065delete this[ name ];2066} catch( e ) {}2067});2068},20692070addClass: function( value ) {2071var classes, elem, cur, clazz, j,2072i = 0,2073len = this.length,2074proceed = typeof value === "string" && value;20752076if ( jQuery.isFunction( value ) ) {2077return this.each(function( j ) {2078jQuery( this ).addClass( value.call( this, j, this.className ) );2079});2080}20812082if ( proceed ) {2083// The disjunction here is for better compressibility (see removeClass)2084classes = ( value || "" ).match( core_rnotwhite ) || [];20852086for ( ; i < len; i++ ) {2087elem = this[ i ];2088cur = elem.nodeType === 1 && ( elem.className ?2089( " " + elem.className + " " ).replace( rclass, " " ) :2090" "2091);20922093if ( cur ) {2094j = 0;2095while ( (clazz = classes[j++]) ) {2096if ( cur.indexOf( " " + clazz + " " ) < 0 ) {2097cur += clazz + " ";2098}2099}2100elem.className = jQuery.trim( cur );21012102}2103}2104}21052106return this;2107},21082109removeClass: function( value ) {2110var classes, elem, cur, clazz, j,2111i = 0,2112len = this.length,2113proceed = arguments.length === 0 || typeof value === "string" && value;21142115if ( jQuery.isFunction( value ) ) {2116return this.each(function( j ) {2117jQuery( this ).removeClass( value.call( this, j, this.className ) );2118});2119}2120if ( proceed ) {2121classes = ( value || "" ).match( core_rnotwhite ) || [];21222123for ( ; i < len; i++ ) {2124elem = this[ i ];2125// This expression is here for better compressibility (see addClass)2126cur = elem.nodeType === 1 && ( elem.className ?2127( " " + elem.className + " " ).replace( rclass, " " ) :2128""2129);21302131if ( cur ) {2132j = 0;2133while ( (clazz = classes[j++]) ) {2134// Remove *all* instances2135while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {2136cur = cur.replace( " " + clazz + " ", " " );2137}2138}2139elem.className = value ? jQuery.trim( cur ) : "";2140}2141}2142}21432144return this;2145},21462147toggleClass: function( value, stateVal ) {2148var type = typeof value,2149isBool = typeof stateVal === "boolean";21502151if ( jQuery.isFunction( value ) ) {2152return this.each(function( i ) {2153jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );2154});2155}21562157return this.each(function() {2158if ( type === "string" ) {2159// toggle individual class names2160var className,2161i = 0,2162self = jQuery( this ),2163state = stateVal,2164classNames = value.match( core_rnotwhite ) || [];21652166while ( (className = classNames[ i++ ]) ) {2167// check each className given, space separated list2168state = isBool ? state : !self.hasClass( className );2169self[ state ? "addClass" : "removeClass" ]( className );2170}21712172// Toggle whole class name2173} else if ( type === core_strundefined || type === "boolean" ) {2174if ( this.className ) {2175// store className if set2176jQuery._data( this, "__className__", this.className );2177}21782179// If the element has a class name or if we're passed "false",2180// then remove the whole classname (if there was one, the above saved it).2181// Otherwise bring back whatever was previously saved (if anything),2182// falling back to the empty string if nothing was stored.2183this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";2184}2185});2186},21872188hasClass: function( selector ) {2189var className = " " + selector + " ",2190i = 0,2191l = this.length;2192for ( ; i < l; i++ ) {2193if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {2194return true;2195}2196}21972198return false;2199},22002201val: function( value ) {2202var ret, hooks, isFunction,2203elem = this[0];22042205if ( !arguments.length ) {2206if ( elem ) {2207hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];22082209if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {2210return ret;2211}22122213ret = elem.value;22142215return typeof ret === "string" ?2216// handle most common string cases2217ret.replace(rreturn, "") :2218// handle cases where value is null/undef or number2219ret == null ? "" : ret;2220}22212222return;2223}22242225isFunction = jQuery.isFunction( value );22262227return this.each(function( i ) {2228var val,2229self = jQuery(this);22302231if ( this.nodeType !== 1 ) {2232return;2233}22342235if ( isFunction ) {2236val = value.call( this, i, self.val() );2237} else {2238val = value;2239}22402241// Treat null/undefined as ""; convert numbers to string2242if ( val == null ) {2243val = "";2244} else if ( typeof val === "number" ) {2245val += "";2246} else if ( jQuery.isArray( val ) ) {2247val = jQuery.map(val, function ( value ) {2248return value == null ? "" : value + "";2249});2250}22512252hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];22532254// If set returns undefined, fall back to normal setting2255if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {2256this.value = val;2257}2258});2259}2260});22612262jQuery.extend({2263valHooks: {2264option: {2265get: function( elem ) {2266// attributes.value is undefined in Blackberry 4.7 but2267// uses .value. See #69322268var val = elem.attributes.value;2269return !val || val.specified ? elem.value : elem.text;2270}2271},2272select: {2273get: function( elem ) {2274var value, option,2275options = elem.options,2276index = elem.selectedIndex,2277one = elem.type === "select-one" || index < 0,2278values = one ? null : [],2279max = one ? index + 1 : options.length,2280i = index < 0 ?2281max :2282one ? index : 0;22832284// Loop through all the selected options2285for ( ; i < max; i++ ) {2286option = options[ i ];22872288// oldIE doesn't update selected after form reset (#2551)2289if ( ( option.selected || i === index ) &&2290// Don't return options that are disabled or in a disabled optgroup2291( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&2292( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {22932294// Get the specific value for the option2295value = jQuery( option ).val();22962297// We don't need an array for one selects2298if ( one ) {2299return value;2300}23012302// Multi-Selects return an array2303values.push( value );2304}2305}23062307return values;2308},23092310set: function( elem, value ) {2311var values = jQuery.makeArray( value );23122313jQuery(elem).find("option").each(function() {2314this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;2315});23162317if ( !values.length ) {2318elem.selectedIndex = -1;2319}2320return values;2321}2322}2323},23242325attr: function( elem, name, value ) {2326var hooks, notxml, ret,2327nType = elem.nodeType;23282329// don't get/set attributes on text, comment and attribute nodes2330if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {2331return;2332}23332334// Fallback to prop when attributes are not supported2335if ( typeof elem.getAttribute === core_strundefined ) {2336return jQuery.prop( elem, name, value );2337}23382339notxml = nType !== 1 || !jQuery.isXMLDoc( elem );23402341// All attributes are lowercase2342// Grab necessary hook if one is defined2343if ( notxml ) {2344name = name.toLowerCase();2345hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );2346}23472348if ( value !== undefined ) {23492350if ( value === null ) {2351jQuery.removeAttr( elem, name );23522353} else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {2354return ret;23552356} else {2357elem.setAttribute( name, value + "" );2358return value;2359}23602361} else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {2362return ret;23632364} else {23652366// In IE9+, Flash objects don't have .getAttribute (#12945)2367// Support: IE9+2368if ( typeof elem.getAttribute !== core_strundefined ) {2369ret = elem.getAttribute( name );2370}23712372// Non-existent attributes return null, we normalize to undefined2373return ret == null ?2374undefined :2375ret;2376}2377},23782379removeAttr: function( elem, value ) {2380var name, propName,2381i = 0,2382attrNames = value && value.match( core_rnotwhite );23832384if ( attrNames && elem.nodeType === 1 ) {2385while ( (name = attrNames[i++]) ) {2386propName = jQuery.propFix[ name ] || name;23872388// Boolean attributes get special treatment (#10870)2389if ( rboolean.test( name ) ) {2390// Set corresponding property to false for boolean attributes2391// Also clear defaultChecked/defaultSelected (if appropriate) for IE<82392if ( !getSetAttribute && ruseDefault.test( name ) ) {2393elem[ jQuery.camelCase( "default-" + name ) ] =2394elem[ propName ] = false;2395} else {2396elem[ propName ] = false;2397}23982399// See #9699 for explanation of this approach (setting first, then removal)2400} else {2401jQuery.attr( elem, name, "" );2402}24032404elem.removeAttribute( getSetAttribute ? name : propName );2405}2406}2407},24082409attrHooks: {2410type: {2411set: function( elem, value ) {2412if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {2413// Setting the type on a radio button after the value resets the value in IE6-92414// Reset value to default in case type is set after value during creation2415var val = elem.value;2416elem.setAttribute( "type", value );2417if ( val ) {2418elem.value = val;2419}2420return value;2421}2422}2423}2424},24252426propFix: {2427tabindex: "tabIndex",2428readonly: "readOnly",2429"for": "htmlFor",2430"class": "className",2431maxlength: "maxLength",2432cellspacing: "cellSpacing",2433cellpadding: "cellPadding",2434rowspan: "rowSpan",2435colspan: "colSpan",2436usemap: "useMap",2437frameborder: "frameBorder",2438contenteditable: "contentEditable"2439},24402441prop: function( elem, name, value ) {2442var ret, hooks, notxml,2443nType = elem.nodeType;24442445// don't get/set properties on text, comment and attribute nodes2446if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {2447return;2448}24492450notxml = nType !== 1 || !jQuery.isXMLDoc( elem );24512452if ( notxml ) {2453// Fix name and attach hooks2454name = jQuery.propFix[ name ] || name;2455hooks = jQuery.propHooks[ name ];2456}24572458if ( value !== undefined ) {2459if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {2460return ret;24612462} else {2463return ( elem[ name ] = value );2464}24652466} else {2467if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {2468return ret;24692470} else {2471return elem[ name ];2472}2473}2474},24752476propHooks: {2477tabIndex: {2478get: function( elem ) {2479// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set2480// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/2481var attributeNode = elem.getAttributeNode("tabindex");24822483return attributeNode && attributeNode.specified ?2484parseInt( attributeNode.value, 10 ) :2485rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?24860 :2487undefined;2488}2489}2490}2491});24922493// Hook for boolean attributes2494boolHook = {2495get: function( elem, name ) {2496var2497// Use .prop to determine if this attribute is understood as boolean2498prop = jQuery.prop( elem, name ),24992500// Fetch it accordingly2501attr = typeof prop === "boolean" && elem.getAttribute( name ),2502detail = typeof prop === "boolean" ?25032504getSetInput && getSetAttribute ?2505attr != null :2506// oldIE fabricates an empty string for missing boolean attributes2507// and conflates checked/selected into attroperties2508ruseDefault.test( name ) ?2509elem[ jQuery.camelCase( "default-" + name ) ] :2510!!attr :25112512// fetch an attribute node for properties not recognized as boolean2513elem.getAttributeNode( name );25142515return detail && detail.value !== false ?2516name.toLowerCase() :2517undefined;2518},2519set: function( elem, value, name ) {2520if ( value === false ) {2521// Remove boolean attributes when set to false2522jQuery.removeAttr( elem, name );2523} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {2524// IE<8 needs the *property* name2525elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );25262527// Use defaultChecked and defaultSelected for oldIE2528} else {2529elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;2530}25312532return name;2533}2534};25352536// fix oldIE value attroperty2537if ( !getSetInput || !getSetAttribute ) {2538jQuery.attrHooks.value = {2539get: function( elem, name ) {2540var ret = elem.getAttributeNode( name );2541return jQuery.nodeName( elem, "input" ) ?25422543// Ignore the value *property* by using defaultValue2544elem.defaultValue :25452546ret && ret.specified ? ret.value : undefined;2547},2548set: function( elem, value, name ) {2549if ( jQuery.nodeName( elem, "input" ) ) {2550// Does not return so that setAttribute is also used2551elem.defaultValue = value;2552} else {2553// Use nodeHook if defined (#1954); otherwise setAttribute is fine2554return nodeHook && nodeHook.set( elem, value, name );2555}2556}2557};2558}25592560// IE6/7 do not support getting/setting some attributes with get/setAttribute2561if ( !getSetAttribute ) {25622563// Use this for any attribute in IE6/72564// This fixes almost every IE6/7 issue2565nodeHook = jQuery.valHooks.button = {2566get: function( elem, name ) {2567var ret = elem.getAttributeNode( name );2568return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?2569ret.value :2570undefined;2571},2572set: function( elem, value, name ) {2573// Set the existing or create a new attribute node2574var ret = elem.getAttributeNode( name );2575if ( !ret ) {2576elem.setAttributeNode(2577(ret = elem.ownerDocument.createAttribute( name ))2578);2579}25802581ret.value = value += "";25822583// Break association with cloned elements by also using setAttribute (#9646)2584return name === "value" || value === elem.getAttribute( name ) ?2585value :2586undefined;2587}2588};25892590// Set contenteditable to false on removals(#10429)2591// Setting to empty string throws an error as an invalid value2592jQuery.attrHooks.contenteditable = {2593get: nodeHook.get,2594set: function( elem, value, name ) {2595nodeHook.set( elem, value === "" ? false : value, name );2596}2597};25982599// Set width and height to auto instead of 0 on empty string( Bug #8150 )2600// This is for removals2601jQuery.each([ "width", "height" ], function( i, name ) {2602jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {2603set: function( elem, value ) {2604if ( value === "" ) {2605elem.setAttribute( name, "auto" );2606return value;2607}2608}2609});2610});2611}261226132614// Some attributes require a special call on IE2615// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx2616if ( !jQuery.support.hrefNormalized ) {2617jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {2618jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {2619get: function( elem ) {2620var ret = elem.getAttribute( name, 2 );2621return ret == null ? undefined : ret;2622}2623});2624});26252626// href/src property should get the full normalized URL (#10299/#12915)2627jQuery.each([ "href", "src" ], function( i, name ) {2628jQuery.propHooks[ name ] = {2629get: function( elem ) {2630return elem.getAttribute( name, 4 );2631}2632};2633});2634}26352636if ( !jQuery.support.style ) {2637jQuery.attrHooks.style = {2638get: function( elem ) {2639// Return undefined in the case of empty string2640// Note: IE uppercases css property names, but if we were to .toLowerCase()2641// .cssText, that would destroy case senstitivity in URL's, like in "background"2642return elem.style.cssText || undefined;2643},2644set: function( elem, value ) {2645return ( elem.style.cssText = value + "" );2646}2647};2648}26492650// Safari mis-reports the default selected property of an option2651// Accessing the parent's selectedIndex property fixes it2652if ( !jQuery.support.optSelected ) {2653jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {2654get: function( elem ) {2655var parent = elem.parentNode;26562657if ( parent ) {2658parent.selectedIndex;26592660// Make sure that it also works with optgroups, see #57012661if ( parent.parentNode ) {2662parent.parentNode.selectedIndex;2663}2664}2665return null;2666}2667});2668}26692670// IE6/7 call enctype encoding2671if ( !jQuery.support.enctype ) {2672jQuery.propFix.enctype = "encoding";2673}26742675// Radios and checkboxes getter/setter2676if ( !jQuery.support.checkOn ) {2677jQuery.each([ "radio", "checkbox" ], function() {2678jQuery.valHooks[ this ] = {2679get: function( elem ) {2680// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified2681return elem.getAttribute("value") === null ? "on" : elem.value;2682}2683};2684});2685}2686jQuery.each([ "radio", "checkbox" ], function() {2687jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {2688set: function( elem, value ) {2689if ( jQuery.isArray( value ) ) {2690return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );2691}2692}2693});2694});2695var rformElems = /^(?:input|select|textarea)$/i,2696rkeyEvent = /^key/,2697rmouseEvent = /^(?:mouse|contextmenu)|click/,2698rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,2699rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;27002701function returnTrue() {2702return true;2703}27042705function returnFalse() {2706return false;2707}27082709/*2710* Helper functions for managing events -- not part of the public interface.2711* Props to Dean Edwards' addEvent library for many of the ideas.2712*/2713jQuery.event = {27142715global: {},27162717add: function( elem, types, handler, data, selector ) {2718var tmp, events, t, handleObjIn,2719special, eventHandle, handleObj,2720handlers, type, namespaces, origType,2721elemData = jQuery._data( elem );27222723// Don't attach events to noData or text/comment nodes (but allow plain objects)2724if ( !elemData ) {2725return;2726}27272728// Caller can pass in an object of custom data in lieu of the handler2729if ( handler.handler ) {2730handleObjIn = handler;2731handler = handleObjIn.handler;2732selector = handleObjIn.selector;2733}27342735// Make sure that the handler has a unique ID, used to find/remove it later2736if ( !handler.guid ) {2737handler.guid = jQuery.guid++;2738}27392740// Init the element's event structure and main handler, if this is the first2741if ( !(events = elemData.events) ) {2742events = elemData.events = {};2743}2744if ( !(eventHandle = elemData.handle) ) {2745eventHandle = elemData.handle = function( e ) {2746// Discard the second event of a jQuery.event.trigger() and2747// when an event is called after a page has unloaded2748return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?2749jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :2750undefined;2751};2752// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events2753eventHandle.elem = elem;2754}27552756// Handle multiple events separated by a space2757// jQuery(...).bind("mouseover mouseout", fn);2758types = ( types || "" ).match( core_rnotwhite ) || [""];2759t = types.length;2760while ( t-- ) {2761tmp = rtypenamespace.exec( types[t] ) || [];2762type = origType = tmp[1];2763namespaces = ( tmp[2] || "" ).split( "." ).sort();27642765// If event changes its type, use the special event handlers for the changed type2766special = jQuery.event.special[ type ] || {};27672768// If selector defined, determine special event api type, otherwise given type2769type = ( selector ? special.delegateType : special.bindType ) || type;27702771// Update special based on newly reset type2772special = jQuery.event.special[ type ] || {};27732774// handleObj is passed to all event handlers2775handleObj = jQuery.extend({2776type: type,2777origType: origType,2778data: data,2779handler: handler,2780guid: handler.guid,2781selector: selector,2782needsContext: selector && jQuery.expr.match.needsContext.test( selector ),2783namespace: namespaces.join(".")2784}, handleObjIn );27852786// Init the event handler queue if we're the first2787if ( !(handlers = events[ type ]) ) {2788handlers = events[ type ] = [];2789handlers.delegateCount = 0;27902791// Only use addEventListener/attachEvent if the special events handler returns false2792if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {2793// Bind the global event handler to the element2794if ( elem.addEventListener ) {2795elem.addEventListener( type, eventHandle, false );27962797} else if ( elem.attachEvent ) {2798elem.attachEvent( "on" + type, eventHandle );2799}2800}2801}28022803if ( special.add ) {2804special.add.call( elem, handleObj );28052806if ( !handleObj.handler.guid ) {2807handleObj.handler.guid = handler.guid;2808}2809}28102811// Add to the element's handler list, delegates in front2812if ( selector ) {2813handlers.splice( handlers.delegateCount++, 0, handleObj );2814} else {2815handlers.push( handleObj );2816}28172818// Keep track of which events have ever been used, for event optimization2819jQuery.event.global[ type ] = true;2820}28212822// Nullify elem to prevent memory leaks in IE2823elem = null;2824},28252826// Detach an event or set of events from an element2827remove: function( elem, types, handler, selector, mappedTypes ) {2828var j, handleObj, tmp,2829origCount, t, events,2830special, handlers, type,2831namespaces, origType,2832elemData = jQuery.hasData( elem ) && jQuery._data( elem );28332834if ( !elemData || !(events = elemData.events) ) {2835return;2836}28372838// Once for each type.namespace in types; type may be omitted2839types = ( types || "" ).match( core_rnotwhite ) || [""];2840t = types.length;2841while ( t-- ) {2842tmp = rtypenamespace.exec( types[t] ) || [];2843type = origType = tmp[1];2844namespaces = ( tmp[2] || "" ).split( "." ).sort();28452846// Unbind all events (on this namespace, if provided) for the element2847if ( !type ) {2848for ( type in events ) {2849jQuery.event.remove( elem, type + types[ t ], handler, selector, true );2850}2851continue;2852}28532854special = jQuery.event.special[ type ] || {};2855type = ( selector ? special.delegateType : special.bindType ) || type;2856handlers = events[ type ] || [];2857tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );28582859// Remove matching events2860origCount = j = handlers.length;2861while ( j-- ) {2862handleObj = handlers[ j ];28632864if ( ( mappedTypes || origType === handleObj.origType ) &&2865( !handler || handler.guid === handleObj.guid ) &&2866( !tmp || tmp.test( handleObj.namespace ) ) &&2867( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {2868handlers.splice( j, 1 );28692870if ( handleObj.selector ) {2871handlers.delegateCount--;2872}2873if ( special.remove ) {2874special.remove.call( elem, handleObj );2875}2876}2877}28782879// Remove generic event handler if we removed something and no more handlers exist2880// (avoids potential for endless recursion during removal of special event handlers)2881if ( origCount && !handlers.length ) {2882if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {2883jQuery.removeEvent( elem, type, elemData.handle );2884}28852886delete events[ type ];2887}2888}28892890// Remove the expando if it's no longer used2891if ( jQuery.isEmptyObject( events ) ) {2892delete elemData.handle;28932894// removeData also checks for emptiness and clears the expando if empty2895// so use it instead of delete2896jQuery._removeData( elem, "events" );2897}2898},28992900trigger: function( event, data, elem, onlyHandlers ) {2901var handle, ontype, cur,2902bubbleType, special, tmp, i,2903eventPath = [ elem || document ],2904type = core_hasOwn.call( event, "type" ) ? event.type : event,2905namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];29062907cur = tmp = elem = elem || document;29082909// Don't do events on text and comment nodes2910if ( elem.nodeType === 3 || elem.nodeType === 8 ) {2911return;2912}29132914// focus/blur morphs to focusin/out; ensure we're not firing them right now2915if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {2916return;2917}29182919if ( type.indexOf(".") >= 0 ) {2920// Namespaced trigger; create a regexp to match event type in handle()2921namespaces = type.split(".");2922type = namespaces.shift();2923namespaces.sort();2924}2925ontype = type.indexOf(":") < 0 && "on" + type;29262927// Caller can pass in a jQuery.Event object, Object, or just an event type string2928event = event[ jQuery.expando ] ?2929event :2930new jQuery.Event( type, typeof event === "object" && event );29312932event.isTrigger = true;2933event.namespace = namespaces.join(".");2934event.namespace_re = event.namespace ?2935new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :2936null;29372938// Clean up the event in case it is being reused2939event.result = undefined;2940if ( !event.target ) {2941event.target = elem;2942}29432944// Clone any incoming data and prepend the event, creating the handler arg list2945data = data == null ?2946[ event ] :2947jQuery.makeArray( data, [ event ] );29482949// Allow special events to draw outside the lines2950special = jQuery.event.special[ type ] || {};2951if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {2952return;2953}29542955// Determine event propagation path in advance, per W3C events spec (#9951)2956// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)2957if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {29582959bubbleType = special.delegateType || type;2960if ( !rfocusMorph.test( bubbleType + type ) ) {2961cur = cur.parentNode;2962}2963for ( ; cur; cur = cur.parentNode ) {2964eventPath.push( cur );2965tmp = cur;2966}29672968// Only add window if we got to document (e.g., not plain obj or detached DOM)2969if ( tmp === (elem.ownerDocument || document) ) {2970eventPath.push( tmp.defaultView || tmp.parentWindow || window );2971}2972}29732974// Fire handlers on the event path2975i = 0;2976while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {29772978event.type = i > 1 ?2979bubbleType :2980special.bindType || type;29812982// jQuery handler2983handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );2984if ( handle ) {2985handle.apply( cur, data );2986}29872988// Native handler2989handle = ontype && cur[ ontype ];2990if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {2991event.preventDefault();2992}2993}2994event.type = type;29952996// If nobody prevented the default action, do it now2997if ( !onlyHandlers && !event.isDefaultPrevented() ) {29982999if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&3000!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {30013002// Call a native DOM method on the target with the same name name as the event.3003// Can't use an .isFunction() check here because IE6/7 fails that test.3004// Don't do default actions on window, that's where global variables be (#6170)3005if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {30063007// Don't re-trigger an onFOO event when we call its FOO() method3008tmp = elem[ ontype ];30093010if ( tmp ) {3011elem[ ontype ] = null;3012}30133014// Prevent re-triggering of the same event, since we already bubbled it above3015jQuery.event.triggered = type;3016try {3017elem[ type ]();3018} catch ( e ) {3019// IE<9 dies on focus/blur to hidden element (#1486,#12518)3020// only reproducible on winXP IE8 native, not IE9 in IE8 mode3021}3022jQuery.event.triggered = undefined;30233024if ( tmp ) {3025elem[ ontype ] = tmp;3026}3027}3028}3029}30303031return event.result;3032},30333034dispatch: function( event ) {30353036// Make a writable jQuery.Event from the native event object3037event = jQuery.event.fix( event );30383039var i, ret, handleObj, matched, j,3040handlerQueue = [],3041args = core_slice.call( arguments ),3042handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],3043special = jQuery.event.special[ event.type ] || {};30443045// Use the fix-ed jQuery.Event rather than the (read-only) native event3046args[0] = event;3047event.delegateTarget = this;30483049// Call the preDispatch hook for the mapped type, and let it bail if desired3050if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {3051return;3052}30533054// Determine handlers3055handlerQueue = jQuery.event.handlers.call( this, event, handlers );30563057// Run delegates first; they may want to stop propagation beneath us3058i = 0;3059while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {3060event.currentTarget = matched.elem;30613062j = 0;3063while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {30643065// Triggered event must either 1) have no namespace, or3066// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).3067if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {30683069event.handleObj = handleObj;3070event.data = handleObj.data;30713072ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )3073.apply( matched.elem, args );30743075if ( ret !== undefined ) {3076if ( (event.result = ret) === false ) {3077event.preventDefault();3078event.stopPropagation();3079}3080}3081}3082}3083}30843085// Call the postDispatch hook for the mapped type3086if ( special.postDispatch ) {3087special.postDispatch.call( this, event );3088}30893090return event.result;3091},30923093handlers: function( event, handlers ) {3094var sel, handleObj, matches, i,3095handlerQueue = [],3096delegateCount = handlers.delegateCount,3097cur = event.target;30983099// Find delegate handlers3100// Black-hole SVG <use> instance trees (#13180)3101// Avoid non-left-click bubbling in Firefox (#3861)3102if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {31033104for ( ; cur != this; cur = cur.parentNode || this ) {31053106// Don't check non-elements (#13208)3107// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)3108if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {3109matches = [];3110for ( i = 0; i < delegateCount; i++ ) {3111handleObj = handlers[ i ];31123113// Don't conflict with Object.prototype properties (#13203)3114sel = handleObj.selector + " ";31153116if ( matches[ sel ] === undefined ) {3117matches[ sel ] = handleObj.needsContext ?3118jQuery( sel, this ).index( cur ) >= 0 :3119jQuery.find( sel, this, null, [ cur ] ).length;3120}3121if ( matches[ sel ] ) {3122matches.push( handleObj );3123}3124}3125if ( matches.length ) {3126handlerQueue.push({ elem: cur, handlers: matches });3127}3128}3129}3130}31313132// Add the remaining (directly-bound) handlers3133if ( delegateCount < handlers.length ) {3134handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });3135}31363137return handlerQueue;3138},31393140fix: function( event ) {3141if ( event[ jQuery.expando ] ) {3142return event;3143}31443145// Create a writable copy of the event object and normalize some properties3146var i, prop, copy,3147type = event.type,3148originalEvent = event,3149fixHook = this.fixHooks[ type ];31503151if ( !fixHook ) {3152this.fixHooks[ type ] = fixHook =3153rmouseEvent.test( type ) ? this.mouseHooks :3154rkeyEvent.test( type ) ? this.keyHooks :3155{};3156}3157copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;31583159event = new jQuery.Event( originalEvent );31603161i = copy.length;3162while ( i-- ) {3163prop = copy[ i ];3164event[ prop ] = originalEvent[ prop ];3165}31663167// Support: IE<93168// Fix target property (#1925)3169if ( !event.target ) {3170event.target = originalEvent.srcElement || document;3171}31723173// Support: Chrome 23+, Safari?3174// Target should not be a text node (#504, #13143)3175if ( event.target.nodeType === 3 ) {3176event.target = event.target.parentNode;3177}31783179// Support: IE<93180// For mouse/key events, metaKey==false if it's undefined (#3368, #11328)3181event.metaKey = !!event.metaKey;31823183return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;3184},31853186// Includes some event props shared by KeyEvent and MouseEvent3187props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),31883189fixHooks: {},31903191keyHooks: {3192props: "char charCode key keyCode".split(" "),3193filter: function( event, original ) {31943195// Add which for key events3196if ( event.which == null ) {3197event.which = original.charCode != null ? original.charCode : original.keyCode;3198}31993200return event;3201}3202},32033204mouseHooks: {3205props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),3206filter: function( event, original ) {3207var body, eventDoc, doc,3208button = original.button,3209fromElement = original.fromElement;32103211// Calculate pageX/Y if missing and clientX/Y available3212if ( event.pageX == null && original.clientX != null ) {3213eventDoc = event.target.ownerDocument || document;3214doc = eventDoc.documentElement;3215body = eventDoc.body;32163217event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );3218event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );3219}32203221// Add relatedTarget, if necessary3222if ( !event.relatedTarget && fromElement ) {3223event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;3224}32253226// Add which for click: 1 === left; 2 === middle; 3 === right3227// Note: button is not normalized, so don't use it3228if ( !event.which && button !== undefined ) {3229event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );3230}32313232return event;3233}3234},32353236special: {3237load: {3238// Prevent triggered image.load events from bubbling to window.load3239noBubble: true3240},3241click: {3242// For checkbox, fire native event so checked state will be right3243trigger: function() {3244if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {3245this.click();3246return false;3247}3248}3249},3250focus: {3251// Fire native event if possible so blur/focus sequence is correct3252trigger: function() {3253if ( this !== document.activeElement && this.focus ) {3254try {3255this.focus();3256return false;3257} catch ( e ) {3258// Support: IE<93259// If we error on focus to hidden element (#1486, #12518),3260// let .trigger() run the handlers3261}3262}3263},3264delegateType: "focusin"3265},3266blur: {3267trigger: function() {3268if ( this === document.activeElement && this.blur ) {3269this.blur();3270return false;3271}3272},3273delegateType: "focusout"3274},32753276beforeunload: {3277postDispatch: function( event ) {32783279// Even when returnValue equals to undefined Firefox will still show alert3280if ( event.result !== undefined ) {3281event.originalEvent.returnValue = event.result;3282}3283}3284}3285},32863287simulate: function( type, elem, event, bubble ) {3288// Piggyback on a donor event to simulate a different one.3289// Fake originalEvent to avoid donor's stopPropagation, but if the3290// simulated event prevents default then we do the same on the donor.3291var e = jQuery.extend(3292new jQuery.Event(),3293event,3294{ type: type,3295isSimulated: true,3296originalEvent: {}3297}3298);3299if ( bubble ) {3300jQuery.event.trigger( e, null, elem );3301} else {3302jQuery.event.dispatch.call( elem, e );3303}3304if ( e.isDefaultPrevented() ) {3305event.preventDefault();3306}3307}3308};33093310jQuery.removeEvent = document.removeEventListener ?3311function( elem, type, handle ) {3312if ( elem.removeEventListener ) {3313elem.removeEventListener( type, handle, false );3314}3315} :3316function( elem, type, handle ) {3317var name = "on" + type;33183319if ( elem.detachEvent ) {33203321// #8545, #7054, preventing memory leaks for custom events in IE6-83322// detachEvent needed property on element, by name of that event, to properly expose it to GC3323if ( typeof elem[ name ] === core_strundefined ) {3324elem[ name ] = null;3325}33263327elem.detachEvent( name, handle );3328}3329};33303331jQuery.Event = function( src, props ) {3332// Allow instantiation without the 'new' keyword3333if ( !(this instanceof jQuery.Event) ) {3334return new jQuery.Event( src, props );3335}33363337// Event object3338if ( src && src.type ) {3339this.originalEvent = src;3340this.type = src.type;33413342// Events bubbling up the document may have been marked as prevented3343// by a handler lower down the tree; reflect the correct value.3344this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||3345src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;33463347// Event type3348} else {3349this.type = src;3350}33513352// Put explicitly provided properties onto the event object3353if ( props ) {3354jQuery.extend( this, props );3355}33563357// Create a timestamp if incoming event doesn't have one3358this.timeStamp = src && src.timeStamp || jQuery.now();33593360// Mark it as fixed3361this[ jQuery.expando ] = true;3362};33633364// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding3365// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html3366jQuery.Event.prototype = {3367isDefaultPrevented: returnFalse,3368isPropagationStopped: returnFalse,3369isImmediatePropagationStopped: returnFalse,33703371preventDefault: function() {3372var e = this.originalEvent;33733374this.isDefaultPrevented = returnTrue;3375if ( !e ) {3376return;3377}33783379// If preventDefault exists, run it on the original event3380if ( e.preventDefault ) {3381e.preventDefault();33823383// Support: IE3384// Otherwise set the returnValue property of the original event to false3385} else {3386e.returnValue = false;3387}3388},3389stopPropagation: function() {3390var e = this.originalEvent;33913392this.isPropagationStopped = returnTrue;3393if ( !e ) {3394return;3395}3396// If stopPropagation exists, run it on the original event3397if ( e.stopPropagation ) {3398e.stopPropagation();3399}34003401// Support: IE3402// Set the cancelBubble property of the original event to true3403e.cancelBubble = true;3404},3405stopImmediatePropagation: function() {3406this.isImmediatePropagationStopped = returnTrue;3407this.stopPropagation();3408}3409};34103411// Create mouseenter/leave events using mouseover/out and event-time checks3412jQuery.each({3413mouseenter: "mouseover",3414mouseleave: "mouseout"3415}, function( orig, fix ) {3416jQuery.event.special[ orig ] = {3417delegateType: fix,3418bindType: fix,34193420handle: function( event ) {3421var ret,3422target = this,3423related = event.relatedTarget,3424handleObj = event.handleObj;34253426// For mousenter/leave call the handler if related is outside the target.3427// NB: No relatedTarget if the mouse left/entered the browser window3428if ( !related || (related !== target && !jQuery.contains( target, related )) ) {3429event.type = handleObj.origType;3430ret = handleObj.handler.apply( this, arguments );3431event.type = fix;3432}3433return ret;3434}3435};3436});34373438// IE submit delegation3439if ( !jQuery.support.submitBubbles ) {34403441jQuery.event.special.submit = {3442setup: function() {3443// Only need this for delegated form submit events3444if ( jQuery.nodeName( this, "form" ) ) {3445return false;3446}34473448// Lazy-add a submit handler when a descendant form may potentially be submitted3449jQuery.event.add( this, "click._submit keypress._submit", function( e ) {3450// Node name check avoids a VML-related crash in IE (#9807)3451var elem = e.target,3452form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;3453if ( form && !jQuery._data( form, "submitBubbles" ) ) {3454jQuery.event.add( form, "submit._submit", function( event ) {3455event._submit_bubble = true;3456});3457jQuery._data( form, "submitBubbles", true );3458}3459});3460// return undefined since we don't need an event listener3461},34623463postDispatch: function( event ) {3464// If form was submitted by the user, bubble the event up the tree3465if ( event._submit_bubble ) {3466delete event._submit_bubble;3467if ( this.parentNode && !event.isTrigger ) {3468jQuery.event.simulate( "submit", this.parentNode, event, true );3469}3470}3471},34723473teardown: function() {3474// Only need this for delegated form submit events3475if ( jQuery.nodeName( this, "form" ) ) {3476return false;3477}34783479// Remove delegated handlers; cleanData eventually reaps submit handlers attached above3480jQuery.event.remove( this, "._submit" );3481}3482};3483}34843485// IE change delegation and checkbox/radio fix3486if ( !jQuery.support.changeBubbles ) {34873488jQuery.event.special.change = {34893490setup: function() {34913492if ( rformElems.test( this.nodeName ) ) {3493// IE doesn't fire change on a check/radio until blur; trigger it on click3494// after a propertychange. Eat the blur-change in special.change.handle.3495// This still fires onchange a second time for check/radio after blur.3496if ( this.type === "checkbox" || this.type === "radio" ) {3497jQuery.event.add( this, "propertychange._change", function( event ) {3498if ( event.originalEvent.propertyName === "checked" ) {3499this._just_changed = true;3500}3501});3502jQuery.event.add( this, "click._change", function( event ) {3503if ( this._just_changed && !event.isTrigger ) {3504this._just_changed = false;3505}3506// Allow triggered, simulated change events (#11500)3507jQuery.event.simulate( "change", this, event, true );3508});3509}3510return false;3511}3512// Delegated event; lazy-add a change handler on descendant inputs3513jQuery.event.add( this, "beforeactivate._change", function( e ) {3514var elem = e.target;35153516if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {3517jQuery.event.add( elem, "change._change", function( event ) {3518if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {3519jQuery.event.simulate( "change", this.parentNode, event, true );3520}3521});3522jQuery._data( elem, "changeBubbles", true );3523}3524});3525},35263527handle: function( event ) {3528var elem = event.target;35293530// Swallow native change events from checkbox/radio, we already triggered them above3531if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {3532return event.handleObj.handler.apply( this, arguments );3533}3534},35353536teardown: function() {3537jQuery.event.remove( this, "._change" );35383539return !rformElems.test( this.nodeName );3540}3541};3542}35433544// Create "bubbling" focus and blur events3545if ( !jQuery.support.focusinBubbles ) {3546jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {35473548// Attach a single capturing handler while someone wants focusin/focusout3549var attaches = 0,3550handler = function( event ) {3551jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );3552};35533554jQuery.event.special[ fix ] = {3555setup: function() {3556if ( attaches++ === 0 ) {3557document.addEventListener( orig, handler, true );3558}3559},3560teardown: function() {3561if ( --attaches === 0 ) {3562document.removeEventListener( orig, handler, true );3563}3564}3565};3566});3567}35683569jQuery.fn.extend({35703571on: function( types, selector, data, fn, /*INTERNAL*/ one ) {3572var type, origFn;35733574// Types can be a map of types/handlers3575if ( typeof types === "object" ) {3576// ( types-Object, selector, data )3577if ( typeof selector !== "string" ) {3578// ( types-Object, data )3579data = data || selector;3580selector = undefined;3581}3582for ( type in types ) {3583this.on( type, selector, data, types[ type ], one );3584}3585return this;3586}35873588if ( data == null && fn == null ) {3589// ( types, fn )3590fn = selector;3591data = selector = undefined;3592} else if ( fn == null ) {3593if ( typeof selector === "string" ) {3594// ( types, selector, fn )3595fn = data;3596data = undefined;3597} else {3598// ( types, data, fn )3599fn = data;3600data = selector;3601selector = undefined;3602}3603}3604if ( fn === false ) {3605fn = returnFalse;3606} else if ( !fn ) {3607return this;3608}36093610if ( one === 1 ) {3611origFn = fn;3612fn = function( event ) {3613// Can use an empty set, since event contains the info3614jQuery().off( event );3615return origFn.apply( this, arguments );3616};3617// Use same guid so caller can remove using origFn3618fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );3619}3620return this.each( function() {3621jQuery.event.add( this, types, fn, data, selector );3622});3623},3624one: function( types, selector, data, fn ) {3625return this.on( types, selector, data, fn, 1 );3626},3627off: function( types, selector, fn ) {3628var handleObj, type;3629if ( types && types.preventDefault && types.handleObj ) {3630// ( event ) dispatched jQuery.Event3631handleObj = types.handleObj;3632jQuery( types.delegateTarget ).off(3633handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,3634handleObj.selector,3635handleObj.handler3636);3637return this;3638}3639if ( typeof types === "object" ) {3640// ( types-object [, selector] )3641for ( type in types ) {3642this.off( type, selector, types[ type ] );3643}3644return this;3645}3646if ( selector === false || typeof selector === "function" ) {3647// ( types [, fn] )3648fn = selector;3649selector = undefined;3650}3651if ( fn === false ) {3652fn = returnFalse;3653}3654return this.each(function() {3655jQuery.event.remove( this, types, fn, selector );3656});3657},36583659bind: function( types, data, fn ) {3660return this.on( types, null, data, fn );3661},3662unbind: function( types, fn ) {3663return this.off( types, null, fn );3664},36653666delegate: function( selector, types, data, fn ) {3667return this.on( types, selector, data, fn );3668},3669undelegate: function( selector, types, fn ) {3670// ( namespace ) or ( selector, types [, fn] )3671return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );3672},36733674trigger: function( type, data ) {3675return this.each(function() {3676jQuery.event.trigger( type, data, this );3677});3678},3679triggerHandler: function( type, data ) {3680var elem = this[0];3681if ( elem ) {3682return jQuery.event.trigger( type, data, elem, true );3683}3684}3685});3686/*!3687* Sizzle CSS Selector Engine3688* Copyright 2012 jQuery Foundation and other contributors3689* Released under the MIT license3690* http://sizzlejs.com/3691*/3692(function( window, undefined ) {36933694var i,3695cachedruns,3696Expr,3697getText,3698isXML,3699compile,3700hasDuplicate,3701outermostContext,37023703// Local document vars3704setDocument,3705document,3706docElem,3707documentIsXML,3708rbuggyQSA,3709rbuggyMatches,3710matches,3711contains,3712sortOrder,37133714// Instance-specific data3715expando = "sizzle" + -(new Date()),3716preferredDoc = window.document,3717support = {},3718dirruns = 0,3719done = 0,3720classCache = createCache(),3721tokenCache = createCache(),3722compilerCache = createCache(),37233724// General-purpose constants3725strundefined = typeof undefined,3726MAX_NEGATIVE = 1 << 31,37273728// Array methods3729arr = [],3730pop = arr.pop,3731push = arr.push,3732slice = arr.slice,3733// Use a stripped-down indexOf if we can't use a native one3734indexOf = arr.indexOf || function( elem ) {3735var i = 0,3736len = this.length;3737for ( ; i < len; i++ ) {3738if ( this[i] === elem ) {3739return i;3740}3741}3742return -1;3743},374437453746// Regular expressions37473748// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace3749whitespace = "[\\x20\\t\\r\\n\\f]",3750// http://www.w3.org/TR/css3-syntax/#characters3751characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",37523753// Loosely modeled on CSS identifier characters3754// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors3755// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier3756identifier = characterEncoding.replace( "w", "w#" ),37573758// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors3759operators = "([*^$|!~]?=)",3760attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +3761"*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",37623763// Prefer arguments quoted,3764// then not containing pseudos/brackets,3765// then attribute selectors/non-parenthetical expressions,3766// then anything else3767// These preferences are here to reduce the number of selectors3768// needing tokenize in the PSEUDO preFilter3769pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",37703771// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter3772rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),37733774rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),3775rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),3776rpseudo = new RegExp( pseudos ),3777ridentifier = new RegExp( "^" + identifier + "$" ),37783779matchExpr = {3780"ID": new RegExp( "^#(" + characterEncoding + ")" ),3781"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),3782"NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),3783"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),3784"ATTR": new RegExp( "^" + attributes ),3785"PSEUDO": new RegExp( "^" + pseudos ),3786"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +3787"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +3788"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),3789// For use in libraries implementing .is()3790// We use this for POS matching in `select`3791"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +3792whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )3793},37943795rsibling = /[\x20\t\r\n\f]*[+~]/,37963797rnative = /^[^{]+\{\s*\[native code/,37983799// Easily-parseable/retrievable ID or TAG or CLASS selectors3800rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,38013802rinputs = /^(?:input|select|textarea|button)$/i,3803rheader = /^h\d$/i,38043805rescape = /'|\\/g,3806rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,38073808// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters3809runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,3810funescape = function( _, escaped ) {3811var high = "0x" + escaped - 0x10000;3812// NaN means non-codepoint3813return high !== high ?3814escaped :3815// BMP codepoint3816high < 0 ?3817String.fromCharCode( high + 0x10000 ) :3818// Supplemental Plane codepoint (surrogate pair)3819String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );3820};38213822// Use a stripped-down slice if we can't use a native one3823try {3824slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;3825} catch ( e ) {3826slice = function( i ) {3827var elem,3828results = [];3829while ( (elem = this[i++]) ) {3830results.push( elem );3831}3832return results;3833};3834}38353836/**3837* For feature detection3838* @param {Function} fn The function to test for native support3839*/3840function isNative( fn ) {3841return rnative.test( fn + "" );3842}38433844/**3845* Create key-value caches of limited size3846* @returns {Function(string, Object)} Returns the Object data after storing it on itself with3847* property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)3848* deleting the oldest entry3849*/3850function createCache() {3851var cache,3852keys = [];38533854return (cache = function( key, value ) {3855// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)3856if ( keys.push( key += " " ) > Expr.cacheLength ) {3857// Only keep the most recent entries3858delete cache[ keys.shift() ];3859}3860return (cache[ key ] = value);3861});3862}38633864/**3865* Mark a function for special use by Sizzle3866* @param {Function} fn The function to mark3867*/3868function markFunction( fn ) {3869fn[ expando ] = true;3870return fn;3871}38723873/**3874* Support testing using an element3875* @param {Function} fn Passed the created div and expects a boolean result3876*/3877function assert( fn ) {3878var div = document.createElement("div");38793880try {3881return fn( div );3882} catch (e) {3883return false;3884} finally {3885// release memory in IE3886div = null;3887}3888}38893890function Sizzle( selector, context, results, seed ) {3891var match, elem, m, nodeType,3892// QSA vars3893i, groups, old, nid, newContext, newSelector;38943895if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {3896setDocument( context );3897}38983899context = context || document;3900results = results || [];39013902if ( !selector || typeof selector !== "string" ) {3903return results;3904}39053906if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {3907return [];3908}39093910if ( !documentIsXML && !seed ) {39113912// Shortcuts3913if ( (match = rquickExpr.exec( selector )) ) {3914// Speed-up: Sizzle("#ID")3915if ( (m = match[1]) ) {3916if ( nodeType === 9 ) {3917elem = context.getElementById( m );3918// Check parentNode to catch when Blackberry 4.6 returns3919// nodes that are no longer in the document #69633920if ( elem && elem.parentNode ) {3921// Handle the case where IE, Opera, and Webkit return items3922// by name instead of ID3923if ( elem.id === m ) {3924results.push( elem );3925return results;3926}3927} else {3928return results;3929}3930} else {3931// Context is not a document3932if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&3933contains( context, elem ) && elem.id === m ) {3934results.push( elem );3935return results;3936}3937}39383939// Speed-up: Sizzle("TAG")3940} else if ( match[2] ) {3941push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );3942return results;39433944// Speed-up: Sizzle(".CLASS")3945} else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {3946push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );3947return results;3948}3949}39503951// QSA path3952if ( support.qsa && !rbuggyQSA.test(selector) ) {3953old = true;3954nid = expando;3955newContext = context;3956newSelector = nodeType === 9 && selector;39573958// qSA works strangely on Element-rooted queries3959// We can work around this by specifying an extra ID on the root3960// and working up from there (Thanks to Andrew Dupont for the technique)3961// IE 8 doesn't work on object elements3962if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {3963groups = tokenize( selector );39643965if ( (old = context.getAttribute("id")) ) {3966nid = old.replace( rescape, "\\$&" );3967} else {3968context.setAttribute( "id", nid );3969}3970nid = "[id='" + nid + "'] ";39713972i = groups.length;3973while ( i-- ) {3974groups[i] = nid + toSelector( groups[i] );3975}3976newContext = rsibling.test( selector ) && context.parentNode || context;3977newSelector = groups.join(",");3978}39793980if ( newSelector ) {3981try {3982push.apply( results, slice.call( newContext.querySelectorAll(3983newSelector3984), 0 ) );3985return results;3986} catch(qsaError) {3987} finally {3988if ( !old ) {3989context.removeAttribute("id");3990}3991}3992}3993}3994}39953996// All others3997return select( selector.replace( rtrim, "$1" ), context, results, seed );3998}39994000/**4001* Detect xml4002* @param {Element|Object} elem An element or a document4003*/4004isXML = Sizzle.isXML = function( elem ) {4005// documentElement is verified for cases where it doesn't yet exist4006// (such as loading iframes in IE - #4833)4007var documentElement = elem && (elem.ownerDocument || elem).documentElement;4008return documentElement ? documentElement.nodeName !== "HTML" : false;4009};40104011/**4012* Sets document-related variables once based on the current document4013* @param {Element|Object} [doc] An element or document object to use to set the document4014* @returns {Object} Returns the current document4015*/4016setDocument = Sizzle.setDocument = function( node ) {4017var doc = node ? node.ownerDocument || node : preferredDoc;40184019// If no document and documentElement is available, return4020if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {4021return document;4022}40234024// Set our document4025document = doc;4026docElem = doc.documentElement;40274028// Support tests4029documentIsXML = isXML( doc );40304031// Check if getElementsByTagName("*") returns only elements4032support.tagNameNoComments = assert(function( div ) {4033div.appendChild( doc.createComment("") );4034return !div.getElementsByTagName("*").length;4035});40364037// Check if attributes should be retrieved by attribute nodes4038support.attributes = assert(function( div ) {4039div.innerHTML = "<select></select>";4040var type = typeof div.lastChild.getAttribute("multiple");4041// IE8 returns a string for some attributes even when not present4042return type !== "boolean" && type !== "string";4043});40444045// Check if getElementsByClassName can be trusted4046support.getByClassName = assert(function( div ) {4047// Opera can't find a second classname (in 9.6)4048div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";4049if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {4050return false;4051}40524053// Safari 3.2 caches class attributes and doesn't catch changes4054div.lastChild.className = "e";4055return div.getElementsByClassName("e").length === 2;4056});40574058// Check if getElementById returns elements by name4059// Check if getElementsByName privileges form controls or returns elements by ID4060support.getByName = assert(function( div ) {4061// Inject content4062div.id = expando + 0;4063div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";4064docElem.insertBefore( div, docElem.firstChild );40654066// Test4067var pass = doc.getElementsByName &&4068// buggy browsers will return fewer than the correct 24069doc.getElementsByName( expando ).length === 2 +4070// buggy browsers will return more than the correct 04071doc.getElementsByName( expando + 0 ).length;4072support.getIdNotName = !doc.getElementById( expando );40734074// Cleanup4075docElem.removeChild( div );40764077return pass;4078});40794080// IE6/7 return modified attributes4081Expr.attrHandle = assert(function( div ) {4082div.innerHTML = "<a href='#'></a>";4083return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&4084div.firstChild.getAttribute("href") === "#";4085}) ?4086{} :4087{4088"href": function( elem ) {4089return elem.getAttribute( "href", 2 );4090},4091"type": function( elem ) {4092return elem.getAttribute("type");4093}4094};40954096// ID find and filter4097if ( support.getIdNotName ) {4098Expr.find["ID"] = function( id, context ) {4099if ( typeof context.getElementById !== strundefined && !documentIsXML ) {4100var m = context.getElementById( id );4101// Check parentNode to catch when Blackberry 4.6 returns4102// nodes that are no longer in the document #69634103return m && m.parentNode ? [m] : [];4104}4105};4106Expr.filter["ID"] = function( id ) {4107var attrId = id.replace( runescape, funescape );4108return function( elem ) {4109return elem.getAttribute("id") === attrId;4110};4111};4112} else {4113Expr.find["ID"] = function( id, context ) {4114if ( typeof context.getElementById !== strundefined && !documentIsXML ) {4115var m = context.getElementById( id );41164117return m ?4118m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?4119[m] :4120undefined :4121[];4122}4123};4124Expr.filter["ID"] = function( id ) {4125var attrId = id.replace( runescape, funescape );4126return function( elem ) {4127var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");4128return node && node.value === attrId;4129};4130};4131}41324133// Tag4134Expr.find["TAG"] = support.tagNameNoComments ?4135function( tag, context ) {4136if ( typeof context.getElementsByTagName !== strundefined ) {4137return context.getElementsByTagName( tag );4138}4139} :4140function( tag, context ) {4141var elem,4142tmp = [],4143i = 0,4144results = context.getElementsByTagName( tag );41454146// Filter out possible comments4147if ( tag === "*" ) {4148while ( (elem = results[i++]) ) {4149if ( elem.nodeType === 1 ) {4150tmp.push( elem );4151}4152}41534154return tmp;4155}4156return results;4157};41584159// Name4160Expr.find["NAME"] = support.getByName && function( tag, context ) {4161if ( typeof context.getElementsByName !== strundefined ) {4162return context.getElementsByName( name );4163}4164};41654166// Class4167Expr.find["CLASS"] = support.getByClassName && function( className, context ) {4168if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {4169return context.getElementsByClassName( className );4170}4171};41724173// QSA and matchesSelector support41744175// matchesSelector(:active) reports false when true (IE9/Opera 11.5)4176rbuggyMatches = [];41774178// qSa(:focus) reports false when true (Chrome 21),4179// no need to also add to buggyMatches since matches checks buggyQSA4180// A support test would require too much code (would include document ready)4181rbuggyQSA = [ ":focus" ];41824183if ( (support.qsa = isNative(doc.querySelectorAll)) ) {4184// Build QSA regex4185// Regex strategy adopted from Diego Perini4186assert(function( div ) {4187// Select is set to empty string on purpose4188// This is to test IE's treatment of not explictly4189// setting a boolean content attribute,4190// since its presence should be enough4191// http://bugs.jquery.com/ticket/123594192div.innerHTML = "<select><option selected=''></option></select>";41934194// IE8 - Some boolean attributes are not treated correctly4195if ( !div.querySelectorAll("[selected]").length ) {4196rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );4197}41984199// Webkit/Opera - :checked should return selected option elements4200// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked4201// IE8 throws error here and will not see later tests4202if ( !div.querySelectorAll(":checked").length ) {4203rbuggyQSA.push(":checked");4204}4205});42064207assert(function( div ) {42084209// Opera 10-12/IE8 - ^= $= *= and empty values4210// Should not select anything4211div.innerHTML = "<input type='hidden' i=''/>";4212if ( div.querySelectorAll("[i^='']").length ) {4213rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );4214}42154216// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)4217// IE8 throws error here and will not see later tests4218if ( !div.querySelectorAll(":enabled").length ) {4219rbuggyQSA.push( ":enabled", ":disabled" );4220}42214222// Opera 10-11 does not throw on post-comma invalid pseudos4223div.querySelectorAll("*,:x");4224rbuggyQSA.push(",.*:");4225});4226}42274228if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||4229docElem.mozMatchesSelector ||4230docElem.webkitMatchesSelector ||4231docElem.oMatchesSelector ||4232docElem.msMatchesSelector) )) ) {42334234assert(function( div ) {4235// Check to see if it's possible to do matchesSelector4236// on a disconnected node (IE 9)4237support.disconnectedMatch = matches.call( div, "div" );42384239// This should fail with an exception4240// Gecko does not error, returns false instead4241matches.call( div, "[s!='']:x" );4242rbuggyMatches.push( "!=", pseudos );4243});4244}42454246rbuggyQSA = new RegExp( rbuggyQSA.join("|") );4247rbuggyMatches = new RegExp( rbuggyMatches.join("|") );42484249// Element contains another4250// Purposefully does not implement inclusive descendent4251// As in, an element does not contain itself4252contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?4253function( a, b ) {4254var adown = a.nodeType === 9 ? a.documentElement : a,4255bup = b && b.parentNode;4256return a === bup || !!( bup && bup.nodeType === 1 && (4257adown.contains ?4258adown.contains( bup ) :4259a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 164260));4261} :4262function( a, b ) {4263if ( b ) {4264while ( (b = b.parentNode) ) {4265if ( b === a ) {4266return true;4267}4268}4269}4270return false;4271};42724273// Document order sorting4274sortOrder = docElem.compareDocumentPosition ?4275function( a, b ) {4276var compare;42774278if ( a === b ) {4279hasDuplicate = true;4280return 0;4281}42824283if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {4284if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {4285if ( a === doc || contains( preferredDoc, a ) ) {4286return -1;4287}4288if ( b === doc || contains( preferredDoc, b ) ) {4289return 1;4290}4291return 0;4292}4293return compare & 4 ? -1 : 1;4294}42954296return a.compareDocumentPosition ? -1 : 1;4297} :4298function( a, b ) {4299var cur,4300i = 0,4301aup = a.parentNode,4302bup = b.parentNode,4303ap = [ a ],4304bp = [ b ];43054306// Exit early if the nodes are identical4307if ( a === b ) {4308hasDuplicate = true;4309return 0;43104311// Parentless nodes are either documents or disconnected4312} else if ( !aup || !bup ) {4313return a === doc ? -1 :4314b === doc ? 1 :4315aup ? -1 :4316bup ? 1 :43170;43184319// If the nodes are siblings, we can do a quick check4320} else if ( aup === bup ) {4321return siblingCheck( a, b );4322}43234324// Otherwise we need full lists of their ancestors for comparison4325cur = a;4326while ( (cur = cur.parentNode) ) {4327ap.unshift( cur );4328}4329cur = b;4330while ( (cur = cur.parentNode) ) {4331bp.unshift( cur );4332}43334334// Walk down the tree looking for a discrepancy4335while ( ap[i] === bp[i] ) {4336i++;4337}43384339return i ?4340// Do a sibling check if the nodes have a common ancestor4341siblingCheck( ap[i], bp[i] ) :43424343// Otherwise nodes in our document sort first4344ap[i] === preferredDoc ? -1 :4345bp[i] === preferredDoc ? 1 :43460;4347};43484349// Always assume the presence of duplicates if sort doesn't4350// pass them to our comparison function (as in Google Chrome).4351hasDuplicate = false;4352[0, 0].sort( sortOrder );4353support.detectDuplicates = hasDuplicate;43544355return document;4356};43574358Sizzle.matches = function( expr, elements ) {4359return Sizzle( expr, null, null, elements );4360};43614362Sizzle.matchesSelector = function( elem, expr ) {4363// Set document vars if needed4364if ( ( elem.ownerDocument || elem ) !== document ) {4365setDocument( elem );4366}43674368// Make sure that attribute selectors are quoted4369expr = expr.replace( rattributeQuotes, "='$1']" );43704371// rbuggyQSA always contains :focus, so no need for an existence check4372if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {4373try {4374var ret = matches.call( elem, expr );43754376// IE 9's matchesSelector returns false on disconnected nodes4377if ( ret || support.disconnectedMatch ||4378// As well, disconnected nodes are said to be in a document4379// fragment in IE 94380elem.document && elem.document.nodeType !== 11 ) {4381return ret;4382}4383} catch(e) {}4384}43854386return Sizzle( expr, document, null, [elem] ).length > 0;4387};43884389Sizzle.contains = function( context, elem ) {4390// Set document vars if needed4391if ( ( context.ownerDocument || context ) !== document ) {4392setDocument( context );4393}4394return contains( context, elem );4395};43964397Sizzle.attr = function( elem, name ) {4398var val;43994400// Set document vars if needed4401if ( ( elem.ownerDocument || elem ) !== document ) {4402setDocument( elem );4403}44044405if ( !documentIsXML ) {4406name = name.toLowerCase();4407}4408if ( (val = Expr.attrHandle[ name ]) ) {4409return val( elem );4410}4411if ( documentIsXML || support.attributes ) {4412return elem.getAttribute( name );4413}4414return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?4415name :4416val && val.specified ? val.value : null;4417};44184419Sizzle.error = function( msg ) {4420throw new Error( "Syntax error, unrecognized expression: " + msg );4421};44224423// Document sorting and removing duplicates4424Sizzle.uniqueSort = function( results ) {4425var elem,4426duplicates = [],4427i = 1,4428j = 0;44294430// Unless we *know* we can detect duplicates, assume their presence4431hasDuplicate = !support.detectDuplicates;4432results.sort( sortOrder );44334434if ( hasDuplicate ) {4435for ( ; (elem = results[i]); i++ ) {4436if ( elem === results[ i - 1 ] ) {4437j = duplicates.push( i );4438}4439}4440while ( j-- ) {4441results.splice( duplicates[ j ], 1 );4442}4443}44444445return results;4446};44474448function siblingCheck( a, b ) {4449var cur = b && a,4450diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );44514452// Use IE sourceIndex if available on both nodes4453if ( diff ) {4454return diff;4455}44564457// Check if b follows a4458if ( cur ) {4459while ( (cur = cur.nextSibling) ) {4460if ( cur === b ) {4461return -1;4462}4463}4464}44654466return a ? 1 : -1;4467}44684469// Returns a function to use in pseudos for input types4470function createInputPseudo( type ) {4471return function( elem ) {4472var name = elem.nodeName.toLowerCase();4473return name === "input" && elem.type === type;4474};4475}44764477// Returns a function to use in pseudos for buttons4478function createButtonPseudo( type ) {4479return function( elem ) {4480var name = elem.nodeName.toLowerCase();4481return (name === "input" || name === "button") && elem.type === type;4482};4483}44844485// Returns a function to use in pseudos for positionals4486function createPositionalPseudo( fn ) {4487return markFunction(function( argument ) {4488argument = +argument;4489return markFunction(function( seed, matches ) {4490var j,4491matchIndexes = fn( [], seed.length, argument ),4492i = matchIndexes.length;44934494// Match elements found at the specified indexes4495while ( i-- ) {4496if ( seed[ (j = matchIndexes[i]) ] ) {4497seed[j] = !(matches[j] = seed[j]);4498}4499}4500});4501});4502}45034504/**4505* Utility function for retrieving the text value of an array of DOM nodes4506* @param {Array|Element} elem4507*/4508getText = Sizzle.getText = function( elem ) {4509var node,4510ret = "",4511i = 0,4512nodeType = elem.nodeType;45134514if ( !nodeType ) {4515// If no nodeType, this is expected to be an array4516for ( ; (node = elem[i]); i++ ) {4517// Do not traverse comment nodes4518ret += getText( node );4519}4520} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {4521// Use textContent for elements4522// innerText usage removed for consistency of new lines (see #11153)4523if ( typeof elem.textContent === "string" ) {4524return elem.textContent;4525} else {4526// Traverse its children4527for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {4528ret += getText( elem );4529}4530}4531} else if ( nodeType === 3 || nodeType === 4 ) {4532return elem.nodeValue;4533}4534// Do not include comment or processing instruction nodes45354536return ret;4537};45384539Expr = Sizzle.selectors = {45404541// Can be adjusted by the user4542cacheLength: 50,45434544createPseudo: markFunction,45454546match: matchExpr,45474548find: {},45494550relative: {4551">": { dir: "parentNode", first: true },4552" ": { dir: "parentNode" },4553"+": { dir: "previousSibling", first: true },4554"~": { dir: "previousSibling" }4555},45564557preFilter: {4558"ATTR": function( match ) {4559match[1] = match[1].replace( runescape, funescape );45604561// Move the given value to match[3] whether quoted or unquoted4562match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );45634564if ( match[2] === "~=" ) {4565match[3] = " " + match[3] + " ";4566}45674568return match.slice( 0, 4 );4569},45704571"CHILD": function( match ) {4572/* matches from matchExpr["CHILD"]45731 type (only|nth|...)45742 what (child|of-type)45753 argument (even|odd|\d*|\d*n([+-]\d+)?|...)45764 xn-component of xn+y argument ([+-]?\d*n|)45775 sign of xn-component45786 x of xn-component45797 sign of y-component45808 y of y-component4581*/4582match[1] = match[1].toLowerCase();45834584if ( match[1].slice( 0, 3 ) === "nth" ) {4585// nth-* requires argument4586if ( !match[3] ) {4587Sizzle.error( match[0] );4588}45894590// numeric x and y parameters for Expr.filter.CHILD4591// remember that false/true cast respectively to 0/14592match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );4593match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );45944595// other types prohibit arguments4596} else if ( match[3] ) {4597Sizzle.error( match[0] );4598}45994600return match;4601},46024603"PSEUDO": function( match ) {4604var excess,4605unquoted = !match[5] && match[2];46064607if ( matchExpr["CHILD"].test( match[0] ) ) {4608return null;4609}46104611// Accept quoted arguments as-is4612if ( match[4] ) {4613match[2] = match[4];46144615// Strip excess characters from unquoted arguments4616} else if ( unquoted && rpseudo.test( unquoted ) &&4617// Get excess from tokenize (recursively)4618(excess = tokenize( unquoted, true )) &&4619// advance to the next closing parenthesis4620(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {46214622// excess is a negative index4623match[0] = match[0].slice( 0, excess );4624match[2] = unquoted.slice( 0, excess );4625}46264627// Return only captures needed by the pseudo filter method (type and argument)4628return match.slice( 0, 3 );4629}4630},46314632filter: {46334634"TAG": function( nodeName ) {4635if ( nodeName === "*" ) {4636return function() { return true; };4637}46384639nodeName = nodeName.replace( runescape, funescape ).toLowerCase();4640return function( elem ) {4641return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;4642};4643},46444645"CLASS": function( className ) {4646var pattern = classCache[ className + " " ];46474648return pattern ||4649(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&4650classCache( className, function( elem ) {4651return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );4652});4653},46544655"ATTR": function( name, operator, check ) {4656return function( elem ) {4657var result = Sizzle.attr( elem, name );46584659if ( result == null ) {4660return operator === "!=";4661}4662if ( !operator ) {4663return true;4664}46654666result += "";46674668return operator === "=" ? result === check :4669operator === "!=" ? result !== check :4670operator === "^=" ? check && result.indexOf( check ) === 0 :4671operator === "*=" ? check && result.indexOf( check ) > -1 :4672operator === "$=" ? check && result.slice( -check.length ) === check :4673operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :4674operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :4675false;4676};4677},46784679"CHILD": function( type, what, argument, first, last ) {4680var simple = type.slice( 0, 3 ) !== "nth",4681forward = type.slice( -4 ) !== "last",4682ofType = what === "of-type";46834684return first === 1 && last === 0 ?46854686// Shortcut for :nth-*(n)4687function( elem ) {4688return !!elem.parentNode;4689} :46904691function( elem, context, xml ) {4692var cache, outerCache, node, diff, nodeIndex, start,4693dir = simple !== forward ? "nextSibling" : "previousSibling",4694parent = elem.parentNode,4695name = ofType && elem.nodeName.toLowerCase(),4696useCache = !xml && !ofType;46974698if ( parent ) {46994700// :(first|last|only)-(child|of-type)4701if ( simple ) {4702while ( dir ) {4703node = elem;4704while ( (node = node[ dir ]) ) {4705if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {4706return false;4707}4708}4709// Reverse direction for :only-* (if we haven't yet done so)4710start = dir = type === "only" && !start && "nextSibling";4711}4712return true;4713}47144715start = [ forward ? parent.firstChild : parent.lastChild ];47164717// non-xml :nth-child(...) stores cache data on `parent`4718if ( forward && useCache ) {4719// Seek `elem` from a previously-cached index4720outerCache = parent[ expando ] || (parent[ expando ] = {});4721cache = outerCache[ type ] || [];4722nodeIndex = cache[0] === dirruns && cache[1];4723diff = cache[0] === dirruns && cache[2];4724node = nodeIndex && parent.childNodes[ nodeIndex ];47254726while ( (node = ++nodeIndex && node && node[ dir ] ||47274728// Fallback to seeking `elem` from the start4729(diff = nodeIndex = 0) || start.pop()) ) {47304731// When found, cache indexes on `parent` and break4732if ( node.nodeType === 1 && ++diff && node === elem ) {4733outerCache[ type ] = [ dirruns, nodeIndex, diff ];4734break;4735}4736}47374738// Use previously-cached element index if available4739} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {4740diff = cache[1];47414742// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)4743} else {4744// Use the same loop as above to seek `elem` from the start4745while ( (node = ++nodeIndex && node && node[ dir ] ||4746(diff = nodeIndex = 0) || start.pop()) ) {47474748if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {4749// Cache the index of each encountered element4750if ( useCache ) {4751(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];4752}47534754if ( node === elem ) {4755break;4756}4757}4758}4759}47604761// Incorporate the offset, then check against cycle size4762diff -= last;4763return diff === first || ( diff % first === 0 && diff / first >= 0 );4764}4765};4766},47674768"PSEUDO": function( pseudo, argument ) {4769// pseudo-class names are case-insensitive4770// http://www.w3.org/TR/selectors/#pseudo-classes4771// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters4772// Remember that setFilters inherits from pseudos4773var args,4774fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||4775Sizzle.error( "unsupported pseudo: " + pseudo );47764777// The user may use createPseudo to indicate that4778// arguments are needed to create the filter function4779// just as Sizzle does4780if ( fn[ expando ] ) {4781return fn( argument );4782}47834784// But maintain support for old signatures4785if ( fn.length > 1 ) {4786args = [ pseudo, pseudo, "", argument ];4787return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?4788markFunction(function( seed, matches ) {4789var idx,4790matched = fn( seed, argument ),4791i = matched.length;4792while ( i-- ) {4793idx = indexOf.call( seed, matched[i] );4794seed[ idx ] = !( matches[ idx ] = matched[i] );4795}4796}) :4797function( elem ) {4798return fn( elem, 0, args );4799};4800}48014802return fn;4803}4804},48054806pseudos: {4807// Potentially complex pseudos4808"not": markFunction(function( selector ) {4809// Trim the selector passed to compile4810// to avoid treating leading and trailing4811// spaces as combinators4812var input = [],4813results = [],4814matcher = compile( selector.replace( rtrim, "$1" ) );48154816return matcher[ expando ] ?4817markFunction(function( seed, matches, context, xml ) {4818var elem,4819unmatched = matcher( seed, null, xml, [] ),4820i = seed.length;48214822// Match elements unmatched by `matcher`4823while ( i-- ) {4824if ( (elem = unmatched[i]) ) {4825seed[i] = !(matches[i] = elem);4826}4827}4828}) :4829function( elem, context, xml ) {4830input[0] = elem;4831matcher( input, null, xml, results );4832return !results.pop();4833};4834}),48354836"has": markFunction(function( selector ) {4837return function( elem ) {4838return Sizzle( selector, elem ).length > 0;4839};4840}),48414842"contains": markFunction(function( text ) {4843return function( elem ) {4844return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;4845};4846}),48474848// "Whether an element is represented by a :lang() selector4849// is based solely on the element's language value4850// being equal to the identifier C,4851// or beginning with the identifier C immediately followed by "-".4852// The matching of C against the element's language value is performed case-insensitively.4853// The identifier C does not have to be a valid language name."4854// http://www.w3.org/TR/selectors/#lang-pseudo4855"lang": markFunction( function( lang ) {4856// lang value must be a valid identifider4857if ( !ridentifier.test(lang || "") ) {4858Sizzle.error( "unsupported lang: " + lang );4859}4860lang = lang.replace( runescape, funescape ).toLowerCase();4861return function( elem ) {4862var elemLang;4863do {4864if ( (elemLang = documentIsXML ?4865elem.getAttribute("xml:lang") || elem.getAttribute("lang") :4866elem.lang) ) {48674868elemLang = elemLang.toLowerCase();4869return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;4870}4871} while ( (elem = elem.parentNode) && elem.nodeType === 1 );4872return false;4873};4874}),48754876// Miscellaneous4877"target": function( elem ) {4878var hash = window.location && window.location.hash;4879return hash && hash.slice( 1 ) === elem.id;4880},48814882"root": function( elem ) {4883return elem === docElem;4884},48854886"focus": function( elem ) {4887return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);4888},48894890// Boolean properties4891"enabled": function( elem ) {4892return elem.disabled === false;4893},48944895"disabled": function( elem ) {4896return elem.disabled === true;4897},48984899"checked": function( elem ) {4900// In CSS3, :checked should return both checked and selected elements4901// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked4902var nodeName = elem.nodeName.toLowerCase();4903return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);4904},49054906"selected": function( elem ) {4907// Accessing this property makes selected-by-default4908// options in Safari work properly4909if ( elem.parentNode ) {4910elem.parentNode.selectedIndex;4911}49124913return elem.selected === true;4914},49154916// Contents4917"empty": function( elem ) {4918// http://www.w3.org/TR/selectors/#empty-pseudo4919// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),4920// not comment, processing instructions, or others4921// Thanks to Diego Perini for the nodeName shortcut4922// Greater than "@" means alpha characters (specifically not starting with "#" or "?")4923for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {4924if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {4925return false;4926}4927}4928return true;4929},49304931"parent": function( elem ) {4932return !Expr.pseudos["empty"]( elem );4933},49344935// Element/input types4936"header": function( elem ) {4937return rheader.test( elem.nodeName );4938},49394940"input": function( elem ) {4941return rinputs.test( elem.nodeName );4942},49434944"button": function( elem ) {4945var name = elem.nodeName.toLowerCase();4946return name === "input" && elem.type === "button" || name === "button";4947},49484949"text": function( elem ) {4950var attr;4951// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)4952// use getAttribute instead to test this case4953return elem.nodeName.toLowerCase() === "input" &&4954elem.type === "text" &&4955( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );4956},49574958// Position-in-collection4959"first": createPositionalPseudo(function() {4960return [ 0 ];4961}),49624963"last": createPositionalPseudo(function( matchIndexes, length ) {4964return [ length - 1 ];4965}),49664967"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {4968return [ argument < 0 ? argument + length : argument ];4969}),49704971"even": createPositionalPseudo(function( matchIndexes, length ) {4972var i = 0;4973for ( ; i < length; i += 2 ) {4974matchIndexes.push( i );4975}4976return matchIndexes;4977}),49784979"odd": createPositionalPseudo(function( matchIndexes, length ) {4980var i = 1;4981for ( ; i < length; i += 2 ) {4982matchIndexes.push( i );4983}4984return matchIndexes;4985}),49864987"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {4988var i = argument < 0 ? argument + length : argument;4989for ( ; --i >= 0; ) {4990matchIndexes.push( i );4991}4992return matchIndexes;4993}),49944995"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {4996var i = argument < 0 ? argument + length : argument;4997for ( ; ++i < length; ) {4998matchIndexes.push( i );4999}5000return matchIndexes;5001})5002}5003};50045005// Add button/input type pseudos5006for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {5007Expr.pseudos[ i ] = createInputPseudo( i );5008}5009for ( i in { submit: true, reset: true } ) {5010Expr.pseudos[ i ] = createButtonPseudo( i );5011}50125013function tokenize( selector, parseOnly ) {5014var matched, match, tokens, type,5015soFar, groups, preFilters,5016cached = tokenCache[ selector + " " ];50175018if ( cached ) {5019return parseOnly ? 0 : cached.slice( 0 );5020}50215022soFar = selector;5023groups = [];5024preFilters = Expr.preFilter;50255026while ( soFar ) {50275028// Comma and first run5029if ( !matched || (match = rcomma.exec( soFar )) ) {5030if ( match ) {5031// Don't consume trailing commas as valid5032soFar = soFar.slice( match[0].length ) || soFar;5033}5034groups.push( tokens = [] );5035}50365037matched = false;50385039// Combinators5040if ( (match = rcombinators.exec( soFar )) ) {5041matched = match.shift();5042tokens.push( {5043value: matched,5044// Cast descendant combinators to space5045type: match[0].replace( rtrim, " " )5046} );5047soFar = soFar.slice( matched.length );5048}50495050// Filters5051for ( type in Expr.filter ) {5052if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||5053(match = preFilters[ type ]( match ))) ) {5054matched = match.shift();5055tokens.push( {5056value: matched,5057type: type,5058matches: match5059} );5060soFar = soFar.slice( matched.length );5061}5062}50635064if ( !matched ) {5065break;5066}5067}50685069// Return the length of the invalid excess5070// if we're just parsing5071// Otherwise, throw an error or return tokens5072return parseOnly ?5073soFar.length :5074soFar ?5075Sizzle.error( selector ) :5076// Cache the tokens5077tokenCache( selector, groups ).slice( 0 );5078}50795080function toSelector( tokens ) {5081var i = 0,5082len = tokens.length,5083selector = "";5084for ( ; i < len; i++ ) {5085selector += tokens[i].value;5086}5087return selector;5088}50895090function addCombinator( matcher, combinator, base ) {5091var dir = combinator.dir,5092checkNonElements = base && dir === "parentNode",5093doneName = done++;50945095return combinator.first ?5096// Check against closest ancestor/preceding element5097function( elem, context, xml ) {5098while ( (elem = elem[ dir ]) ) {5099if ( elem.nodeType === 1 || checkNonElements ) {5100return matcher( elem, context, xml );5101}5102}5103} :51045105// Check against all ancestor/preceding elements5106function( elem, context, xml ) {5107var data, cache, outerCache,5108dirkey = dirruns + " " + doneName;51095110// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching5111if ( xml ) {5112while ( (elem = elem[ dir ]) ) {5113if ( elem.nodeType === 1 || checkNonElements ) {5114if ( matcher( elem, context, xml ) ) {5115return true;5116}5117}5118}5119} else {5120while ( (elem = elem[ dir ]) ) {5121if ( elem.nodeType === 1 || checkNonElements ) {5122outerCache = elem[ expando ] || (elem[ expando ] = {});5123if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {5124if ( (data = cache[1]) === true || data === cachedruns ) {5125return data === true;5126}5127} else {5128cache = outerCache[ dir ] = [ dirkey ];5129cache[1] = matcher( elem, context, xml ) || cachedruns;5130if ( cache[1] === true ) {5131return true;5132}5133}5134}5135}5136}5137};5138}51395140function elementMatcher( matchers ) {5141return matchers.length > 1 ?5142function( elem, context, xml ) {5143var i = matchers.length;5144while ( i-- ) {5145if ( !matchers[i]( elem, context, xml ) ) {5146return false;5147}5148}5149return true;5150} :5151matchers[0];5152}51535154function condense( unmatched, map, filter, context, xml ) {5155var elem,5156newUnmatched = [],5157i = 0,5158len = unmatched.length,5159mapped = map != null;51605161for ( ; i < len; i++ ) {5162if ( (elem = unmatched[i]) ) {5163if ( !filter || filter( elem, context, xml ) ) {5164newUnmatched.push( elem );5165if ( mapped ) {5166map.push( i );5167}5168}5169}5170}51715172return newUnmatched;5173}51745175function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {5176if ( postFilter && !postFilter[ expando ] ) {5177postFilter = setMatcher( postFilter );5178}5179if ( postFinder && !postFinder[ expando ] ) {5180postFinder = setMatcher( postFinder, postSelector );5181}5182return markFunction(function( seed, results, context, xml ) {5183var temp, i, elem,5184preMap = [],5185postMap = [],5186preexisting = results.length,51875188// Get initial elements from seed or context5189elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),51905191// Prefilter to get matcher input, preserving a map for seed-results synchronization5192matcherIn = preFilter && ( seed || !selector ) ?5193condense( elems, preMap, preFilter, context, xml ) :5194elems,51955196matcherOut = matcher ?5197// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,5198postFinder || ( seed ? preFilter : preexisting || postFilter ) ?51995200// ...intermediate processing is necessary5201[] :52025203// ...otherwise use results directly5204results :5205matcherIn;52065207// Find primary matches5208if ( matcher ) {5209matcher( matcherIn, matcherOut, context, xml );5210}52115212// Apply postFilter5213if ( postFilter ) {5214temp = condense( matcherOut, postMap );5215postFilter( temp, [], context, xml );52165217// Un-match failing elements by moving them back to matcherIn5218i = temp.length;5219while ( i-- ) {5220if ( (elem = temp[i]) ) {5221matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);5222}5223}5224}52255226if ( seed ) {5227if ( postFinder || preFilter ) {5228if ( postFinder ) {5229// Get the final matcherOut by condensing this intermediate into postFinder contexts5230temp = [];5231i = matcherOut.length;5232while ( i-- ) {5233if ( (elem = matcherOut[i]) ) {5234// Restore matcherIn since elem is not yet a final match5235temp.push( (matcherIn[i] = elem) );5236}5237}5238postFinder( null, (matcherOut = []), temp, xml );5239}52405241// Move matched elements from seed to results to keep them synchronized5242i = matcherOut.length;5243while ( i-- ) {5244if ( (elem = matcherOut[i]) &&5245(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {52465247seed[temp] = !(results[temp] = elem);5248}5249}5250}52515252// Add elements to results, through postFinder if defined5253} else {5254matcherOut = condense(5255matcherOut === results ?5256matcherOut.splice( preexisting, matcherOut.length ) :5257matcherOut5258);5259if ( postFinder ) {5260postFinder( null, results, matcherOut, xml );5261} else {5262push.apply( results, matcherOut );5263}5264}5265});5266}52675268function matcherFromTokens( tokens ) {5269var checkContext, matcher, j,5270len = tokens.length,5271leadingRelative = Expr.relative[ tokens[0].type ],5272implicitRelative = leadingRelative || Expr.relative[" "],5273i = leadingRelative ? 1 : 0,52745275// The foundational matcher ensures that elements are reachable from top-level context(s)5276matchContext = addCombinator( function( elem ) {5277return elem === checkContext;5278}, implicitRelative, true ),5279matchAnyContext = addCombinator( function( elem ) {5280return indexOf.call( checkContext, elem ) > -1;5281}, implicitRelative, true ),5282matchers = [ function( elem, context, xml ) {5283return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (5284(checkContext = context).nodeType ?5285matchContext( elem, context, xml ) :5286matchAnyContext( elem, context, xml ) );5287} ];52885289for ( ; i < len; i++ ) {5290if ( (matcher = Expr.relative[ tokens[i].type ]) ) {5291matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];5292} else {5293matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );52945295// Return special upon seeing a positional matcher5296if ( matcher[ expando ] ) {5297// Find the next relative operator (if any) for proper handling5298j = ++i;5299for ( ; j < len; j++ ) {5300if ( Expr.relative[ tokens[j].type ] ) {5301break;5302}5303}5304return setMatcher(5305i > 1 && elementMatcher( matchers ),5306i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),5307matcher,5308i < j && matcherFromTokens( tokens.slice( i, j ) ),5309j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),5310j < len && toSelector( tokens )5311);5312}5313matchers.push( matcher );5314}5315}53165317return elementMatcher( matchers );5318}53195320function matcherFromGroupMatchers( elementMatchers, setMatchers ) {5321// A counter to specify which element is currently being matched5322var matcherCachedRuns = 0,5323bySet = setMatchers.length > 0,5324byElement = elementMatchers.length > 0,5325superMatcher = function( seed, context, xml, results, expandContext ) {5326var elem, j, matcher,5327setMatched = [],5328matchedCount = 0,5329i = "0",5330unmatched = seed && [],5331outermost = expandContext != null,5332contextBackup = outermostContext,5333// We must always have either seed elements or context5334elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),5335// Use integer dirruns iff this is the outermost matcher5336dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);53375338if ( outermost ) {5339outermostContext = context !== document && context;5340cachedruns = matcherCachedRuns;5341}53425343// Add elements passing elementMatchers directly to results5344// Keep `i` a string if there are no elements so `matchedCount` will be "00" below5345for ( ; (elem = elems[i]) != null; i++ ) {5346if ( byElement && elem ) {5347j = 0;5348while ( (matcher = elementMatchers[j++]) ) {5349if ( matcher( elem, context, xml ) ) {5350results.push( elem );5351break;5352}5353}5354if ( outermost ) {5355dirruns = dirrunsUnique;5356cachedruns = ++matcherCachedRuns;5357}5358}53595360// Track unmatched elements for set filters5361if ( bySet ) {5362// They will have gone through all possible matchers5363if ( (elem = !matcher && elem) ) {5364matchedCount--;5365}53665367// Lengthen the array for every element, matched or not5368if ( seed ) {5369unmatched.push( elem );5370}5371}5372}53735374// Apply set filters to unmatched elements5375matchedCount += i;5376if ( bySet && i !== matchedCount ) {5377j = 0;5378while ( (matcher = setMatchers[j++]) ) {5379matcher( unmatched, setMatched, context, xml );5380}53815382if ( seed ) {5383// Reintegrate element matches to eliminate the need for sorting5384if ( matchedCount > 0 ) {5385while ( i-- ) {5386if ( !(unmatched[i] || setMatched[i]) ) {5387setMatched[i] = pop.call( results );5388}5389}5390}53915392// Discard index placeholder values to get only actual matches5393setMatched = condense( setMatched );5394}53955396// Add matches to results5397push.apply( results, setMatched );53985399// Seedless set matches succeeding multiple successful matchers stipulate sorting5400if ( outermost && !seed && setMatched.length > 0 &&5401( matchedCount + setMatchers.length ) > 1 ) {54025403Sizzle.uniqueSort( results );5404}5405}54065407// Override manipulation of globals by nested matchers5408if ( outermost ) {5409dirruns = dirrunsUnique;5410outermostContext = contextBackup;5411}54125413return unmatched;5414};54155416return bySet ?5417markFunction( superMatcher ) :5418superMatcher;5419}54205421compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {5422var i,5423setMatchers = [],5424elementMatchers = [],5425cached = compilerCache[ selector + " " ];54265427if ( !cached ) {5428// Generate a function of recursive functions that can be used to check each element5429if ( !group ) {5430group = tokenize( selector );5431}5432i = group.length;5433while ( i-- ) {5434cached = matcherFromTokens( group[i] );5435if ( cached[ expando ] ) {5436setMatchers.push( cached );5437} else {5438elementMatchers.push( cached );5439}5440}54415442// Cache the compiled function5443cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );5444}5445return cached;5446};54475448function multipleContexts( selector, contexts, results ) {5449var i = 0,5450len = contexts.length;5451for ( ; i < len; i++ ) {5452Sizzle( selector, contexts[i], results );5453}5454return results;5455}54565457function select( selector, context, results, seed ) {5458var i, tokens, token, type, find,5459match = tokenize( selector );54605461if ( !seed ) {5462// Try to minimize operations if there is only one group5463if ( match.length === 1 ) {54645465// Take a shortcut and set the context if the root selector is an ID5466tokens = match[0] = match[0].slice( 0 );5467if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&5468context.nodeType === 9 && !documentIsXML &&5469Expr.relative[ tokens[1].type ] ) {54705471context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];5472if ( !context ) {5473return results;5474}54755476selector = selector.slice( tokens.shift().value.length );5477}54785479// Fetch a seed set for right-to-left matching5480i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;5481while ( i-- ) {5482token = tokens[i];54835484// Abort if we hit a combinator5485if ( Expr.relative[ (type = token.type) ] ) {5486break;5487}5488if ( (find = Expr.find[ type ]) ) {5489// Search, expanding context for leading sibling combinators5490if ( (seed = find(5491token.matches[0].replace( runescape, funescape ),5492rsibling.test( tokens[0].type ) && context.parentNode || context5493)) ) {54945495// If seed is empty or no tokens remain, we can return early5496tokens.splice( i, 1 );5497selector = seed.length && toSelector( tokens );5498if ( !selector ) {5499push.apply( results, slice.call( seed, 0 ) );5500return results;5501}55025503break;5504}5505}5506}5507}5508}55095510// Compile and execute a filtering function5511// Provide `match` to avoid retokenization if we modified the selector above5512compile( selector, match )(5513seed,5514context,5515documentIsXML,5516results,5517rsibling.test( selector )5518);5519return results;5520}55215522// Deprecated5523Expr.pseudos["nth"] = Expr.pseudos["eq"];55245525// Easy API for creating new setFilters5526function setFilters() {}5527Expr.filters = setFilters.prototype = Expr.pseudos;5528Expr.setFilters = new setFilters();55295530// Initialize with the default document5531setDocument();55325533// Override sizzle attribute retrieval5534Sizzle.attr = jQuery.attr;5535jQuery.find = Sizzle;5536jQuery.expr = Sizzle.selectors;5537jQuery.expr[":"] = jQuery.expr.pseudos;5538jQuery.unique = Sizzle.uniqueSort;5539jQuery.text = Sizzle.getText;5540jQuery.isXMLDoc = Sizzle.isXML;5541jQuery.contains = Sizzle.contains;554255435544})( window );5545var runtil = /Until$/,5546rparentsprev = /^(?:parents|prev(?:Until|All))/,5547isSimple = /^.[^:#\[\.,]*$/,5548rneedsContext = jQuery.expr.match.needsContext,5549// methods guaranteed to produce a unique set when starting from a unique set5550guaranteedUnique = {5551children: true,5552contents: true,5553next: true,5554prev: true5555};55565557jQuery.fn.extend({5558find: function( selector ) {5559var i, ret, self,5560len = this.length;55615562if ( typeof selector !== "string" ) {5563self = this;5564return this.pushStack( jQuery( selector ).filter(function() {5565for ( i = 0; i < len; i++ ) {5566if ( jQuery.contains( self[ i ], this ) ) {5567return true;5568}5569}5570}) );5571}55725573ret = [];5574for ( i = 0; i < len; i++ ) {5575jQuery.find( selector, this[ i ], ret );5576}55775578// Needed because $( selector, context ) becomes $( context ).find( selector )5579ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );5580ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;5581return ret;5582},55835584has: function( target ) {5585var i,5586targets = jQuery( target, this ),5587len = targets.length;55885589return this.filter(function() {5590for ( i = 0; i < len; i++ ) {5591if ( jQuery.contains( this, targets[i] ) ) {5592return true;5593}5594}5595});5596},55975598not: function( selector ) {5599return this.pushStack( winnow(this, selector, false) );5600},56015602filter: function( selector ) {5603return this.pushStack( winnow(this, selector, true) );5604},56055606is: function( selector ) {5607return !!selector && (5608typeof selector === "string" ?5609// If this is a positional/relative selector, check membership in the returned set5610// so $("p:first").is("p:last") won't return true for a doc with two "p".5611rneedsContext.test( selector ) ?5612jQuery( selector, this.context ).index( this[0] ) >= 0 :5613jQuery.filter( selector, this ).length > 0 :5614this.filter( selector ).length > 0 );5615},56165617closest: function( selectors, context ) {5618var cur,5619i = 0,5620l = this.length,5621ret = [],5622pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?5623jQuery( selectors, context || this.context ) :56240;56255626for ( ; i < l; i++ ) {5627cur = this[i];56285629while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {5630if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {5631ret.push( cur );5632break;5633}5634cur = cur.parentNode;5635}5636}56375638return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );5639},56405641// Determine the position of an element within5642// the matched set of elements5643index: function( elem ) {56445645// No argument, return index in parent5646if ( !elem ) {5647return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;5648}56495650// index in selector5651if ( typeof elem === "string" ) {5652return jQuery.inArray( this[0], jQuery( elem ) );5653}56545655// Locate the position of the desired element5656return jQuery.inArray(5657// If it receives a jQuery object, the first element is used5658elem.jquery ? elem[0] : elem, this );5659},56605661add: function( selector, context ) {5662var set = typeof selector === "string" ?5663jQuery( selector, context ) :5664jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),5665all = jQuery.merge( this.get(), set );56665667return this.pushStack( jQuery.unique(all) );5668},56695670addBack: function( selector ) {5671return this.add( selector == null ?5672this.prevObject : this.prevObject.filter(selector)5673);5674}5675});56765677jQuery.fn.andSelf = jQuery.fn.addBack;56785679function sibling( cur, dir ) {5680do {5681cur = cur[ dir ];5682} while ( cur && cur.nodeType !== 1 );56835684return cur;5685}56865687jQuery.each({5688parent: function( elem ) {5689var parent = elem.parentNode;5690return parent && parent.nodeType !== 11 ? parent : null;5691},5692parents: function( elem ) {5693return jQuery.dir( elem, "parentNode" );5694},5695parentsUntil: function( elem, i, until ) {5696return jQuery.dir( elem, "parentNode", until );5697},5698next: function( elem ) {5699return sibling( elem, "nextSibling" );5700},5701prev: function( elem ) {5702return sibling( elem, "previousSibling" );5703},5704nextAll: function( elem ) {5705return jQuery.dir( elem, "nextSibling" );5706},5707prevAll: function( elem ) {5708return jQuery.dir( elem, "previousSibling" );5709},5710nextUntil: function( elem, i, until ) {5711return jQuery.dir( elem, "nextSibling", until );5712},5713prevUntil: function( elem, i, until ) {5714return jQuery.dir( elem, "previousSibling", until );5715},5716siblings: function( elem ) {5717return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );5718},5719children: function( elem ) {5720return jQuery.sibling( elem.firstChild );5721},5722contents: function( elem ) {5723return jQuery.nodeName( elem, "iframe" ) ?5724elem.contentDocument || elem.contentWindow.document :5725jQuery.merge( [], elem.childNodes );5726}5727}, function( name, fn ) {5728jQuery.fn[ name ] = function( until, selector ) {5729var ret = jQuery.map( this, fn, until );57305731if ( !runtil.test( name ) ) {5732selector = until;5733}57345735if ( selector && typeof selector === "string" ) {5736ret = jQuery.filter( selector, ret );5737}57385739ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;57405741if ( this.length > 1 && rparentsprev.test( name ) ) {5742ret = ret.reverse();5743}57445745return this.pushStack( ret );5746};5747});57485749jQuery.extend({5750filter: function( expr, elems, not ) {5751if ( not ) {5752expr = ":not(" + expr + ")";5753}57545755return elems.length === 1 ?5756jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :5757jQuery.find.matches(expr, elems);5758},57595760dir: function( elem, dir, until ) {5761var matched = [],5762cur = elem[ dir ];57635764while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {5765if ( cur.nodeType === 1 ) {5766matched.push( cur );5767}5768cur = cur[dir];5769}5770return matched;5771},57725773sibling: function( n, elem ) {5774var r = [];57755776for ( ; n; n = n.nextSibling ) {5777if ( n.nodeType === 1 && n !== elem ) {5778r.push( n );5779}5780}57815782return r;5783}5784});57855786// Implement the identical functionality for filter and not5787function winnow( elements, qualifier, keep ) {57885789// Can't pass null or undefined to indexOf in Firefox 45790// Set to 0 to skip string check5791qualifier = qualifier || 0;57925793if ( jQuery.isFunction( qualifier ) ) {5794return jQuery.grep(elements, function( elem, i ) {5795var retVal = !!qualifier.call( elem, i, elem );5796return retVal === keep;5797});57985799} else if ( qualifier.nodeType ) {5800return jQuery.grep(elements, function( elem ) {5801return ( elem === qualifier ) === keep;5802});58035804} else if ( typeof qualifier === "string" ) {5805var filtered = jQuery.grep(elements, function( elem ) {5806return elem.nodeType === 1;5807});58085809if ( isSimple.test( qualifier ) ) {5810return jQuery.filter(qualifier, filtered, !keep);5811} else {5812qualifier = jQuery.filter( qualifier, filtered );5813}5814}58155816return jQuery.grep(elements, function( elem ) {5817return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;5818});5819}5820function createSafeFragment( document ) {5821var list = nodeNames.split( "|" ),5822safeFrag = document.createDocumentFragment();58235824if ( safeFrag.createElement ) {5825while ( list.length ) {5826safeFrag.createElement(5827list.pop()5828);5829}5830}5831return safeFrag;5832}58335834var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +5835"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",5836rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,5837rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),5838rleadingWhitespace = /^\s+/,5839rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,5840rtagName = /<([\w:]+)/,5841rtbody = /<tbody/i,5842rhtml = /<|&#?\w+;/,5843rnoInnerhtml = /<(?:script|style|link)/i,5844manipulation_rcheckableType = /^(?:checkbox|radio)$/i,5845// checked="checked" or checked5846rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,5847rscriptType = /^$|\/(?:java|ecma)script/i,5848rscriptTypeMasked = /^true\/(.*)/,5849rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,58505851// We have to close these tags to support XHTML (#13200)5852wrapMap = {5853option: [ 1, "<select multiple='multiple'>", "</select>" ],5854legend: [ 1, "<fieldset>", "</fieldset>" ],5855area: [ 1, "<map>", "</map>" ],5856param: [ 1, "<object>", "</object>" ],5857thead: [ 1, "<table>", "</table>" ],5858tr: [ 2, "<table><tbody>", "</tbody></table>" ],5859col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],5860td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],58615862// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,5863// unless wrapped in a div with non-breaking characters in front of it.5864_default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]5865},5866safeFragment = createSafeFragment( document ),5867fragmentDiv = safeFragment.appendChild( document.createElement("div") );58685869wrapMap.optgroup = wrapMap.option;5870wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;5871wrapMap.th = wrapMap.td;58725873jQuery.fn.extend({5874text: function( value ) {5875return jQuery.access( this, function( value ) {5876return value === undefined ?5877jQuery.text( this ) :5878this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );5879}, null, value, arguments.length );5880},58815882wrapAll: function( html ) {5883if ( jQuery.isFunction( html ) ) {5884return this.each(function(i) {5885jQuery(this).wrapAll( html.call(this, i) );5886});5887}58885889if ( this[0] ) {5890// The elements to wrap the target around5891var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);58925893if ( this[0].parentNode ) {5894wrap.insertBefore( this[0] );5895}58965897wrap.map(function() {5898var elem = this;58995900while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {5901elem = elem.firstChild;5902}59035904return elem;5905}).append( this );5906}59075908return this;5909},59105911wrapInner: function( html ) {5912if ( jQuery.isFunction( html ) ) {5913return this.each(function(i) {5914jQuery(this).wrapInner( html.call(this, i) );5915});5916}59175918return this.each(function() {5919var self = jQuery( this ),5920contents = self.contents();59215922if ( contents.length ) {5923contents.wrapAll( html );59245925} else {5926self.append( html );5927}5928});5929},59305931wrap: function( html ) {5932var isFunction = jQuery.isFunction( html );59335934return this.each(function(i) {5935jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );5936});5937},59385939unwrap: function() {5940return this.parent().each(function() {5941if ( !jQuery.nodeName( this, "body" ) ) {5942jQuery( this ).replaceWith( this.childNodes );5943}5944}).end();5945},59465947append: function() {5948return this.domManip(arguments, true, function( elem ) {5949if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {5950this.appendChild( elem );5951}5952});5953},59545955prepend: function() {5956return this.domManip(arguments, true, function( elem ) {5957if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {5958this.insertBefore( elem, this.firstChild );5959}5960});5961},59625963before: function() {5964return this.domManip( arguments, false, function( elem ) {5965if ( this.parentNode ) {5966this.parentNode.insertBefore( elem, this );5967}5968});5969},59705971after: function() {5972return this.domManip( arguments, false, function( elem ) {5973if ( this.parentNode ) {5974this.parentNode.insertBefore( elem, this.nextSibling );5975}5976});5977},59785979// keepData is for internal use only--do not document5980remove: function( selector, keepData ) {5981var elem,5982i = 0;59835984for ( ; (elem = this[i]) != null; i++ ) {5985if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {5986if ( !keepData && elem.nodeType === 1 ) {5987jQuery.cleanData( getAll( elem ) );5988}59895990if ( elem.parentNode ) {5991if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {5992setGlobalEval( getAll( elem, "script" ) );5993}5994elem.parentNode.removeChild( elem );5995}5996}5997}59985999return this;6000},60016002empty: function() {6003var elem,6004i = 0;60056006for ( ; (elem = this[i]) != null; i++ ) {6007// Remove element nodes and prevent memory leaks6008if ( elem.nodeType === 1 ) {6009jQuery.cleanData( getAll( elem, false ) );6010}60116012// Remove any remaining nodes6013while ( elem.firstChild ) {6014elem.removeChild( elem.firstChild );6015}60166017// If this is a select, ensure that it displays empty (#12336)6018// Support: IE<96019if ( elem.options && jQuery.nodeName( elem, "select" ) ) {6020elem.options.length = 0;6021}6022}60236024return this;6025},60266027clone: function( dataAndEvents, deepDataAndEvents ) {6028dataAndEvents = dataAndEvents == null ? false : dataAndEvents;6029deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;60306031return this.map( function () {6032return jQuery.clone( this, dataAndEvents, deepDataAndEvents );6033});6034},60356036html: function( value ) {6037return jQuery.access( this, function( value ) {6038var elem = this[0] || {},6039i = 0,6040l = this.length;60416042if ( value === undefined ) {6043return elem.nodeType === 1 ?6044elem.innerHTML.replace( rinlinejQuery, "" ) :6045undefined;6046}60476048// See if we can take a shortcut and just use innerHTML6049if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&6050( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&6051( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&6052!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {60536054value = value.replace( rxhtmlTag, "<$1></$2>" );60556056try {6057for (; i < l; i++ ) {6058// Remove element nodes and prevent memory leaks6059elem = this[i] || {};6060if ( elem.nodeType === 1 ) {6061jQuery.cleanData( getAll( elem, false ) );6062elem.innerHTML = value;6063}6064}60656066elem = 0;60676068// If using innerHTML throws an exception, use the fallback method6069} catch(e) {}6070}60716072if ( elem ) {6073this.empty().append( value );6074}6075}, null, value, arguments.length );6076},60776078replaceWith: function( value ) {6079var isFunc = jQuery.isFunction( value );60806081// Make sure that the elements are removed from the DOM before they are inserted6082// this can help fix replacing a parent with child elements6083if ( !isFunc && typeof value !== "string" ) {6084value = jQuery( value ).not( this ).detach();6085}60866087return this.domManip( [ value ], true, function( elem ) {6088var next = this.nextSibling,6089parent = this.parentNode;60906091if ( parent ) {6092jQuery( this ).remove();6093parent.insertBefore( elem, next );6094}6095});6096},60976098detach: function( selector ) {6099return this.remove( selector, true );6100},61016102domManip: function( args, table, callback ) {61036104// Flatten any nested arrays6105args = core_concat.apply( [], args );61066107var first, node, hasScripts,6108scripts, doc, fragment,6109i = 0,6110l = this.length,6111set = this,6112iNoClone = l - 1,6113value = args[0],6114isFunction = jQuery.isFunction( value );61156116// We can't cloneNode fragments that contain checked, in WebKit6117if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {6118return this.each(function( index ) {6119var self = set.eq( index );6120if ( isFunction ) {6121args[0] = value.call( this, index, table ? self.html() : undefined );6122}6123self.domManip( args, table, callback );6124});6125}61266127if ( l ) {6128fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );6129first = fragment.firstChild;61306131if ( fragment.childNodes.length === 1 ) {6132fragment = first;6133}61346135if ( first ) {6136table = table && jQuery.nodeName( first, "tr" );6137scripts = jQuery.map( getAll( fragment, "script" ), disableScript );6138hasScripts = scripts.length;61396140// Use the original fragment for the last item instead of the first because it can end up6141// being emptied incorrectly in certain situations (#8070).6142for ( ; i < l; i++ ) {6143node = fragment;61446145if ( i !== iNoClone ) {6146node = jQuery.clone( node, true, true );61476148// Keep references to cloned scripts for later restoration6149if ( hasScripts ) {6150jQuery.merge( scripts, getAll( node, "script" ) );6151}6152}61536154callback.call(6155table && jQuery.nodeName( this[i], "table" ) ?6156findOrAppend( this[i], "tbody" ) :6157this[i],6158node,6159i6160);6161}61626163if ( hasScripts ) {6164doc = scripts[ scripts.length - 1 ].ownerDocument;61656166// Reenable scripts6167jQuery.map( scripts, restoreScript );61686169// Evaluate executable scripts on first document insertion6170for ( i = 0; i < hasScripts; i++ ) {6171node = scripts[ i ];6172if ( rscriptType.test( node.type || "" ) &&6173!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {61746175if ( node.src ) {6176// Hope ajax is available...6177jQuery.ajax({6178url: node.src,6179type: "GET",6180dataType: "script",6181async: false,6182global: false,6183"throws": true6184});6185} else {6186jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );6187}6188}6189}6190}61916192// Fix #11809: Avoid leaking memory6193fragment = first = null;6194}6195}61966197return this;6198}6199});62006201function findOrAppend( elem, tag ) {6202return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );6203}62046205// Replace/restore the type attribute of script elements for safe DOM manipulation6206function disableScript( elem ) {6207var attr = elem.getAttributeNode("type");6208elem.type = ( attr && attr.specified ) + "/" + elem.type;6209return elem;6210}6211function restoreScript( elem ) {6212var match = rscriptTypeMasked.exec( elem.type );6213if ( match ) {6214elem.type = match[1];6215} else {6216elem.removeAttribute("type");6217}6218return elem;6219}62206221// Mark scripts as having already been evaluated6222function setGlobalEval( elems, refElements ) {6223var elem,6224i = 0;6225for ( ; (elem = elems[i]) != null; i++ ) {6226jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );6227}6228}62296230function cloneCopyEvent( src, dest ) {62316232if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {6233return;6234}62356236var type, i, l,6237oldData = jQuery._data( src ),6238curData = jQuery._data( dest, oldData ),6239events = oldData.events;62406241if ( events ) {6242delete curData.handle;6243curData.events = {};62446245for ( type in events ) {6246for ( i = 0, l = events[ type ].length; i < l; i++ ) {6247jQuery.event.add( dest, type, events[ type ][ i ] );6248}6249}6250}62516252// make the cloned public data object a copy from the original6253if ( curData.data ) {6254curData.data = jQuery.extend( {}, curData.data );6255}6256}62576258function fixCloneNodeIssues( src, dest ) {6259var nodeName, e, data;62606261// We do not need to do anything for non-Elements6262if ( dest.nodeType !== 1 ) {6263return;6264}62656266nodeName = dest.nodeName.toLowerCase();62676268// IE6-8 copies events bound via attachEvent when using cloneNode.6269if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {6270data = jQuery._data( dest );62716272for ( e in data.events ) {6273jQuery.removeEvent( dest, e, data.handle );6274}62756276// Event data gets referenced instead of copied if the expando gets copied too6277dest.removeAttribute( jQuery.expando );6278}62796280// IE blanks contents when cloning scripts, and tries to evaluate newly-set text6281if ( nodeName === "script" && dest.text !== src.text ) {6282disableScript( dest ).text = src.text;6283restoreScript( dest );62846285// IE6-10 improperly clones children of object elements using classid.6286// IE10 throws NoModificationAllowedError if parent is null, #12132.6287} else if ( nodeName === "object" ) {6288if ( dest.parentNode ) {6289dest.outerHTML = src.outerHTML;6290}62916292// This path appears unavoidable for IE9. When cloning an object6293// element in IE9, the outerHTML strategy above is not sufficient.6294// If the src has innerHTML and the destination does not,6295// copy the src.innerHTML into the dest.innerHTML. #103246296if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {6297dest.innerHTML = src.innerHTML;6298}62996300} else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {6301// IE6-8 fails to persist the checked state of a cloned checkbox6302// or radio button. Worse, IE6-7 fail to give the cloned element6303// a checked appearance if the defaultChecked value isn't also set63046305dest.defaultChecked = dest.checked = src.checked;63066307// IE6-7 get confused and end up setting the value of a cloned6308// checkbox/radio button to an empty string instead of "on"6309if ( dest.value !== src.value ) {6310dest.value = src.value;6311}63126313// IE6-8 fails to return the selected option to the default selected6314// state when cloning options6315} else if ( nodeName === "option" ) {6316dest.defaultSelected = dest.selected = src.defaultSelected;63176318// IE6-8 fails to set the defaultValue to the correct value when6319// cloning other types of input fields6320} else if ( nodeName === "input" || nodeName === "textarea" ) {6321dest.defaultValue = src.defaultValue;6322}6323}63246325jQuery.each({6326appendTo: "append",6327prependTo: "prepend",6328insertBefore: "before",6329insertAfter: "after",6330replaceAll: "replaceWith"6331}, function( name, original ) {6332jQuery.fn[ name ] = function( selector ) {6333var elems,6334i = 0,6335ret = [],6336insert = jQuery( selector ),6337last = insert.length - 1;63386339for ( ; i <= last; i++ ) {6340elems = i === last ? this : this.clone(true);6341jQuery( insert[i] )[ original ]( elems );63426343// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()6344core_push.apply( ret, elems.get() );6345}63466347return this.pushStack( ret );6348};6349});63506351function getAll( context, tag ) {6352var elems, elem,6353i = 0,6354found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :6355typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :6356undefined;63576358if ( !found ) {6359for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {6360if ( !tag || jQuery.nodeName( elem, tag ) ) {6361found.push( elem );6362} else {6363jQuery.merge( found, getAll( elem, tag ) );6364}6365}6366}63676368return tag === undefined || tag && jQuery.nodeName( context, tag ) ?6369jQuery.merge( [ context ], found ) :6370found;6371}63726373// Used in buildFragment, fixes the defaultChecked property6374function fixDefaultChecked( elem ) {6375if ( manipulation_rcheckableType.test( elem.type ) ) {6376elem.defaultChecked = elem.checked;6377}6378}63796380jQuery.extend({6381clone: function( elem, dataAndEvents, deepDataAndEvents ) {6382var destElements, node, clone, i, srcElements,6383inPage = jQuery.contains( elem.ownerDocument, elem );63846385if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {6386clone = elem.cloneNode( true );63876388// IE<=8 does not properly clone detached, unknown element nodes6389} else {6390fragmentDiv.innerHTML = elem.outerHTML;6391fragmentDiv.removeChild( clone = fragmentDiv.firstChild );6392}63936394if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&6395(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {63966397// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/26398destElements = getAll( clone );6399srcElements = getAll( elem );64006401// Fix all IE cloning issues6402for ( i = 0; (node = srcElements[i]) != null; ++i ) {6403// Ensure that the destination node is not null; Fixes #95876404if ( destElements[i] ) {6405fixCloneNodeIssues( node, destElements[i] );6406}6407}6408}64096410// Copy the events from the original to the clone6411if ( dataAndEvents ) {6412if ( deepDataAndEvents ) {6413srcElements = srcElements || getAll( elem );6414destElements = destElements || getAll( clone );64156416for ( i = 0; (node = srcElements[i]) != null; i++ ) {6417cloneCopyEvent( node, destElements[i] );6418}6419} else {6420cloneCopyEvent( elem, clone );6421}6422}64236424// Preserve script evaluation history6425destElements = getAll( clone, "script" );6426if ( destElements.length > 0 ) {6427setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );6428}64296430destElements = srcElements = node = null;64316432// Return the cloned set6433return clone;6434},64356436buildFragment: function( elems, context, scripts, selection ) {6437var j, elem, contains,6438tmp, tag, tbody, wrap,6439l = elems.length,64406441// Ensure a safe fragment6442safe = createSafeFragment( context ),64436444nodes = [],6445i = 0;64466447for ( ; i < l; i++ ) {6448elem = elems[ i ];64496450if ( elem || elem === 0 ) {64516452// Add nodes directly6453if ( jQuery.type( elem ) === "object" ) {6454jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );64556456// Convert non-html into a text node6457} else if ( !rhtml.test( elem ) ) {6458nodes.push( context.createTextNode( elem ) );64596460// Convert html into DOM nodes6461} else {6462tmp = tmp || safe.appendChild( context.createElement("div") );64636464// Deserialize a standard representation6465tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();6466wrap = wrapMap[ tag ] || wrapMap._default;64676468tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];64696470// Descend through wrappers to the right content6471j = wrap[0];6472while ( j-- ) {6473tmp = tmp.lastChild;6474}64756476// Manually add leading whitespace removed by IE6477if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {6478nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );6479}64806481// Remove IE's autoinserted <tbody> from table fragments6482if ( !jQuery.support.tbody ) {64836484// String was a <table>, *may* have spurious <tbody>6485elem = tag === "table" && !rtbody.test( elem ) ?6486tmp.firstChild :64876488// String was a bare <thead> or <tfoot>6489wrap[1] === "<table>" && !rtbody.test( elem ) ?6490tmp :64910;64926493j = elem && elem.childNodes.length;6494while ( j-- ) {6495if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {6496elem.removeChild( tbody );6497}6498}6499}65006501jQuery.merge( nodes, tmp.childNodes );65026503// Fix #12392 for WebKit and IE > 96504tmp.textContent = "";65056506// Fix #12392 for oldIE6507while ( tmp.firstChild ) {6508tmp.removeChild( tmp.firstChild );6509}65106511// Remember the top-level container for proper cleanup6512tmp = safe.lastChild;6513}6514}6515}65166517// Fix #11356: Clear elements from fragment6518if ( tmp ) {6519safe.removeChild( tmp );6520}65216522// Reset defaultChecked for any radios and checkboxes6523// about to be appended to the DOM in IE 6/7 (#8060)6524if ( !jQuery.support.appendChecked ) {6525jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );6526}65276528i = 0;6529while ( (elem = nodes[ i++ ]) ) {65306531// #4087 - If origin and destination elements are the same, and this is6532// that element, do not do anything6533if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {6534continue;6535}65366537contains = jQuery.contains( elem.ownerDocument, elem );65386539// Append to fragment6540tmp = getAll( safe.appendChild( elem ), "script" );65416542// Preserve script evaluation history6543if ( contains ) {6544setGlobalEval( tmp );6545}65466547// Capture executables6548if ( scripts ) {6549j = 0;6550while ( (elem = tmp[ j++ ]) ) {6551if ( rscriptType.test( elem.type || "" ) ) {6552scripts.push( elem );6553}6554}6555}6556}65576558tmp = null;65596560return safe;6561},65626563cleanData: function( elems, /* internal */ acceptData ) {6564var elem, type, id, data,6565i = 0,6566internalKey = jQuery.expando,6567cache = jQuery.cache,6568deleteExpando = jQuery.support.deleteExpando,6569special = jQuery.event.special;65706571for ( ; (elem = elems[i]) != null; i++ ) {65726573if ( acceptData || jQuery.acceptData( elem ) ) {65746575id = elem[ internalKey ];6576data = id && cache[ id ];65776578if ( data ) {6579if ( data.events ) {6580for ( type in data.events ) {6581if ( special[ type ] ) {6582jQuery.event.remove( elem, type );65836584// This is a shortcut to avoid jQuery.event.remove's overhead6585} else {6586jQuery.removeEvent( elem, type, data.handle );6587}6588}6589}65906591// Remove cache only if it was not already removed by jQuery.event.remove6592if ( cache[ id ] ) {65936594delete cache[ id ];65956596// IE does not allow us to delete expando properties from nodes,6597// nor does it have a removeAttribute function on Document nodes;6598// we must handle all of these cases6599if ( deleteExpando ) {6600delete elem[ internalKey ];66016602} else if ( typeof elem.removeAttribute !== core_strundefined ) {6603elem.removeAttribute( internalKey );66046605} else {6606elem[ internalKey ] = null;6607}66086609core_deletedIds.push( id );6610}6611}6612}6613}6614}6615});6616var iframe, getStyles, curCSS,6617ralpha = /alpha\([^)]*\)/i,6618ropacity = /opacity\s*=\s*([^)]*)/,6619rposition = /^(top|right|bottom|left)$/,6620// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"6621// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display6622rdisplayswap = /^(none|table(?!-c[ea]).+)/,6623rmargin = /^margin/,6624rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),6625rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),6626rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),6627elemdisplay = { BODY: "block" },66286629cssShow = { position: "absolute", visibility: "hidden", display: "block" },6630cssNormalTransform = {6631letterSpacing: 0,6632fontWeight: 4006633},66346635cssExpand = [ "Top", "Right", "Bottom", "Left" ],6636cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];66376638// return a css property mapped to a potentially vendor prefixed property6639function vendorPropName( style, name ) {66406641// shortcut for names that are not vendor prefixed6642if ( name in style ) {6643return name;6644}66456646// check for vendor prefixed names6647var capName = name.charAt(0).toUpperCase() + name.slice(1),6648origName = name,6649i = cssPrefixes.length;66506651while ( i-- ) {6652name = cssPrefixes[ i ] + capName;6653if ( name in style ) {6654return name;6655}6656}66576658return origName;6659}66606661function isHidden( elem, el ) {6662// isHidden might be called from jQuery#filter function;6663// in that case, element will be second argument6664elem = el || elem;6665return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );6666}66676668function showHide( elements, show ) {6669var display, elem, hidden,6670values = [],6671index = 0,6672length = elements.length;66736674for ( ; index < length; index++ ) {6675elem = elements[ index ];6676if ( !elem.style ) {6677continue;6678}66796680values[ index ] = jQuery._data( elem, "olddisplay" );6681display = elem.style.display;6682if ( show ) {6683// Reset the inline display of this element to learn if it is6684// being hidden by cascaded rules or not6685if ( !values[ index ] && display === "none" ) {6686elem.style.display = "";6687}66886689// Set elements which have been overridden with display: none6690// in a stylesheet to whatever the default browser style is6691// for such an element6692if ( elem.style.display === "" && isHidden( elem ) ) {6693values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );6694}6695} else {66966697if ( !values[ index ] ) {6698hidden = isHidden( elem );66996700if ( display && display !== "none" || !hidden ) {6701jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );6702}6703}6704}6705}67066707// Set the display of most of the elements in a second loop6708// to avoid the constant reflow6709for ( index = 0; index < length; index++ ) {6710elem = elements[ index ];6711if ( !elem.style ) {6712continue;6713}6714if ( !show || elem.style.display === "none" || elem.style.display === "" ) {6715elem.style.display = show ? values[ index ] || "" : "none";6716}6717}67186719return elements;6720}67216722jQuery.fn.extend({6723css: function( name, value ) {6724return jQuery.access( this, function( elem, name, value ) {6725var len, styles,6726map = {},6727i = 0;67286729if ( jQuery.isArray( name ) ) {6730styles = getStyles( elem );6731len = name.length;67326733for ( ; i < len; i++ ) {6734map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );6735}67366737return map;6738}67396740return value !== undefined ?6741jQuery.style( elem, name, value ) :6742jQuery.css( elem, name );6743}, name, value, arguments.length > 1 );6744},6745show: function() {6746return showHide( this, true );6747},6748hide: function() {6749return showHide( this );6750},6751toggle: function( state ) {6752var bool = typeof state === "boolean";67536754return this.each(function() {6755if ( bool ? state : isHidden( this ) ) {6756jQuery( this ).show();6757} else {6758jQuery( this ).hide();6759}6760});6761}6762});67636764jQuery.extend({6765// Add in style property hooks for overriding the default6766// behavior of getting and setting a style property6767cssHooks: {6768opacity: {6769get: function( elem, computed ) {6770if ( computed ) {6771// We should always get a number back from opacity6772var ret = curCSS( elem, "opacity" );6773return ret === "" ? "1" : ret;6774}6775}6776}6777},67786779// Exclude the following css properties to add px6780cssNumber: {6781"columnCount": true,6782"fillOpacity": true,6783"fontWeight": true,6784"lineHeight": true,6785"opacity": true,6786"orphans": true,6787"widows": true,6788"zIndex": true,6789"zoom": true6790},67916792// Add in properties whose names you wish to fix before6793// setting or getting the value6794cssProps: {6795// normalize float css property6796"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"6797},67986799// Get and set the style property on a DOM Node6800style: function( elem, name, value, extra ) {6801// Don't set styles on text and comment nodes6802if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {6803return;6804}68056806// Make sure that we're working with the right name6807var ret, type, hooks,6808origName = jQuery.camelCase( name ),6809style = elem.style;68106811name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );68126813// gets hook for the prefixed version6814// followed by the unprefixed version6815hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];68166817// Check if we're setting a value6818if ( value !== undefined ) {6819type = typeof value;68206821// convert relative number strings (+= or -=) to relative numbers. #73456822if ( type === "string" && (ret = rrelNum.exec( value )) ) {6823value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );6824// Fixes bug #92376825type = "number";6826}68276828// Make sure that NaN and null values aren't set. See: #71166829if ( value == null || type === "number" && isNaN( value ) ) {6830return;6831}68326833// If a number was passed in, add 'px' to the (except for certain CSS properties)6834if ( type === "number" && !jQuery.cssNumber[ origName ] ) {6835value += "px";6836}68376838// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,6839// but it would mean to define eight (for every problematic property) identical functions6840if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {6841style[ name ] = "inherit";6842}68436844// If a hook was provided, use that value, otherwise just set the specified value6845if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {68466847// Wrapped to prevent IE from throwing errors when 'invalid' values are provided6848// Fixes bug #55096849try {6850style[ name ] = value;6851} catch(e) {}6852}68536854} else {6855// If a hook was provided get the non-computed value from there6856if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {6857return ret;6858}68596860// Otherwise just get the value from the style object6861return style[ name ];6862}6863},68646865css: function( elem, name, extra, styles ) {6866var num, val, hooks,6867origName = jQuery.camelCase( name );68686869// Make sure that we're working with the right name6870name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );68716872// gets hook for the prefixed version6873// followed by the unprefixed version6874hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];68756876// If a hook was provided get the computed value from there6877if ( hooks && "get" in hooks ) {6878val = hooks.get( elem, true, extra );6879}68806881// Otherwise, if a way to get the computed value exists, use that6882if ( val === undefined ) {6883val = curCSS( elem, name, styles );6884}68856886//convert "normal" to computed value6887if ( val === "normal" && name in cssNormalTransform ) {6888val = cssNormalTransform[ name ];6889}68906891// Return, converting to number if forced or a qualifier was provided and val looks numeric6892if ( extra === "" || extra ) {6893num = parseFloat( val );6894return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;6895}6896return val;6897},68986899// A method for quickly swapping in/out CSS properties to get correct calculations6900swap: function( elem, options, callback, args ) {6901var ret, name,6902old = {};69036904// Remember the old values, and insert the new ones6905for ( name in options ) {6906old[ name ] = elem.style[ name ];6907elem.style[ name ] = options[ name ];6908}69096910ret = callback.apply( elem, args || [] );69116912// Revert the old values6913for ( name in options ) {6914elem.style[ name ] = old[ name ];6915}69166917return ret;6918}6919});69206921// NOTE: we've included the "window" in window.getComputedStyle6922// because jsdom on node.js will break without it.6923if ( window.getComputedStyle ) {6924getStyles = function( elem ) {6925return window.getComputedStyle( elem, null );6926};69276928curCSS = function( elem, name, _computed ) {6929var width, minWidth, maxWidth,6930computed = _computed || getStyles( elem ),69316932// getPropertyValue is only needed for .css('filter') in IE9, see #125376933ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,6934style = elem.style;69356936if ( computed ) {69376938if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {6939ret = jQuery.style( elem, name );6940}69416942// A tribute to the "awesome hack by Dean Edwards"6943// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right6944// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels6945// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values6946if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {69476948// Remember the original values6949width = style.width;6950minWidth = style.minWidth;6951maxWidth = style.maxWidth;69526953// Put in the new values to get a computed value out6954style.minWidth = style.maxWidth = style.width = ret;6955ret = computed.width;69566957// Revert the changed values6958style.width = width;6959style.minWidth = minWidth;6960style.maxWidth = maxWidth;6961}6962}69636964return ret;6965};6966} else if ( document.documentElement.currentStyle ) {6967getStyles = function( elem ) {6968return elem.currentStyle;6969};69706971curCSS = function( elem, name, _computed ) {6972var left, rs, rsLeft,6973computed = _computed || getStyles( elem ),6974ret = computed ? computed[ name ] : undefined,6975style = elem.style;69766977// Avoid setting ret to empty string here6978// so we don't default to auto6979if ( ret == null && style && style[ name ] ) {6980ret = style[ name ];6981}69826983// From the awesome hack by Dean Edwards6984// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-10229169856986// If we're not dealing with a regular pixel number6987// but a number that has a weird ending, we need to convert it to pixels6988// but not position css attributes, as those are proportional to the parent element instead6989// and we can't measure the parent instead because it might trigger a "stacking dolls" problem6990if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {69916992// Remember the original values6993left = style.left;6994rs = elem.runtimeStyle;6995rsLeft = rs && rs.left;69966997// Put in the new values to get a computed value out6998if ( rsLeft ) {6999rs.left = elem.currentStyle.left;7000}7001style.left = name === "fontSize" ? "1em" : ret;7002ret = style.pixelLeft + "px";70037004// Revert the changed values7005style.left = left;7006if ( rsLeft ) {7007rs.left = rsLeft;7008}7009}70107011return ret === "" ? "auto" : ret;7012};7013}70147015function setPositiveNumber( elem, value, subtract ) {7016var matches = rnumsplit.exec( value );7017return matches ?7018// Guard against undefined "subtract", e.g., when used as in cssHooks7019Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :7020value;7021}70227023function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {7024var i = extra === ( isBorderBox ? "border" : "content" ) ?7025// If we already have the right measurement, avoid augmentation70264 :7027// Otherwise initialize for horizontal or vertical properties7028name === "width" ? 1 : 0,70297030val = 0;70317032for ( ; i < 4; i += 2 ) {7033// both box models exclude margin, so add it if we want it7034if ( extra === "margin" ) {7035val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );7036}70377038if ( isBorderBox ) {7039// border-box includes padding, so remove it if we want content7040if ( extra === "content" ) {7041val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );7042}70437044// at this point, extra isn't border nor margin, so remove border7045if ( extra !== "margin" ) {7046val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );7047}7048} else {7049// at this point, extra isn't content, so add padding7050val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );70517052// at this point, extra isn't content nor padding, so add border7053if ( extra !== "padding" ) {7054val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );7055}7056}7057}70587059return val;7060}70617062function getWidthOrHeight( elem, name, extra ) {70637064// Start with offset property, which is equivalent to the border-box value7065var valueIsBorderBox = true,7066val = name === "width" ? elem.offsetWidth : elem.offsetHeight,7067styles = getStyles( elem ),7068isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";70697070// some non-html elements return undefined for offsetWidth, so check for null/undefined7071// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=6492857072// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=4916687073if ( val <= 0 || val == null ) {7074// Fall back to computed then uncomputed css if necessary7075val = curCSS( elem, name, styles );7076if ( val < 0 || val == null ) {7077val = elem.style[ name ];7078}70797080// Computed unit is not pixels. Stop here and return.7081if ( rnumnonpx.test(val) ) {7082return val;7083}70847085// we need the check for style in case a browser which returns unreliable values7086// for getComputedStyle silently falls back to the reliable elem.style7087valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );70887089// Normalize "", auto, and prepare for extra7090val = parseFloat( val ) || 0;7091}70927093// use the active box-sizing model to add/subtract irrelevant styles7094return ( val +7095augmentWidthOrHeight(7096elem,7097name,7098extra || ( isBorderBox ? "border" : "content" ),7099valueIsBorderBox,7100styles7101)7102) + "px";7103}71047105// Try to determine the default display value of an element7106function css_defaultDisplay( nodeName ) {7107var doc = document,7108display = elemdisplay[ nodeName ];71097110if ( !display ) {7111display = actualDisplay( nodeName, doc );71127113// If the simple way fails, read from inside an iframe7114if ( display === "none" || !display ) {7115// Use the already-created iframe if possible7116iframe = ( iframe ||7117jQuery("<iframe frameborder='0' width='0' height='0'/>")7118.css( "cssText", "display:block !important" )7119).appendTo( doc.documentElement );71207121// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse7122doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;7123doc.write("<!doctype html><html><body>");7124doc.close();71257126display = actualDisplay( nodeName, doc );7127iframe.detach();7128}71297130// Store the correct default display7131elemdisplay[ nodeName ] = display;7132}71337134return display;7135}71367137// Called ONLY from within css_defaultDisplay7138function actualDisplay( name, doc ) {7139var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),7140display = jQuery.css( elem[0], "display" );7141elem.remove();7142return display;7143}71447145jQuery.each([ "height", "width" ], function( i, name ) {7146jQuery.cssHooks[ name ] = {7147get: function( elem, computed, extra ) {7148if ( computed ) {7149// certain elements can have dimension info if we invisibly show them7150// however, it must have a current display style that would benefit from this7151return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?7152jQuery.swap( elem, cssShow, function() {7153return getWidthOrHeight( elem, name, extra );7154}) :7155getWidthOrHeight( elem, name, extra );7156}7157},71587159set: function( elem, value, extra ) {7160var styles = extra && getStyles( elem );7161return setPositiveNumber( elem, value, extra ?7162augmentWidthOrHeight(7163elem,7164name,7165extra,7166jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",7167styles7168) : 07169);7170}7171};7172});71737174if ( !jQuery.support.opacity ) {7175jQuery.cssHooks.opacity = {7176get: function( elem, computed ) {7177// IE uses filters for opacity7178return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?7179( 0.01 * parseFloat( RegExp.$1 ) ) + "" :7180computed ? "1" : "";7181},71827183set: function( elem, value ) {7184var style = elem.style,7185currentStyle = elem.currentStyle,7186opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",7187filter = currentStyle && currentStyle.filter || style.filter || "";71887189// IE has trouble with opacity if it does not have layout7190// Force it by setting the zoom level7191style.zoom = 1;71927193// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #66527194// if value === "", then remove inline opacity #126857195if ( ( value >= 1 || value === "" ) &&7196jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&7197style.removeAttribute ) {71987199// Setting style.filter to null, "" & " " still leave "filter:" in the cssText7200// if "filter:" is present at all, clearType is disabled, we want to avoid this7201// style.removeAttribute is IE Only, but so apparently is this code path...7202style.removeAttribute( "filter" );72037204// if there is no filter style applied in a css rule or unset inline opacity, we are done7205if ( value === "" || currentStyle && !currentStyle.filter ) {7206return;7207}7208}72097210// otherwise, set new filter values7211style.filter = ralpha.test( filter ) ?7212filter.replace( ralpha, opacity ) :7213filter + " " + opacity;7214}7215};7216}72177218// These hooks cannot be added until DOM ready because the support test7219// for it is not run until after DOM ready7220jQuery(function() {7221if ( !jQuery.support.reliableMarginRight ) {7222jQuery.cssHooks.marginRight = {7223get: function( elem, computed ) {7224if ( computed ) {7225// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right7226// Work around by temporarily setting element display to inline-block7227return jQuery.swap( elem, { "display": "inline-block" },7228curCSS, [ elem, "marginRight" ] );7229}7230}7231};7232}72337234// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=290847235// getComputedStyle returns percent when specified for top/left/bottom/right7236// rather than make the css module depend on the offset module, we just check for it here7237if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {7238jQuery.each( [ "top", "left" ], function( i, prop ) {7239jQuery.cssHooks[ prop ] = {7240get: function( elem, computed ) {7241if ( computed ) {7242computed = curCSS( elem, prop );7243// if curCSS returns percentage, fallback to offset7244return rnumnonpx.test( computed ) ?7245jQuery( elem ).position()[ prop ] + "px" :7246computed;7247}7248}7249};7250});7251}72527253});72547255if ( jQuery.expr && jQuery.expr.filters ) {7256jQuery.expr.filters.hidden = function( elem ) {7257// Support: Opera <= 12.127258// Opera reports offsetWidths and offsetHeights less than zero on some elements7259return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||7260(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");7261};72627263jQuery.expr.filters.visible = function( elem ) {7264return !jQuery.expr.filters.hidden( elem );7265};7266}72677268// These hooks are used by animate to expand properties7269jQuery.each({7270margin: "",7271padding: "",7272border: "Width"7273}, function( prefix, suffix ) {7274jQuery.cssHooks[ prefix + suffix ] = {7275expand: function( value ) {7276var i = 0,7277expanded = {},72787279// assumes a single number if not a string7280parts = typeof value === "string" ? value.split(" ") : [ value ];72817282for ( ; i < 4; i++ ) {7283expanded[ prefix + cssExpand[ i ] + suffix ] =7284parts[ i ] || parts[ i - 2 ] || parts[ 0 ];7285}72867287return expanded;7288}7289};72907291if ( !rmargin.test( prefix ) ) {7292jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;7293}7294});7295var r20 = /%20/g,7296rbracket = /\[\]$/,7297rCRLF = /\r?\n/g,7298rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,7299rsubmittable = /^(?:input|select|textarea|keygen)/i;73007301jQuery.fn.extend({7302serialize: function() {7303return jQuery.param( this.serializeArray() );7304},7305serializeArray: function() {7306return this.map(function(){7307// Can add propHook for "elements" to filter or add form elements7308var elements = jQuery.prop( this, "elements" );7309return elements ? jQuery.makeArray( elements ) : this;7310})7311.filter(function(){7312var type = this.type;7313// Use .is(":disabled") so that fieldset[disabled] works7314return this.name && !jQuery( this ).is( ":disabled" ) &&7315rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&7316( this.checked || !manipulation_rcheckableType.test( type ) );7317})7318.map(function( i, elem ){7319var val = jQuery( this ).val();73207321return val == null ?7322null :7323jQuery.isArray( val ) ?7324jQuery.map( val, function( val ){7325return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };7326}) :7327{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };7328}).get();7329}7330});73317332//Serialize an array of form elements or a set of7333//key/values into a query string7334jQuery.param = function( a, traditional ) {7335var prefix,7336s = [],7337add = function( key, value ) {7338// If value is a function, invoke it and return its value7339value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );7340s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );7341};73427343// Set traditional to true for jQuery <= 1.3.2 behavior.7344if ( traditional === undefined ) {7345traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;7346}73477348// If an array was passed in, assume that it is an array of form elements.7349if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {7350// Serialize the form elements7351jQuery.each( a, function() {7352add( this.name, this.value );7353});73547355} else {7356// If traditional, encode the "old" way (the way 1.3.2 or older7357// did it), otherwise encode params recursively.7358for ( prefix in a ) {7359buildParams( prefix, a[ prefix ], traditional, add );7360}7361}73627363// Return the resulting serialization7364return s.join( "&" ).replace( r20, "+" );7365};73667367function buildParams( prefix, obj, traditional, add ) {7368var name;73697370if ( jQuery.isArray( obj ) ) {7371// Serialize array item.7372jQuery.each( obj, function( i, v ) {7373if ( traditional || rbracket.test( prefix ) ) {7374// Treat each array item as a scalar.7375add( prefix, v );73767377} else {7378// Item is non-scalar (array or object), encode its numeric index.7379buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );7380}7381});73827383} else if ( !traditional && jQuery.type( obj ) === "object" ) {7384// Serialize object item.7385for ( name in obj ) {7386buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );7387}73887389} else {7390// Serialize scalar item.7391add( prefix, obj );7392}7393}7394jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +7395"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +7396"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {73977398// Handle event binding7399jQuery.fn[ name ] = function( data, fn ) {7400return arguments.length > 0 ?7401this.on( name, null, data, fn ) :7402this.trigger( name );7403};7404});74057406jQuery.fn.hover = function( fnOver, fnOut ) {7407return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );7408};7409var7410// Document location7411ajaxLocParts,7412ajaxLocation,7413ajax_nonce = jQuery.now(),74147415ajax_rquery = /\?/,7416rhash = /#.*$/,7417rts = /([?&])_=[^&]*/,7418rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL7419// #7653, #8125, #8152: local protocol detection7420rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,7421rnoContent = /^(?:GET|HEAD)$/,7422rprotocol = /^\/\//,7423rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,74247425// Keep a copy of the old load method7426_load = jQuery.fn.load,74277428/* Prefilters7429* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)7430* 2) These are called:7431* - BEFORE asking for a transport7432* - AFTER param serialization (s.data is a string if s.processData is true)7433* 3) key is the dataType7434* 4) the catchall symbol "*" can be used7435* 5) execution will start with transport dataType and THEN continue down to "*" if needed7436*/7437prefilters = {},74387439/* Transports bindings7440* 1) key is the dataType7441* 2) the catchall symbol "*" can be used7442* 3) selection will start with transport dataType and THEN go to "*" if needed7443*/7444transports = {},74457446// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression7447allTypes = "*/".concat("*");74487449// #8138, IE may throw an exception when accessing7450// a field from window.location if document.domain has been set7451try {7452ajaxLocation = location.href;7453} catch( e ) {7454// Use the href attribute of an A element7455// since IE will modify it given document.location7456ajaxLocation = document.createElement( "a" );7457ajaxLocation.href = "";7458ajaxLocation = ajaxLocation.href;7459}74607461// Segment location into parts7462ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];74637464// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport7465function addToPrefiltersOrTransports( structure ) {74667467// dataTypeExpression is optional and defaults to "*"7468return function( dataTypeExpression, func ) {74697470if ( typeof dataTypeExpression !== "string" ) {7471func = dataTypeExpression;7472dataTypeExpression = "*";7473}74747475var dataType,7476i = 0,7477dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];74787479if ( jQuery.isFunction( func ) ) {7480// For each dataType in the dataTypeExpression7481while ( (dataType = dataTypes[i++]) ) {7482// Prepend if requested7483if ( dataType[0] === "+" ) {7484dataType = dataType.slice( 1 ) || "*";7485(structure[ dataType ] = structure[ dataType ] || []).unshift( func );74867487// Otherwise append7488} else {7489(structure[ dataType ] = structure[ dataType ] || []).push( func );7490}7491}7492}7493};7494}74957496// Base inspection function for prefilters and transports7497function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {74987499var inspected = {},7500seekingTransport = ( structure === transports );75017502function inspect( dataType ) {7503var selected;7504inspected[ dataType ] = true;7505jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {7506var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );7507if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {7508options.dataTypes.unshift( dataTypeOrTransport );7509inspect( dataTypeOrTransport );7510return false;7511} else if ( seekingTransport ) {7512return !( selected = dataTypeOrTransport );7513}7514});7515return selected;7516}75177518return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );7519}75207521// A special extend for ajax options7522// that takes "flat" options (not to be deep extended)7523// Fixes #98877524function ajaxExtend( target, src ) {7525var deep, key,7526flatOptions = jQuery.ajaxSettings.flatOptions || {};75277528for ( key in src ) {7529if ( src[ key ] !== undefined ) {7530( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];7531}7532}7533if ( deep ) {7534jQuery.extend( true, target, deep );7535}75367537return target;7538}75397540jQuery.fn.load = function( url, params, callback ) {7541if ( typeof url !== "string" && _load ) {7542return _load.apply( this, arguments );7543}75447545var selector, response, type,7546self = this,7547off = url.indexOf(" ");75487549if ( off >= 0 ) {7550selector = url.slice( off, url.length );7551url = url.slice( 0, off );7552}75537554// If it's a function7555if ( jQuery.isFunction( params ) ) {75567557// We assume that it's the callback7558callback = params;7559params = undefined;75607561// Otherwise, build a param string7562} else if ( params && typeof params === "object" ) {7563type = "POST";7564}75657566// If we have elements to modify, make the request7567if ( self.length > 0 ) {7568jQuery.ajax({7569url: url,75707571// if "type" variable is undefined, then "GET" method will be used7572type: type,7573dataType: "html",7574data: params7575}).done(function( responseText ) {75767577// Save response for use in complete callback7578response = arguments;75797580self.html( selector ?75817582// If a selector was specified, locate the right elements in a dummy div7583// Exclude scripts to avoid IE 'Permission Denied' errors7584jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :75857586// Otherwise use the full result7587responseText );75887589}).complete( callback && function( jqXHR, status ) {7590self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );7591});7592}75937594return this;7595};75967597// Attach a bunch of functions for handling common AJAX events7598jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){7599jQuery.fn[ type ] = function( fn ){7600return this.on( type, fn );7601};7602});76037604jQuery.each( [ "get", "post" ], function( i, method ) {7605jQuery[ method ] = function( url, data, callback, type ) {7606// shift arguments if data argument was omitted7607if ( jQuery.isFunction( data ) ) {7608type = type || callback;7609callback = data;7610data = undefined;7611}76127613return jQuery.ajax({7614url: url,7615type: method,7616dataType: type,7617data: data,7618success: callback7619});7620};7621});76227623jQuery.extend({76247625// Counter for holding the number of active queries7626active: 0,76277628// Last-Modified header cache for next request7629lastModified: {},7630etag: {},76317632ajaxSettings: {7633url: ajaxLocation,7634type: "GET",7635isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),7636global: true,7637processData: true,7638async: true,7639contentType: "application/x-www-form-urlencoded; charset=UTF-8",7640/*7641timeout: 0,7642data: null,7643dataType: null,7644username: null,7645password: null,7646cache: null,7647throws: false,7648traditional: false,7649headers: {},7650*/76517652accepts: {7653"*": allTypes,7654text: "text/plain",7655html: "text/html",7656xml: "application/xml, text/xml",7657json: "application/json, text/javascript"7658},76597660contents: {7661xml: /xml/,7662html: /html/,7663json: /json/7664},76657666responseFields: {7667xml: "responseXML",7668text: "responseText"7669},76707671// Data converters7672// Keys separate source (or catchall "*") and destination types with a single space7673converters: {76747675// Convert anything to text7676"* text": window.String,76777678// Text to html (true = no transformation)7679"text html": true,76807681// Evaluate text as a json expression7682"text json": jQuery.parseJSON,76837684// Parse text as xml7685"text xml": jQuery.parseXML7686},76877688// For options that shouldn't be deep extended:7689// you can add your own custom options here if7690// and when you create one that shouldn't be7691// deep extended (see ajaxExtend)7692flatOptions: {7693url: true,7694context: true7695}7696},76977698// Creates a full fledged settings object into target7699// with both ajaxSettings and settings fields.7700// If target is omitted, writes into ajaxSettings.7701ajaxSetup: function( target, settings ) {7702return settings ?77037704// Building a settings object7705ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :77067707// Extending ajaxSettings7708ajaxExtend( jQuery.ajaxSettings, target );7709},77107711ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),7712ajaxTransport: addToPrefiltersOrTransports( transports ),77137714// Main method7715ajax: function( url, options ) {77167717// If url is an object, simulate pre-1.5 signature7718if ( typeof url === "object" ) {7719options = url;7720url = undefined;7721}77227723// Force options to be an object7724options = options || {};77257726var // Cross-domain detection vars7727parts,7728// Loop variable7729i,7730// URL without anti-cache param7731cacheURL,7732// Response headers as string7733responseHeadersString,7734// timeout handle7735timeoutTimer,77367737// To know if global events are to be dispatched7738fireGlobals,77397740transport,7741// Response headers7742responseHeaders,7743// Create the final options object7744s = jQuery.ajaxSetup( {}, options ),7745// Callbacks context7746callbackContext = s.context || s,7747// Context for global events is callbackContext if it is a DOM node or jQuery collection7748globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?7749jQuery( callbackContext ) :7750jQuery.event,7751// Deferreds7752deferred = jQuery.Deferred(),7753completeDeferred = jQuery.Callbacks("once memory"),7754// Status-dependent callbacks7755statusCode = s.statusCode || {},7756// Headers (they are sent all at once)7757requestHeaders = {},7758requestHeadersNames = {},7759// The jqXHR state7760state = 0,7761// Default abort message7762strAbort = "canceled",7763// Fake xhr7764jqXHR = {7765readyState: 0,77667767// Builds headers hashtable if needed7768getResponseHeader: function( key ) {7769var match;7770if ( state === 2 ) {7771if ( !responseHeaders ) {7772responseHeaders = {};7773while ( (match = rheaders.exec( responseHeadersString )) ) {7774responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];7775}7776}7777match = responseHeaders[ key.toLowerCase() ];7778}7779return match == null ? null : match;7780},77817782// Raw string7783getAllResponseHeaders: function() {7784return state === 2 ? responseHeadersString : null;7785},77867787// Caches the header7788setRequestHeader: function( name, value ) {7789var lname = name.toLowerCase();7790if ( !state ) {7791name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;7792requestHeaders[ name ] = value;7793}7794return this;7795},77967797// Overrides response content-type header7798overrideMimeType: function( type ) {7799if ( !state ) {7800s.mimeType = type;7801}7802return this;7803},78047805// Status-dependent callbacks7806statusCode: function( map ) {7807var code;7808if ( map ) {7809if ( state < 2 ) {7810for ( code in map ) {7811// Lazy-add the new callback in a way that preserves old ones7812statusCode[ code ] = [ statusCode[ code ], map[ code ] ];7813}7814} else {7815// Execute the appropriate callbacks7816jqXHR.always( map[ jqXHR.status ] );7817}7818}7819return this;7820},78217822// Cancel the request7823abort: function( statusText ) {7824var finalText = statusText || strAbort;7825if ( transport ) {7826transport.abort( finalText );7827}7828done( 0, finalText );7829return this;7830}7831};78327833// Attach deferreds7834deferred.promise( jqXHR ).complete = completeDeferred.add;7835jqXHR.success = jqXHR.done;7836jqXHR.error = jqXHR.fail;78377838// Remove hash character (#7531: and string promotion)7839// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)7840// Handle falsy url in the settings object (#10093: consistency with old signature)7841// We also use the url parameter if available7842s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );78437844// Alias method option to type as per ticket #120047845s.type = options.method || options.type || s.method || s.type;78467847// Extract dataTypes list7848s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];78497850// A cross-domain request is in order when we have a protocol:host:port mismatch7851if ( s.crossDomain == null ) {7852parts = rurl.exec( s.url.toLowerCase() );7853s.crossDomain = !!( parts &&7854( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||7855( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=7856( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )7857);7858}78597860// Convert data if not already a string7861if ( s.data && s.processData && typeof s.data !== "string" ) {7862s.data = jQuery.param( s.data, s.traditional );7863}78647865// Apply prefilters7866inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );78677868// If request was aborted inside a prefilter, stop there7869if ( state === 2 ) {7870return jqXHR;7871}78727873// We can fire global events as of now if asked to7874fireGlobals = s.global;78757876// Watch for a new set of requests7877if ( fireGlobals && jQuery.active++ === 0 ) {7878jQuery.event.trigger("ajaxStart");7879}78807881// Uppercase the type7882s.type = s.type.toUpperCase();78837884// Determine if request has content7885s.hasContent = !rnoContent.test( s.type );78867887// Save the URL in case we're toying with the If-Modified-Since7888// and/or If-None-Match header later on7889cacheURL = s.url;78907891// More options handling for requests with no content7892if ( !s.hasContent ) {78937894// If data is available, append data to url7895if ( s.data ) {7896cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );7897// #9682: remove data so that it's not used in an eventual retry7898delete s.data;7899}79007901// Add anti-cache in url if needed7902if ( s.cache === false ) {7903s.url = rts.test( cacheURL ) ?79047905// If there is already a '_' parameter, set its value7906cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :79077908// Otherwise add one to the end7909cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;7910}7911}79127913// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.7914if ( s.ifModified ) {7915if ( jQuery.lastModified[ cacheURL ] ) {7916jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );7917}7918if ( jQuery.etag[ cacheURL ] ) {7919jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );7920}7921}79227923// Set the correct header, if data is being sent7924if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {7925jqXHR.setRequestHeader( "Content-Type", s.contentType );7926}79277928// Set the Accepts header for the server, depending on the dataType7929jqXHR.setRequestHeader(7930"Accept",7931s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?7932s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :7933s.accepts[ "*" ]7934);79357936// Check for headers option7937for ( i in s.headers ) {7938jqXHR.setRequestHeader( i, s.headers[ i ] );7939}79407941// Allow custom headers/mimetypes and early abort7942if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {7943// Abort if not done already and return7944return jqXHR.abort();7945}79467947// aborting is no longer a cancellation7948strAbort = "abort";79497950// Install callbacks on deferreds7951for ( i in { success: 1, error: 1, complete: 1 } ) {7952jqXHR[ i ]( s[ i ] );7953}79547955// Get transport7956transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );79577958// If no transport, we auto-abort7959if ( !transport ) {7960done( -1, "No Transport" );7961} else {7962jqXHR.readyState = 1;79637964// Send global event7965if ( fireGlobals ) {7966globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );7967}7968// Timeout7969if ( s.async && s.timeout > 0 ) {7970timeoutTimer = setTimeout(function() {7971jqXHR.abort("timeout");7972}, s.timeout );7973}79747975try {7976state = 1;7977transport.send( requestHeaders, done );7978} catch ( e ) {7979// Propagate exception as error if not done7980if ( state < 2 ) {7981done( -1, e );7982// Simply rethrow otherwise7983} else {7984throw e;7985}7986}7987}79887989// Callback for when everything is done7990function done( status, nativeStatusText, responses, headers ) {7991var isSuccess, success, error, response, modified,7992statusText = nativeStatusText;79937994// Called once7995if ( state === 2 ) {7996return;7997}79987999// State is "done" now8000state = 2;80018002// Clear timeout if it exists8003if ( timeoutTimer ) {8004clearTimeout( timeoutTimer );8005}80068007// Dereference transport for early garbage collection8008// (no matter how long the jqXHR object will be used)8009transport = undefined;80108011// Cache response headers8012responseHeadersString = headers || "";80138014// Set readyState8015jqXHR.readyState = status > 0 ? 4 : 0;80168017// Get response data8018if ( responses ) {8019response = ajaxHandleResponses( s, jqXHR, responses );8020}80218022// If successful, handle type chaining8023if ( status >= 200 && status < 300 || status === 304 ) {80248025// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.8026if ( s.ifModified ) {8027modified = jqXHR.getResponseHeader("Last-Modified");8028if ( modified ) {8029jQuery.lastModified[ cacheURL ] = modified;8030}8031modified = jqXHR.getResponseHeader("etag");8032if ( modified ) {8033jQuery.etag[ cacheURL ] = modified;8034}8035}80368037// if no content8038if ( status === 204 ) {8039isSuccess = true;8040statusText = "nocontent";80418042// if not modified8043} else if ( status === 304 ) {8044isSuccess = true;8045statusText = "notmodified";80468047// If we have data, let's convert it8048} else {8049isSuccess = ajaxConvert( s, response );8050statusText = isSuccess.state;8051success = isSuccess.data;8052error = isSuccess.error;8053isSuccess = !error;8054}8055} else {8056// We extract error from statusText8057// then normalize statusText and status for non-aborts8058error = statusText;8059if ( status || !statusText ) {8060statusText = "error";8061if ( status < 0 ) {8062status = 0;8063}8064}8065}80668067// Set data for the fake xhr object8068jqXHR.status = status;8069jqXHR.statusText = ( nativeStatusText || statusText ) + "";80708071// Success/Error8072if ( isSuccess ) {8073deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );8074} else {8075deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );8076}80778078// Status-dependent callbacks8079jqXHR.statusCode( statusCode );8080statusCode = undefined;80818082if ( fireGlobals ) {8083globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",8084[ jqXHR, s, isSuccess ? success : error ] );8085}80868087// Complete8088completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );80898090if ( fireGlobals ) {8091globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );8092// Handle the global AJAX counter8093if ( !( --jQuery.active ) ) {8094jQuery.event.trigger("ajaxStop");8095}8096}8097}80988099return jqXHR;8100},81018102getScript: function( url, callback ) {8103return jQuery.get( url, undefined, callback, "script" );8104},81058106getJSON: function( url, data, callback ) {8107return jQuery.get( url, data, callback, "json" );8108}8109});81108111/* Handles responses to an ajax request:8112* - sets all responseXXX fields accordingly8113* - finds the right dataType (mediates between content-type and expected dataType)8114* - returns the corresponding response8115*/8116function ajaxHandleResponses( s, jqXHR, responses ) {8117var firstDataType, ct, finalDataType, type,8118contents = s.contents,8119dataTypes = s.dataTypes,8120responseFields = s.responseFields;81218122// Fill responseXXX fields8123for ( type in responseFields ) {8124if ( type in responses ) {8125jqXHR[ responseFields[type] ] = responses[ type ];8126}8127}81288129// Remove auto dataType and get content-type in the process8130while( dataTypes[ 0 ] === "*" ) {8131dataTypes.shift();8132if ( ct === undefined ) {8133ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");8134}8135}81368137// Check if we're dealing with a known content-type8138if ( ct ) {8139for ( type in contents ) {8140if ( contents[ type ] && contents[ type ].test( ct ) ) {8141dataTypes.unshift( type );8142break;8143}8144}8145}81468147// Check to see if we have a response for the expected dataType8148if ( dataTypes[ 0 ] in responses ) {8149finalDataType = dataTypes[ 0 ];8150} else {8151// Try convertible dataTypes8152for ( type in responses ) {8153if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {8154finalDataType = type;8155break;8156}8157if ( !firstDataType ) {8158firstDataType = type;8159}8160}8161// Or just use first one8162finalDataType = finalDataType || firstDataType;8163}81648165// If we found a dataType8166// We add the dataType to the list if needed8167// and return the corresponding response8168if ( finalDataType ) {8169if ( finalDataType !== dataTypes[ 0 ] ) {8170dataTypes.unshift( finalDataType );8171}8172return responses[ finalDataType ];8173}8174}81758176// Chain conversions given the request and the original response8177function ajaxConvert( s, response ) {8178var conv2, current, conv, tmp,8179converters = {},8180i = 0,8181// Work with a copy of dataTypes in case we need to modify it for conversion8182dataTypes = s.dataTypes.slice(),8183prev = dataTypes[ 0 ];81848185// Apply the dataFilter if provided8186if ( s.dataFilter ) {8187response = s.dataFilter( response, s.dataType );8188}81898190// Create converters map with lowercased keys8191if ( dataTypes[ 1 ] ) {8192for ( conv in s.converters ) {8193converters[ conv.toLowerCase() ] = s.converters[ conv ];8194}8195}81968197// Convert to each sequential dataType, tolerating list modification8198for ( ; (current = dataTypes[++i]); ) {81998200// There's only work to do if current dataType is non-auto8201if ( current !== "*" ) {82028203// Convert response if prev dataType is non-auto and differs from current8204if ( prev !== "*" && prev !== current ) {82058206// Seek a direct converter8207conv = converters[ prev + " " + current ] || converters[ "* " + current ];82088209// If none found, seek a pair8210if ( !conv ) {8211for ( conv2 in converters ) {82128213// If conv2 outputs current8214tmp = conv2.split(" ");8215if ( tmp[ 1 ] === current ) {82168217// If prev can be converted to accepted input8218conv = converters[ prev + " " + tmp[ 0 ] ] ||8219converters[ "* " + tmp[ 0 ] ];8220if ( conv ) {8221// Condense equivalence converters8222if ( conv === true ) {8223conv = converters[ conv2 ];82248225// Otherwise, insert the intermediate dataType8226} else if ( converters[ conv2 ] !== true ) {8227current = tmp[ 0 ];8228dataTypes.splice( i--, 0, current );8229}82308231break;8232}8233}8234}8235}82368237// Apply converter (if not an equivalence)8238if ( conv !== true ) {82398240// Unless errors are allowed to bubble, catch and return them8241if ( conv && s["throws"] ) {8242response = conv( response );8243} else {8244try {8245response = conv( response );8246} catch ( e ) {8247return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };8248}8249}8250}8251}82528253// Update prev for next iteration8254prev = current;8255}8256}82578258return { state: "success", data: response };8259}8260// Install script dataType8261jQuery.ajaxSetup({8262accepts: {8263script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"8264},8265contents: {8266script: /(?:java|ecma)script/8267},8268converters: {8269"text script": function( text ) {8270jQuery.globalEval( text );8271return text;8272}8273}8274});82758276// Handle cache's special case and global8277jQuery.ajaxPrefilter( "script", function( s ) {8278if ( s.cache === undefined ) {8279s.cache = false;8280}8281if ( s.crossDomain ) {8282s.type = "GET";8283s.global = false;8284}8285});82868287// Bind script tag hack transport8288jQuery.ajaxTransport( "script", function(s) {82898290// This transport only deals with cross domain requests8291if ( s.crossDomain ) {82928293var script,8294head = document.head || jQuery("head")[0] || document.documentElement;82958296return {82978298send: function( _, callback ) {82998300script = document.createElement("script");83018302script.async = true;83038304if ( s.scriptCharset ) {8305script.charset = s.scriptCharset;8306}83078308script.src = s.url;83098310// Attach handlers for all browsers8311script.onload = script.onreadystatechange = function( _, isAbort ) {83128313if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {83148315// Handle memory leak in IE8316script.onload = script.onreadystatechange = null;83178318// Remove the script8319if ( script.parentNode ) {8320script.parentNode.removeChild( script );8321}83228323// Dereference the script8324script = null;83258326// Callback if not abort8327if ( !isAbort ) {8328callback( 200, "success" );8329}8330}8331};83328333// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending8334// Use native DOM manipulation to avoid our domManip AJAX trickery8335head.insertBefore( script, head.firstChild );8336},83378338abort: function() {8339if ( script ) {8340script.onload( undefined, true );8341}8342}8343};8344}8345});8346var oldCallbacks = [],8347rjsonp = /(=)\?(?=&|$)|\?\?/;83488349// Default jsonp settings8350jQuery.ajaxSetup({8351jsonp: "callback",8352jsonpCallback: function() {8353var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );8354this[ callback ] = true;8355return callback;8356}8357});83588359// Detect, normalize options and install callbacks for jsonp requests8360jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {83618362var callbackName, overwritten, responseContainer,8363jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?8364"url" :8365typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"8366);83678368// Handle iff the expected data type is "jsonp" or we have a parameter to set8369if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {83708371// Get callback name, remembering preexisting value associated with it8372callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?8373s.jsonpCallback() :8374s.jsonpCallback;83758376// Insert callback into url or form data8377if ( jsonProp ) {8378s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );8379} else if ( s.jsonp !== false ) {8380s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;8381}83828383// Use data converter to retrieve json after script execution8384s.converters["script json"] = function() {8385if ( !responseContainer ) {8386jQuery.error( callbackName + " was not called" );8387}8388return responseContainer[ 0 ];8389};83908391// force json dataType8392s.dataTypes[ 0 ] = "json";83938394// Install callback8395overwritten = window[ callbackName ];8396window[ callbackName ] = function() {8397responseContainer = arguments;8398};83998400// Clean-up function (fires after converters)8401jqXHR.always(function() {8402// Restore preexisting value8403window[ callbackName ] = overwritten;84048405// Save back as free8406if ( s[ callbackName ] ) {8407// make sure that re-using the options doesn't screw things around8408s.jsonpCallback = originalSettings.jsonpCallback;84098410// save the callback name for future use8411oldCallbacks.push( callbackName );8412}84138414// Call if it was a function and we have a response8415if ( responseContainer && jQuery.isFunction( overwritten ) ) {8416overwritten( responseContainer[ 0 ] );8417}84188419responseContainer = overwritten = undefined;8420});84218422// Delegate to script8423return "script";8424}8425});8426var xhrCallbacks, xhrSupported,8427xhrId = 0,8428// #5280: Internet Explorer will keep connections alive if we don't abort on unload8429xhrOnUnloadAbort = window.ActiveXObject && function() {8430// Abort all pending requests8431var key;8432for ( key in xhrCallbacks ) {8433xhrCallbacks[ key ]( undefined, true );8434}8435};84368437// Functions to create xhrs8438function createStandardXHR() {8439try {8440return new window.XMLHttpRequest();8441} catch( e ) {}8442}84438444function createActiveXHR() {8445try {8446return new window.ActiveXObject("Microsoft.XMLHTTP");8447} catch( e ) {}8448}84498450// Create the request object8451// (This is still attached to ajaxSettings for backward compatibility)8452jQuery.ajaxSettings.xhr = window.ActiveXObject ?8453/* Microsoft failed to properly8454* implement the XMLHttpRequest in IE7 (can't request local files),8455* so we use the ActiveXObject when it is available8456* Additionally XMLHttpRequest can be disabled in IE7/IE8 so8457* we need a fallback.8458*/8459function() {8460return !this.isLocal && createStandardXHR() || createActiveXHR();8461} :8462// For all other browsers, use the standard XMLHttpRequest object8463createStandardXHR;84648465// Determine support properties8466xhrSupported = jQuery.ajaxSettings.xhr();8467jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );8468xhrSupported = jQuery.support.ajax = !!xhrSupported;84698470// Create transport if the browser can provide an xhr8471if ( xhrSupported ) {84728473jQuery.ajaxTransport(function( s ) {8474// Cross domain only allowed if supported through XMLHttpRequest8475if ( !s.crossDomain || jQuery.support.cors ) {84768477var callback;84788479return {8480send: function( headers, complete ) {84818482// Get a new xhr8483var handle, i,8484xhr = s.xhr();84858486// Open the socket8487// Passing null username, generates a login popup on Opera (#2865)8488if ( s.username ) {8489xhr.open( s.type, s.url, s.async, s.username, s.password );8490} else {8491xhr.open( s.type, s.url, s.async );8492}84938494// Apply custom fields if provided8495if ( s.xhrFields ) {8496for ( i in s.xhrFields ) {8497xhr[ i ] = s.xhrFields[ i ];8498}8499}85008501// Override mime type if needed8502if ( s.mimeType && xhr.overrideMimeType ) {8503xhr.overrideMimeType( s.mimeType );8504}85058506// X-Requested-With header8507// For cross-domain requests, seeing as conditions for a preflight are8508// akin to a jigsaw puzzle, we simply never set it to be sure.8509// (it can always be set on a per-request basis or even using ajaxSetup)8510// For same-domain requests, won't change header if already provided.8511if ( !s.crossDomain && !headers["X-Requested-With"] ) {8512headers["X-Requested-With"] = "XMLHttpRequest";8513}85148515// Need an extra try/catch for cross domain requests in Firefox 38516try {8517for ( i in headers ) {8518xhr.setRequestHeader( i, headers[ i ] );8519}8520} catch( err ) {}85218522// Do send the request8523// This may raise an exception which is actually8524// handled in jQuery.ajax (so no try/catch here)8525xhr.send( ( s.hasContent && s.data ) || null );85268527// Listener8528callback = function( _, isAbort ) {8529var status, responseHeaders, statusText, responses;85308531// Firefox throws exceptions when accessing properties8532// of an xhr when a network error occurred8533// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)8534try {85358536// Was never called and is aborted or complete8537if ( callback && ( isAbort || xhr.readyState === 4 ) ) {85388539// Only called once8540callback = undefined;85418542// Do not keep as active anymore8543if ( handle ) {8544xhr.onreadystatechange = jQuery.noop;8545if ( xhrOnUnloadAbort ) {8546delete xhrCallbacks[ handle ];8547}8548}85498550// If it's an abort8551if ( isAbort ) {8552// Abort it manually if needed8553if ( xhr.readyState !== 4 ) {8554xhr.abort();8555}8556} else {8557responses = {};8558status = xhr.status;8559responseHeaders = xhr.getAllResponseHeaders();85608561// When requesting binary data, IE6-9 will throw an exception8562// on any attempt to access responseText (#11426)8563if ( typeof xhr.responseText === "string" ) {8564responses.text = xhr.responseText;8565}85668567// Firefox throws an exception when accessing8568// statusText for faulty cross-domain requests8569try {8570statusText = xhr.statusText;8571} catch( e ) {8572// We normalize with Webkit giving an empty statusText8573statusText = "";8574}85758576// Filter status for non standard behaviors85778578// If the request is local and we have data: assume a success8579// (success with no data won't get notified, that's the best we8580// can do given current implementations)8581if ( !status && s.isLocal && !s.crossDomain ) {8582status = responses.text ? 200 : 404;8583// IE - #1450: sometimes returns 1223 when it should be 2048584} else if ( status === 1223 ) {8585status = 204;8586}8587}8588}8589} catch( firefoxAccessException ) {8590if ( !isAbort ) {8591complete( -1, firefoxAccessException );8592}8593}85948595// Call complete if needed8596if ( responses ) {8597complete( status, statusText, responses, responseHeaders );8598}8599};86008601if ( !s.async ) {8602// if we're in sync mode we fire the callback8603callback();8604} else if ( xhr.readyState === 4 ) {8605// (IE6 & IE7) if it's in cache and has been8606// retrieved directly we need to fire the callback8607setTimeout( callback );8608} else {8609handle = ++xhrId;8610if ( xhrOnUnloadAbort ) {8611// Create the active xhrs callbacks list if needed8612// and attach the unload handler8613if ( !xhrCallbacks ) {8614xhrCallbacks = {};8615jQuery( window ).unload( xhrOnUnloadAbort );8616}8617// Add to list of active xhrs callbacks8618xhrCallbacks[ handle ] = callback;8619}8620xhr.onreadystatechange = callback;8621}8622},86238624abort: function() {8625if ( callback ) {8626callback( undefined, true );8627}8628}8629};8630}8631});8632}8633var fxNow, timerId,8634rfxtypes = /^(?:toggle|show|hide)$/,8635rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),8636rrun = /queueHooks$/,8637animationPrefilters = [ defaultPrefilter ],8638tweeners = {8639"*": [function( prop, value ) {8640var end, unit,8641tween = this.createTween( prop, value ),8642parts = rfxnum.exec( value ),8643target = tween.cur(),8644start = +target || 0,8645scale = 1,8646maxIterations = 20;86478648if ( parts ) {8649end = +parts[2];8650unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );86518652// We need to compute starting value8653if ( unit !== "px" && start ) {8654// Iteratively approximate from a nonzero starting point8655// Prefer the current property, because this process will be trivial if it uses the same units8656// Fallback to end or a simple constant8657start = jQuery.css( tween.elem, prop, true ) || end || 1;86588659do {8660// If previous iteration zeroed out, double until we get *something*8661// Use a string for doubling factor so we don't accidentally see scale as unchanged below8662scale = scale || ".5";86638664// Adjust and apply8665start = start / scale;8666jQuery.style( tween.elem, prop, start + unit );86678668// Update scale, tolerating zero or NaN from tween.cur()8669// And breaking the loop if scale is unchanged or perfect, or if we've just had enough8670} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );8671}86728673tween.unit = unit;8674tween.start = start;8675// If a +=/-= token was provided, we're doing a relative animation8676tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;8677}8678return tween;8679}]8680};86818682// Animations created synchronously will run synchronously8683function createFxNow() {8684setTimeout(function() {8685fxNow = undefined;8686});8687return ( fxNow = jQuery.now() );8688}86898690function createTweens( animation, props ) {8691jQuery.each( props, function( prop, value ) {8692var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),8693index = 0,8694length = collection.length;8695for ( ; index < length; index++ ) {8696if ( collection[ index ].call( animation, prop, value ) ) {86978698// we're done with this property8699return;8700}8701}8702});8703}87048705function Animation( elem, properties, options ) {8706var result,8707stopped,8708index = 0,8709length = animationPrefilters.length,8710deferred = jQuery.Deferred().always( function() {8711// don't match elem in the :animated selector8712delete tick.elem;8713}),8714tick = function() {8715if ( stopped ) {8716return false;8717}8718var currentTime = fxNow || createFxNow(),8719remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),8720// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)8721temp = remaining / animation.duration || 0,8722percent = 1 - temp,8723index = 0,8724length = animation.tweens.length;87258726for ( ; index < length ; index++ ) {8727animation.tweens[ index ].run( percent );8728}87298730deferred.notifyWith( elem, [ animation, percent, remaining ]);87318732if ( percent < 1 && length ) {8733return remaining;8734} else {8735deferred.resolveWith( elem, [ animation ] );8736return false;8737}8738},8739animation = deferred.promise({8740elem: elem,8741props: jQuery.extend( {}, properties ),8742opts: jQuery.extend( true, { specialEasing: {} }, options ),8743originalProperties: properties,8744originalOptions: options,8745startTime: fxNow || createFxNow(),8746duration: options.duration,8747tweens: [],8748createTween: function( prop, end ) {8749var tween = jQuery.Tween( elem, animation.opts, prop, end,8750animation.opts.specialEasing[ prop ] || animation.opts.easing );8751animation.tweens.push( tween );8752return tween;8753},8754stop: function( gotoEnd ) {8755var index = 0,8756// if we are going to the end, we want to run all the tweens8757// otherwise we skip this part8758length = gotoEnd ? animation.tweens.length : 0;8759if ( stopped ) {8760return this;8761}8762stopped = true;8763for ( ; index < length ; index++ ) {8764animation.tweens[ index ].run( 1 );8765}87668767// resolve when we played the last frame8768// otherwise, reject8769if ( gotoEnd ) {8770deferred.resolveWith( elem, [ animation, gotoEnd ] );8771} else {8772deferred.rejectWith( elem, [ animation, gotoEnd ] );8773}8774return this;8775}8776}),8777props = animation.props;87788779propFilter( props, animation.opts.specialEasing );87808781for ( ; index < length ; index++ ) {8782result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );8783if ( result ) {8784return result;8785}8786}87878788createTweens( animation, props );87898790if ( jQuery.isFunction( animation.opts.start ) ) {8791animation.opts.start.call( elem, animation );8792}87938794jQuery.fx.timer(8795jQuery.extend( tick, {8796elem: elem,8797anim: animation,8798queue: animation.opts.queue8799})8800);88018802// attach callbacks from options8803return animation.progress( animation.opts.progress )8804.done( animation.opts.done, animation.opts.complete )8805.fail( animation.opts.fail )8806.always( animation.opts.always );8807}88088809function propFilter( props, specialEasing ) {8810var value, name, index, easing, hooks;88118812// camelCase, specialEasing and expand cssHook pass8813for ( index in props ) {8814name = jQuery.camelCase( index );8815easing = specialEasing[ name ];8816value = props[ index ];8817if ( jQuery.isArray( value ) ) {8818easing = value[ 1 ];8819value = props[ index ] = value[ 0 ];8820}88218822if ( index !== name ) {8823props[ name ] = value;8824delete props[ index ];8825}88268827hooks = jQuery.cssHooks[ name ];8828if ( hooks && "expand" in hooks ) {8829value = hooks.expand( value );8830delete props[ name ];88318832// not quite $.extend, this wont overwrite keys already present.8833// also - reusing 'index' from above because we have the correct "name"8834for ( index in value ) {8835if ( !( index in props ) ) {8836props[ index ] = value[ index ];8837specialEasing[ index ] = easing;8838}8839}8840} else {8841specialEasing[ name ] = easing;8842}8843}8844}88458846jQuery.Animation = jQuery.extend( Animation, {88478848tweener: function( props, callback ) {8849if ( jQuery.isFunction( props ) ) {8850callback = props;8851props = [ "*" ];8852} else {8853props = props.split(" ");8854}88558856var prop,8857index = 0,8858length = props.length;88598860for ( ; index < length ; index++ ) {8861prop = props[ index ];8862tweeners[ prop ] = tweeners[ prop ] || [];8863tweeners[ prop ].unshift( callback );8864}8865},88668867prefilter: function( callback, prepend ) {8868if ( prepend ) {8869animationPrefilters.unshift( callback );8870} else {8871animationPrefilters.push( callback );8872}8873}8874});88758876function defaultPrefilter( elem, props, opts ) {8877/*jshint validthis:true */8878var prop, index, length,8879value, dataShow, toggle,8880tween, hooks, oldfire,8881anim = this,8882style = elem.style,8883orig = {},8884handled = [],8885hidden = elem.nodeType && isHidden( elem );88868887// handle queue: false promises8888if ( !opts.queue ) {8889hooks = jQuery._queueHooks( elem, "fx" );8890if ( hooks.unqueued == null ) {8891hooks.unqueued = 0;8892oldfire = hooks.empty.fire;8893hooks.empty.fire = function() {8894if ( !hooks.unqueued ) {8895oldfire();8896}8897};8898}8899hooks.unqueued++;89008901anim.always(function() {8902// doing this makes sure that the complete handler will be called8903// before this completes8904anim.always(function() {8905hooks.unqueued--;8906if ( !jQuery.queue( elem, "fx" ).length ) {8907hooks.empty.fire();8908}8909});8910});8911}89128913// height/width overflow pass8914if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {8915// Make sure that nothing sneaks out8916// Record all 3 overflow attributes because IE does not8917// change the overflow attribute when overflowX and8918// overflowY are set to the same value8919opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];89208921// Set display property to inline-block for height/width8922// animations on inline elements that are having width/height animated8923if ( jQuery.css( elem, "display" ) === "inline" &&8924jQuery.css( elem, "float" ) === "none" ) {89258926// inline-level elements accept inline-block;8927// block-level elements need to be inline with layout8928if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {8929style.display = "inline-block";89308931} else {8932style.zoom = 1;8933}8934}8935}89368937if ( opts.overflow ) {8938style.overflow = "hidden";8939if ( !jQuery.support.shrinkWrapBlocks ) {8940anim.always(function() {8941style.overflow = opts.overflow[ 0 ];8942style.overflowX = opts.overflow[ 1 ];8943style.overflowY = opts.overflow[ 2 ];8944});8945}8946}894789488949// show/hide pass8950for ( index in props ) {8951value = props[ index ];8952if ( rfxtypes.exec( value ) ) {8953delete props[ index ];8954toggle = toggle || value === "toggle";8955if ( value === ( hidden ? "hide" : "show" ) ) {8956continue;8957}8958handled.push( index );8959}8960}89618962length = handled.length;8963if ( length ) {8964dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );8965if ( "hidden" in dataShow ) {8966hidden = dataShow.hidden;8967}89688969// store state if its toggle - enables .stop().toggle() to "reverse"8970if ( toggle ) {8971dataShow.hidden = !hidden;8972}8973if ( hidden ) {8974jQuery( elem ).show();8975} else {8976anim.done(function() {8977jQuery( elem ).hide();8978});8979}8980anim.done(function() {8981var prop;8982jQuery._removeData( elem, "fxshow" );8983for ( prop in orig ) {8984jQuery.style( elem, prop, orig[ prop ] );8985}8986});8987for ( index = 0 ; index < length ; index++ ) {8988prop = handled[ index ];8989tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );8990orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );89918992if ( !( prop in dataShow ) ) {8993dataShow[ prop ] = tween.start;8994if ( hidden ) {8995tween.end = tween.start;8996tween.start = prop === "width" || prop === "height" ? 1 : 0;8997}8998}8999}9000}9001}90029003function Tween( elem, options, prop, end, easing ) {9004return new Tween.prototype.init( elem, options, prop, end, easing );9005}9006jQuery.Tween = Tween;90079008Tween.prototype = {9009constructor: Tween,9010init: function( elem, options, prop, end, easing, unit ) {9011this.elem = elem;9012this.prop = prop;9013this.easing = easing || "swing";9014this.options = options;9015this.start = this.now = this.cur();9016this.end = end;9017this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );9018},9019cur: function() {9020var hooks = Tween.propHooks[ this.prop ];90219022return hooks && hooks.get ?9023hooks.get( this ) :9024Tween.propHooks._default.get( this );9025},9026run: function( percent ) {9027var eased,9028hooks = Tween.propHooks[ this.prop ];90299030if ( this.options.duration ) {9031this.pos = eased = jQuery.easing[ this.easing ](9032percent, this.options.duration * percent, 0, 1, this.options.duration9033);9034} else {9035this.pos = eased = percent;9036}9037this.now = ( this.end - this.start ) * eased + this.start;90389039if ( this.options.step ) {9040this.options.step.call( this.elem, this.now, this );9041}90429043if ( hooks && hooks.set ) {9044hooks.set( this );9045} else {9046Tween.propHooks._default.set( this );9047}9048return this;9049}9050};90519052Tween.prototype.init.prototype = Tween.prototype;90539054Tween.propHooks = {9055_default: {9056get: function( tween ) {9057var result;90589059if ( tween.elem[ tween.prop ] != null &&9060(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {9061return tween.elem[ tween.prop ];9062}90639064// passing an empty string as a 3rd parameter to .css will automatically9065// attempt a parseFloat and fallback to a string if the parse fails9066// so, simple values such as "10px" are parsed to Float.9067// complex values such as "rotate(1rad)" are returned as is.9068result = jQuery.css( tween.elem, tween.prop, "" );9069// Empty strings, null, undefined and "auto" are converted to 0.9070return !result || result === "auto" ? 0 : result;9071},9072set: function( tween ) {9073// use step hook for back compat - use cssHook if its there - use .style if its9074// available and use plain properties where available9075if ( jQuery.fx.step[ tween.prop ] ) {9076jQuery.fx.step[ tween.prop ]( tween );9077} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {9078jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );9079} else {9080tween.elem[ tween.prop ] = tween.now;9081}9082}9083}9084};90859086// Remove in 2.0 - this supports IE8's panic based approach9087// to setting things on disconnected nodes90889089Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {9090set: function( tween ) {9091if ( tween.elem.nodeType && tween.elem.parentNode ) {9092tween.elem[ tween.prop ] = tween.now;9093}9094}9095};90969097jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {9098var cssFn = jQuery.fn[ name ];9099jQuery.fn[ name ] = function( speed, easing, callback ) {9100return speed == null || typeof speed === "boolean" ?9101cssFn.apply( this, arguments ) :9102this.animate( genFx( name, true ), speed, easing, callback );9103};9104});91059106jQuery.fn.extend({9107fadeTo: function( speed, to, easing, callback ) {91089109// show any hidden elements after setting opacity to 09110return this.filter( isHidden ).css( "opacity", 0 ).show()91119112// animate to the value specified9113.end().animate({ opacity: to }, speed, easing, callback );9114},9115animate: function( prop, speed, easing, callback ) {9116var empty = jQuery.isEmptyObject( prop ),9117optall = jQuery.speed( speed, easing, callback ),9118doAnimation = function() {9119// Operate on a copy of prop so per-property easing won't be lost9120var anim = Animation( this, jQuery.extend( {}, prop ), optall );9121doAnimation.finish = function() {9122anim.stop( true );9123};9124// Empty animations, or finishing resolves immediately9125if ( empty || jQuery._data( this, "finish" ) ) {9126anim.stop( true );9127}9128};9129doAnimation.finish = doAnimation;91309131return empty || optall.queue === false ?9132this.each( doAnimation ) :9133this.queue( optall.queue, doAnimation );9134},9135stop: function( type, clearQueue, gotoEnd ) {9136var stopQueue = function( hooks ) {9137var stop = hooks.stop;9138delete hooks.stop;9139stop( gotoEnd );9140};91419142if ( typeof type !== "string" ) {9143gotoEnd = clearQueue;9144clearQueue = type;9145type = undefined;9146}9147if ( clearQueue && type !== false ) {9148this.queue( type || "fx", [] );9149}91509151return this.each(function() {9152var dequeue = true,9153index = type != null && type + "queueHooks",9154timers = jQuery.timers,9155data = jQuery._data( this );91569157if ( index ) {9158if ( data[ index ] && data[ index ].stop ) {9159stopQueue( data[ index ] );9160}9161} else {9162for ( index in data ) {9163if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {9164stopQueue( data[ index ] );9165}9166}9167}91689169for ( index = timers.length; index--; ) {9170if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {9171timers[ index ].anim.stop( gotoEnd );9172dequeue = false;9173timers.splice( index, 1 );9174}9175}91769177// start the next in the queue if the last step wasn't forced9178// timers currently will call their complete callbacks, which will dequeue9179// but only if they were gotoEnd9180if ( dequeue || !gotoEnd ) {9181jQuery.dequeue( this, type );9182}9183});9184},9185finish: function( type ) {9186if ( type !== false ) {9187type = type || "fx";9188}9189return this.each(function() {9190var index,9191data = jQuery._data( this ),9192queue = data[ type + "queue" ],9193hooks = data[ type + "queueHooks" ],9194timers = jQuery.timers,9195length = queue ? queue.length : 0;91969197// enable finishing flag on private data9198data.finish = true;91999200// empty the queue first9201jQuery.queue( this, type, [] );92029203if ( hooks && hooks.cur && hooks.cur.finish ) {9204hooks.cur.finish.call( this );9205}92069207// look for any active animations, and finish them9208for ( index = timers.length; index--; ) {9209if ( timers[ index ].elem === this && timers[ index ].queue === type ) {9210timers[ index ].anim.stop( true );9211timers.splice( index, 1 );9212}9213}92149215// look for any animations in the old queue and finish them9216for ( index = 0; index < length; index++ ) {9217if ( queue[ index ] && queue[ index ].finish ) {9218queue[ index ].finish.call( this );9219}9220}92219222// turn off finishing flag9223delete data.finish;9224});9225}9226});92279228// Generate parameters to create a standard animation9229function genFx( type, includeWidth ) {9230var which,9231attrs = { height: type },9232i = 0;92339234// if we include width, step value is 1 to do all cssExpand values,9235// if we don't include width, step value is 2 to skip over Left and Right9236includeWidth = includeWidth? 1 : 0;9237for( ; i < 4 ; i += 2 - includeWidth ) {9238which = cssExpand[ i ];9239attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;9240}92419242if ( includeWidth ) {9243attrs.opacity = attrs.width = type;9244}92459246return attrs;9247}92489249// Generate shortcuts for custom animations9250jQuery.each({9251slideDown: genFx("show"),9252slideUp: genFx("hide"),9253slideToggle: genFx("toggle"),9254fadeIn: { opacity: "show" },9255fadeOut: { opacity: "hide" },9256fadeToggle: { opacity: "toggle" }9257}, function( name, props ) {9258jQuery.fn[ name ] = function( speed, easing, callback ) {9259return this.animate( props, speed, easing, callback );9260};9261});92629263jQuery.speed = function( speed, easing, fn ) {9264var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {9265complete: fn || !fn && easing ||9266jQuery.isFunction( speed ) && speed,9267duration: speed,9268easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing9269};92709271opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :9272opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;92739274// normalize opt.queue - true/undefined/null -> "fx"9275if ( opt.queue == null || opt.queue === true ) {9276opt.queue = "fx";9277}92789279// Queueing9280opt.old = opt.complete;92819282opt.complete = function() {9283if ( jQuery.isFunction( opt.old ) ) {9284opt.old.call( this );9285}92869287if ( opt.queue ) {9288jQuery.dequeue( this, opt.queue );9289}9290};92919292return opt;9293};92949295jQuery.easing = {9296linear: function( p ) {9297return p;9298},9299swing: function( p ) {9300return 0.5 - Math.cos( p*Math.PI ) / 2;9301}9302};93039304jQuery.timers = [];9305jQuery.fx = Tween.prototype.init;9306jQuery.fx.tick = function() {9307var timer,9308timers = jQuery.timers,9309i = 0;93109311fxNow = jQuery.now();93129313for ( ; i < timers.length; i++ ) {9314timer = timers[ i ];9315// Checks the timer has not already been removed9316if ( !timer() && timers[ i ] === timer ) {9317timers.splice( i--, 1 );9318}9319}93209321if ( !timers.length ) {9322jQuery.fx.stop();9323}9324fxNow = undefined;9325};93269327jQuery.fx.timer = function( timer ) {9328if ( timer() && jQuery.timers.push( timer ) ) {9329jQuery.fx.start();9330}9331};93329333jQuery.fx.interval = 13;93349335jQuery.fx.start = function() {9336if ( !timerId ) {9337timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );9338}9339};93409341jQuery.fx.stop = function() {9342clearInterval( timerId );9343timerId = null;9344};93459346jQuery.fx.speeds = {9347slow: 600,9348fast: 200,9349// Default speed9350_default: 4009351};93529353// Back Compat <1.8 extension point9354jQuery.fx.step = {};93559356if ( jQuery.expr && jQuery.expr.filters ) {9357jQuery.expr.filters.animated = function( elem ) {9358return jQuery.grep(jQuery.timers, function( fn ) {9359return elem === fn.elem;9360}).length;9361};9362}9363jQuery.fn.offset = function( options ) {9364if ( arguments.length ) {9365return options === undefined ?9366this :9367this.each(function( i ) {9368jQuery.offset.setOffset( this, options, i );9369});9370}93719372var docElem, win,9373box = { top: 0, left: 0 },9374elem = this[ 0 ],9375doc = elem && elem.ownerDocument;93769377if ( !doc ) {9378return;9379}93809381docElem = doc.documentElement;93829383// Make sure it's not a disconnected DOM node9384if ( !jQuery.contains( docElem, elem ) ) {9385return box;9386}93879388// If we don't have gBCR, just use 0,0 rather than error9389// BlackBerry 5, iOS 3 (original iPhone)9390if ( typeof elem.getBoundingClientRect !== core_strundefined ) {9391box = elem.getBoundingClientRect();9392}9393win = getWindow( doc );9394return {9395top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),9396left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )9397};9398};93999400jQuery.offset = {94019402setOffset: function( elem, options, i ) {9403var position = jQuery.css( elem, "position" );94049405// set position first, in-case top/left are set even on static elem9406if ( position === "static" ) {9407elem.style.position = "relative";9408}94099410var curElem = jQuery( elem ),9411curOffset = curElem.offset(),9412curCSSTop = jQuery.css( elem, "top" ),9413curCSSLeft = jQuery.css( elem, "left" ),9414calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,9415props = {}, curPosition = {}, curTop, curLeft;94169417// need to be able to calculate position if either top or left is auto and position is either absolute or fixed9418if ( calculatePosition ) {9419curPosition = curElem.position();9420curTop = curPosition.top;9421curLeft = curPosition.left;9422} else {9423curTop = parseFloat( curCSSTop ) || 0;9424curLeft = parseFloat( curCSSLeft ) || 0;9425}94269427if ( jQuery.isFunction( options ) ) {9428options = options.call( elem, i, curOffset );9429}94309431if ( options.top != null ) {9432props.top = ( options.top - curOffset.top ) + curTop;9433}9434if ( options.left != null ) {9435props.left = ( options.left - curOffset.left ) + curLeft;9436}94379438if ( "using" in options ) {9439options.using.call( elem, props );9440} else {9441curElem.css( props );9442}9443}9444};944594469447jQuery.fn.extend({94489449position: function() {9450if ( !this[ 0 ] ) {9451return;9452}94539454var offsetParent, offset,9455parentOffset = { top: 0, left: 0 },9456elem = this[ 0 ];94579458// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent9459if ( jQuery.css( elem, "position" ) === "fixed" ) {9460// we assume that getBoundingClientRect is available when computed position is fixed9461offset = elem.getBoundingClientRect();9462} else {9463// Get *real* offsetParent9464offsetParent = this.offsetParent();94659466// Get correct offsets9467offset = this.offset();9468if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {9469parentOffset = offsetParent.offset();9470}94719472// Add offsetParent borders9473parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );9474parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );9475}94769477// Subtract parent offsets and element margins9478// note: when an element has margin: auto the offsetLeft and marginLeft9479// are the same in Safari causing offset.left to incorrectly be 09480return {9481top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),9482left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)9483};9484},94859486offsetParent: function() {9487return this.map(function() {9488var offsetParent = this.offsetParent || document.documentElement;9489while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {9490offsetParent = offsetParent.offsetParent;9491}9492return offsetParent || document.documentElement;9493});9494}9495});949694979498// Create scrollLeft and scrollTop methods9499jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {9500var top = /Y/.test( prop );95019502jQuery.fn[ method ] = function( val ) {9503return jQuery.access( this, function( elem, method, val ) {9504var win = getWindow( elem );95059506if ( val === undefined ) {9507return win ? (prop in win) ? win[ prop ] :9508win.document.documentElement[ method ] :9509elem[ method ];9510}95119512if ( win ) {9513win.scrollTo(9514!top ? val : jQuery( win ).scrollLeft(),9515top ? val : jQuery( win ).scrollTop()9516);95179518} else {9519elem[ method ] = val;9520}9521}, method, val, arguments.length, null );9522};9523});95249525function getWindow( elem ) {9526return jQuery.isWindow( elem ) ?9527elem :9528elem.nodeType === 9 ?9529elem.defaultView || elem.parentWindow :9530false;9531}9532// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods9533jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {9534jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {9535// margin is only for outerHeight, outerWidth9536jQuery.fn[ funcName ] = function( margin, value ) {9537var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),9538extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );95399540return jQuery.access( this, function( elem, type, value ) {9541var doc;95429543if ( jQuery.isWindow( elem ) ) {9544// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there9545// isn't a whole lot we can do. See pull request at this URL for discussion:9546// https://github.com/jquery/jquery/pull/7649547return elem.document.documentElement[ "client" + name ];9548}95499550// Get document width or height9551if ( elem.nodeType === 9 ) {9552doc = elem.documentElement;95539554// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest9555// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.9556return Math.max(9557elem.body[ "scroll" + name ], doc[ "scroll" + name ],9558elem.body[ "offset" + name ], doc[ "offset" + name ],9559doc[ "client" + name ]9560);9561}95629563return value === undefined ?9564// Get width or height on the element, requesting but not forcing parseFloat9565jQuery.css( elem, type, extra ) :95669567// Set width or height on the element9568jQuery.style( elem, type, value, extra );9569}, type, chainable ? margin : undefined, chainable, null );9570};9571});9572});9573// Limit scope pollution from any deprecated API9574// (function() {95759576// })();9577// Expose jQuery to the global object9578window.jQuery = window.$ = jQuery;95799580// Expose jQuery as an AMD module, but only for AMD loaders that9581// understand the issues with loading multiple versions of jQuery9582// in a page that all might call define(). The loader will indicate9583// they have special allowances for multiple jQuery versions by9584// specifying define.amd.jQuery = true. Register as a named module,9585// since jQuery can be concatenated with other files that may use define,9586// but not use a proper concatenation script that understands anonymous9587// AMD modules. A named AMD is safest and most robust way to register.9588// Lowercase jquery is used because AMD module names are derived from9589// file names, and jQuery is normally delivered in a lowercase file name.9590// Do this after creating the global so that if an AMD module wants to call9591// noConflict to hide this version of jQuery, it will work.9592if ( typeof define === "function" && define.amd && define.amd.jQuery ) {9593define( "jquery", [], function () { return jQuery; } );9594}95959596})( window );95979598