Path: blob/main/contrib/libxo/xohtml/external/jquery.js
39562 views
/*!1* jQuery JavaScript Library v1.72* http://jquery.com/3*4* Copyright 2011, John Resig5* Dual licensed under the MIT or GPL Version 2 licenses.6* http://jquery.org/license7*8* Includes Sizzle.js9* http://sizzlejs.com/10* Copyright 2011, The Dojo Foundation11* Released under the MIT, BSD, and GPL Licenses.12*13* Date: Thu Nov 3 16:18:21 2011 -040014*/15(function( window, undefined ) {1617// Use the correct document accordingly with window argument (sandbox)18var document = window.document,19navigator = window.navigator,20location = window.location;21var jQuery = (function() {2223// Define a local copy of jQuery24var jQuery = function( selector, context ) {25// The jQuery object is actually just the init constructor 'enhanced'26return new jQuery.fn.init( selector, context, rootjQuery );27},2829// Map over jQuery in case of overwrite30_jQuery = window.jQuery,3132// Map over the $ in case of overwrite33_$ = window.$,3435// A central reference to the root jQuery(document)36rootjQuery,3738// A simple way to check for HTML strings or ID strings39// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)40quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,4142// Check if a string has a non-whitespace character in it43rnotwhite = /\S/,4445// Used for trimming whitespace46trimLeft = /^\s+/,47trimRight = /\s+$/,4849// Check for digits50rdigit = /\d/,5152// Match a standalone tag53rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,5455// JSON RegExp56rvalidchars = /^[\],:{}\s]*$/,57rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,58rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,59rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,6061// Useragent RegExp62rwebkit = /(webkit)[ \/]([\w.]+)/,63ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,64rmsie = /(msie) ([\w.]+)/,65rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,6667// Matches dashed string for camelizing68rdashAlpha = /-([a-z]|[0-9])/ig,69rmsPrefix = /^-ms-/,7071// Used by jQuery.camelCase as callback to replace()72fcamelCase = function( all, letter ) {73return ( letter + "" ).toUpperCase();74},7576// Keep a UserAgent string for use with jQuery.browser77userAgent = navigator.userAgent,7879// For matching the engine and version of the browser80browserMatch,8182// The deferred used on DOM ready83readyList,8485// The ready event handler86DOMContentLoaded,8788// Save a reference to some core methods89toString = Object.prototype.toString,90hasOwn = Object.prototype.hasOwnProperty,91push = Array.prototype.push,92slice = Array.prototype.slice,93trim = String.prototype.trim,94indexOf = Array.prototype.indexOf,9596// [[Class]] -> type pairs97class2type = {};9899jQuery.fn = jQuery.prototype = {100constructor: jQuery,101init: function( selector, context, rootjQuery ) {102var match, elem, ret, doc;103104// Handle $(""), $(null), or $(undefined)105if ( !selector ) {106return this;107}108109// Handle $(DOMElement)110if ( selector.nodeType ) {111this.context = this[0] = selector;112this.length = 1;113return this;114}115116// The body element only exists once, optimize finding it117if ( selector === "body" && !context && document.body ) {118this.context = document;119this[0] = document.body;120this.selector = selector;121this.length = 1;122return this;123}124125// Handle HTML strings126if ( typeof selector === "string" ) {127// Are we dealing with HTML string or an ID?128if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {129// Assume that strings that start and end with <> are HTML and skip the regex check130match = [ null, selector, null ];131132} else {133match = quickExpr.exec( selector );134}135136// Verify a match, and that no context was specified for #id137if ( match && (match[1] || !context) ) {138139// HANDLE: $(html) -> $(array)140if ( match[1] ) {141context = context instanceof jQuery ? context[0] : context;142doc = ( context ? context.ownerDocument || context : document );143144// If a single string is passed in and it's a single tag145// just do a createElement and skip the rest146ret = rsingleTag.exec( selector );147148if ( ret ) {149if ( jQuery.isPlainObject( context ) ) {150selector = [ document.createElement( ret[1] ) ];151jQuery.fn.attr.call( selector, context, true );152153} else {154selector = [ doc.createElement( ret[1] ) ];155}156157} else {158ret = jQuery.buildFragment( [ match[1] ], [ doc ] );159selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;160}161162return jQuery.merge( this, selector );163164// HANDLE: $("#id")165} else {166elem = document.getElementById( match[2] );167168// Check parentNode to catch when Blackberry 4.6 returns169// nodes that are no longer in the document #6963170if ( elem && elem.parentNode ) {171// Handle the case where IE and Opera return items172// by name instead of ID173if ( elem.id !== match[2] ) {174return rootjQuery.find( selector );175}176177// Otherwise, we inject the element directly into the jQuery object178this.length = 1;179this[0] = elem;180}181182this.context = document;183this.selector = selector;184return this;185}186187// HANDLE: $(expr, $(...))188} else if ( !context || context.jquery ) {189return ( context || rootjQuery ).find( selector );190191// HANDLE: $(expr, context)192// (which is just equivalent to: $(context).find(expr)193} else {194return this.constructor( context ).find( selector );195}196197// HANDLE: $(function)198// Shortcut for document ready199} else if ( jQuery.isFunction( selector ) ) {200return rootjQuery.ready( selector );201}202203if ( selector.selector !== undefined ) {204this.selector = selector.selector;205this.context = selector.context;206}207208return jQuery.makeArray( selector, this );209},210211// Start with an empty selector212selector: "",213214// The current version of jQuery being used215jquery: "1.7",216217// The default length of a jQuery object is 0218length: 0,219220// The number of elements contained in the matched element set221size: function() {222return this.length;223},224225toArray: function() {226return slice.call( this, 0 );227},228229// Get the Nth element in the matched element set OR230// Get the whole matched element set as a clean array231get: function( num ) {232return num == null ?233234// Return a 'clean' array235this.toArray() :236237// Return just the object238( num < 0 ? this[ this.length + num ] : this[ num ] );239},240241// Take an array of elements and push it onto the stack242// (returning the new matched element set)243pushStack: function( elems, name, selector ) {244// Build a new jQuery matched element set245var ret = this.constructor();246247if ( jQuery.isArray( elems ) ) {248push.apply( ret, elems );249250} else {251jQuery.merge( ret, elems );252}253254// Add the old object onto the stack (as a reference)255ret.prevObject = this;256257ret.context = this.context;258259if ( name === "find" ) {260ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;261} else if ( name ) {262ret.selector = this.selector + "." + name + "(" + selector + ")";263}264265// Return the newly-formed element set266return ret;267},268269// Execute a callback for every element in the matched set.270// (You can seed the arguments with an array of args, but this is271// only used internally.)272each: function( callback, args ) {273return jQuery.each( this, callback, args );274},275276ready: function( fn ) {277// Attach the listeners278jQuery.bindReady();279280// Add the callback281readyList.add( fn );282283return this;284},285286eq: function( i ) {287return i === -1 ?288this.slice( i ) :289this.slice( i, +i + 1 );290},291292first: function() {293return this.eq( 0 );294},295296last: function() {297return this.eq( -1 );298},299300slice: function() {301return this.pushStack( slice.apply( this, arguments ),302"slice", slice.call(arguments).join(",") );303},304305map: function( callback ) {306return this.pushStack( jQuery.map(this, function( elem, i ) {307return callback.call( elem, i, elem );308}));309},310311end: function() {312return this.prevObject || this.constructor(null);313},314315// For internal use only.316// Behaves like an Array's method, not like a jQuery method.317push: push,318sort: [].sort,319splice: [].splice320};321322// Give the init function the jQuery prototype for later instantiation323jQuery.fn.init.prototype = jQuery.fn;324325jQuery.extend = jQuery.fn.extend = function() {326var options, name, src, copy, copyIsArray, clone,327target = arguments[0] || {},328i = 1,329length = arguments.length,330deep = false;331332// Handle a deep copy situation333if ( typeof target === "boolean" ) {334deep = target;335target = arguments[1] || {};336// skip the boolean and the target337i = 2;338}339340// Handle case when target is a string or something (possible in deep copy)341if ( typeof target !== "object" && !jQuery.isFunction(target) ) {342target = {};343}344345// extend jQuery itself if only one argument is passed346if ( length === i ) {347target = this;348--i;349}350351for ( ; i < length; i++ ) {352// Only deal with non-null/undefined values353if ( (options = arguments[ i ]) != null ) {354// Extend the base object355for ( name in options ) {356src = target[ name ];357copy = options[ name ];358359// Prevent never-ending loop360if ( target === copy ) {361continue;362}363364// Recurse if we're merging plain objects or arrays365if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {366if ( copyIsArray ) {367copyIsArray = false;368clone = src && jQuery.isArray(src) ? src : [];369370} else {371clone = src && jQuery.isPlainObject(src) ? src : {};372}373374// Never move original objects, clone them375target[ name ] = jQuery.extend( deep, clone, copy );376377// Don't bring in undefined values378} else if ( copy !== undefined ) {379target[ name ] = copy;380}381}382}383}384385// Return the modified object386return target;387};388389jQuery.extend({390noConflict: function( deep ) {391if ( window.$ === jQuery ) {392window.$ = _$;393}394395if ( deep && window.jQuery === jQuery ) {396window.jQuery = _jQuery;397}398399return jQuery;400},401402// Is the DOM ready to be used? Set to true once it occurs.403isReady: false,404405// A counter to track how many items to wait for before406// the ready event fires. See #6781407readyWait: 1,408409// Hold (or release) the ready event410holdReady: function( hold ) {411if ( hold ) {412jQuery.readyWait++;413} else {414jQuery.ready( true );415}416},417418// Handle when the DOM is ready419ready: function( wait ) {420// Either a released hold or an DOMready/load event and not yet ready421if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {422// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).423if ( !document.body ) {424return setTimeout( jQuery.ready, 1 );425}426427// Remember that the DOM is ready428jQuery.isReady = true;429430// If a normal DOM Ready event fired, decrement, and wait if need be431if ( wait !== true && --jQuery.readyWait > 0 ) {432return;433}434435// If there are functions bound, to execute436readyList.fireWith( document, [ jQuery ] );437438// Trigger any bound ready events439if ( jQuery.fn.trigger ) {440jQuery( document ).trigger( "ready" ).unbind( "ready" );441}442}443},444445bindReady: function() {446if ( readyList ) {447return;448}449450readyList = jQuery.Callbacks( "once memory" );451452// Catch cases where $(document).ready() is called after the453// browser event has already occurred.454if ( document.readyState === "complete" ) {455// Handle it asynchronously to allow scripts the opportunity to delay ready456return setTimeout( jQuery.ready, 1 );457}458459// Mozilla, Opera and webkit nightlies currently support this event460if ( document.addEventListener ) {461// Use the handy event callback462document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );463464// A fallback to window.onload, that will always work465window.addEventListener( "load", jQuery.ready, false );466467// If IE event model is used468} else if ( document.attachEvent ) {469// ensure firing before onload,470// maybe late but safe also for iframes471document.attachEvent( "onreadystatechange", DOMContentLoaded );472473// A fallback to window.onload, that will always work474window.attachEvent( "onload", jQuery.ready );475476// If IE and not a frame477// continually check to see if the document is ready478var toplevel = false;479480try {481toplevel = window.frameElement == null;482} catch(e) {}483484if ( document.documentElement.doScroll && toplevel ) {485doScrollCheck();486}487}488},489490// See test/unit/core.js for details concerning isFunction.491// Since version 1.3, DOM methods and functions like alert492// aren't supported. They return false on IE (#2968).493isFunction: function( obj ) {494return jQuery.type(obj) === "function";495},496497isArray: Array.isArray || function( obj ) {498return jQuery.type(obj) === "array";499},500501// A crude way of determining if an object is a window502isWindow: function( obj ) {503return obj && typeof obj === "object" && "setInterval" in obj;504},505506isNumeric: function( obj ) {507return obj != null && rdigit.test( obj ) && !isNaN( obj );508},509510type: function( obj ) {511return obj == null ?512String( obj ) :513class2type[ toString.call(obj) ] || "object";514},515516isPlainObject: function( obj ) {517// Must be an Object.518// Because of IE, we also have to check the presence of the constructor property.519// Make sure that DOM nodes and window objects don't pass through, as well520if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {521return false;522}523524try {525// Not own constructor property must be Object526if ( obj.constructor &&527!hasOwn.call(obj, "constructor") &&528!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {529return false;530}531} catch ( e ) {532// IE8,9 Will throw exceptions on certain host objects #9897533return false;534}535536// Own properties are enumerated firstly, so to speed up,537// if last one is own, then all properties are own.538539var key;540for ( key in obj ) {}541542return key === undefined || hasOwn.call( obj, key );543},544545isEmptyObject: function( obj ) {546for ( var name in obj ) {547return false;548}549return true;550},551552error: function( msg ) {553throw msg;554},555556parseJSON: function( data ) {557if ( typeof data !== "string" || !data ) {558return null;559}560561// Make sure leading/trailing whitespace is removed (IE can't handle it)562data = jQuery.trim( data );563564// Attempt to parse using the native JSON parser first565if ( window.JSON && window.JSON.parse ) {566return window.JSON.parse( data );567}568569// Make sure the incoming data is actual JSON570// Logic borrowed from http://json.org/json2.js571if ( rvalidchars.test( data.replace( rvalidescape, "@" )572.replace( rvalidtokens, "]" )573.replace( rvalidbraces, "")) ) {574575return ( new Function( "return " + data ) )();576577}578jQuery.error( "Invalid JSON: " + data );579},580581// Cross-browser xml parsing582parseXML: function( data ) {583var xml, tmp;584try {585if ( window.DOMParser ) { // Standard586tmp = new DOMParser();587xml = tmp.parseFromString( data , "text/xml" );588} else { // IE589xml = new ActiveXObject( "Microsoft.XMLDOM" );590xml.async = "false";591xml.loadXML( data );592}593} catch( e ) {594xml = undefined;595}596if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {597jQuery.error( "Invalid XML: " + data );598}599return xml;600},601602noop: function() {},603604// Evaluates a script in a global context605// Workarounds based on findings by Jim Driscoll606// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context607globalEval: function( data ) {608if ( data && rnotwhite.test( data ) ) {609// We use execScript on Internet Explorer610// We use an anonymous function so that context is window611// rather than jQuery in Firefox612( window.execScript || function( data ) {613window[ "eval" ].call( window, data );614} )( data );615}616},617618// Convert dashed to camelCase; used by the css and data modules619// Microsoft forgot to hump their vendor prefix (#9572)620camelCase: function( string ) {621return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );622},623624nodeName: function( elem, name ) {625return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();626},627628// args is for internal usage only629each: function( object, callback, args ) {630var name, i = 0,631length = object.length,632isObj = length === undefined || jQuery.isFunction( object );633634if ( args ) {635if ( isObj ) {636for ( name in object ) {637if ( callback.apply( object[ name ], args ) === false ) {638break;639}640}641} else {642for ( ; i < length; ) {643if ( callback.apply( object[ i++ ], args ) === false ) {644break;645}646}647}648649// A special, fast, case for the most common use of each650} else {651if ( isObj ) {652for ( name in object ) {653if ( callback.call( object[ name ], name, object[ name ] ) === false ) {654break;655}656}657} else {658for ( ; i < length; ) {659if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {660break;661}662}663}664}665666return object;667},668669// Use native String.trim function wherever possible670trim: trim ?671function( text ) {672return text == null ?673"" :674trim.call( text );675} :676677// Otherwise use our own trimming functionality678function( text ) {679return text == null ?680"" :681text.toString().replace( trimLeft, "" ).replace( trimRight, "" );682},683684// results is for internal usage only685makeArray: function( array, results ) {686var ret = results || [];687688if ( array != null ) {689// The window, strings (and functions) also have 'length'690// The extra typeof function check is to prevent crashes691// in Safari 2 (See: #3039)692// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930693var type = jQuery.type( array );694695if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {696push.call( ret, array );697} else {698jQuery.merge( ret, array );699}700}701702return ret;703},704705inArray: function( elem, array, i ) {706var len;707708if ( array ) {709if ( indexOf ) {710return indexOf.call( array, elem, i );711}712713len = array.length;714i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;715716for ( ; i < len; i++ ) {717// Skip accessing in sparse arrays718if ( i in array && array[ i ] === elem ) {719return i;720}721}722}723724return -1;725},726727merge: function( first, second ) {728var i = first.length,729j = 0;730731if ( typeof second.length === "number" ) {732for ( var l = second.length; j < l; j++ ) {733first[ i++ ] = second[ j ];734}735736} else {737while ( second[j] !== undefined ) {738first[ i++ ] = second[ j++ ];739}740}741742first.length = i;743744return first;745},746747grep: function( elems, callback, inv ) {748var ret = [], retVal;749inv = !!inv;750751// Go through the array, only saving the items752// that pass the validator function753for ( var i = 0, length = elems.length; i < length; i++ ) {754retVal = !!callback( elems[ i ], i );755if ( inv !== retVal ) {756ret.push( elems[ i ] );757}758}759760return ret;761},762763// arg is for internal usage only764map: function( elems, callback, arg ) {765var value, key, ret = [],766i = 0,767length = elems.length,768// jquery objects are treated as arrays769isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;770771// Go through the array, translating each of the items to their772if ( isArray ) {773for ( ; i < length; i++ ) {774value = callback( elems[ i ], i, arg );775776if ( value != null ) {777ret[ ret.length ] = value;778}779}780781// Go through every key on the object,782} else {783for ( key in elems ) {784value = callback( elems[ key ], key, arg );785786if ( value != null ) {787ret[ ret.length ] = value;788}789}790}791792// Flatten any nested arrays793return ret.concat.apply( [], ret );794},795796// A global GUID counter for objects797guid: 1,798799// Bind a function to a context, optionally partially applying any800// arguments.801proxy: function( fn, context ) {802if ( typeof context === "string" ) {803var tmp = 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 bind815var args = slice.call( arguments, 2 ),816proxy = function() {817return fn.apply( context, args.concat( 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 || proxy.guid || jQuery.guid++;822823return proxy;824},825826// Mutifunctional method to get and set values to a collection827// The value/s can optionally be executed if it's a function828access: function( elems, key, value, exec, fn, pass ) {829var length = elems.length;830831// Setting many attributes832if ( typeof key === "object" ) {833for ( var k in key ) {834jQuery.access( elems, k, key[k], exec, fn, value );835}836return elems;837}838839// Setting one attribute840if ( value !== undefined ) {841// Optionally, function values get executed if exec is true842exec = !pass && exec && jQuery.isFunction(value);843844for ( var i = 0; i < length; i++ ) {845fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );846}847848return elems;849}850851// Getting an attribute852return length ? fn( elems[0], key ) : undefined;853},854855now: function() {856return ( new Date() ).getTime();857},858859// Use of jQuery.browser is frowned upon.860// More details: http://docs.jquery.com/Utilities/jQuery.browser861uaMatch: function( ua ) {862ua = ua.toLowerCase();863864var match = rwebkit.exec( ua ) ||865ropera.exec( ua ) ||866rmsie.exec( ua ) ||867ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||868[];869870return { browser: match[1] || "", version: match[2] || "0" };871},872873sub: function() {874function jQuerySub( selector, context ) {875return new jQuerySub.fn.init( selector, context );876}877jQuery.extend( true, jQuerySub, this );878jQuerySub.superclass = this;879jQuerySub.fn = jQuerySub.prototype = this();880jQuerySub.fn.constructor = jQuerySub;881jQuerySub.sub = this.sub;882jQuerySub.fn.init = function init( selector, context ) {883if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {884context = jQuerySub( context );885}886887return jQuery.fn.init.call( this, selector, context, rootjQuerySub );888};889jQuerySub.fn.init.prototype = jQuerySub.fn;890var rootjQuerySub = jQuerySub(document);891return jQuerySub;892},893894browser: {}895});896897// Populate the class2type map898jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {899class2type[ "[object " + name + "]" ] = name.toLowerCase();900});901902browserMatch = jQuery.uaMatch( userAgent );903if ( browserMatch.browser ) {904jQuery.browser[ browserMatch.browser ] = true;905jQuery.browser.version = browserMatch.version;906}907908// Deprecated, use jQuery.browser.webkit instead909if ( jQuery.browser.webkit ) {910jQuery.browser.safari = true;911}912913// IE doesn't match non-breaking spaces with \s914if ( rnotwhite.test( "\xA0" ) ) {915trimLeft = /^[\s\xA0]+/;916trimRight = /[\s\xA0]+$/;917}918919// All jQuery objects should point back to these920rootjQuery = jQuery(document);921922// Cleanup functions for the document ready method923if ( document.addEventListener ) {924DOMContentLoaded = function() {925document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );926jQuery.ready();927};928929} else if ( document.attachEvent ) {930DOMContentLoaded = function() {931// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).932if ( document.readyState === "complete" ) {933document.detachEvent( "onreadystatechange", DOMContentLoaded );934jQuery.ready();935}936};937}938939// The DOM ready check for Internet Explorer940function doScrollCheck() {941if ( jQuery.isReady ) {942return;943}944945try {946// If IE is used, use the trick by Diego Perini947// http://javascript.nwbox.com/IEContentLoaded/948document.documentElement.doScroll("left");949} catch(e) {950setTimeout( doScrollCheck, 1 );951return;952}953954// and execute any waiting functions955jQuery.ready();956}957958// Expose jQuery as an AMD module, but only for AMD loaders that959// understand the issues with loading multiple versions of jQuery960// in a page that all might call define(). The loader will indicate961// they have special allowances for multiple jQuery versions by962// specifying define.amd.jQuery = true. Register as a named module,963// since jQuery can be concatenated with other files that may use define,964// but not use a proper concatenation script that understands anonymous965// AMD modules. A named AMD is safest and most robust way to register.966// Lowercase jquery is used because AMD module names are derived from967// file names, and jQuery is normally delivered in a lowercase file name.968if ( typeof define === "function" && define.amd && define.amd.jQuery ) {969define( "jquery", [], function () { return jQuery; } );970}971972return jQuery;973974})();975976977// String to Object flags format cache978var flagsCache = {};979980// Convert String-formatted flags into Object-formatted ones and store in cache981function createFlags( flags ) {982var object = flagsCache[ flags ] = {},983i, length;984flags = flags.split( /\s+/ );985for ( i = 0, length = flags.length; i < length; i++ ) {986object[ flags[i] ] = true;987}988return object;989}990991/*992* Create a callback list using the following parameters:993*994* flags: an optional list of space-separated flags that will change how995* the callback list behaves996*997* By default a callback list will act like an event callback list and can be998* "fired" multiple times.999*1000* Possible flags:1001*1002* once: will ensure the callback list can only be fired once (like a Deferred)1003*1004* memory: will keep track of previous values and will call any callback added1005* after the list has been fired right away with the latest "memorized"1006* values (like a Deferred)1007*1008* unique: will ensure a callback can only be added once (no duplicate in the list)1009*1010* stopOnFalse: interrupt callings when a callback returns false1011*1012*/1013jQuery.Callbacks = function( flags ) {10141015// Convert flags from String-formatted to Object-formatted1016// (we check in cache first)1017flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};10181019var // Actual callback list1020list = [],1021// Stack of fire calls for repeatable lists1022stack = [],1023// Last fire value (for non-forgettable lists)1024memory,1025// Flag to know if list is currently firing1026firing,1027// First callback to fire (used internally by add and fireWith)1028firingStart,1029// End of the loop when firing1030firingLength,1031// Index of currently firing callback (modified by remove if needed)1032firingIndex,1033// Add one or several callbacks to the list1034add = function( args ) {1035var i,1036length,1037elem,1038type,1039actual;1040for ( i = 0, length = args.length; i < length; i++ ) {1041elem = args[ i ];1042type = jQuery.type( elem );1043if ( type === "array" ) {1044// Inspect recursively1045add( elem );1046} else if ( type === "function" ) {1047// Add if not in unique mode and callback is not in1048if ( !flags.unique || !self.has( elem ) ) {1049list.push( elem );1050}1051}1052}1053},1054// Fire callbacks1055fire = function( context, args ) {1056args = args || [];1057memory = !flags.memory || [ context, args ];1058firing = true;1059firingIndex = firingStart || 0;1060firingStart = 0;1061firingLength = list.length;1062for ( ; list && firingIndex < firingLength; firingIndex++ ) {1063if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {1064memory = true; // Mark as halted1065break;1066}1067}1068firing = false;1069if ( list ) {1070if ( !flags.once ) {1071if ( stack && stack.length ) {1072memory = stack.shift();1073self.fireWith( memory[ 0 ], memory[ 1 ] );1074}1075} else if ( memory === true ) {1076self.disable();1077} else {1078list = [];1079}1080}1081},1082// Actual Callbacks object1083self = {1084// Add a callback or a collection of callbacks to the list1085add: function() {1086if ( list ) {1087var length = list.length;1088add( arguments );1089// Do we need to add the callbacks to the1090// current firing batch?1091if ( firing ) {1092firingLength = list.length;1093// With memory, if we're not firing then1094// we should call right away, unless previous1095// firing was halted (stopOnFalse)1096} else if ( memory && memory !== true ) {1097firingStart = length;1098fire( memory[ 0 ], memory[ 1 ] );1099}1100}1101return this;1102},1103// Remove a callback from the list1104remove: function() {1105if ( list ) {1106var args = arguments,1107argIndex = 0,1108argLength = args.length;1109for ( ; argIndex < argLength ; argIndex++ ) {1110for ( var i = 0; i < list.length; i++ ) {1111if ( args[ argIndex ] === list[ i ] ) {1112// Handle firingIndex and firingLength1113if ( firing ) {1114if ( i <= firingLength ) {1115firingLength--;1116if ( i <= firingIndex ) {1117firingIndex--;1118}1119}1120}1121// Remove the element1122list.splice( i--, 1 );1123// If we have some unicity property then1124// we only need to do this once1125if ( flags.unique ) {1126break;1127}1128}1129}1130}1131}1132return this;1133},1134// Control if a given callback is in the list1135has: function( fn ) {1136if ( list ) {1137var i = 0,1138length = list.length;1139for ( ; i < length; i++ ) {1140if ( fn === list[ i ] ) {1141return true;1142}1143}1144}1145return false;1146},1147// Remove all callbacks from the list1148empty: function() {1149list = [];1150return this;1151},1152// Have the list do nothing anymore1153disable: function() {1154list = stack = memory = undefined;1155return this;1156},1157// Is it disabled?1158disabled: function() {1159return !list;1160},1161// Lock the list in its current state1162lock: function() {1163stack = undefined;1164if ( !memory || memory === true ) {1165self.disable();1166}1167return this;1168},1169// Is it locked?1170locked: function() {1171return !stack;1172},1173// Call all callbacks with the given context and arguments1174fireWith: function( context, args ) {1175if ( stack ) {1176if ( firing ) {1177if ( !flags.once ) {1178stack.push( [ context, args ] );1179}1180} else if ( !( flags.once && memory ) ) {1181fire( context, args );1182}1183}1184return this;1185},1186// Call all the callbacks with the given arguments1187fire: function() {1188self.fireWith( this, arguments );1189return this;1190},1191// To know if the callbacks have already been called at least once1192fired: function() {1193return !!memory;1194}1195};11961197return self;1198};11991200120112021203var // Static reference to slice1204sliceDeferred = [].slice;12051206jQuery.extend({12071208Deferred: function( func ) {1209var doneList = jQuery.Callbacks( "once memory" ),1210failList = jQuery.Callbacks( "once memory" ),1211progressList = jQuery.Callbacks( "memory" ),1212state = "pending",1213lists = {1214resolve: doneList,1215reject: failList,1216notify: progressList1217},1218promise = {1219done: doneList.add,1220fail: failList.add,1221progress: progressList.add,12221223state: function() {1224return state;1225},12261227// Deprecated1228isResolved: doneList.fired,1229isRejected: failList.fired,12301231then: function( doneCallbacks, failCallbacks, progressCallbacks ) {1232deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );1233return this;1234},1235always: function() {1236return deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );1237},1238pipe: function( fnDone, fnFail, fnProgress ) {1239return jQuery.Deferred(function( newDefer ) {1240jQuery.each( {1241done: [ fnDone, "resolve" ],1242fail: [ fnFail, "reject" ],1243progress: [ fnProgress, "notify" ]1244}, function( handler, data ) {1245var fn = data[ 0 ],1246action = data[ 1 ],1247returned;1248if ( jQuery.isFunction( fn ) ) {1249deferred[ handler ](function() {1250returned = fn.apply( this, arguments );1251if ( returned && jQuery.isFunction( returned.promise ) ) {1252returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );1253} else {1254newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );1255}1256});1257} else {1258deferred[ handler ]( newDefer[ action ] );1259}1260});1261}).promise();1262},1263// Get a promise for this deferred1264// If obj is provided, the promise aspect is added to the object1265promise: function( obj ) {1266if ( obj == null ) {1267obj = promise;1268} else {1269for ( var key in promise ) {1270obj[ key ] = promise[ key ];1271}1272}1273return obj;1274}1275},1276deferred = promise.promise({}),1277key;12781279for ( key in lists ) {1280deferred[ key ] = lists[ key ].fire;1281deferred[ key + "With" ] = lists[ key ].fireWith;1282}12831284// Handle state1285deferred.done( function() {1286state = "resolved";1287}, failList.disable, progressList.lock ).fail( function() {1288state = "rejected";1289}, doneList.disable, progressList.lock );12901291// Call given func if any1292if ( func ) {1293func.call( deferred, deferred );1294}12951296// All done!1297return deferred;1298},12991300// Deferred helper1301when: function( firstParam ) {1302var args = sliceDeferred.call( arguments, 0 ),1303i = 0,1304length = args.length,1305pValues = new Array( length ),1306count = length,1307pCount = length,1308deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?1309firstParam :1310jQuery.Deferred(),1311promise = deferred.promise();1312function resolveFunc( i ) {1313return function( value ) {1314args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;1315if ( !( --count ) ) {1316deferred.resolveWith( deferred, args );1317}1318};1319}1320function progressFunc( i ) {1321return function( value ) {1322pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;1323deferred.notifyWith( promise, pValues );1324};1325}1326if ( length > 1 ) {1327for ( ; i < length; i++ ) {1328if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {1329args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );1330} else {1331--count;1332}1333}1334if ( !count ) {1335deferred.resolveWith( deferred, args );1336}1337} else if ( deferred !== firstParam ) {1338deferred.resolveWith( deferred, length ? [ firstParam ] : [] );1339}1340return promise;1341}1342});13431344134513461347jQuery.support = (function() {13481349var div = document.createElement( "div" ),1350documentElement = document.documentElement,1351all,1352a,1353select,1354opt,1355input,1356marginDiv,1357support,1358fragment,1359body,1360testElementParent,1361testElement,1362testElementStyle,1363tds,1364events,1365eventName,1366i,1367isSupported;13681369// Preliminary tests1370div.setAttribute("className", "t");1371div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/><nav></nav>";137213731374all = div.getElementsByTagName( "*" );1375a = div.getElementsByTagName( "a" )[ 0 ];13761377// Can't get basic test support1378if ( !all || !all.length || !a ) {1379return {};1380}13811382// First batch of supports tests1383select = document.createElement( "select" );1384opt = select.appendChild( document.createElement("option") );1385input = div.getElementsByTagName( "input" )[ 0 ];13861387support = {1388// IE strips leading whitespace when .innerHTML is used1389leadingWhitespace: ( div.firstChild.nodeType === 3 ),13901391// Make sure that tbody elements aren't automatically inserted1392// IE will insert them into empty tables1393tbody: !div.getElementsByTagName( "tbody" ).length,13941395// Make sure that link elements get serialized correctly by innerHTML1396// This requires a wrapper element in IE1397htmlSerialize: !!div.getElementsByTagName( "link" ).length,13981399// Get the style information from getAttribute1400// (IE uses .cssText instead)1401style: /top/.test( a.getAttribute("style") ),14021403// Make sure that URLs aren't manipulated1404// (IE normalizes it by default)1405hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),14061407// Make sure that element opacity exists1408// (IE uses filter instead)1409// Use a regex to work around a WebKit issue. See #51451410opacity: /^0.55/.test( a.style.opacity ),14111412// Verify style float existence1413// (IE uses styleFloat instead of cssFloat)1414cssFloat: !!a.style.cssFloat,14151416// Make sure unknown elements (like HTML5 elems) are handled appropriately1417unknownElems: !!div.getElementsByTagName( "nav" ).length,14181419// Make sure that if no value is specified for a checkbox1420// that it defaults to "on".1421// (WebKit defaults to "" instead)1422checkOn: ( input.value === "on" ),14231424// Make sure that a selected-by-default option has a working selected property.1425// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)1426optSelected: opt.selected,14271428// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)1429getSetAttribute: div.className !== "t",14301431// Tests for enctype support on a form(#6743)1432enctype: !!document.createElement("form").enctype,14331434// Will be defined later1435submitBubbles: true,1436changeBubbles: true,1437focusinBubbles: false,1438deleteExpando: true,1439noCloneEvent: true,1440inlineBlockNeedsLayout: false,1441shrinkWrapBlocks: false,1442reliableMarginRight: true1443};14441445// Make sure checked status is properly cloned1446input.checked = true;1447support.noCloneChecked = input.cloneNode( true ).checked;14481449// Make sure that the options inside disabled selects aren't marked as disabled1450// (WebKit marks them as disabled)1451select.disabled = true;1452support.optDisabled = !opt.disabled;14531454// Test to see if it's possible to delete an expando from an element1455// Fails in Internet Explorer1456try {1457delete div.test;1458} catch( e ) {1459support.deleteExpando = false;1460}14611462if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {1463div.attachEvent( "onclick", function() {1464// Cloning a node shouldn't copy over any1465// bound event handlers (IE does this)1466support.noCloneEvent = false;1467});1468div.cloneNode( true ).fireEvent( "onclick" );1469}14701471// Check if a radio maintains its value1472// after being appended to the DOM1473input = document.createElement("input");1474input.value = "t";1475input.setAttribute("type", "radio");1476support.radioValue = input.value === "t";14771478input.setAttribute("checked", "checked");1479div.appendChild( input );1480fragment = document.createDocumentFragment();1481fragment.appendChild( div.lastChild );14821483// WebKit doesn't clone checked state correctly in fragments1484support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;14851486div.innerHTML = "";14871488// Figure out if the W3C box model works as expected1489div.style.width = div.style.paddingLeft = "1px";14901491// We don't want to do body-related feature tests on frameset1492// documents, which lack a body. So we use1493// document.getElementsByTagName("body")[0], which is undefined in1494// frameset documents, while document.body isn’t. (7398)1495body = document.getElementsByTagName("body")[ 0 ];1496// We use our own, invisible, body unless the body is already present1497// in which case we use a div (#9239)1498testElement = document.createElement( body ? "div" : "body" );1499testElementStyle = {1500visibility: "hidden",1501width: 0,1502height: 0,1503border: 0,1504margin: 0,1505background: "none"1506};1507if ( body ) {1508jQuery.extend( testElementStyle, {1509position: "absolute",1510left: "-999px",1511top: "-999px"1512});1513}1514for ( i in testElementStyle ) {1515testElement.style[ i ] = testElementStyle[ i ];1516}1517testElement.appendChild( div );1518testElementParent = body || documentElement;1519testElementParent.insertBefore( testElement, testElementParent.firstChild );15201521// Check if a disconnected checkbox will retain its checked1522// value of true after appended to the DOM (IE6/7)1523support.appendChecked = input.checked;15241525support.boxModel = div.offsetWidth === 2;15261527if ( "zoom" in div.style ) {1528// Check if natively block-level elements act like inline-block1529// elements when setting their display to 'inline' and giving1530// them layout1531// (IE < 8 does this)1532div.style.display = "inline";1533div.style.zoom = 1;1534support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );15351536// Check if elements with layout shrink-wrap their children1537// (IE 6 does this)1538div.style.display = "";1539div.innerHTML = "<div style='width:4px;'></div>";1540support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );1541}15421543div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";1544tds = div.getElementsByTagName( "td" );15451546// Check if table cells still have offsetWidth/Height when they are set1547// to display:none and there are still other visible table cells in a1548// table row; if so, offsetWidth/Height are not reliable for use when1549// determining if an element has been hidden directly using1550// display:none (it is still safe to use offsets if a parent element is1551// hidden; don safety goggles and see bug #4512 for more information).1552// (only IE 8 fails this test)1553isSupported = ( tds[ 0 ].offsetHeight === 0 );15541555tds[ 0 ].style.display = "";1556tds[ 1 ].style.display = "none";15571558// Check if empty table cells still have offsetWidth/Height1559// (IE < 8 fail this test)1560support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );1561div.innerHTML = "";15621563// Check if div with explicit width and no margin-right incorrectly1564// gets computed margin-right based on width of container. For more1565// info see bug #33331566// Fails in WebKit before Feb 2011 nightlies1567// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right1568if ( document.defaultView && document.defaultView.getComputedStyle ) {1569marginDiv = document.createElement( "div" );1570marginDiv.style.width = "0";1571marginDiv.style.marginRight = "0";1572div.appendChild( marginDiv );1573support.reliableMarginRight =1574( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;1575}15761577// Technique from Juriy Zaytsev1578// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/1579// We only care about the case where non-standard event systems1580// are used, namely in IE. Short-circuiting here helps us to1581// avoid an eval call (in setAttribute) which can cause CSP1582// to go haywire. See: https://developer.mozilla.org/en/Security/CSP1583if ( div.attachEvent ) {1584for( i in {1585submit: 1,1586change: 1,1587focusin: 11588} ) {1589eventName = "on" + i;1590isSupported = ( eventName in div );1591if ( !isSupported ) {1592div.setAttribute( eventName, "return;" );1593isSupported = ( typeof div[ eventName ] === "function" );1594}1595support[ i + "Bubbles" ] = isSupported;1596}1597}15981599// Run fixed position tests at doc ready to avoid a crash1600// related to the invisible body in IE81601jQuery(function() {1602var container, outer, inner, table, td, offsetSupport,1603conMarginTop = 1,1604ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",1605vb = "visibility:hidden;border:0;",1606style = "style='" + ptlm + "border:5px solid #000;padding:0;'",1607html = "<div " + style + "><div></div></div>" +1608"<table " + style + " cellpadding='0' cellspacing='0'>" +1609"<tr><td></td></tr></table>";16101611// Reconstruct a container1612body = document.getElementsByTagName("body")[0];1613if ( !body ) {1614// Return for frameset docs that don't have a body1615// These tests cannot be done1616return;1617}16181619container = document.createElement("div");1620container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";1621body.insertBefore( container, body.firstChild );16221623// Construct a test element1624testElement = document.createElement("div");1625testElement.style.cssText = ptlm + vb;16261627testElement.innerHTML = html;1628container.appendChild( testElement );1629outer = testElement.firstChild;1630inner = outer.firstChild;1631td = outer.nextSibling.firstChild.firstChild;16321633offsetSupport = {1634doesNotAddBorder: ( inner.offsetTop !== 5 ),1635doesAddBorderForTableAndCells: ( td.offsetTop === 5 )1636};16371638inner.style.position = "fixed";1639inner.style.top = "20px";16401641// safari subtracts parent border width here which is 5px1642offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );1643inner.style.position = inner.style.top = "";16441645outer.style.overflow = "hidden";1646outer.style.position = "relative";16471648offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );1649offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );16501651body.removeChild( container );1652testElement = container = null;16531654jQuery.extend( support, offsetSupport );1655});16561657testElement.innerHTML = "";1658testElementParent.removeChild( testElement );16591660// Null connected elements to avoid leaks in IE1661testElement = fragment = select = opt = body = marginDiv = div = input = null;16621663return support;1664})();16651666// Keep track of boxModel1667jQuery.boxModel = jQuery.support.boxModel;16681669167016711672var rbrace = /^(?:\{.*\}|\[.*\])$/,1673rmultiDash = /([A-Z])/g;16741675jQuery.extend({1676cache: {},16771678// Please use with caution1679uuid: 0,16801681// Unique for each copy of jQuery on the page1682// Non-digits removed to match rinlinejQuery1683expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),16841685// The following elements throw uncatchable exceptions if you1686// attempt to add expando properties to them.1687noData: {1688"embed": true,1689// Ban all objects except for Flash (which handle expandos)1690"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",1691"applet": true1692},16931694hasData: function( elem ) {1695elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];1696return !!elem && !isEmptyDataObject( elem );1697},16981699data: function( elem, name, data, pvt /* Internal Use Only */ ) {1700if ( !jQuery.acceptData( elem ) ) {1701return;1702}17031704var privateCache, thisCache, ret,1705internalKey = jQuery.expando,1706getByName = typeof name === "string",17071708// We have to handle DOM nodes and JS objects differently because IE6-71709// can't GC object references properly across the DOM-JS boundary1710isNode = elem.nodeType,17111712// Only DOM nodes need the global jQuery cache; JS object data is1713// attached directly to the object so GC can occur automatically1714cache = isNode ? jQuery.cache : elem,17151716// Only defining an ID for JS objects if its cache already exists allows1717// the code to shortcut on the same path as a DOM node with no cache1718id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando,1719isEvents = name === "events";17201721// Avoid doing any more work than we need to when trying to get data on an1722// object that has no data at all1723if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {1724return;1725}17261727if ( !id ) {1728// Only DOM nodes need a new unique ID for each element since their data1729// ends up in the global cache1730if ( isNode ) {1731elem[ jQuery.expando ] = id = ++jQuery.uuid;1732} else {1733id = jQuery.expando;1734}1735}17361737if ( !cache[ id ] ) {1738cache[ id ] = {};17391740// Avoids exposing jQuery metadata on plain JS objects when the object1741// is serialized using JSON.stringify1742if ( !isNode ) {1743cache[ id ].toJSON = jQuery.noop;1744}1745}17461747// An object can be passed to jQuery.data instead of a key/value pair; this gets1748// shallow copied over onto the existing cache1749if ( typeof name === "object" || typeof name === "function" ) {1750if ( pvt ) {1751cache[ id ] = jQuery.extend( cache[ id ], name );1752} else {1753cache[ id ].data = jQuery.extend( cache[ id ].data, name );1754}1755}17561757privateCache = thisCache = cache[ id ];17581759// jQuery data() is stored in a separate object inside the object's internal data1760// cache in order to avoid key collisions between internal data and user-defined1761// data.1762if ( !pvt ) {1763if ( !thisCache.data ) {1764thisCache.data = {};1765}17661767thisCache = thisCache.data;1768}17691770if ( data !== undefined ) {1771thisCache[ jQuery.camelCase( name ) ] = data;1772}17731774// Users should not attempt to inspect the internal events object using jQuery.data,1775// it is undocumented and subject to change. But does anyone listen? No.1776if ( isEvents && !thisCache[ name ] ) {1777return privateCache.events;1778}17791780// Check for both converted-to-camel and non-converted data property names1781// If a data property was specified1782if ( getByName ) {17831784// First Try to find as-is property data1785ret = thisCache[ name ];17861787// Test for null|undefined property data1788if ( ret == null ) {17891790// Try to find the camelCased property1791ret = thisCache[ jQuery.camelCase( name ) ];1792}1793} else {1794ret = thisCache;1795}17961797return ret;1798},17991800removeData: function( elem, name, pvt /* Internal Use Only */ ) {1801if ( !jQuery.acceptData( elem ) ) {1802return;1803}18041805var thisCache, i, l,18061807// Reference to internal data cache key1808internalKey = jQuery.expando,18091810isNode = elem.nodeType,18111812// See jQuery.data for more information1813cache = isNode ? jQuery.cache : elem,18141815// See jQuery.data for more information1816id = isNode ? elem[ jQuery.expando ] : jQuery.expando;18171818// If there is already no cache entry for this object, there is no1819// purpose in continuing1820if ( !cache[ id ] ) {1821return;1822}18231824if ( name ) {18251826thisCache = pvt ? cache[ id ] : cache[ id ].data;18271828if ( thisCache ) {18291830// Support space separated names1831if ( jQuery.isArray( name ) ) {1832name = name;1833} else if ( name in thisCache ) {1834name = [ name ];1835} else {18361837// split the camel cased version by spaces1838name = jQuery.camelCase( name );1839if ( name in thisCache ) {1840name = [ name ];1841} else {1842name = name.split( " " );1843}1844}18451846for ( i = 0, l = name.length; i < l; i++ ) {1847delete thisCache[ name[i] ];1848}18491850// If there is no data left in the cache, we want to continue1851// and let the cache object itself get destroyed1852if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {1853return;1854}1855}1856}18571858// See jQuery.data for more information1859if ( !pvt ) {1860delete cache[ id ].data;18611862// Don't destroy the parent cache unless the internal data object1863// had been the only thing left in it1864if ( !isEmptyDataObject(cache[ id ]) ) {1865return;1866}1867}18681869// Browsers that fail expando deletion also refuse to delete expandos on1870// the window, but it will allow it on all other JS objects; other browsers1871// don't care1872// Ensure that `cache` is not a window object #100801873if ( jQuery.support.deleteExpando || !cache.setInterval ) {1874delete cache[ id ];1875} else {1876cache[ id ] = null;1877}18781879// We destroyed the cache and need to eliminate the expando on the node to avoid1880// false lookups in the cache for entries that no longer exist1881if ( isNode ) {1882// IE does not allow us to delete expando properties from nodes,1883// nor does it have a removeAttribute function on Document nodes;1884// we must handle all of these cases1885if ( jQuery.support.deleteExpando ) {1886delete elem[ jQuery.expando ];1887} else if ( elem.removeAttribute ) {1888elem.removeAttribute( jQuery.expando );1889} else {1890elem[ jQuery.expando ] = null;1891}1892}1893},18941895// For internal use only.1896_data: function( elem, name, data ) {1897return jQuery.data( elem, name, data, true );1898},18991900// A method for determining if a DOM node can handle the data expando1901acceptData: function( elem ) {1902if ( elem.nodeName ) {1903var match = jQuery.noData[ elem.nodeName.toLowerCase() ];19041905if ( match ) {1906return !(match === true || elem.getAttribute("classid") !== match);1907}1908}19091910return true;1911}1912});19131914jQuery.fn.extend({1915data: function( key, value ) {1916var parts, attr, name,1917data = null;19181919if ( typeof key === "undefined" ) {1920if ( this.length ) {1921data = jQuery.data( this[0] );19221923if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) {1924attr = this[0].attributes;1925for ( var i = 0, l = attr.length; i < l; i++ ) {1926name = attr[i].name;19271928if ( name.indexOf( "data-" ) === 0 ) {1929name = jQuery.camelCase( name.substring(5) );19301931dataAttr( this[0], name, data[ name ] );1932}1933}1934jQuery._data( this[0], "parsedAttrs", true );1935}1936}19371938return data;19391940} else if ( typeof key === "object" ) {1941return this.each(function() {1942jQuery.data( this, key );1943});1944}19451946parts = key.split(".");1947parts[1] = parts[1] ? "." + parts[1] : "";19481949if ( value === undefined ) {1950data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);19511952// Try to fetch any internally stored data first1953if ( data === undefined && this.length ) {1954data = jQuery.data( this[0], key );1955data = dataAttr( this[0], key, data );1956}19571958return data === undefined && parts[1] ?1959this.data( parts[0] ) :1960data;19611962} else {1963return this.each(function() {1964var $this = jQuery( this ),1965args = [ parts[0], value ];19661967$this.triggerHandler( "setData" + parts[1] + "!", args );1968jQuery.data( this, key, value );1969$this.triggerHandler( "changeData" + parts[1] + "!", args );1970});1971}1972},19731974removeData: function( key ) {1975return this.each(function() {1976jQuery.removeData( this, key );1977});1978}1979});19801981function dataAttr( elem, key, data ) {1982// If nothing was found internally, try to fetch any1983// data from the HTML5 data-* attribute1984if ( data === undefined && elem.nodeType === 1 ) {19851986var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();19871988data = elem.getAttribute( name );19891990if ( typeof data === "string" ) {1991try {1992data = data === "true" ? true :1993data === "false" ? false :1994data === "null" ? null :1995jQuery.isNumeric( data ) ? parseFloat( data ) :1996rbrace.test( data ) ? jQuery.parseJSON( data ) :1997data;1998} catch( e ) {}19992000// Make sure we set the data so it isn't changed later2001jQuery.data( elem, key, data );20022003} else {2004data = undefined;2005}2006}20072008return data;2009}20102011// checks a cache object for emptiness2012function isEmptyDataObject( obj ) {2013for ( var name in obj ) {20142015// if the public data object is empty, the private is still empty2016if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {2017continue;2018}2019if ( name !== "toJSON" ) {2020return false;2021}2022}20232024return true;2025}20262027202820292030function handleQueueMarkDefer( elem, type, src ) {2031var deferDataKey = type + "defer",2032queueDataKey = type + "queue",2033markDataKey = type + "mark",2034defer = jQuery._data( elem, deferDataKey );2035if ( defer &&2036( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&2037( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {2038// Give room for hard-coded callbacks to fire first2039// and eventually mark/queue something else on the element2040setTimeout( function() {2041if ( !jQuery._data( elem, queueDataKey ) &&2042!jQuery._data( elem, markDataKey ) ) {2043jQuery.removeData( elem, deferDataKey, true );2044defer.fire();2045}2046}, 0 );2047}2048}20492050jQuery.extend({20512052_mark: function( elem, type ) {2053if ( elem ) {2054type = ( type || "fx" ) + "mark";2055jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );2056}2057},20582059_unmark: function( force, elem, type ) {2060if ( force !== true ) {2061type = elem;2062elem = force;2063force = false;2064}2065if ( elem ) {2066type = type || "fx";2067var key = type + "mark",2068count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );2069if ( count ) {2070jQuery._data( elem, key, count );2071} else {2072jQuery.removeData( elem, key, true );2073handleQueueMarkDefer( elem, type, "mark" );2074}2075}2076},20772078queue: function( elem, type, data ) {2079var q;2080if ( elem ) {2081type = ( type || "fx" ) + "queue";2082q = jQuery._data( elem, type );20832084// Speed up dequeue by getting out quickly if this is just a lookup2085if ( data ) {2086if ( !q || jQuery.isArray(data) ) {2087q = jQuery._data( elem, type, jQuery.makeArray(data) );2088} else {2089q.push( data );2090}2091}2092return q || [];2093}2094},20952096dequeue: function( elem, type ) {2097type = type || "fx";20982099var queue = jQuery.queue( elem, type ),2100fn = queue.shift(),2101hooks = {};21022103// If the fx queue is dequeued, always remove the progress sentinel2104if ( fn === "inprogress" ) {2105fn = queue.shift();2106}21072108if ( fn ) {2109// Add a progress sentinel to prevent the fx queue from being2110// automatically dequeued2111if ( type === "fx" ) {2112queue.unshift( "inprogress" );2113}21142115jQuery._data( elem, type + ".run", hooks );2116fn.call( elem, function() {2117jQuery.dequeue( elem, type );2118}, hooks );2119}21202121if ( !queue.length ) {2122jQuery.removeData( elem, type + "queue " + type + ".run", true );2123handleQueueMarkDefer( elem, type, "queue" );2124}2125}2126});21272128jQuery.fn.extend({2129queue: function( type, data ) {2130if ( typeof type !== "string" ) {2131data = type;2132type = "fx";2133}21342135if ( data === undefined ) {2136return jQuery.queue( this[0], type );2137}2138return this.each(function() {2139var queue = jQuery.queue( this, type, data );21402141if ( type === "fx" && queue[0] !== "inprogress" ) {2142jQuery.dequeue( this, type );2143}2144});2145},2146dequeue: function( type ) {2147return this.each(function() {2148jQuery.dequeue( this, type );2149});2150},2151// Based off of the plugin by Clint Helfers, with permission.2152// http://blindsignals.com/index.php/2009/07/jquery-delay/2153delay: function( time, type ) {2154time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;2155type = type || "fx";21562157return this.queue( type, function( next, hooks ) {2158var timeout = setTimeout( next, time );2159hooks.stop = function() {2160clearTimeout( timeout );2161};2162});2163},2164clearQueue: function( type ) {2165return this.queue( type || "fx", [] );2166},2167// Get a promise resolved when queues of a certain type2168// are emptied (fx is the type by default)2169promise: function( type, object ) {2170if ( typeof type !== "string" ) {2171object = type;2172type = undefined;2173}2174type = type || "fx";2175var defer = jQuery.Deferred(),2176elements = this,2177i = elements.length,2178count = 1,2179deferDataKey = type + "defer",2180queueDataKey = type + "queue",2181markDataKey = type + "mark",2182tmp;2183function resolve() {2184if ( !( --count ) ) {2185defer.resolveWith( elements, [ elements ] );2186}2187}2188while( i-- ) {2189if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||2190( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||2191jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&2192jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {2193count++;2194tmp.add( resolve );2195}2196}2197resolve();2198return defer.promise();2199}2200});22012202220322042205var rclass = /[\n\t\r]/g,2206rspace = /\s+/,2207rreturn = /\r/g,2208rtype = /^(?:button|input)$/i,2209rfocusable = /^(?:button|input|object|select|textarea)$/i,2210rclickable = /^a(?:rea)?$/i,2211rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,2212getSetAttribute = jQuery.support.getSetAttribute,2213nodeHook, boolHook, fixSpecified;22142215jQuery.fn.extend({2216attr: function( name, value ) {2217return jQuery.access( this, name, value, true, jQuery.attr );2218},22192220removeAttr: function( name ) {2221return this.each(function() {2222jQuery.removeAttr( this, name );2223});2224},22252226prop: function( name, value ) {2227return jQuery.access( this, name, value, true, jQuery.prop );2228},22292230removeProp: function( name ) {2231name = jQuery.propFix[ name ] || name;2232return this.each(function() {2233// try/catch handles cases where IE balks (such as removing a property on window)2234try {2235this[ name ] = undefined;2236delete this[ name ];2237} catch( e ) {}2238});2239},22402241addClass: function( value ) {2242var classNames, i, l, elem,2243setClass, c, cl;22442245if ( jQuery.isFunction( value ) ) {2246return this.each(function( j ) {2247jQuery( this ).addClass( value.call(this, j, this.className) );2248});2249}22502251if ( value && typeof value === "string" ) {2252classNames = value.split( rspace );22532254for ( i = 0, l = this.length; i < l; i++ ) {2255elem = this[ i ];22562257if ( elem.nodeType === 1 ) {2258if ( !elem.className && classNames.length === 1 ) {2259elem.className = value;22602261} else {2262setClass = " " + elem.className + " ";22632264for ( c = 0, cl = classNames.length; c < cl; c++ ) {2265if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {2266setClass += classNames[ c ] + " ";2267}2268}2269elem.className = jQuery.trim( setClass );2270}2271}2272}2273}22742275return this;2276},22772278removeClass: function( value ) {2279var classNames, i, l, elem, className, c, cl;22802281if ( jQuery.isFunction( value ) ) {2282return this.each(function( j ) {2283jQuery( this ).removeClass( value.call(this, j, this.className) );2284});2285}22862287if ( (value && typeof value === "string") || value === undefined ) {2288classNames = ( value || "" ).split( rspace );22892290for ( i = 0, l = this.length; i < l; i++ ) {2291elem = this[ i ];22922293if ( elem.nodeType === 1 && elem.className ) {2294if ( value ) {2295className = (" " + elem.className + " ").replace( rclass, " " );2296for ( c = 0, cl = classNames.length; c < cl; c++ ) {2297className = className.replace(" " + classNames[ c ] + " ", " ");2298}2299elem.className = jQuery.trim( className );23002301} else {2302elem.className = "";2303}2304}2305}2306}23072308return this;2309},23102311toggleClass: function( value, stateVal ) {2312var type = typeof value,2313isBool = typeof stateVal === "boolean";23142315if ( jQuery.isFunction( value ) ) {2316return this.each(function( i ) {2317jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );2318});2319}23202321return this.each(function() {2322if ( type === "string" ) {2323// toggle individual class names2324var className,2325i = 0,2326self = jQuery( this ),2327state = stateVal,2328classNames = value.split( rspace );23292330while ( (className = classNames[ i++ ]) ) {2331// check each className given, space seperated list2332state = isBool ? state : !self.hasClass( className );2333self[ state ? "addClass" : "removeClass" ]( className );2334}23352336} else if ( type === "undefined" || type === "boolean" ) {2337if ( this.className ) {2338// store className if set2339jQuery._data( this, "__className__", this.className );2340}23412342// toggle whole className2343this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";2344}2345});2346},23472348hasClass: function( selector ) {2349var className = " " + selector + " ",2350i = 0,2351l = this.length;2352for ( ; i < l; i++ ) {2353if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {2354return true;2355}2356}23572358return false;2359},23602361val: function( value ) {2362var hooks, ret, isFunction,2363elem = this[0];23642365if ( !arguments.length ) {2366if ( elem ) {2367hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];23682369if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {2370return ret;2371}23722373ret = elem.value;23742375return typeof ret === "string" ?2376// handle most common string cases2377ret.replace(rreturn, "") :2378// handle cases where value is null/undef or number2379ret == null ? "" : ret;2380}23812382return undefined;2383}23842385isFunction = jQuery.isFunction( value );23862387return this.each(function( i ) {2388var self = jQuery(this), val;23892390if ( this.nodeType !== 1 ) {2391return;2392}23932394if ( isFunction ) {2395val = value.call( this, i, self.val() );2396} else {2397val = value;2398}23992400// Treat null/undefined as ""; convert numbers to string2401if ( val == null ) {2402val = "";2403} else if ( typeof val === "number" ) {2404val += "";2405} else if ( jQuery.isArray( val ) ) {2406val = jQuery.map(val, function ( value ) {2407return value == null ? "" : value + "";2408});2409}24102411hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];24122413// If set returns undefined, fall back to normal setting2414if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {2415this.value = val;2416}2417});2418}2419});24202421jQuery.extend({2422valHooks: {2423option: {2424get: function( elem ) {2425// attributes.value is undefined in Blackberry 4.7 but2426// uses .value. See #69322427var val = elem.attributes.value;2428return !val || val.specified ? elem.value : elem.text;2429}2430},2431select: {2432get: function( elem ) {2433var value, i, max, option,2434index = elem.selectedIndex,2435values = [],2436options = elem.options,2437one = elem.type === "select-one";24382439// Nothing was selected2440if ( index < 0 ) {2441return null;2442}24432444// Loop through all the selected options2445i = one ? index : 0;2446max = one ? index + 1 : options.length;2447for ( ; i < max; i++ ) {2448option = options[ i ];24492450// Don't return options that are disabled or in a disabled optgroup2451if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&2452(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {24532454// Get the specific value for the option2455value = jQuery( option ).val();24562457// We don't need an array for one selects2458if ( one ) {2459return value;2460}24612462// Multi-Selects return an array2463values.push( value );2464}2465}24662467// Fixes Bug #2551 -- select.val() broken in IE after form.reset()2468if ( one && !values.length && options.length ) {2469return jQuery( options[ index ] ).val();2470}24712472return values;2473},24742475set: function( elem, value ) {2476var values = jQuery.makeArray( value );24772478jQuery(elem).find("option").each(function() {2479this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;2480});24812482if ( !values.length ) {2483elem.selectedIndex = -1;2484}2485return values;2486}2487}2488},24892490attrFn: {2491val: true,2492css: true,2493html: true,2494text: true,2495data: true,2496width: true,2497height: true,2498offset: true2499},25002501attr: function( elem, name, value, pass ) {2502var ret, hooks, notxml,2503nType = elem.nodeType;25042505// don't get/set attributes on text, comment and attribute nodes2506if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {2507return undefined;2508}25092510if ( pass && name in jQuery.attrFn ) {2511return jQuery( elem )[ name ]( value );2512}25132514// Fallback to prop when attributes are not supported2515if ( !("getAttribute" in elem) ) {2516return jQuery.prop( elem, name, value );2517}25182519notxml = nType !== 1 || !jQuery.isXMLDoc( elem );25202521// All attributes are lowercase2522// Grab necessary hook if one is defined2523if ( notxml ) {2524name = name.toLowerCase();2525hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );2526}25272528if ( value !== undefined ) {25292530if ( value === null ) {2531jQuery.removeAttr( elem, name );2532return undefined;25332534} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {2535return ret;25362537} else {2538elem.setAttribute( name, "" + value );2539return value;2540}25412542} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {2543return ret;25442545} else {25462547ret = elem.getAttribute( name );25482549// Non-existent attributes return null, we normalize to undefined2550return ret === null ?2551undefined :2552ret;2553}2554},25552556removeAttr: function( elem, value ) {2557var propName, attrNames, name, l,2558i = 0;25592560if ( elem.nodeType === 1 ) {2561attrNames = ( value || "" ).split( rspace );2562l = attrNames.length;25632564for ( ; i < l; i++ ) {2565name = attrNames[ i ].toLowerCase();2566propName = jQuery.propFix[ name ] || name;25672568// See #9699 for explanation of this approach (setting first, then removal)2569jQuery.attr( elem, name, "" );2570elem.removeAttribute( getSetAttribute ? name : propName );25712572// Set corresponding property to false for boolean attributes2573if ( rboolean.test( name ) && propName in elem ) {2574elem[ propName ] = false;2575}2576}2577}2578},25792580attrHooks: {2581type: {2582set: function( elem, value ) {2583// We can't allow the type property to be changed (since it causes problems in IE)2584if ( rtype.test( elem.nodeName ) && elem.parentNode ) {2585jQuery.error( "type property can't be changed" );2586} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {2587// Setting the type on a radio button after the value resets the value in IE6-92588// Reset value to it's default in case type is set after value2589// This is for element creation2590var val = elem.value;2591elem.setAttribute( "type", value );2592if ( val ) {2593elem.value = val;2594}2595return value;2596}2597}2598},2599// Use the value property for back compat2600// Use the nodeHook for button elements in IE6/7 (#1954)2601value: {2602get: function( elem, name ) {2603if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {2604return nodeHook.get( elem, name );2605}2606return name in elem ?2607elem.value :2608null;2609},2610set: function( elem, value, name ) {2611if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {2612return nodeHook.set( elem, value, name );2613}2614// Does not return so that setAttribute is also used2615elem.value = value;2616}2617}2618},26192620propFix: {2621tabindex: "tabIndex",2622readonly: "readOnly",2623"for": "htmlFor",2624"class": "className",2625maxlength: "maxLength",2626cellspacing: "cellSpacing",2627cellpadding: "cellPadding",2628rowspan: "rowSpan",2629colspan: "colSpan",2630usemap: "useMap",2631frameborder: "frameBorder",2632contenteditable: "contentEditable"2633},26342635prop: function( elem, name, value ) {2636var ret, hooks, notxml,2637nType = elem.nodeType;26382639// don't get/set properties on text, comment and attribute nodes2640if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {2641return undefined;2642}26432644notxml = nType !== 1 || !jQuery.isXMLDoc( elem );26452646if ( notxml ) {2647// Fix name and attach hooks2648name = jQuery.propFix[ name ] || name;2649hooks = jQuery.propHooks[ name ];2650}26512652if ( value !== undefined ) {2653if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {2654return ret;26552656} else {2657return ( elem[ name ] = value );2658}26592660} else {2661if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {2662return ret;26632664} else {2665return elem[ name ];2666}2667}2668},26692670propHooks: {2671tabIndex: {2672get: function( elem ) {2673// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set2674// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/2675var attributeNode = elem.getAttributeNode("tabindex");26762677return attributeNode && attributeNode.specified ?2678parseInt( attributeNode.value, 10 ) :2679rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?26800 :2681undefined;2682}2683}2684}2685});26862687// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)2688jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;26892690// Hook for boolean attributes2691boolHook = {2692get: function( elem, name ) {2693// Align boolean attributes with corresponding properties2694// Fall back to attribute presence where some booleans are not supported2695var attrNode,2696property = jQuery.prop( elem, name );2697return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?2698name.toLowerCase() :2699undefined;2700},2701set: function( elem, value, name ) {2702var propName;2703if ( value === false ) {2704// Remove boolean attributes when set to false2705jQuery.removeAttr( elem, name );2706} else {2707// value is true since we know at this point it's type boolean and not false2708// Set boolean attributes to the same name and set the DOM property2709propName = jQuery.propFix[ name ] || name;2710if ( propName in elem ) {2711// Only set the IDL specifically if it already exists on the element2712elem[ propName ] = true;2713}27142715elem.setAttribute( name, name.toLowerCase() );2716}2717return name;2718}2719};27202721// IE6/7 do not support getting/setting some attributes with get/setAttribute2722if ( !getSetAttribute ) {27232724fixSpecified = {2725name: true,2726id: true2727};27282729// Use this for any attribute in IE6/72730// This fixes almost every IE6/7 issue2731nodeHook = jQuery.valHooks.button = {2732get: function( elem, name ) {2733var ret;2734ret = elem.getAttributeNode( name );2735return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?2736ret.nodeValue :2737undefined;2738},2739set: function( elem, value, name ) {2740// Set the existing or create a new attribute node2741var ret = elem.getAttributeNode( name );2742if ( !ret ) {2743ret = document.createAttribute( name );2744elem.setAttributeNode( ret );2745}2746return ( ret.nodeValue = value + "" );2747}2748};27492750// Apply the nodeHook to tabindex2751jQuery.attrHooks.tabindex.set = nodeHook.set;27522753// Set width and height to auto instead of 0 on empty string( Bug #8150 )2754// This is for removals2755jQuery.each([ "width", "height" ], function( i, name ) {2756jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {2757set: function( elem, value ) {2758if ( value === "" ) {2759elem.setAttribute( name, "auto" );2760return value;2761}2762}2763});2764});27652766// Set contenteditable to false on removals(#10429)2767// Setting to empty string throws an error as an invalid value2768jQuery.attrHooks.contenteditable = {2769get: nodeHook.get,2770set: function( elem, value, name ) {2771if ( value === "" ) {2772value = "false";2773}2774nodeHook.set( elem, value, name );2775}2776};2777}277827792780// Some attributes require a special call on IE2781if ( !jQuery.support.hrefNormalized ) {2782jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {2783jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {2784get: function( elem ) {2785var ret = elem.getAttribute( name, 2 );2786return ret === null ? undefined : ret;2787}2788});2789});2790}27912792if ( !jQuery.support.style ) {2793jQuery.attrHooks.style = {2794get: function( elem ) {2795// Return undefined in the case of empty string2796// Normalize to lowercase since IE uppercases css property names2797return elem.style.cssText.toLowerCase() || undefined;2798},2799set: function( elem, value ) {2800return ( elem.style.cssText = "" + value );2801}2802};2803}28042805// Safari mis-reports the default selected property of an option2806// Accessing the parent's selectedIndex property fixes it2807if ( !jQuery.support.optSelected ) {2808jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {2809get: function( elem ) {2810var parent = elem.parentNode;28112812if ( parent ) {2813parent.selectedIndex;28142815// Make sure that it also works with optgroups, see #57012816if ( parent.parentNode ) {2817parent.parentNode.selectedIndex;2818}2819}2820return null;2821}2822});2823}28242825// IE6/7 call enctype encoding2826if ( !jQuery.support.enctype ) {2827jQuery.propFix.enctype = "encoding";2828}28292830// Radios and checkboxes getter/setter2831if ( !jQuery.support.checkOn ) {2832jQuery.each([ "radio", "checkbox" ], function() {2833jQuery.valHooks[ this ] = {2834get: function( elem ) {2835// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified2836return elem.getAttribute("value") === null ? "on" : elem.value;2837}2838};2839});2840}2841jQuery.each([ "radio", "checkbox" ], function() {2842jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {2843set: function( elem, value ) {2844if ( jQuery.isArray( value ) ) {2845return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );2846}2847}2848});2849});28502851285228532854var rnamespaces = /\.(.*)$/,2855rformElems = /^(?:textarea|input|select)$/i,2856rperiod = /\./g,2857rspaces = / /g,2858rescape = /[^\w\s.|`]/g,2859rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,2860rhoverHack = /\bhover(\.\S+)?/,2861rkeyEvent = /^key/,2862rmouseEvent = /^(?:mouse|contextmenu)|click/,2863rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,2864quickParse = function( selector ) {2865var quick = rquickIs.exec( selector );2866if ( quick ) {2867// 0 1 2 32868// [ _, tag, id, class ]2869quick[1] = ( quick[1] || "" ).toLowerCase();2870quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );2871}2872return quick;2873},2874quickIs = function( elem, m ) {2875return (2876(!m[1] || elem.nodeName.toLowerCase() === m[1]) &&2877(!m[2] || elem.id === m[2]) &&2878(!m[3] || m[3].test( elem.className ))2879);2880},2881hoverHack = function( events ) {2882return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );2883};28842885/*2886* Helper functions for managing events -- not part of the public interface.2887* Props to Dean Edwards' addEvent library for many of the ideas.2888*/2889jQuery.event = {28902891add: function( elem, types, handler, data, selector ) {28922893var elemData, eventHandle, events,2894t, tns, type, namespaces, handleObj,2895handleObjIn, quick, handlers, special;28962897// Don't attach events to noData or text/comment nodes (allow plain objects tho)2898if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {2899return;2900}29012902// Caller can pass in an object of custom data in lieu of the handler2903if ( handler.handler ) {2904handleObjIn = handler;2905handler = handleObjIn.handler;2906}29072908// Make sure that the handler has a unique ID, used to find/remove it later2909if ( !handler.guid ) {2910handler.guid = jQuery.guid++;2911}29122913// Init the element's event structure and main handler, if this is the first2914events = elemData.events;2915if ( !events ) {2916elemData.events = events = {};2917}2918eventHandle = elemData.handle;2919if ( !eventHandle ) {2920elemData.handle = eventHandle = function( e ) {2921// Discard the second event of a jQuery.event.trigger() and2922// when an event is called after a page has unloaded2923return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?2924jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :2925undefined;2926};2927// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events2928eventHandle.elem = elem;2929}29302931// Handle multiple events separated by a space2932// jQuery(...).bind("mouseover mouseout", fn);2933types = hoverHack(types).split( " " );2934for ( t = 0; t < types.length; t++ ) {29352936tns = rtypenamespace.exec( types[t] ) || [];2937type = tns[1];2938namespaces = ( tns[2] || "" ).split( "." ).sort();29392940// If event changes its type, use the special event handlers for the changed type2941special = jQuery.event.special[ type ] || {};29422943// If selector defined, determine special event api type, otherwise given type2944type = ( selector ? special.delegateType : special.bindType ) || type;29452946// Update special based on newly reset type2947special = jQuery.event.special[ type ] || {};29482949// handleObj is passed to all event handlers2950handleObj = jQuery.extend({2951type: type,2952origType: tns[1],2953data: data,2954handler: handler,2955guid: handler.guid,2956selector: selector,2957namespace: namespaces.join(".")2958}, handleObjIn );29592960// Delegated event; pre-analyze selector so it's processed quickly on event dispatch2961if ( selector ) {2962handleObj.quick = quickParse( selector );2963if ( !handleObj.quick && jQuery.expr.match.POS.test( selector ) ) {2964handleObj.isPositional = true;2965}2966}29672968// Init the event handler queue if we're the first2969handlers = events[ type ];2970if ( !handlers ) {2971handlers = events[ type ] = [];2972handlers.delegateCount = 0;29732974// Only use addEventListener/attachEvent if the special events handler returns false2975if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {2976// Bind the global event handler to the element2977if ( elem.addEventListener ) {2978elem.addEventListener( type, eventHandle, false );29792980} else if ( elem.attachEvent ) {2981elem.attachEvent( "on" + type, eventHandle );2982}2983}2984}29852986if ( special.add ) {2987special.add.call( elem, handleObj );29882989if ( !handleObj.handler.guid ) {2990handleObj.handler.guid = handler.guid;2991}2992}29932994// Add to the element's handler list, delegates in front2995if ( selector ) {2996handlers.splice( handlers.delegateCount++, 0, handleObj );2997} else {2998handlers.push( handleObj );2999}30003001// Keep track of which events have ever been used, for event optimization3002jQuery.event.global[ type ] = true;3003}30043005// Nullify elem to prevent memory leaks in IE3006elem = null;3007},30083009global: {},30103011// Detach an event or set of events from an element3012remove: function( elem, types, handler, selector ) {30133014var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),3015t, tns, type, namespaces, origCount,3016j, events, special, handle, eventType, handleObj;30173018if ( !elemData || !(events = elemData.events) ) {3019return;3020}30213022// Once for each type.namespace in types; type may be omitted3023types = hoverHack( types || "" ).split(" ");3024for ( t = 0; t < types.length; t++ ) {3025tns = rtypenamespace.exec( types[t] ) || [];3026type = tns[1];3027namespaces = tns[2];30283029// Unbind all events (on this namespace, if provided) for the element3030if ( !type ) {3031namespaces = namespaces? "." + namespaces : "";3032for ( j in events ) {3033jQuery.event.remove( elem, j + namespaces, handler, selector );3034}3035return;3036}30373038special = jQuery.event.special[ type ] || {};3039type = ( selector? special.delegateType : special.bindType ) || type;3040eventType = events[ type ] || [];3041origCount = eventType.length;3042namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;30433044// Only need to loop for special events or selective removal3045if ( handler || namespaces || selector || special.remove ) {3046for ( j = 0; j < eventType.length; j++ ) {3047handleObj = eventType[ j ];30483049if ( !handler || handler.guid === handleObj.guid ) {3050if ( !namespaces || namespaces.test( handleObj.namespace ) ) {3051if ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) {3052eventType.splice( j--, 1 );30533054if ( handleObj.selector ) {3055eventType.delegateCount--;3056}3057if ( special.remove ) {3058special.remove.call( elem, handleObj );3059}3060}3061}3062}3063}3064} else {3065// Removing all events3066eventType.length = 0;3067}30683069// Remove generic event handler if we removed something and no more handlers exist3070// (avoids potential for endless recursion during removal of special event handlers)3071if ( eventType.length === 0 && origCount !== eventType.length ) {3072if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {3073jQuery.removeEvent( elem, type, elemData.handle );3074}30753076delete events[ type ];3077}3078}30793080// Remove the expando if it's no longer used3081if ( jQuery.isEmptyObject( events ) ) {3082handle = elemData.handle;3083if ( handle ) {3084handle.elem = null;3085}30863087// removeData also checks for emptiness and clears the expando if empty3088// so use it instead of delete3089jQuery.removeData( elem, [ "events", "handle" ], true );3090}3091},30923093// Events that are safe to short-circuit if no handlers are attached.3094// Native DOM events should not be added, they may have inline handlers.3095customEvent: {3096"getData": true,3097"setData": true,3098"changeData": true3099},31003101trigger: function( event, data, elem, onlyHandlers ) {3102// Don't do events on text and comment nodes3103if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {3104return;3105}31063107// Event object or event type3108var type = event.type || event,3109namespaces = [],3110cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;31113112if ( type.indexOf( "!" ) >= 0 ) {3113// Exclusive events trigger only for the exact event (no namespaces)3114type = type.slice(0, -1);3115exclusive = true;3116}31173118if ( type.indexOf( "." ) >= 0 ) {3119// Namespaced trigger; create a regexp to match event type in handle()3120namespaces = type.split(".");3121type = namespaces.shift();3122namespaces.sort();3123}31243125if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {3126// No jQuery handlers for this event type, and it can't have inline handlers3127return;3128}31293130// Caller can pass in an Event, Object, or just an event type string3131event = typeof event === "object" ?3132// jQuery.Event object3133event[ jQuery.expando ] ? event :3134// Object literal3135new jQuery.Event( type, event ) :3136// Just the event type (string)3137new jQuery.Event( type );31383139event.type = type;3140event.isTrigger = true;3141event.exclusive = exclusive;3142event.namespace = namespaces.join( "." );3143event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;3144ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";31453146// triggerHandler() and global events don't bubble or run the default action3147if ( onlyHandlers || !elem ) {3148event.preventDefault();3149}31503151// Handle a global trigger3152if ( !elem ) {31533154// TODO: Stop taunting the data cache; remove global events and always attach to document3155cache = jQuery.cache;3156for ( i in cache ) {3157if ( cache[ i ].events && cache[ i ].events[ type ] ) {3158jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );3159}3160}3161return;3162}31633164// Clean up the event in case it is being reused3165event.result = undefined;3166if ( !event.target ) {3167event.target = elem;3168}31693170// Clone any incoming data and prepend the event, creating the handler arg list3171data = data != null ? jQuery.makeArray( data ) : [];3172data.unshift( event );31733174// Allow special events to draw outside the lines3175special = jQuery.event.special[ type ] || {};3176if ( special.trigger && special.trigger.apply( elem, data ) === false ) {3177return;3178}31793180// Determine event propagation path in advance, per W3C events spec (#9951)3181// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)3182eventPath = [[ elem, special.bindType || type ]];3183if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {31843185bubbleType = special.delegateType || type;3186old = null;3187for ( cur = elem.parentNode; cur; cur = cur.parentNode ) {3188eventPath.push([ cur, bubbleType ]);3189old = cur;3190}31913192// Only add window if we got to document (e.g., not plain obj or detached DOM)3193if ( old && old === elem.ownerDocument ) {3194eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);3195}3196}31973198// Fire handlers on the event path3199for ( i = 0; i < eventPath.length; i++ ) {32003201cur = eventPath[i][0];3202event.type = eventPath[i][1];32033204handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );3205if ( handle ) {3206handle.apply( cur, data );3207}3208handle = ontype && cur[ ontype ];3209if ( handle && jQuery.acceptData( cur ) ) {3210handle.apply( cur, data );3211}32123213if ( event.isPropagationStopped() ) {3214break;3215}3216}3217event.type = type;32183219// If nobody prevented the default action, do it now3220if ( !event.isDefaultPrevented() ) {32213222if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&3223!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {32243225// Call a native DOM method on the target with the same name name as the event.3226// Can't use an .isFunction() check here because IE6/7 fails that test.3227// Don't do default actions on window, that's where global variables be (#6170)3228// IE<9 dies on focus/blur to hidden element (#1486)3229if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {32303231// Don't re-trigger an onFOO event when we call its FOO() method3232old = elem[ ontype ];32333234if ( old ) {3235elem[ ontype ] = null;3236}32373238// Prevent re-triggering of the same event, since we already bubbled it above3239jQuery.event.triggered = type;3240elem[ type ]();3241jQuery.event.triggered = undefined;32423243if ( old ) {3244elem[ ontype ] = old;3245}3246}3247}3248}32493250return event.result;3251},32523253dispatch: function( event ) {32543255// Make a writable jQuery.Event from the native event object3256event = jQuery.event.fix( event || window.event );32573258var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),3259delegateCount = handlers.delegateCount,3260args = [].slice.call( arguments, 0 ),3261run_all = !event.exclusive && !event.namespace,3262specialHandle = ( jQuery.event.special[ event.type ] || {} ).handle,3263handlerQueue = [],3264i, j, cur, ret, selMatch, matched, matches, handleObj, sel, hit, related;32653266// Use the fix-ed jQuery.Event rather than the (read-only) native event3267args[0] = event;3268event.delegateTarget = this;32693270// Determine handlers that should run if there are delegated events3271// Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861)3272if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {32733274for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {3275selMatch = {};3276matches = [];3277for ( i = 0; i < delegateCount; i++ ) {3278handleObj = handlers[ i ];3279sel = handleObj.selector;3280hit = selMatch[ sel ];32813282if ( handleObj.isPositional ) {3283// Since .is() does not work for positionals; see http://jsfiddle.net/eJ4yd/3/3284hit = ( hit || (selMatch[ sel ] = jQuery( sel )) ).index( cur ) >= 0;3285} else if ( hit === undefined ) {3286hit = selMatch[ sel ] = ( handleObj.quick ? quickIs( cur, handleObj.quick ) : jQuery( cur ).is( sel ) );3287}3288if ( hit ) {3289matches.push( handleObj );3290}3291}3292if ( matches.length ) {3293handlerQueue.push({ elem: cur, matches: matches });3294}3295}3296}32973298// Add the remaining (directly-bound) handlers3299if ( handlers.length > delegateCount ) {3300handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });3301}33023303// Run delegates first; they may want to stop propagation beneath us3304for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {3305matched = handlerQueue[ i ];3306event.currentTarget = matched.elem;33073308for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {3309handleObj = matched.matches[ j ];33103311// Triggered event must either 1) be non-exclusive and have no namespace, or3312// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).3313if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {33143315event.data = handleObj.data;3316event.handleObj = handleObj;33173318ret = ( specialHandle || handleObj.handler ).apply( matched.elem, args );33193320if ( ret !== undefined ) {3321event.result = ret;3322if ( ret === false ) {3323event.preventDefault();3324event.stopPropagation();3325}3326}3327}3328}3329}33303331return event.result;3332},33333334// Includes some event props shared by KeyEvent and MouseEvent3335// *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***3336props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),33373338fixHooks: {},33393340keyHooks: {3341props: "char charCode key keyCode".split(" "),3342filter: function( event, original ) {33433344// Add which for key events3345if ( event.which == null ) {3346event.which = original.charCode != null ? original.charCode : original.keyCode;3347}33483349return event;3350}3351},33523353mouseHooks: {3354props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement wheelDelta".split(" "),3355filter: function( event, original ) {3356var eventDoc, doc, body,3357button = original.button,3358fromElement = original.fromElement;33593360// Calculate pageX/Y if missing and clientX/Y available3361if ( event.pageX == null && original.clientX != null ) {3362eventDoc = event.target.ownerDocument || document;3363doc = eventDoc.documentElement;3364body = eventDoc.body;33653366event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );3367event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );3368}33693370// Add relatedTarget, if necessary3371if ( !event.relatedTarget && fromElement ) {3372event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;3373}33743375// Add which for click: 1 === left; 2 === middle; 3 === right3376// Note: button is not normalized, so don't use it3377if ( !event.which && button !== undefined ) {3378event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );3379}33803381return event;3382}3383},33843385fix: function( event ) {3386if ( event[ jQuery.expando ] ) {3387return event;3388}33893390// Create a writable copy of the event object and normalize some properties3391var i, prop,3392originalEvent = event,3393fixHook = jQuery.event.fixHooks[ event.type ] || {},3394copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;33953396event = jQuery.Event( originalEvent );33973398for ( i = copy.length; i; ) {3399prop = copy[ --i ];3400event[ prop ] = originalEvent[ prop ];3401}34023403// Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)3404if ( !event.target ) {3405event.target = originalEvent.srcElement || document;3406}34073408// Target should not be a text node (#504, Safari)3409if ( event.target.nodeType === 3 ) {3410event.target = event.target.parentNode;3411}34123413// For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)3414if ( event.metaKey === undefined ) {3415event.metaKey = event.ctrlKey;3416}34173418return fixHook.filter? fixHook.filter( event, originalEvent ) : event;3419},34203421special: {3422ready: {3423// Make sure the ready event is setup3424setup: jQuery.bindReady3425},34263427focus: {3428delegateType: "focusin",3429noBubble: true3430},3431blur: {3432delegateType: "focusout",3433noBubble: true3434},34353436beforeunload: {3437setup: function( data, namespaces, eventHandle ) {3438// We only want to do this special case on windows3439if ( jQuery.isWindow( this ) ) {3440this.onbeforeunload = eventHandle;3441}3442},34433444teardown: function( namespaces, eventHandle ) {3445if ( this.onbeforeunload === eventHandle ) {3446this.onbeforeunload = null;3447}3448}3449}3450},34513452simulate: function( type, elem, event, bubble ) {3453// Piggyback on a donor event to simulate a different one.3454// Fake originalEvent to avoid donor's stopPropagation, but if the3455// simulated event prevents default then we do the same on the donor.3456var e = jQuery.extend(3457new jQuery.Event(),3458event,3459{ type: type,3460isSimulated: true,3461originalEvent: {}3462}3463);3464if ( bubble ) {3465jQuery.event.trigger( e, null, elem );3466} else {3467jQuery.event.dispatch.call( elem, e );3468}3469if ( e.isDefaultPrevented() ) {3470event.preventDefault();3471}3472}3473};34743475// Some plugins are using, but it's undocumented/deprecated and will be removed.3476// The 1.7 special event interface should provide all the hooks needed now.3477jQuery.event.handle = jQuery.event.dispatch;34783479jQuery.removeEvent = document.removeEventListener ?3480function( elem, type, handle ) {3481if ( elem.removeEventListener ) {3482elem.removeEventListener( type, handle, false );3483}3484} :3485function( elem, type, handle ) {3486if ( elem.detachEvent ) {3487elem.detachEvent( "on" + type, handle );3488}3489};34903491jQuery.Event = function( src, props ) {3492// Allow instantiation without the 'new' keyword3493if ( !(this instanceof jQuery.Event) ) {3494return new jQuery.Event( src, props );3495}34963497// Event object3498if ( src && src.type ) {3499this.originalEvent = src;3500this.type = src.type;35013502// Events bubbling up the document may have been marked as prevented3503// by a handler lower down the tree; reflect the correct value.3504this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||3505src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;35063507// Event type3508} else {3509this.type = src;3510}35113512// Put explicitly provided properties onto the event object3513if ( props ) {3514jQuery.extend( this, props );3515}35163517// Create a timestamp if incoming event doesn't have one3518this.timeStamp = src && src.timeStamp || jQuery.now();35193520// Mark it as fixed3521this[ jQuery.expando ] = true;3522};35233524function returnFalse() {3525return false;3526}3527function returnTrue() {3528return true;3529}35303531// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding3532// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html3533jQuery.Event.prototype = {3534preventDefault: function() {3535this.isDefaultPrevented = returnTrue;35363537var e = this.originalEvent;3538if ( !e ) {3539return;3540}35413542// if preventDefault exists run it on the original event3543if ( e.preventDefault ) {3544e.preventDefault();35453546// otherwise set the returnValue property of the original event to false (IE)3547} else {3548e.returnValue = false;3549}3550},3551stopPropagation: function() {3552this.isPropagationStopped = returnTrue;35533554var e = this.originalEvent;3555if ( !e ) {3556return;3557}3558// if stopPropagation exists run it on the original event3559if ( e.stopPropagation ) {3560e.stopPropagation();3561}3562// otherwise set the cancelBubble property of the original event to true (IE)3563e.cancelBubble = true;3564},3565stopImmediatePropagation: function() {3566this.isImmediatePropagationStopped = returnTrue;3567this.stopPropagation();3568},3569isDefaultPrevented: returnFalse,3570isPropagationStopped: returnFalse,3571isImmediatePropagationStopped: returnFalse3572};35733574// Create mouseenter/leave events using mouseover/out and event-time checks3575jQuery.each({3576mouseenter: "mouseover",3577mouseleave: "mouseout"3578}, function( orig, fix ) {3579jQuery.event.special[ orig ] = jQuery.event.special[ fix ] = {3580delegateType: fix,3581bindType: fix,35823583handle: function( event ) {3584var target = this,3585related = event.relatedTarget,3586handleObj = event.handleObj,3587selector = handleObj.selector,3588oldType, ret;35893590// For a real mouseover/out, always call the handler; for3591// mousenter/leave call the handler if related is outside the target.3592// NB: No relatedTarget if the mouse left/entered the browser window3593if ( !related || handleObj.origType === event.type || (related !== target && !jQuery.contains( target, related )) ) {3594oldType = event.type;3595event.type = handleObj.origType;3596ret = handleObj.handler.apply( this, arguments );3597event.type = oldType;3598}3599return ret;3600}3601};3602});36033604// IE submit delegation3605if ( !jQuery.support.submitBubbles ) {36063607jQuery.event.special.submit = {3608setup: function() {3609// Only need this for delegated form submit events3610if ( jQuery.nodeName( this, "form" ) ) {3611return false;3612}36133614// Lazy-add a submit handler when a descendant form may potentially be submitted3615jQuery.event.add( this, "click._submit keypress._submit", function( e ) {3616// Node name check avoids a VML-related crash in IE (#9807)3617var elem = e.target,3618form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;3619if ( form && !form._submit_attached ) {3620jQuery.event.add( form, "submit._submit", function( event ) {3621// Form was submitted, bubble the event up the tree3622if ( this.parentNode ) {3623jQuery.event.simulate( "submit", this.parentNode, event, true );3624}3625});3626form._submit_attached = true;3627}3628});3629// return undefined since we don't need an event listener3630},36313632teardown: function() {3633// Only need this for delegated form submit events3634if ( jQuery.nodeName( this, "form" ) ) {3635return false;3636}36373638// Remove delegated handlers; cleanData eventually reaps submit handlers attached above3639jQuery.event.remove( this, "._submit" );3640}3641};3642}36433644// IE change delegation and checkbox/radio fix3645if ( !jQuery.support.changeBubbles ) {36463647jQuery.event.special.change = {36483649setup: function() {36503651if ( rformElems.test( this.nodeName ) ) {3652// IE doesn't fire change on a check/radio until blur; trigger it on click3653// after a propertychange. Eat the blur-change in special.change.handle.3654// This still fires onchange a second time for check/radio after blur.3655if ( this.type === "checkbox" || this.type === "radio" ) {3656jQuery.event.add( this, "propertychange._change", function( event ) {3657if ( event.originalEvent.propertyName === "checked" ) {3658this._just_changed = true;3659}3660});3661jQuery.event.add( this, "click._change", function( event ) {3662if ( this._just_changed ) {3663this._just_changed = false;3664jQuery.event.simulate( "change", this, event, true );3665}3666});3667}3668return false;3669}3670// Delegated event; lazy-add a change handler on descendant inputs3671jQuery.event.add( this, "beforeactivate._change", function( e ) {3672var elem = e.target;36733674if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {3675jQuery.event.add( elem, "change._change", function( event ) {3676if ( this.parentNode && !event.isSimulated ) {3677jQuery.event.simulate( "change", this.parentNode, event, true );3678}3679});3680elem._change_attached = true;3681}3682});3683},36843685handle: function( event ) {3686var elem = event.target;36873688// Swallow native change events from checkbox/radio, we already triggered them above3689if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {3690return event.handleObj.handler.apply( this, arguments );3691}3692},36933694teardown: function() {3695jQuery.event.remove( this, "._change" );36963697return rformElems.test( this.nodeName );3698}3699};3700}37013702// Create "bubbling" focus and blur events3703if ( !jQuery.support.focusinBubbles ) {3704jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {37053706// Attach a single capturing handler while someone wants focusin/focusout3707var attaches = 0,3708handler = function( event ) {3709jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );3710};37113712jQuery.event.special[ fix ] = {3713setup: function() {3714if ( attaches++ === 0 ) {3715document.addEventListener( orig, handler, true );3716}3717},3718teardown: function() {3719if ( --attaches === 0 ) {3720document.removeEventListener( orig, handler, true );3721}3722}3723};3724});3725}37263727jQuery.fn.extend({37283729on: function( types, selector, data, fn, /*INTERNAL*/ one ) {3730var origFn, type;37313732// Types can be a map of types/handlers3733if ( typeof types === "object" ) {3734// ( types-Object, selector, data )3735if ( typeof selector !== "string" ) {3736// ( types-Object, data )3737data = selector;3738selector = undefined;3739}3740for ( type in types ) {3741this.on( type, selector, data, types[ type ], one );3742}3743return this;3744}37453746if ( data == null && fn == null ) {3747// ( types, fn )3748fn = selector;3749data = selector = undefined;3750} else if ( fn == null ) {3751if ( typeof selector === "string" ) {3752// ( types, selector, fn )3753fn = data;3754data = undefined;3755} else {3756// ( types, data, fn )3757fn = data;3758data = selector;3759selector = undefined;3760}3761}3762if ( fn === false ) {3763fn = returnFalse;3764} else if ( !fn ) {3765return this;3766}37673768if ( one === 1 ) {3769origFn = fn;3770fn = function( event ) {3771// Can use an empty set, since event contains the info3772jQuery().off( event );3773return origFn.apply( this, arguments );3774};3775// Use same guid so caller can remove using origFn3776fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );3777}3778return this.each( function() {3779jQuery.event.add( this, types, fn, data, selector );3780});3781},3782one: function( types, selector, data, fn ) {3783return this.on.call( this, types, selector, data, fn, 1 );3784},3785off: function( types, selector, fn ) {3786if ( types && types.preventDefault && types.handleObj ) {3787// ( event ) dispatched jQuery.Event3788var handleObj = types.handleObj;3789jQuery( types.delegateTarget ).off(3790handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type,3791handleObj.selector,3792handleObj.handler3793);3794return this;3795}3796if ( typeof types === "object" ) {3797// ( types-object [, selector] )3798for ( var type in types ) {3799this.off( type, selector, types[ type ] );3800}3801return this;3802}3803if ( selector === false || typeof selector === "function" ) {3804// ( types [, fn] )3805fn = selector;3806selector = undefined;3807}3808if ( fn === false ) {3809fn = returnFalse;3810}3811return this.each(function() {3812jQuery.event.remove( this, types, fn, selector );3813});3814},38153816bind: function( types, data, fn ) {3817return this.on( types, null, data, fn );3818},3819unbind: function( types, fn ) {3820return this.off( types, null, fn );3821},38223823live: function( types, data, fn ) {3824jQuery( this.context ).on( types, this.selector, data, fn );3825return this;3826},3827die: function( types, fn ) {3828jQuery( this.context ).off( types, this.selector || "**", fn );3829return this;3830},38313832delegate: function( selector, types, data, fn ) {3833return this.on( types, selector, data, fn );3834},3835undelegate: function( selector, types, fn ) {3836// ( namespace ) or ( selector, types [, fn] )3837return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );3838},38393840trigger: function( type, data ) {3841return this.each(function() {3842jQuery.event.trigger( type, data, this );3843});3844},3845triggerHandler: function( type, data ) {3846if ( this[0] ) {3847return jQuery.event.trigger( type, data, this[0], true );3848}3849},38503851toggle: function( fn ) {3852// Save reference to arguments for access in closure3853var args = arguments,3854guid = fn.guid || jQuery.guid++,3855i = 0,3856toggler = function( event ) {3857// Figure out which function to execute3858var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;3859jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );38603861// Make sure that clicks stop3862event.preventDefault();38633864// and execute the function3865return args[ lastToggle ].apply( this, arguments ) || false;3866};38673868// link all the functions, so any of them can unbind this click handler3869toggler.guid = guid;3870while ( i < args.length ) {3871args[ i++ ].guid = guid;3872}38733874return this.click( toggler );3875},38763877hover: function( fnOver, fnOut ) {3878return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );3879}3880});38813882jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +3883"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +3884"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {38853886// Handle event binding3887jQuery.fn[ name ] = function( data, fn ) {3888if ( fn == null ) {3889fn = data;3890data = null;3891}38923893return arguments.length > 0 ?3894this.bind( name, data, fn ) :3895this.trigger( name );3896};38973898if ( jQuery.attrFn ) {3899jQuery.attrFn[ name ] = true;3900}39013902if ( rkeyEvent.test( name ) ) {3903jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;3904}39053906if ( rmouseEvent.test( name ) ) {3907jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;3908}3909});3910391139123913/*!3914* Sizzle CSS Selector Engine3915* Copyright 2011, The Dojo Foundation3916* Released under the MIT, BSD, and GPL Licenses.3917* More information: http://sizzlejs.com/3918*/3919(function(){39203921var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,3922expando = "sizcache" + (Math.random() + '').replace('.', ''),3923done = 0,3924toString = Object.prototype.toString,3925hasDuplicate = false,3926baseHasDuplicate = true,3927rBackslash = /\\/g,3928rReturn = /\r\n/g,3929rNonWord = /\W/;39303931// Here we check if the JavaScript engine is using some sort of3932// optimization where it does not always call our comparision3933// function. If that is the case, discard the hasDuplicate value.3934// Thus far that includes Google Chrome.3935[0, 0].sort(function() {3936baseHasDuplicate = false;3937return 0;3938});39393940var Sizzle = function( selector, context, results, seed ) {3941results = results || [];3942context = context || document;39433944var origContext = context;39453946if ( context.nodeType !== 1 && context.nodeType !== 9 ) {3947return [];3948}39493950if ( !selector || typeof selector !== "string" ) {3951return results;3952}39533954var m, set, checkSet, extra, ret, cur, pop, i,3955prune = true,3956contextXML = Sizzle.isXML( context ),3957parts = [],3958soFar = selector;39593960// Reset the position of the chunker regexp (start from head)3961do {3962chunker.exec( "" );3963m = chunker.exec( soFar );39643965if ( m ) {3966soFar = m[3];39673968parts.push( m[1] );39693970if ( m[2] ) {3971extra = m[3];3972break;3973}3974}3975} while ( m );39763977if ( parts.length > 1 && origPOS.exec( selector ) ) {39783979if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {3980set = posProcess( parts[0] + parts[1], context, seed );39813982} else {3983set = Expr.relative[ parts[0] ] ?3984[ context ] :3985Sizzle( parts.shift(), context );39863987while ( parts.length ) {3988selector = parts.shift();39893990if ( Expr.relative[ selector ] ) {3991selector += parts.shift();3992}39933994set = posProcess( selector, set, seed );3995}3996}39973998} else {3999// Take a shortcut and set the context if the root selector is an ID4000// (but not if it'll be faster if the inner selector is an ID)4001if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&4002Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {40034004ret = Sizzle.find( parts.shift(), context, contextXML );4005context = ret.expr ?4006Sizzle.filter( ret.expr, ret.set )[0] :4007ret.set[0];4008}40094010if ( context ) {4011ret = seed ?4012{ expr: parts.pop(), set: makeArray(seed) } :4013Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );40144015set = ret.expr ?4016Sizzle.filter( ret.expr, ret.set ) :4017ret.set;40184019if ( parts.length > 0 ) {4020checkSet = makeArray( set );40214022} else {4023prune = false;4024}40254026while ( parts.length ) {4027cur = parts.pop();4028pop = cur;40294030if ( !Expr.relative[ cur ] ) {4031cur = "";4032} else {4033pop = parts.pop();4034}40354036if ( pop == null ) {4037pop = context;4038}40394040Expr.relative[ cur ]( checkSet, pop, contextXML );4041}40424043} else {4044checkSet = parts = [];4045}4046}40474048if ( !checkSet ) {4049checkSet = set;4050}40514052if ( !checkSet ) {4053Sizzle.error( cur || selector );4054}40554056if ( toString.call(checkSet) === "[object Array]" ) {4057if ( !prune ) {4058results.push.apply( results, checkSet );40594060} else if ( context && context.nodeType === 1 ) {4061for ( i = 0; checkSet[i] != null; i++ ) {4062if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {4063results.push( set[i] );4064}4065}40664067} else {4068for ( i = 0; checkSet[i] != null; i++ ) {4069if ( checkSet[i] && checkSet[i].nodeType === 1 ) {4070results.push( set[i] );4071}4072}4073}40744075} else {4076makeArray( checkSet, results );4077}40784079if ( extra ) {4080Sizzle( extra, origContext, results, seed );4081Sizzle.uniqueSort( results );4082}40834084return results;4085};40864087Sizzle.uniqueSort = function( results ) {4088if ( sortOrder ) {4089hasDuplicate = baseHasDuplicate;4090results.sort( sortOrder );40914092if ( hasDuplicate ) {4093for ( var i = 1; i < results.length; i++ ) {4094if ( results[i] === results[ i - 1 ] ) {4095results.splice( i--, 1 );4096}4097}4098}4099}41004101return results;4102};41034104Sizzle.matches = function( expr, set ) {4105return Sizzle( expr, null, null, set );4106};41074108Sizzle.matchesSelector = function( node, expr ) {4109return Sizzle( expr, null, null, [node] ).length > 0;4110};41114112Sizzle.find = function( expr, context, isXML ) {4113var set, i, len, match, type, left;41144115if ( !expr ) {4116return [];4117}41184119for ( i = 0, len = Expr.order.length; i < len; i++ ) {4120type = Expr.order[i];41214122if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {4123left = match[1];4124match.splice( 1, 1 );41254126if ( left.substr( left.length - 1 ) !== "\\" ) {4127match[1] = (match[1] || "").replace( rBackslash, "" );4128set = Expr.find[ type ]( match, context, isXML );41294130if ( set != null ) {4131expr = expr.replace( Expr.match[ type ], "" );4132break;4133}4134}4135}4136}41374138if ( !set ) {4139set = typeof context.getElementsByTagName !== "undefined" ?4140context.getElementsByTagName( "*" ) :4141[];4142}41434144return { set: set, expr: expr };4145};41464147Sizzle.filter = function( expr, set, inplace, not ) {4148var match, anyFound,4149type, found, item, filter, left,4150i, pass,4151old = expr,4152result = [],4153curLoop = set,4154isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );41554156while ( expr && set.length ) {4157for ( type in Expr.filter ) {4158if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {4159filter = Expr.filter[ type ];4160left = match[1];41614162anyFound = false;41634164match.splice(1,1);41654166if ( left.substr( left.length - 1 ) === "\\" ) {4167continue;4168}41694170if ( curLoop === result ) {4171result = [];4172}41734174if ( Expr.preFilter[ type ] ) {4175match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );41764177if ( !match ) {4178anyFound = found = true;41794180} else if ( match === true ) {4181continue;4182}4183}41844185if ( match ) {4186for ( i = 0; (item = curLoop[i]) != null; i++ ) {4187if ( item ) {4188found = filter( item, match, i, curLoop );4189pass = not ^ found;41904191if ( inplace && found != null ) {4192if ( pass ) {4193anyFound = true;41944195} else {4196curLoop[i] = false;4197}41984199} else if ( pass ) {4200result.push( item );4201anyFound = true;4202}4203}4204}4205}42064207if ( found !== undefined ) {4208if ( !inplace ) {4209curLoop = result;4210}42114212expr = expr.replace( Expr.match[ type ], "" );42134214if ( !anyFound ) {4215return [];4216}42174218break;4219}4220}4221}42224223// Improper expression4224if ( expr === old ) {4225if ( anyFound == null ) {4226Sizzle.error( expr );42274228} else {4229break;4230}4231}42324233old = expr;4234}42354236return curLoop;4237};42384239Sizzle.error = function( msg ) {4240throw "Syntax error, unrecognized expression: " + msg;4241};42424243/**4244* Utility function for retreiving the text value of an array of DOM nodes4245* @param {Array|Element} elem4246*/4247var getText = Sizzle.getText = function( elem ) {4248var i, node,4249nodeType = elem.nodeType,4250ret = "";42514252if ( nodeType ) {4253if ( nodeType === 1 ) {4254// Use textContent || innerText for elements4255if ( typeof elem.textContent === 'string' ) {4256return elem.textContent;4257} else if ( typeof elem.innerText === 'string' ) {4258// Replace IE's carriage returns4259return elem.innerText.replace( rReturn, '' );4260} else {4261// Traverse it's children4262for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {4263ret += getText( elem );4264}4265}4266} else if ( nodeType === 3 || nodeType === 4 ) {4267return elem.nodeValue;4268}4269} else {42704271// If no nodeType, this is expected to be an array4272for ( i = 0; (node = elem[i]); i++ ) {4273// Do not traverse comment nodes4274if ( node.nodeType !== 8 ) {4275ret += getText( node );4276}4277}4278}4279return ret;4280};42814282var Expr = Sizzle.selectors = {4283order: [ "ID", "NAME", "TAG" ],42844285match: {4286ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,4287CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,4288NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,4289ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,4290TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,4291CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,4292POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,4293PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/4294},42954296leftMatch: {},42974298attrMap: {4299"class": "className",4300"for": "htmlFor"4301},43024303attrHandle: {4304href: function( elem ) {4305return elem.getAttribute( "href" );4306},4307type: function( elem ) {4308return elem.getAttribute( "type" );4309}4310},43114312relative: {4313"+": function(checkSet, part){4314var isPartStr = typeof part === "string",4315isTag = isPartStr && !rNonWord.test( part ),4316isPartStrNotTag = isPartStr && !isTag;43174318if ( isTag ) {4319part = part.toLowerCase();4320}43214322for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {4323if ( (elem = checkSet[i]) ) {4324while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}43254326checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?4327elem || false :4328elem === part;4329}4330}43314332if ( isPartStrNotTag ) {4333Sizzle.filter( part, checkSet, true );4334}4335},43364337">": function( checkSet, part ) {4338var elem,4339isPartStr = typeof part === "string",4340i = 0,4341l = checkSet.length;43424343if ( isPartStr && !rNonWord.test( part ) ) {4344part = part.toLowerCase();43454346for ( ; i < l; i++ ) {4347elem = checkSet[i];43484349if ( elem ) {4350var parent = elem.parentNode;4351checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;4352}4353}43544355} else {4356for ( ; i < l; i++ ) {4357elem = checkSet[i];43584359if ( elem ) {4360checkSet[i] = isPartStr ?4361elem.parentNode :4362elem.parentNode === part;4363}4364}43654366if ( isPartStr ) {4367Sizzle.filter( part, checkSet, true );4368}4369}4370},43714372"": function(checkSet, part, isXML){4373var nodeCheck,4374doneName = done++,4375checkFn = dirCheck;43764377if ( typeof part === "string" && !rNonWord.test( part ) ) {4378part = part.toLowerCase();4379nodeCheck = part;4380checkFn = dirNodeCheck;4381}43824383checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );4384},43854386"~": function( checkSet, part, isXML ) {4387var nodeCheck,4388doneName = done++,4389checkFn = dirCheck;43904391if ( typeof part === "string" && !rNonWord.test( part ) ) {4392part = part.toLowerCase();4393nodeCheck = part;4394checkFn = dirNodeCheck;4395}43964397checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );4398}4399},44004401find: {4402ID: function( match, context, isXML ) {4403if ( typeof context.getElementById !== "undefined" && !isXML ) {4404var m = context.getElementById(match[1]);4405// Check parentNode to catch when Blackberry 4.6 returns4406// nodes that are no longer in the document #69634407return m && m.parentNode ? [m] : [];4408}4409},44104411NAME: function( match, context ) {4412if ( typeof context.getElementsByName !== "undefined" ) {4413var ret = [],4414results = context.getElementsByName( match[1] );44154416for ( var i = 0, l = results.length; i < l; i++ ) {4417if ( results[i].getAttribute("name") === match[1] ) {4418ret.push( results[i] );4419}4420}44214422return ret.length === 0 ? null : ret;4423}4424},44254426TAG: function( match, context ) {4427if ( typeof context.getElementsByTagName !== "undefined" ) {4428return context.getElementsByTagName( match[1] );4429}4430}4431},4432preFilter: {4433CLASS: function( match, curLoop, inplace, result, not, isXML ) {4434match = " " + match[1].replace( rBackslash, "" ) + " ";44354436if ( isXML ) {4437return match;4438}44394440for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {4441if ( elem ) {4442if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {4443if ( !inplace ) {4444result.push( elem );4445}44464447} else if ( inplace ) {4448curLoop[i] = false;4449}4450}4451}44524453return false;4454},44554456ID: function( match ) {4457return match[1].replace( rBackslash, "" );4458},44594460TAG: function( match, curLoop ) {4461return match[1].replace( rBackslash, "" ).toLowerCase();4462},44634464CHILD: function( match ) {4465if ( match[1] === "nth" ) {4466if ( !match[2] ) {4467Sizzle.error( match[0] );4468}44694470match[2] = match[2].replace(/^\+|\s*/g, '');44714472// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'4473var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(4474match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||4475!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);44764477// calculate the numbers (first)n+(last) including if they are negative4478match[2] = (test[1] + (test[2] || 1)) - 0;4479match[3] = test[3] - 0;4480}4481else if ( match[2] ) {4482Sizzle.error( match[0] );4483}44844485// TODO: Move to normal caching system4486match[0] = done++;44874488return match;4489},44904491ATTR: function( match, curLoop, inplace, result, not, isXML ) {4492var name = match[1] = match[1].replace( rBackslash, "" );44934494if ( !isXML && Expr.attrMap[name] ) {4495match[1] = Expr.attrMap[name];4496}44974498// Handle if an un-quoted value was used4499match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );45004501if ( match[2] === "~=" ) {4502match[4] = " " + match[4] + " ";4503}45044505return match;4506},45074508PSEUDO: function( match, curLoop, inplace, result, not ) {4509if ( match[1] === "not" ) {4510// If we're dealing with a complex expression, or a simple one4511if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {4512match[3] = Sizzle(match[3], null, null, curLoop);45134514} else {4515var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);45164517if ( !inplace ) {4518result.push.apply( result, ret );4519}45204521return false;4522}45234524} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {4525return true;4526}45274528return match;4529},45304531POS: function( match ) {4532match.unshift( true );45334534return match;4535}4536},45374538filters: {4539enabled: function( elem ) {4540return elem.disabled === false && elem.type !== "hidden";4541},45424543disabled: function( elem ) {4544return elem.disabled === true;4545},45464547checked: function( elem ) {4548return elem.checked === true;4549},45504551selected: function( elem ) {4552// Accessing this property makes selected-by-default4553// options in Safari work properly4554if ( elem.parentNode ) {4555elem.parentNode.selectedIndex;4556}45574558return elem.selected === true;4559},45604561parent: function( elem ) {4562return !!elem.firstChild;4563},45644565empty: function( elem ) {4566return !elem.firstChild;4567},45684569has: function( elem, i, match ) {4570return !!Sizzle( match[3], elem ).length;4571},45724573header: function( elem ) {4574return (/h\d/i).test( elem.nodeName );4575},45764577text: function( elem ) {4578var attr = elem.getAttribute( "type" ), type = elem.type;4579// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)4580// use getAttribute instead to test this case4581return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );4582},45834584radio: function( elem ) {4585return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;4586},45874588checkbox: function( elem ) {4589return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;4590},45914592file: function( elem ) {4593return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;4594},45954596password: function( elem ) {4597return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;4598},45994600submit: function( elem ) {4601var name = elem.nodeName.toLowerCase();4602return (name === "input" || name === "button") && "submit" === elem.type;4603},46044605image: function( elem ) {4606return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;4607},46084609reset: function( elem ) {4610var name = elem.nodeName.toLowerCase();4611return (name === "input" || name === "button") && "reset" === elem.type;4612},46134614button: function( elem ) {4615var name = elem.nodeName.toLowerCase();4616return name === "input" && "button" === elem.type || name === "button";4617},46184619input: function( elem ) {4620return (/input|select|textarea|button/i).test( elem.nodeName );4621},46224623focus: function( elem ) {4624return elem === elem.ownerDocument.activeElement;4625}4626},4627setFilters: {4628first: function( elem, i ) {4629return i === 0;4630},46314632last: function( elem, i, match, array ) {4633return i === array.length - 1;4634},46354636even: function( elem, i ) {4637return i % 2 === 0;4638},46394640odd: function( elem, i ) {4641return i % 2 === 1;4642},46434644lt: function( elem, i, match ) {4645return i < match[3] - 0;4646},46474648gt: function( elem, i, match ) {4649return i > match[3] - 0;4650},46514652nth: function( elem, i, match ) {4653return match[3] - 0 === i;4654},46554656eq: function( elem, i, match ) {4657return match[3] - 0 === i;4658}4659},4660filter: {4661PSEUDO: function( elem, match, i, array ) {4662var name = match[1],4663filter = Expr.filters[ name ];46644665if ( filter ) {4666return filter( elem, i, match, array );46674668} else if ( name === "contains" ) {4669return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;46704671} else if ( name === "not" ) {4672var not = match[3];46734674for ( var j = 0, l = not.length; j < l; j++ ) {4675if ( not[j] === elem ) {4676return false;4677}4678}46794680return true;46814682} else {4683Sizzle.error( name );4684}4685},46864687CHILD: function( elem, match ) {4688var first, last,4689doneName, parent, cache,4690count, diff,4691type = match[1],4692node = elem;46934694switch ( type ) {4695case "only":4696case "first":4697while ( (node = node.previousSibling) ) {4698if ( node.nodeType === 1 ) {4699return false;4700}4701}47024703if ( type === "first" ) {4704return true;4705}47064707node = elem;47084709case "last":4710while ( (node = node.nextSibling) ) {4711if ( node.nodeType === 1 ) {4712return false;4713}4714}47154716return true;47174718case "nth":4719first = match[2];4720last = match[3];47214722if ( first === 1 && last === 0 ) {4723return true;4724}47254726doneName = match[0];4727parent = elem.parentNode;47284729if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {4730count = 0;47314732for ( node = parent.firstChild; node; node = node.nextSibling ) {4733if ( node.nodeType === 1 ) {4734node.nodeIndex = ++count;4735}4736}47374738parent[ expando ] = doneName;4739}47404741diff = elem.nodeIndex - last;47424743if ( first === 0 ) {4744return diff === 0;47454746} else {4747return ( diff % first === 0 && diff / first >= 0 );4748}4749}4750},47514752ID: function( elem, match ) {4753return elem.nodeType === 1 && elem.getAttribute("id") === match;4754},47554756TAG: function( elem, match ) {4757return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;4758},47594760CLASS: function( elem, match ) {4761return (" " + (elem.className || elem.getAttribute("class")) + " ")4762.indexOf( match ) > -1;4763},47644765ATTR: function( elem, match ) {4766var name = match[1],4767result = Sizzle.attr ?4768Sizzle.attr( elem, name ) :4769Expr.attrHandle[ name ] ?4770Expr.attrHandle[ name ]( elem ) :4771elem[ name ] != null ?4772elem[ name ] :4773elem.getAttribute( name ),4774value = result + "",4775type = match[2],4776check = match[4];47774778return result == null ?4779type === "!=" :4780!type && Sizzle.attr ?4781result != null :4782type === "=" ?4783value === check :4784type === "*=" ?4785value.indexOf(check) >= 0 :4786type === "~=" ?4787(" " + value + " ").indexOf(check) >= 0 :4788!check ?4789value && result !== false :4790type === "!=" ?4791value !== check :4792type === "^=" ?4793value.indexOf(check) === 0 :4794type === "$=" ?4795value.substr(value.length - check.length) === check :4796type === "|=" ?4797value === check || value.substr(0, check.length + 1) === check + "-" :4798false;4799},48004801POS: function( elem, match, i, array ) {4802var name = match[2],4803filter = Expr.setFilters[ name ];48044805if ( filter ) {4806return filter( elem, i, match, array );4807}4808}4809}4810};48114812var origPOS = Expr.match.POS,4813fescape = function(all, num){4814return "\\" + (num - 0 + 1);4815};48164817for ( var type in Expr.match ) {4818Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );4819Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );4820}48214822var makeArray = function( array, results ) {4823array = Array.prototype.slice.call( array, 0 );48244825if ( results ) {4826results.push.apply( results, array );4827return results;4828}48294830return array;4831};48324833// Perform a simple check to determine if the browser is capable of4834// converting a NodeList to an array using builtin methods.4835// Also verifies that the returned array holds DOM nodes4836// (which is not the case in the Blackberry browser)4837try {4838Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;48394840// Provide a fallback method if it does not work4841} catch( e ) {4842makeArray = function( array, results ) {4843var i = 0,4844ret = results || [];48454846if ( toString.call(array) === "[object Array]" ) {4847Array.prototype.push.apply( ret, array );48484849} else {4850if ( typeof array.length === "number" ) {4851for ( var l = array.length; i < l; i++ ) {4852ret.push( array[i] );4853}48544855} else {4856for ( ; array[i]; i++ ) {4857ret.push( array[i] );4858}4859}4860}48614862return ret;4863};4864}48654866var sortOrder, siblingCheck;48674868if ( document.documentElement.compareDocumentPosition ) {4869sortOrder = function( a, b ) {4870if ( a === b ) {4871hasDuplicate = true;4872return 0;4873}48744875if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {4876return a.compareDocumentPosition ? -1 : 1;4877}48784879return a.compareDocumentPosition(b) & 4 ? -1 : 1;4880};48814882} else {4883sortOrder = function( a, b ) {4884// The nodes are identical, we can exit early4885if ( a === b ) {4886hasDuplicate = true;4887return 0;48884889// Fallback to using sourceIndex (in IE) if it's available on both nodes4890} else if ( a.sourceIndex && b.sourceIndex ) {4891return a.sourceIndex - b.sourceIndex;4892}48934894var al, bl,4895ap = [],4896bp = [],4897aup = a.parentNode,4898bup = b.parentNode,4899cur = aup;49004901// If the nodes are siblings (or identical) we can do a quick check4902if ( aup === bup ) {4903return siblingCheck( a, b );49044905// If no parents were found then the nodes are disconnected4906} else if ( !aup ) {4907return -1;49084909} else if ( !bup ) {4910return 1;4911}49124913// Otherwise they're somewhere else in the tree so we need4914// to build up a full list of the parentNodes for comparison4915while ( cur ) {4916ap.unshift( cur );4917cur = cur.parentNode;4918}49194920cur = bup;49214922while ( cur ) {4923bp.unshift( cur );4924cur = cur.parentNode;4925}49264927al = ap.length;4928bl = bp.length;49294930// Start walking down the tree looking for a discrepancy4931for ( var i = 0; i < al && i < bl; i++ ) {4932if ( ap[i] !== bp[i] ) {4933return siblingCheck( ap[i], bp[i] );4934}4935}49364937// We ended someplace up the tree so do a sibling check4938return i === al ?4939siblingCheck( a, bp[i], -1 ) :4940siblingCheck( ap[i], b, 1 );4941};49424943siblingCheck = function( a, b, ret ) {4944if ( a === b ) {4945return ret;4946}49474948var cur = a.nextSibling;49494950while ( cur ) {4951if ( cur === b ) {4952return -1;4953}49544955cur = cur.nextSibling;4956}49574958return 1;4959};4960}49614962// Check to see if the browser returns elements by name when4963// querying by getElementById (and provide a workaround)4964(function(){4965// We're going to inject a fake input element with a specified name4966var form = document.createElement("div"),4967id = "script" + (new Date()).getTime(),4968root = document.documentElement;49694970form.innerHTML = "<a name='" + id + "'/>";49714972// Inject it into the root element, check its status, and remove it quickly4973root.insertBefore( form, root.firstChild );49744975// The workaround has to do additional checks after a getElementById4976// Which slows things down for other browsers (hence the branching)4977if ( document.getElementById( id ) ) {4978Expr.find.ID = function( match, context, isXML ) {4979if ( typeof context.getElementById !== "undefined" && !isXML ) {4980var m = context.getElementById(match[1]);49814982return m ?4983m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?4984[m] :4985undefined :4986[];4987}4988};49894990Expr.filter.ID = function( elem, match ) {4991var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");49924993return elem.nodeType === 1 && node && node.nodeValue === match;4994};4995}49964997root.removeChild( form );49984999// release memory in IE5000root = form = null;5001})();50025003(function(){5004// Check to see if the browser returns only elements5005// when doing getElementsByTagName("*")50065007// Create a fake element5008var div = document.createElement("div");5009div.appendChild( document.createComment("") );50105011// Make sure no comments are found5012if ( div.getElementsByTagName("*").length > 0 ) {5013Expr.find.TAG = function( match, context ) {5014var results = context.getElementsByTagName( match[1] );50155016// Filter out possible comments5017if ( match[1] === "*" ) {5018var tmp = [];50195020for ( var i = 0; results[i]; i++ ) {5021if ( results[i].nodeType === 1 ) {5022tmp.push( results[i] );5023}5024}50255026results = tmp;5027}50285029return results;5030};5031}50325033// Check to see if an attribute returns normalized href attributes5034div.innerHTML = "<a href='#'></a>";50355036if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&5037div.firstChild.getAttribute("href") !== "#" ) {50385039Expr.attrHandle.href = function( elem ) {5040return elem.getAttribute( "href", 2 );5041};5042}50435044// release memory in IE5045div = null;5046})();50475048if ( document.querySelectorAll ) {5049(function(){5050var oldSizzle = Sizzle,5051div = document.createElement("div"),5052id = "__sizzle__";50535054div.innerHTML = "<p class='TEST'></p>";50555056// Safari can't handle uppercase or unicode characters when5057// in quirks mode.5058if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {5059return;5060}50615062Sizzle = function( query, context, extra, seed ) {5063context = context || document;50645065// Only use querySelectorAll on non-XML documents5066// (ID selectors don't work in non-HTML documents)5067if ( !seed && !Sizzle.isXML(context) ) {5068// See if we find a selector to speed up5069var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );50705071if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {5072// Speed-up: Sizzle("TAG")5073if ( match[1] ) {5074return makeArray( context.getElementsByTagName( query ), extra );50755076// Speed-up: Sizzle(".CLASS")5077} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {5078return makeArray( context.getElementsByClassName( match[2] ), extra );5079}5080}50815082if ( context.nodeType === 9 ) {5083// Speed-up: Sizzle("body")5084// The body element only exists once, optimize finding it5085if ( query === "body" && context.body ) {5086return makeArray( [ context.body ], extra );50875088// Speed-up: Sizzle("#ID")5089} else if ( match && match[3] ) {5090var elem = context.getElementById( match[3] );50915092// Check parentNode to catch when Blackberry 4.6 returns5093// nodes that are no longer in the document #69635094if ( elem && elem.parentNode ) {5095// Handle the case where IE and Opera return items5096// by name instead of ID5097if ( elem.id === match[3] ) {5098return makeArray( [ elem ], extra );5099}51005101} else {5102return makeArray( [], extra );5103}5104}51055106try {5107return makeArray( context.querySelectorAll(query), extra );5108} catch(qsaError) {}51095110// qSA works strangely on Element-rooted queries5111// We can work around this by specifying an extra ID on the root5112// and working up from there (Thanks to Andrew Dupont for the technique)5113// IE 8 doesn't work on object elements5114} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {5115var oldContext = context,5116old = context.getAttribute( "id" ),5117nid = old || id,5118hasParent = context.parentNode,5119relativeHierarchySelector = /^\s*[+~]/.test( query );51205121if ( !old ) {5122context.setAttribute( "id", nid );5123} else {5124nid = nid.replace( /'/g, "\\$&" );5125}5126if ( relativeHierarchySelector && hasParent ) {5127context = context.parentNode;5128}51295130try {5131if ( !relativeHierarchySelector || hasParent ) {5132return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );5133}51345135} catch(pseudoError) {5136} finally {5137if ( !old ) {5138oldContext.removeAttribute( "id" );5139}5140}5141}5142}51435144return oldSizzle(query, context, extra, seed);5145};51465147for ( var prop in oldSizzle ) {5148Sizzle[ prop ] = oldSizzle[ prop ];5149}51505151// release memory in IE5152div = null;5153})();5154}51555156(function(){5157var html = document.documentElement,5158matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;51595160if ( matches ) {5161// Check to see if it's possible to do matchesSelector5162// on a disconnected node (IE 9 fails this)5163var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),5164pseudoWorks = false;51655166try {5167// This should fail with an exception5168// Gecko does not error, returns false instead5169matches.call( document.documentElement, "[test!='']:sizzle" );51705171} catch( pseudoError ) {5172pseudoWorks = true;5173}51745175Sizzle.matchesSelector = function( node, expr ) {5176// Make sure that attribute selectors are quoted5177expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");51785179if ( !Sizzle.isXML( node ) ) {5180try {5181if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {5182var ret = matches.call( node, expr );51835184// IE 9's matchesSelector returns false on disconnected nodes5185if ( ret || !disconnectedMatch ||5186// As well, disconnected nodes are said to be in a document5187// fragment in IE 9, so check for that5188node.document && node.document.nodeType !== 11 ) {5189return ret;5190}5191}5192} catch(e) {}5193}51945195return Sizzle(expr, null, null, [node]).length > 0;5196};5197}5198})();51995200(function(){5201var div = document.createElement("div");52025203div.innerHTML = "<div class='test e'></div><div class='test'></div>";52045205// Opera can't find a second classname (in 9.6)5206// Also, make sure that getElementsByClassName actually exists5207if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {5208return;5209}52105211// Safari caches class attributes, doesn't catch changes (in 3.2)5212div.lastChild.className = "e";52135214if ( div.getElementsByClassName("e").length === 1 ) {5215return;5216}52175218Expr.order.splice(1, 0, "CLASS");5219Expr.find.CLASS = function( match, context, isXML ) {5220if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {5221return context.getElementsByClassName(match[1]);5222}5223};52245225// release memory in IE5226div = null;5227})();52285229function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {5230for ( var i = 0, l = checkSet.length; i < l; i++ ) {5231var elem = checkSet[i];52325233if ( elem ) {5234var match = false;52355236elem = elem[dir];52375238while ( elem ) {5239if ( elem[ expando ] === doneName ) {5240match = checkSet[elem.sizset];5241break;5242}52435244if ( elem.nodeType === 1 && !isXML ){5245elem[ expando ] = doneName;5246elem.sizset = i;5247}52485249if ( elem.nodeName.toLowerCase() === cur ) {5250match = elem;5251break;5252}52535254elem = elem[dir];5255}52565257checkSet[i] = match;5258}5259}5260}52615262function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {5263for ( var i = 0, l = checkSet.length; i < l; i++ ) {5264var elem = checkSet[i];52655266if ( elem ) {5267var match = false;52685269elem = elem[dir];52705271while ( elem ) {5272if ( elem[ expando ] === doneName ) {5273match = checkSet[elem.sizset];5274break;5275}52765277if ( elem.nodeType === 1 ) {5278if ( !isXML ) {5279elem[ expando ] = doneName;5280elem.sizset = i;5281}52825283if ( typeof cur !== "string" ) {5284if ( elem === cur ) {5285match = true;5286break;5287}52885289} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {5290match = elem;5291break;5292}5293}52945295elem = elem[dir];5296}52975298checkSet[i] = match;5299}5300}5301}53025303if ( document.documentElement.contains ) {5304Sizzle.contains = function( a, b ) {5305return a !== b && (a.contains ? a.contains(b) : true);5306};53075308} else if ( document.documentElement.compareDocumentPosition ) {5309Sizzle.contains = function( a, b ) {5310return !!(a.compareDocumentPosition(b) & 16);5311};53125313} else {5314Sizzle.contains = function() {5315return false;5316};5317}53185319Sizzle.isXML = function( elem ) {5320// documentElement is verified for cases where it doesn't yet exist5321// (such as loading iframes in IE - #4833)5322var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;53235324return documentElement ? documentElement.nodeName !== "HTML" : false;5325};53265327var posProcess = function( selector, context, seed ) {5328var match,5329tmpSet = [],5330later = "",5331root = context.nodeType ? [context] : context;53325333// Position selectors must be done after the filter5334// And so must :not(positional) so we move all PSEUDOs to the end5335while ( (match = Expr.match.PSEUDO.exec( selector )) ) {5336later += match[0];5337selector = selector.replace( Expr.match.PSEUDO, "" );5338}53395340selector = Expr.relative[selector] ? selector + "*" : selector;53415342for ( var i = 0, l = root.length; i < l; i++ ) {5343Sizzle( selector, root[i], tmpSet, seed );5344}53455346return Sizzle.filter( later, tmpSet );5347};53485349// EXPOSE5350// Override sizzle attribute retrieval5351Sizzle.attr = jQuery.attr;5352Sizzle.selectors.attrMap = {};5353jQuery.find = Sizzle;5354jQuery.expr = Sizzle.selectors;5355jQuery.expr[":"] = jQuery.expr.filters;5356jQuery.unique = Sizzle.uniqueSort;5357jQuery.text = Sizzle.getText;5358jQuery.isXMLDoc = Sizzle.isXML;5359jQuery.contains = Sizzle.contains;536053615362})();536353645365var runtil = /Until$/,5366rparentsprev = /^(?:parents|prevUntil|prevAll)/,5367// Note: This RegExp should be improved, or likely pulled from Sizzle5368rmultiselector = /,/,5369isSimple = /^.[^:#\[\.,]*$/,5370slice = Array.prototype.slice,5371POS = jQuery.expr.match.POS,5372// methods guaranteed to produce a unique set when starting from a unique set5373guaranteedUnique = {5374children: true,5375contents: true,5376next: true,5377prev: true5378};53795380jQuery.fn.extend({5381find: function( selector ) {5382var self = this,5383i, l;53845385if ( typeof selector !== "string" ) {5386return jQuery( selector ).filter(function() {5387for ( i = 0, l = self.length; i < l; i++ ) {5388if ( jQuery.contains( self[ i ], this ) ) {5389return true;5390}5391}5392});5393}53945395var ret = this.pushStack( "", "find", selector ),5396length, n, r;53975398for ( i = 0, l = this.length; i < l; i++ ) {5399length = ret.length;5400jQuery.find( selector, this[i], ret );54015402if ( i > 0 ) {5403// Make sure that the results are unique5404for ( n = length; n < ret.length; n++ ) {5405for ( r = 0; r < length; r++ ) {5406if ( ret[r] === ret[n] ) {5407ret.splice(n--, 1);5408break;5409}5410}5411}5412}5413}54145415return ret;5416},54175418has: function( target ) {5419var targets = jQuery( target );5420return this.filter(function() {5421for ( var i = 0, l = targets.length; i < l; i++ ) {5422if ( jQuery.contains( this, targets[i] ) ) {5423return true;5424}5425}5426});5427},54285429not: function( selector ) {5430return this.pushStack( winnow(this, selector, false), "not", selector);5431},54325433filter: function( selector ) {5434return this.pushStack( winnow(this, selector, true), "filter", selector );5435},54365437is: function( selector ) {5438return !!selector && (5439typeof selector === "string" ?5440// If this is a positional selector, check membership in the returned set5441// so $("p:first").is("p:last") won't return true for a doc with two "p".5442POS.test( selector ) ?5443jQuery( selector, this.context ).index( this[0] ) >= 0 :5444jQuery.filter( selector, this ).length > 0 :5445this.filter( selector ).length > 0 );5446},54475448closest: function( selectors, context ) {5449var ret = [], i, l, cur = this[0];54505451// Array (deprecated as of jQuery 1.7)5452if ( jQuery.isArray( selectors ) ) {5453var level = 1;54545455while ( cur && cur.ownerDocument && cur !== context ) {5456for ( i = 0; i < selectors.length; i++ ) {54575458if ( jQuery( cur ).is( selectors[ i ] ) ) {5459ret.push({ selector: selectors[ i ], elem: cur, level: level });5460}5461}54625463cur = cur.parentNode;5464level++;5465}54665467return ret;5468}54695470// String5471var pos = POS.test( selectors ) || typeof selectors !== "string" ?5472jQuery( selectors, context || this.context ) :54730;54745475for ( i = 0, l = this.length; i < l; i++ ) {5476cur = this[i];54775478while ( cur ) {5479if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {5480ret.push( cur );5481break;54825483} else {5484cur = cur.parentNode;5485if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {5486break;5487}5488}5489}5490}54915492ret = ret.length > 1 ? jQuery.unique( ret ) : ret;54935494return this.pushStack( ret, "closest", selectors );5495},54965497// Determine the position of an element within5498// the matched set of elements5499index: function( elem ) {55005501// No argument, return index in parent5502if ( !elem ) {5503return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;5504}55055506// index in selector5507if ( typeof elem === "string" ) {5508return jQuery.inArray( this[0], jQuery( elem ) );5509}55105511// Locate the position of the desired element5512return jQuery.inArray(5513// If it receives a jQuery object, the first element is used5514elem.jquery ? elem[0] : elem, this );5515},55165517add: function( selector, context ) {5518var set = typeof selector === "string" ?5519jQuery( selector, context ) :5520jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),5521all = jQuery.merge( this.get(), set );55225523return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?5524all :5525jQuery.unique( all ) );5526},55275528andSelf: function() {5529return this.add( this.prevObject );5530}5531});55325533// A painfully simple check to see if an element is disconnected5534// from a document (should be improved, where feasible).5535function isDisconnected( node ) {5536return !node || !node.parentNode || node.parentNode.nodeType === 11;5537}55385539jQuery.each({5540parent: function( elem ) {5541var parent = elem.parentNode;5542return parent && parent.nodeType !== 11 ? parent : null;5543},5544parents: function( elem ) {5545return jQuery.dir( elem, "parentNode" );5546},5547parentsUntil: function( elem, i, until ) {5548return jQuery.dir( elem, "parentNode", until );5549},5550next: function( elem ) {5551return jQuery.nth( elem, 2, "nextSibling" );5552},5553prev: function( elem ) {5554return jQuery.nth( elem, 2, "previousSibling" );5555},5556nextAll: function( elem ) {5557return jQuery.dir( elem, "nextSibling" );5558},5559prevAll: function( elem ) {5560return jQuery.dir( elem, "previousSibling" );5561},5562nextUntil: function( elem, i, until ) {5563return jQuery.dir( elem, "nextSibling", until );5564},5565prevUntil: function( elem, i, until ) {5566return jQuery.dir( elem, "previousSibling", until );5567},5568siblings: function( elem ) {5569return jQuery.sibling( elem.parentNode.firstChild, elem );5570},5571children: function( elem ) {5572return jQuery.sibling( elem.firstChild );5573},5574contents: function( elem ) {5575return jQuery.nodeName( elem, "iframe" ) ?5576elem.contentDocument || elem.contentWindow.document :5577jQuery.makeArray( elem.childNodes );5578}5579}, function( name, fn ) {5580jQuery.fn[ name ] = function( until, selector ) {5581var ret = jQuery.map( this, fn, until ),5582// The variable 'args' was introduced in5583// https://github.com/jquery/jquery/commit/52a02385584// to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.5585// http://code.google.com/p/v8/issues/detail?id=10505586args = slice.call(arguments);55875588if ( !runtil.test( name ) ) {5589selector = until;5590}55915592if ( selector && typeof selector === "string" ) {5593ret = jQuery.filter( selector, ret );5594}55955596ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;55975598if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {5599ret = ret.reverse();5600}56015602return this.pushStack( ret, name, args.join(",") );5603};5604});56055606jQuery.extend({5607filter: function( expr, elems, not ) {5608if ( not ) {5609expr = ":not(" + expr + ")";5610}56115612return elems.length === 1 ?5613jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :5614jQuery.find.matches(expr, elems);5615},56165617dir: function( elem, dir, until ) {5618var matched = [],5619cur = elem[ dir ];56205621while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {5622if ( cur.nodeType === 1 ) {5623matched.push( cur );5624}5625cur = cur[dir];5626}5627return matched;5628},56295630nth: function( cur, result, dir, elem ) {5631result = result || 1;5632var num = 0;56335634for ( ; cur; cur = cur[dir] ) {5635if ( cur.nodeType === 1 && ++num === result ) {5636break;5637}5638}56395640return cur;5641},56425643sibling: function( n, elem ) {5644var r = [];56455646for ( ; n; n = n.nextSibling ) {5647if ( n.nodeType === 1 && n !== elem ) {5648r.push( n );5649}5650}56515652return r;5653}5654});56555656// Implement the identical functionality for filter and not5657function winnow( elements, qualifier, keep ) {56585659// Can't pass null or undefined to indexOf in Firefox 45660// Set to 0 to skip string check5661qualifier = qualifier || 0;56625663if ( jQuery.isFunction( qualifier ) ) {5664return jQuery.grep(elements, function( elem, i ) {5665var retVal = !!qualifier.call( elem, i, elem );5666return retVal === keep;5667});56685669} else if ( qualifier.nodeType ) {5670return jQuery.grep(elements, function( elem, i ) {5671return ( elem === qualifier ) === keep;5672});56735674} else if ( typeof qualifier === "string" ) {5675var filtered = jQuery.grep(elements, function( elem ) {5676return elem.nodeType === 1;5677});56785679if ( isSimple.test( qualifier ) ) {5680return jQuery.filter(qualifier, filtered, !keep);5681} else {5682qualifier = jQuery.filter( qualifier, filtered );5683}5684}56855686return jQuery.grep(elements, function( elem, i ) {5687return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;5688});5689}56905691569256935694function createSafeFragment( document ) {5695var list = nodeNames.split( " " ),5696safeFrag = document.createDocumentFragment();56975698if ( safeFrag.createElement ) {5699while ( list.length ) {5700safeFrag.createElement(5701list.pop()5702);5703}5704}5705return safeFrag;5706}57075708var nodeNames = "abbr article aside audio canvas datalist details figcaption figure footer " +5709"header hgroup mark meter nav output progress section summary time video",5710rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,5711rleadingWhitespace = /^\s+/,5712rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,5713rtagName = /<([\w:]+)/,5714rtbody = /<tbody/i,5715rhtml = /<|&#?\w+;/,5716rnoInnerhtml = /<(?:script|style)/i,5717rnocache = /<(?:script|object|embed|option|style)/i,5718rnoshimcache = new RegExp("<(?:" + nodeNames.replace(" ", "|") + ")", "i"),5719// checked="checked" or checked5720rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,5721rscriptType = /\/(java|ecma)script/i,5722rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,5723wrapMap = {5724option: [ 1, "<select multiple='multiple'>", "</select>" ],5725legend: [ 1, "<fieldset>", "</fieldset>" ],5726thead: [ 1, "<table>", "</table>" ],5727tr: [ 2, "<table><tbody>", "</tbody></table>" ],5728td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],5729col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],5730area: [ 1, "<map>", "</map>" ],5731_default: [ 0, "", "" ]5732},5733safeFragment = createSafeFragment( document );57345735wrapMap.optgroup = wrapMap.option;5736wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;5737wrapMap.th = wrapMap.td;57385739// IE can't serialize <link> and <script> tags normally5740if ( !jQuery.support.htmlSerialize ) {5741wrapMap._default = [ 1, "div<div>", "</div>" ];5742}57435744jQuery.fn.extend({5745text: function( text ) {5746if ( jQuery.isFunction(text) ) {5747return this.each(function(i) {5748var self = jQuery( this );57495750self.text( text.call(this, i, self.text()) );5751});5752}57535754if ( typeof text !== "object" && text !== undefined ) {5755return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );5756}57575758return jQuery.text( this );5759},57605761wrapAll: function( html ) {5762if ( jQuery.isFunction( html ) ) {5763return this.each(function(i) {5764jQuery(this).wrapAll( html.call(this, i) );5765});5766}57675768if ( this[0] ) {5769// The elements to wrap the target around5770var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);57715772if ( this[0].parentNode ) {5773wrap.insertBefore( this[0] );5774}57755776wrap.map(function() {5777var elem = this;57785779while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {5780elem = elem.firstChild;5781}57825783return elem;5784}).append( this );5785}57865787return this;5788},57895790wrapInner: function( html ) {5791if ( jQuery.isFunction( html ) ) {5792return this.each(function(i) {5793jQuery(this).wrapInner( html.call(this, i) );5794});5795}57965797return this.each(function() {5798var self = jQuery( this ),5799contents = self.contents();58005801if ( contents.length ) {5802contents.wrapAll( html );58035804} else {5805self.append( html );5806}5807});5808},58095810wrap: function( html ) {5811return this.each(function() {5812jQuery( this ).wrapAll( html );5813});5814},58155816unwrap: function() {5817return this.parent().each(function() {5818if ( !jQuery.nodeName( this, "body" ) ) {5819jQuery( this ).replaceWith( this.childNodes );5820}5821}).end();5822},58235824append: function() {5825return this.domManip(arguments, true, function( elem ) {5826if ( this.nodeType === 1 ) {5827this.appendChild( elem );5828}5829});5830},58315832prepend: function() {5833return this.domManip(arguments, true, function( elem ) {5834if ( this.nodeType === 1 ) {5835this.insertBefore( elem, this.firstChild );5836}5837});5838},58395840before: function() {5841if ( this[0] && this[0].parentNode ) {5842return this.domManip(arguments, false, function( elem ) {5843this.parentNode.insertBefore( elem, this );5844});5845} else if ( arguments.length ) {5846var set = jQuery(arguments[0]);5847set.push.apply( set, this.toArray() );5848return this.pushStack( set, "before", arguments );5849}5850},58515852after: function() {5853if ( this[0] && this[0].parentNode ) {5854return this.domManip(arguments, false, function( elem ) {5855this.parentNode.insertBefore( elem, this.nextSibling );5856});5857} else if ( arguments.length ) {5858var set = this.pushStack( this, "after", arguments );5859set.push.apply( set, jQuery(arguments[0]).toArray() );5860return set;5861}5862},58635864// keepData is for internal use only--do not document5865remove: function( selector, keepData ) {5866for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {5867if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {5868if ( !keepData && elem.nodeType === 1 ) {5869jQuery.cleanData( elem.getElementsByTagName("*") );5870jQuery.cleanData( [ elem ] );5871}58725873if ( elem.parentNode ) {5874elem.parentNode.removeChild( elem );5875}5876}5877}58785879return this;5880},58815882empty: function() {5883for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {5884// Remove element nodes and prevent memory leaks5885if ( elem.nodeType === 1 ) {5886jQuery.cleanData( elem.getElementsByTagName("*") );5887}58885889// Remove any remaining nodes5890while ( elem.firstChild ) {5891elem.removeChild( elem.firstChild );5892}5893}58945895return this;5896},58975898clone: function( dataAndEvents, deepDataAndEvents ) {5899dataAndEvents = dataAndEvents == null ? false : dataAndEvents;5900deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;59015902return this.map( function () {5903return jQuery.clone( this, dataAndEvents, deepDataAndEvents );5904});5905},59065907html: function( value ) {5908if ( value === undefined ) {5909return this[0] && this[0].nodeType === 1 ?5910this[0].innerHTML.replace(rinlinejQuery, "") :5911null;59125913// See if we can take a shortcut and just use innerHTML5914} else if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&5915(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&5916!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {59175918value = value.replace(rxhtmlTag, "<$1></$2>");59195920try {5921for ( var i = 0, l = this.length; i < l; i++ ) {5922// Remove element nodes and prevent memory leaks5923if ( this[i].nodeType === 1 ) {5924jQuery.cleanData( this[i].getElementsByTagName("*") );5925this[i].innerHTML = value;5926}5927}59285929// If using innerHTML throws an exception, use the fallback method5930} catch(e) {5931this.empty().append( value );5932}59335934} else if ( jQuery.isFunction( value ) ) {5935this.each(function(i){5936var self = jQuery( this );59375938self.html( value.call(this, i, self.html()) );5939});59405941} else {5942this.empty().append( value );5943}59445945return this;5946},59475948replaceWith: function( value ) {5949if ( this[0] && this[0].parentNode ) {5950// Make sure that the elements are removed from the DOM before they are inserted5951// this can help fix replacing a parent with child elements5952if ( jQuery.isFunction( value ) ) {5953return this.each(function(i) {5954var self = jQuery(this), old = self.html();5955self.replaceWith( value.call( this, i, old ) );5956});5957}59585959if ( typeof value !== "string" ) {5960value = jQuery( value ).detach();5961}59625963return this.each(function() {5964var next = this.nextSibling,5965parent = this.parentNode;59665967jQuery( this ).remove();59685969if ( next ) {5970jQuery(next).before( value );5971} else {5972jQuery(parent).append( value );5973}5974});5975} else {5976return this.length ?5977this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :5978this;5979}5980},59815982detach: function( selector ) {5983return this.remove( selector, true );5984},59855986domManip: function( args, table, callback ) {5987var results, first, fragment, parent,5988value = args[0],5989scripts = [];59905991// We can't cloneNode fragments that contain checked, in WebKit5992if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {5993return this.each(function() {5994jQuery(this).domManip( args, table, callback, true );5995});5996}59975998if ( jQuery.isFunction(value) ) {5999return this.each(function(i) {6000var self = jQuery(this);6001args[0] = value.call(this, i, table ? self.html() : undefined);6002self.domManip( args, table, callback );6003});6004}60056006if ( this[0] ) {6007parent = value && value.parentNode;60086009// If we're in a fragment, just use that instead of building a new one6010if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {6011results = { fragment: parent };60126013} else {6014results = jQuery.buildFragment( args, this, scripts );6015}60166017fragment = results.fragment;60186019if ( fragment.childNodes.length === 1 ) {6020first = fragment = fragment.firstChild;6021} else {6022first = fragment.firstChild;6023}60246025if ( first ) {6026table = table && jQuery.nodeName( first, "tr" );60276028for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {6029callback.call(6030table ?6031root(this[i], first) :6032this[i],6033// Make sure that we do not leak memory by inadvertently discarding6034// the original fragment (which might have attached data) instead of6035// using it; in addition, use the original fragment object for the last6036// item instead of first because it can end up being emptied incorrectly6037// in certain situations (Bug #8070).6038// Fragments from the fragment cache must always be cloned and never used6039// in place.6040results.cacheable || ( l > 1 && i < lastIndex ) ?6041jQuery.clone( fragment, true, true ) :6042fragment6043);6044}6045}60466047if ( scripts.length ) {6048jQuery.each( scripts, evalScript );6049}6050}60516052return this;6053}6054});60556056function root( elem, cur ) {6057return jQuery.nodeName(elem, "table") ?6058(elem.getElementsByTagName("tbody")[0] ||6059elem.appendChild(elem.ownerDocument.createElement("tbody"))) :6060elem;6061}60626063function cloneCopyEvent( src, dest ) {60646065if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {6066return;6067}60686069var type, i, l,6070oldData = jQuery._data( src ),6071curData = jQuery._data( dest, oldData ),6072events = oldData.events;60736074if ( events ) {6075delete curData.handle;6076curData.events = {};60776078for ( type in events ) {6079for ( i = 0, l = events[ type ].length; i < l; i++ ) {6080jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );6081}6082}6083}60846085// make the cloned public data object a copy from the original6086if ( curData.data ) {6087curData.data = jQuery.extend( {}, curData.data );6088}6089}60906091function cloneFixAttributes( src, dest ) {6092var nodeName;60936094// We do not need to do anything for non-Elements6095if ( dest.nodeType !== 1 ) {6096return;6097}60986099// clearAttributes removes the attributes, which we don't want,6100// but also removes the attachEvent events, which we *do* want6101if ( dest.clearAttributes ) {6102dest.clearAttributes();6103}61046105// mergeAttributes, in contrast, only merges back on the6106// original attributes, not the events6107if ( dest.mergeAttributes ) {6108dest.mergeAttributes( src );6109}61106111nodeName = dest.nodeName.toLowerCase();61126113// IE6-8 fail to clone children inside object elements that use6114// the proprietary classid attribute value (rather than the type6115// attribute) to identify the type of content to display6116if ( nodeName === "object" ) {6117dest.outerHTML = src.outerHTML;61186119} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {6120// IE6-8 fails to persist the checked state of a cloned checkbox6121// or radio button. Worse, IE6-7 fail to give the cloned element6122// a checked appearance if the defaultChecked value isn't also set6123if ( src.checked ) {6124dest.defaultChecked = dest.checked = src.checked;6125}61266127// IE6-7 get confused and end up setting the value of a cloned6128// checkbox/radio button to an empty string instead of "on"6129if ( dest.value !== src.value ) {6130dest.value = src.value;6131}61326133// IE6-8 fails to return the selected option to the default selected6134// state when cloning options6135} else if ( nodeName === "option" ) {6136dest.selected = src.defaultSelected;61376138// IE6-8 fails to set the defaultValue to the correct value when6139// cloning other types of input fields6140} else if ( nodeName === "input" || nodeName === "textarea" ) {6141dest.defaultValue = src.defaultValue;6142}61436144// Event data gets referenced instead of copied if the expando6145// gets copied too6146dest.removeAttribute( jQuery.expando );6147}61486149jQuery.buildFragment = function( args, nodes, scripts ) {6150var fragment, cacheable, cacheresults, doc,6151first = args[ 0 ];61526153// nodes may contain either an explicit document object,6154// a jQuery collection or context object.6155// If nodes[0] contains a valid object to assign to doc6156if ( nodes && nodes[0] ) {6157doc = nodes[0].ownerDocument || nodes[0];6158}61596160// Ensure that an attr object doesn't incorrectly stand in as a document object6161// Chrome and Firefox seem to allow this to occur and will throw exception6162// Fixes #89506163if ( !doc.createDocumentFragment ) {6164doc = document;6165}61666167// Only cache "small" (1/2 KB) HTML strings that are associated with the main document6168// Cloning options loses the selected state, so don't cache them6169// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment6170// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache6171// Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #105016172if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&6173first.charAt(0) === "<" && !rnocache.test( first ) &&6174(jQuery.support.checkClone || !rchecked.test( first )) &&6175(!jQuery.support.unknownElems && rnoshimcache.test( first )) ) {61766177cacheable = true;61786179cacheresults = jQuery.fragments[ first ];6180if ( cacheresults && cacheresults !== 1 ) {6181fragment = cacheresults;6182}6183}61846185if ( !fragment ) {6186fragment = doc.createDocumentFragment();6187jQuery.clean( args, doc, fragment, scripts );6188}61896190if ( cacheable ) {6191jQuery.fragments[ first ] = cacheresults ? fragment : 1;6192}61936194return { fragment: fragment, cacheable: cacheable };6195};61966197jQuery.fragments = {};61986199jQuery.each({6200appendTo: "append",6201prependTo: "prepend",6202insertBefore: "before",6203insertAfter: "after",6204replaceAll: "replaceWith"6205}, function( name, original ) {6206jQuery.fn[ name ] = function( selector ) {6207var ret = [],6208insert = jQuery( selector ),6209parent = this.length === 1 && this[0].parentNode;62106211if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {6212insert[ original ]( this[0] );6213return this;62146215} else {6216for ( var i = 0, l = insert.length; i < l; i++ ) {6217var elems = ( i > 0 ? this.clone(true) : this ).get();6218jQuery( insert[i] )[ original ]( elems );6219ret = ret.concat( elems );6220}62216222return this.pushStack( ret, name, insert.selector );6223}6224};6225});62266227function getAll( elem ) {6228if ( typeof elem.getElementsByTagName !== "undefined" ) {6229return elem.getElementsByTagName( "*" );62306231} else if ( typeof elem.querySelectorAll !== "undefined" ) {6232return elem.querySelectorAll( "*" );62336234} else {6235return [];6236}6237}62386239// Used in clean, fixes the defaultChecked property6240function fixDefaultChecked( elem ) {6241if ( elem.type === "checkbox" || elem.type === "radio" ) {6242elem.defaultChecked = elem.checked;6243}6244}6245// Finds all inputs and passes them to fixDefaultChecked6246function findInputs( elem ) {6247var nodeName = ( elem.nodeName || "" ).toLowerCase();6248if ( nodeName === "input" ) {6249fixDefaultChecked( elem );6250// Skip scripts, get other children6251} else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {6252jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );6253}6254}62556256jQuery.extend({6257clone: function( elem, dataAndEvents, deepDataAndEvents ) {6258var clone = elem.cloneNode(true),6259srcElements,6260destElements,6261i;62626263if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&6264(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {6265// IE copies events bound via attachEvent when using cloneNode.6266// Calling detachEvent on the clone will also remove the events6267// from the original. In order to get around this, we use some6268// proprietary methods to clear the events. Thanks to MooTools6269// guys for this hotness.62706271cloneFixAttributes( elem, clone );62726273// Using Sizzle here is crazy slow, so we use getElementsByTagName6274// instead6275srcElements = getAll( elem );6276destElements = getAll( clone );62776278// Weird iteration because IE will replace the length property6279// with an element if you are cloning the body and one of the6280// elements on the page has a name or id of "length"6281for ( i = 0; srcElements[i]; ++i ) {6282// Ensure that the destination node is not null; Fixes #95876283if ( destElements[i] ) {6284cloneFixAttributes( srcElements[i], destElements[i] );6285}6286}6287}62886289// Copy the events from the original to the clone6290if ( dataAndEvents ) {6291cloneCopyEvent( elem, clone );62926293if ( deepDataAndEvents ) {6294srcElements = getAll( elem );6295destElements = getAll( clone );62966297for ( i = 0; srcElements[i]; ++i ) {6298cloneCopyEvent( srcElements[i], destElements[i] );6299}6300}6301}63026303srcElements = destElements = null;63046305// Return the cloned set6306return clone;6307},63086309clean: function( elems, context, fragment, scripts ) {6310var checkScriptType;63116312context = context || document;63136314// !context.createElement fails in IE with an error but returns typeof 'object'6315if ( typeof context.createElement === "undefined" ) {6316context = context.ownerDocument || context[0] && context[0].ownerDocument || document;6317}63186319var ret = [], j;63206321for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {6322if ( typeof elem === "number" ) {6323elem += "";6324}63256326if ( !elem ) {6327continue;6328}63296330// Convert html string into DOM nodes6331if ( typeof elem === "string" ) {6332if ( !rhtml.test( elem ) ) {6333elem = context.createTextNode( elem );6334} else {6335// Fix "XHTML"-style tags in all browsers6336elem = elem.replace(rxhtmlTag, "<$1></$2>");63376338// Trim whitespace, otherwise indexOf won't work as expected6339var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),6340wrap = wrapMap[ tag ] || wrapMap._default,6341depth = wrap[0],6342div = context.createElement("div");63436344// Append wrapper element to unknown element safe doc fragment6345if ( context === document ) {6346// Use the fragment we've already created for this document6347safeFragment.appendChild( div );6348} else {6349// Use a fragment created with the owner document6350createSafeFragment( context ).appendChild( div );6351}63526353// Go to html and back, then peel off extra wrappers6354div.innerHTML = wrap[1] + elem + wrap[2];63556356// Move to the right depth6357while ( depth-- ) {6358div = div.lastChild;6359}63606361// Remove IE's autoinserted <tbody> from table fragments6362if ( !jQuery.support.tbody ) {63636364// String was a <table>, *may* have spurious <tbody>6365var hasBody = rtbody.test(elem),6366tbody = tag === "table" && !hasBody ?6367div.firstChild && div.firstChild.childNodes :63686369// String was a bare <thead> or <tfoot>6370wrap[1] === "<table>" && !hasBody ?6371div.childNodes :6372[];63736374for ( j = tbody.length - 1; j >= 0 ; --j ) {6375if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {6376tbody[ j ].parentNode.removeChild( tbody[ j ] );6377}6378}6379}63806381// IE completely kills leading whitespace when innerHTML is used6382if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {6383div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );6384}63856386elem = div.childNodes;6387}6388}63896390// Resets defaultChecked for any radios and checkboxes6391// about to be appended to the DOM in IE 6/7 (#8060)6392var len;6393if ( !jQuery.support.appendChecked ) {6394if ( elem[0] && typeof (len = elem.length) === "number" ) {6395for ( j = 0; j < len; j++ ) {6396findInputs( elem[j] );6397}6398} else {6399findInputs( elem );6400}6401}64026403if ( elem.nodeType ) {6404ret.push( elem );6405} else {6406ret = jQuery.merge( ret, elem );6407}6408}64096410if ( fragment ) {6411checkScriptType = function( elem ) {6412return !elem.type || rscriptType.test( elem.type );6413};6414for ( i = 0; ret[i]; i++ ) {6415if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {6416scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );64176418} else {6419if ( ret[i].nodeType === 1 ) {6420var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );64216422ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );6423}6424fragment.appendChild( ret[i] );6425}6426}6427}64286429return ret;6430},64316432cleanData: function( elems ) {6433var data, id,6434cache = jQuery.cache,6435special = jQuery.event.special,6436deleteExpando = jQuery.support.deleteExpando;64376438for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {6439if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {6440continue;6441}64426443id = elem[ jQuery.expando ];64446445if ( id ) {6446data = cache[ id ];64476448if ( data && data.events ) {6449for ( var type in data.events ) {6450if ( special[ type ] ) {6451jQuery.event.remove( elem, type );64526453// This is a shortcut to avoid jQuery.event.remove's overhead6454} else {6455jQuery.removeEvent( elem, type, data.handle );6456}6457}64586459// Null the DOM reference to avoid IE6/7/8 leak (#7054)6460if ( data.handle ) {6461data.handle.elem = null;6462}6463}64646465if ( deleteExpando ) {6466delete elem[ jQuery.expando ];64676468} else if ( elem.removeAttribute ) {6469elem.removeAttribute( jQuery.expando );6470}64716472delete cache[ id ];6473}6474}6475}6476});64776478function evalScript( i, elem ) {6479if ( elem.src ) {6480jQuery.ajax({6481url: elem.src,6482async: false,6483dataType: "script"6484});6485} else {6486jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );6487}64886489if ( elem.parentNode ) {6490elem.parentNode.removeChild( elem );6491}6492}64936494649564966497var ralpha = /alpha\([^)]*\)/i,6498ropacity = /opacity=([^)]*)/,6499// fixed for IE9, see #83466500rupper = /([A-Z]|^ms)/g,6501rnumpx = /^-?\d+(?:px)?$/i,6502rnum = /^-?\d/,6503rrelNum = /^([\-+])=([\-+.\de]+)/,65046505cssShow = { position: "absolute", visibility: "hidden", display: "block" },6506cssWidth = [ "Left", "Right" ],6507cssHeight = [ "Top", "Bottom" ],6508curCSS,65096510getComputedStyle,6511currentStyle;65126513jQuery.fn.css = function( name, value ) {6514// Setting 'undefined' is a no-op6515if ( arguments.length === 2 && value === undefined ) {6516return this;6517}65186519return jQuery.access( this, name, value, true, function( elem, name, value ) {6520return value !== undefined ?6521jQuery.style( elem, name, value ) :6522jQuery.css( elem, name );6523});6524};65256526jQuery.extend({6527// Add in style property hooks for overriding the default6528// behavior of getting and setting a style property6529cssHooks: {6530opacity: {6531get: function( elem, computed ) {6532if ( computed ) {6533// We should always get a number back from opacity6534var ret = curCSS( elem, "opacity", "opacity" );6535return ret === "" ? "1" : ret;65366537} else {6538return elem.style.opacity;6539}6540}6541}6542},65436544// Exclude the following css properties to add px6545cssNumber: {6546"fillOpacity": true,6547"fontWeight": true,6548"lineHeight": true,6549"opacity": true,6550"orphans": true,6551"widows": true,6552"zIndex": true,6553"zoom": true6554},65556556// Add in properties whose names you wish to fix before6557// setting or getting the value6558cssProps: {6559// normalize float css property6560"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"6561},65626563// Get and set the style property on a DOM Node6564style: function( elem, name, value, extra ) {6565// Don't set styles on text and comment nodes6566if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {6567return;6568}65696570// Make sure that we're working with the right name6571var ret, type, origName = jQuery.camelCase( name ),6572style = elem.style, hooks = jQuery.cssHooks[ origName ];65736574name = jQuery.cssProps[ origName ] || origName;65756576// Check if we're setting a value6577if ( value !== undefined ) {6578type = typeof value;65796580// convert relative number strings (+= or -=) to relative numbers. #73456581if ( type === "string" && (ret = rrelNum.exec( value )) ) {6582value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );6583// Fixes bug #92376584type = "number";6585}65866587// Make sure that NaN and null values aren't set. See: #71166588if ( value == null || type === "number" && isNaN( value ) ) {6589return;6590}65916592// If a number was passed in, add 'px' to the (except for certain CSS properties)6593if ( type === "number" && !jQuery.cssNumber[ origName ] ) {6594value += "px";6595}65966597// If a hook was provided, use that value, otherwise just set the specified value6598if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {6599// Wrapped to prevent IE from throwing errors when 'invalid' values are provided6600// Fixes bug #55096601try {6602style[ name ] = value;6603} catch(e) {}6604}66056606} else {6607// If a hook was provided get the non-computed value from there6608if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {6609return ret;6610}66116612// Otherwise just get the value from the style object6613return style[ name ];6614}6615},66166617css: function( elem, name, extra ) {6618var ret, hooks;66196620// Make sure that we're working with the right name6621name = jQuery.camelCase( name );6622hooks = jQuery.cssHooks[ name ];6623name = jQuery.cssProps[ name ] || name;66246625// cssFloat needs a special treatment6626if ( name === "cssFloat" ) {6627name = "float";6628}66296630// If a hook was provided get the computed value from there6631if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {6632return ret;66336634// Otherwise, if a way to get the computed value exists, use that6635} else if ( curCSS ) {6636return curCSS( elem, name );6637}6638},66396640// A method for quickly swapping in/out CSS properties to get correct calculations6641swap: function( elem, options, callback ) {6642var old = {};66436644// Remember the old values, and insert the new ones6645for ( var name in options ) {6646old[ name ] = elem.style[ name ];6647elem.style[ name ] = options[ name ];6648}66496650callback.call( elem );66516652// Revert the old values6653for ( name in options ) {6654elem.style[ name ] = old[ name ];6655}6656}6657});66586659// DEPRECATED, Use jQuery.css() instead6660jQuery.curCSS = jQuery.css;66616662jQuery.each(["height", "width"], function( i, name ) {6663jQuery.cssHooks[ name ] = {6664get: function( elem, computed, extra ) {6665var val;66666667if ( computed ) {6668if ( elem.offsetWidth !== 0 ) {6669return getWH( elem, name, extra );6670} else {6671jQuery.swap( elem, cssShow, function() {6672val = getWH( elem, name, extra );6673});6674}66756676return val;6677}6678},66796680set: function( elem, value ) {6681if ( rnumpx.test( value ) ) {6682// ignore negative width and height values #15996683value = parseFloat( value );66846685if ( value >= 0 ) {6686return value + "px";6687}66886689} else {6690return value;6691}6692}6693};6694});66956696if ( !jQuery.support.opacity ) {6697jQuery.cssHooks.opacity = {6698get: function( elem, computed ) {6699// IE uses filters for opacity6700return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?6701( parseFloat( RegExp.$1 ) / 100 ) + "" :6702computed ? "1" : "";6703},67046705set: function( elem, value ) {6706var style = elem.style,6707currentStyle = elem.currentStyle,6708opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",6709filter = currentStyle && currentStyle.filter || style.filter || "";67106711// IE has trouble with opacity if it does not have layout6712// Force it by setting the zoom level6713style.zoom = 1;67146715// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #66526716if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {67176718// Setting style.filter to null, "" & " " still leave "filter:" in the cssText6719// if "filter:" is present at all, clearType is disabled, we want to avoid this6720// style.removeAttribute is IE Only, but so apparently is this code path...6721style.removeAttribute( "filter" );67226723// if there there is no filter style applied in a css rule, we are done6724if ( currentStyle && !currentStyle.filter ) {6725return;6726}6727}67286729// otherwise, set new filter values6730style.filter = ralpha.test( filter ) ?6731filter.replace( ralpha, opacity ) :6732filter + " " + opacity;6733}6734};6735}67366737jQuery(function() {6738// This hook cannot be added until DOM ready because the support test6739// for it is not run until after DOM ready6740if ( !jQuery.support.reliableMarginRight ) {6741jQuery.cssHooks.marginRight = {6742get: function( elem, computed ) {6743// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right6744// Work around by temporarily setting element display to inline-block6745var ret;6746jQuery.swap( elem, { "display": "inline-block" }, function() {6747if ( computed ) {6748ret = curCSS( elem, "margin-right", "marginRight" );6749} else {6750ret = elem.style.marginRight;6751}6752});6753return ret;6754}6755};6756}6757});67586759if ( document.defaultView && document.defaultView.getComputedStyle ) {6760getComputedStyle = function( elem, name ) {6761var ret, defaultView, computedStyle;67626763name = name.replace( rupper, "-$1" ).toLowerCase();67646765if ( !(defaultView = elem.ownerDocument.defaultView) ) {6766return undefined;6767}67686769if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {6770ret = computedStyle.getPropertyValue( name );6771if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {6772ret = jQuery.style( elem, name );6773}6774}67756776return ret;6777};6778}67796780if ( document.documentElement.currentStyle ) {6781currentStyle = function( elem, name ) {6782var left, rsLeft, uncomputed,6783ret = elem.currentStyle && elem.currentStyle[ name ],6784style = elem.style;67856786// Avoid setting ret to empty string here6787// so we don't default to auto6788if ( ret === null && style && (uncomputed = style[ name ]) ) {6789ret = uncomputed;6790}67916792// From the awesome hack by Dean Edwards6793// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-10229167946795// If we're not dealing with a regular pixel number6796// but a number that has a weird ending, we need to convert it to pixels6797if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {67986799// Remember the original values6800left = style.left;6801rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;68026803// Put in the new values to get a computed value out6804if ( rsLeft ) {6805elem.runtimeStyle.left = elem.currentStyle.left;6806}6807style.left = name === "fontSize" ? "1em" : ( ret || 0 );6808ret = style.pixelLeft + "px";68096810// Revert the changed values6811style.left = left;6812if ( rsLeft ) {6813elem.runtimeStyle.left = rsLeft;6814}6815}68166817return ret === "" ? "auto" : ret;6818};6819}68206821curCSS = getComputedStyle || currentStyle;68226823function getWH( elem, name, extra ) {68246825// Start with offset property6826var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,6827which = name === "width" ? cssWidth : cssHeight;68286829if ( val > 0 ) {6830if ( extra !== "border" ) {6831jQuery.each( which, function() {6832if ( !extra ) {6833val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;6834}6835if ( extra === "margin" ) {6836val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;6837} else {6838val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;6839}6840});6841}68426843return val + "px";6844}68456846// Fall back to computed then uncomputed css if necessary6847val = curCSS( elem, name, name );6848if ( val < 0 || val == null ) {6849val = elem.style[ name ] || 0;6850}6851// Normalize "", auto, and prepare for extra6852val = parseFloat( val ) || 0;68536854// Add padding, border, margin6855if ( extra ) {6856jQuery.each( which, function() {6857val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;6858if ( extra !== "padding" ) {6859val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;6860}6861if ( extra === "margin" ) {6862val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;6863}6864});6865}68666867return val + "px";6868}68696870if ( jQuery.expr && jQuery.expr.filters ) {6871jQuery.expr.filters.hidden = function( elem ) {6872var width = elem.offsetWidth,6873height = elem.offsetHeight;68746875return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");6876};68776878jQuery.expr.filters.visible = function( elem ) {6879return !jQuery.expr.filters.hidden( elem );6880};6881}68826883688468856886var r20 = /%20/g,6887rbracket = /\[\]$/,6888rCRLF = /\r?\n/g,6889rhash = /#.*$/,6890rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL6891rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,6892// #7653, #8125, #8152: local protocol detection6893rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,6894rnoContent = /^(?:GET|HEAD)$/,6895rprotocol = /^\/\//,6896rquery = /\?/,6897rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,6898rselectTextarea = /^(?:select|textarea)/i,6899rspacesAjax = /\s+/,6900rts = /([?&])_=[^&]*/,6901rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,69026903// Keep a copy of the old load method6904_load = jQuery.fn.load,69056906/* Prefilters6907* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)6908* 2) These are called:6909* - BEFORE asking for a transport6910* - AFTER param serialization (s.data is a string if s.processData is true)6911* 3) key is the dataType6912* 4) the catchall symbol "*" can be used6913* 5) execution will start with transport dataType and THEN continue down to "*" if needed6914*/6915prefilters = {},69166917/* Transports bindings6918* 1) key is the dataType6919* 2) the catchall symbol "*" can be used6920* 3) selection will start with transport dataType and THEN go to "*" if needed6921*/6922transports = {},69236924// Document location6925ajaxLocation,69266927// Document location segments6928ajaxLocParts,69296930// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression6931allTypes = ["*/"] + ["*"];69326933// #8138, IE may throw an exception when accessing6934// a field from window.location if document.domain has been set6935try {6936ajaxLocation = location.href;6937} catch( e ) {6938// Use the href attribute of an A element6939// since IE will modify it given document.location6940ajaxLocation = document.createElement( "a" );6941ajaxLocation.href = "";6942ajaxLocation = ajaxLocation.href;6943}69446945// Segment location into parts6946ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];69476948// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport6949function addToPrefiltersOrTransports( structure ) {69506951// dataTypeExpression is optional and defaults to "*"6952return function( dataTypeExpression, func ) {69536954if ( typeof dataTypeExpression !== "string" ) {6955func = dataTypeExpression;6956dataTypeExpression = "*";6957}69586959if ( jQuery.isFunction( func ) ) {6960var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),6961i = 0,6962length = dataTypes.length,6963dataType,6964list,6965placeBefore;69666967// For each dataType in the dataTypeExpression6968for ( ; i < length; i++ ) {6969dataType = dataTypes[ i ];6970// We control if we're asked to add before6971// any existing element6972placeBefore = /^\+/.test( dataType );6973if ( placeBefore ) {6974dataType = dataType.substr( 1 ) || "*";6975}6976list = structure[ dataType ] = structure[ dataType ] || [];6977// then we add to the structure accordingly6978list[ placeBefore ? "unshift" : "push" ]( func );6979}6980}6981};6982}69836984// Base inspection function for prefilters and transports6985function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,6986dataType /* internal */, inspected /* internal */ ) {69876988dataType = dataType || options.dataTypes[ 0 ];6989inspected = inspected || {};69906991inspected[ dataType ] = true;69926993var list = structure[ dataType ],6994i = 0,6995length = list ? list.length : 0,6996executeOnly = ( structure === prefilters ),6997selection;69986999for ( ; i < length && ( executeOnly || !selection ); i++ ) {7000selection = list[ i ]( options, originalOptions, jqXHR );7001// If we got redirected to another dataType7002// we try there if executing only and not done already7003if ( typeof selection === "string" ) {7004if ( !executeOnly || inspected[ selection ] ) {7005selection = undefined;7006} else {7007options.dataTypes.unshift( selection );7008selection = inspectPrefiltersOrTransports(7009structure, options, originalOptions, jqXHR, selection, inspected );7010}7011}7012}7013// If we're only executing or nothing was selected7014// we try the catchall dataType if not done already7015if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {7016selection = inspectPrefiltersOrTransports(7017structure, options, originalOptions, jqXHR, "*", inspected );7018}7019// unnecessary when only executing (prefilters)7020// but it'll be ignored by the caller in that case7021return selection;7022}70237024// A special extend for ajax options7025// that takes "flat" options (not to be deep extended)7026// Fixes #98877027function ajaxExtend( target, src ) {7028var key, deep,7029flatOptions = jQuery.ajaxSettings.flatOptions || {};7030for ( key in src ) {7031if ( src[ key ] !== undefined ) {7032( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];7033}7034}7035if ( deep ) {7036jQuery.extend( true, target, deep );7037}7038}70397040jQuery.fn.extend({7041load: function( url, params, callback ) {7042if ( typeof url !== "string" && _load ) {7043return _load.apply( this, arguments );70447045// Don't do a request if no elements are being requested7046} else if ( !this.length ) {7047return this;7048}70497050var off = url.indexOf( " " );7051if ( off >= 0 ) {7052var selector = url.slice( off, url.length );7053url = url.slice( 0, off );7054}70557056// Default to a GET request7057var type = "GET";70587059// If the second parameter was provided7060if ( params ) {7061// If it's a function7062if ( jQuery.isFunction( params ) ) {7063// We assume that it's the callback7064callback = params;7065params = undefined;70667067// Otherwise, build a param string7068} else if ( typeof params === "object" ) {7069params = jQuery.param( params, jQuery.ajaxSettings.traditional );7070type = "POST";7071}7072}70737074var self = this;70757076// Request the remote document7077jQuery.ajax({7078url: url,7079type: type,7080dataType: "html",7081data: params,7082// Complete callback (responseText is used internally)7083complete: function( jqXHR, status, responseText ) {7084// Store the response as specified by the jqXHR object7085responseText = jqXHR.responseText;7086// If successful, inject the HTML into all the matched elements7087if ( jqXHR.isResolved() ) {7088// #4825: Get the actual response in case7089// a dataFilter is present in ajaxSettings7090jqXHR.done(function( r ) {7091responseText = r;7092});7093// See if a selector was specified7094self.html( selector ?7095// Create a dummy div to hold the results7096jQuery("<div>")7097// inject the contents of the document in, removing the scripts7098// to avoid any 'Permission Denied' errors in IE7099.append(responseText.replace(rscript, ""))71007101// Locate the specified elements7102.find(selector) :71037104// If not, just inject the full result7105responseText );7106}71077108if ( callback ) {7109self.each( callback, [ responseText, status, jqXHR ] );7110}7111}7112});71137114return this;7115},71167117serialize: function() {7118return jQuery.param( this.serializeArray() );7119},71207121serializeArray: function() {7122return this.map(function(){7123return this.elements ? jQuery.makeArray( this.elements ) : this;7124})7125.filter(function(){7126return this.name && !this.disabled &&7127( this.checked || rselectTextarea.test( this.nodeName ) ||7128rinput.test( this.type ) );7129})7130.map(function( i, elem ){7131var val = jQuery( this ).val();71327133return val == null ?7134null :7135jQuery.isArray( val ) ?7136jQuery.map( val, function( val, i ){7137return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };7138}) :7139{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };7140}).get();7141}7142});71437144// Attach a bunch of functions for handling common AJAX events7145jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){7146jQuery.fn[ o ] = function( f ){7147return this.bind( o, f );7148};7149});71507151jQuery.each( [ "get", "post" ], function( i, method ) {7152jQuery[ method ] = function( url, data, callback, type ) {7153// shift arguments if data argument was omitted7154if ( jQuery.isFunction( data ) ) {7155type = type || callback;7156callback = data;7157data = undefined;7158}71597160return jQuery.ajax({7161type: method,7162url: url,7163data: data,7164success: callback,7165dataType: type7166});7167};7168});71697170jQuery.extend({71717172getScript: function( url, callback ) {7173return jQuery.get( url, undefined, callback, "script" );7174},71757176getJSON: function( url, data, callback ) {7177return jQuery.get( url, data, callback, "json" );7178},71797180// Creates a full fledged settings object into target7181// with both ajaxSettings and settings fields.7182// If target is omitted, writes into ajaxSettings.7183ajaxSetup: function( target, settings ) {7184if ( settings ) {7185// Building a settings object7186ajaxExtend( target, jQuery.ajaxSettings );7187} else {7188// Extending ajaxSettings7189settings = target;7190target = jQuery.ajaxSettings;7191}7192ajaxExtend( target, settings );7193return target;7194},71957196ajaxSettings: {7197url: ajaxLocation,7198isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),7199global: true,7200type: "GET",7201contentType: "application/x-www-form-urlencoded",7202processData: true,7203async: true,7204/*7205timeout: 0,7206data: null,7207dataType: null,7208username: null,7209password: null,7210cache: null,7211traditional: false,7212headers: {},7213*/72147215accepts: {7216xml: "application/xml, text/xml",7217html: "text/html",7218text: "text/plain",7219json: "application/json, text/javascript",7220"*": allTypes7221},72227223contents: {7224xml: /xml/,7225html: /html/,7226json: /json/7227},72287229responseFields: {7230xml: "responseXML",7231text: "responseText"7232},72337234// List of data converters7235// 1) key format is "source_type destination_type" (a single space in-between)7236// 2) the catchall symbol "*" can be used for source_type7237converters: {72387239// Convert anything to text7240"* text": window.String,72417242// Text to html (true = no transformation)7243"text html": true,72447245// Evaluate text as a json expression7246"text json": jQuery.parseJSON,72477248// Parse text as xml7249"text xml": jQuery.parseXML7250},72517252// For options that shouldn't be deep extended:7253// you can add your own custom options here if7254// and when you create one that shouldn't be7255// deep extended (see ajaxExtend)7256flatOptions: {7257context: true,7258url: true7259}7260},72617262ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),7263ajaxTransport: addToPrefiltersOrTransports( transports ),72647265// Main method7266ajax: function( url, options ) {72677268// If url is an object, simulate pre-1.5 signature7269if ( typeof url === "object" ) {7270options = url;7271url = undefined;7272}72737274// Force options to be an object7275options = options || {};72767277var // Create the final options object7278s = jQuery.ajaxSetup( {}, options ),7279// Callbacks context7280callbackContext = s.context || s,7281// Context for global events7282// It's the callbackContext if one was provided in the options7283// and if it's a DOM node or a jQuery collection7284globalEventContext = callbackContext !== s &&7285( callbackContext.nodeType || callbackContext instanceof jQuery ) ?7286jQuery( callbackContext ) : jQuery.event,7287// Deferreds7288deferred = jQuery.Deferred(),7289completeDeferred = jQuery.Callbacks( "once memory" ),7290// Status-dependent callbacks7291statusCode = s.statusCode || {},7292// ifModified key7293ifModifiedKey,7294// Headers (they are sent all at once)7295requestHeaders = {},7296requestHeadersNames = {},7297// Response headers7298responseHeadersString,7299responseHeaders,7300// transport7301transport,7302// timeout handle7303timeoutTimer,7304// Cross-domain detection vars7305parts,7306// The jqXHR state7307state = 0,7308// To know if global events are to be dispatched7309fireGlobals,7310// Loop variable7311i,7312// Fake xhr7313jqXHR = {73147315readyState: 0,73167317// Caches the header7318setRequestHeader: function( name, value ) {7319if ( !state ) {7320var lname = name.toLowerCase();7321name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;7322requestHeaders[ name ] = value;7323}7324return this;7325},73267327// Raw string7328getAllResponseHeaders: function() {7329return state === 2 ? responseHeadersString : null;7330},73317332// Builds headers hashtable if needed7333getResponseHeader: function( key ) {7334var match;7335if ( state === 2 ) {7336if ( !responseHeaders ) {7337responseHeaders = {};7338while( ( match = rheaders.exec( responseHeadersString ) ) ) {7339responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];7340}7341}7342match = responseHeaders[ key.toLowerCase() ];7343}7344return match === undefined ? null : match;7345},73467347// Overrides response content-type header7348overrideMimeType: function( type ) {7349if ( !state ) {7350s.mimeType = type;7351}7352return this;7353},73547355// Cancel the request7356abort: function( statusText ) {7357statusText = statusText || "abort";7358if ( transport ) {7359transport.abort( statusText );7360}7361done( 0, statusText );7362return this;7363}7364};73657366// Callback for when everything is done7367// It is defined here because jslint complains if it is declared7368// at the end of the function (which would be more logical and readable)7369function done( status, nativeStatusText, responses, headers ) {73707371// Called once7372if ( state === 2 ) {7373return;7374}73757376// State is "done" now7377state = 2;73787379// Clear timeout if it exists7380if ( timeoutTimer ) {7381clearTimeout( timeoutTimer );7382}73837384// Dereference transport for early garbage collection7385// (no matter how long the jqXHR object will be used)7386transport = undefined;73877388// Cache response headers7389responseHeadersString = headers || "";73907391// Set readyState7392jqXHR.readyState = status > 0 ? 4 : 0;73937394var isSuccess,7395success,7396error,7397statusText = nativeStatusText,7398response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,7399lastModified,7400etag;74017402// If successful, handle type chaining7403if ( status >= 200 && status < 300 || status === 304 ) {74047405// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.7406if ( s.ifModified ) {74077408if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {7409jQuery.lastModified[ ifModifiedKey ] = lastModified;7410}7411if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {7412jQuery.etag[ ifModifiedKey ] = etag;7413}7414}74157416// If not modified7417if ( status === 304 ) {74187419statusText = "notmodified";7420isSuccess = true;74217422// If we have data7423} else {74247425try {7426success = ajaxConvert( s, response );7427statusText = "success";7428isSuccess = true;7429} catch(e) {7430// We have a parsererror7431statusText = "parsererror";7432error = e;7433}7434}7435} else {7436// We extract error from statusText7437// then normalize statusText and status for non-aborts7438error = statusText;7439if ( !statusText || status ) {7440statusText = "error";7441if ( status < 0 ) {7442status = 0;7443}7444}7445}74467447// Set data for the fake xhr object7448jqXHR.status = status;7449jqXHR.statusText = "" + ( nativeStatusText || statusText );74507451// Success/Error7452if ( isSuccess ) {7453deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );7454} else {7455deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );7456}74577458// Status-dependent callbacks7459jqXHR.statusCode( statusCode );7460statusCode = undefined;74617462if ( fireGlobals ) {7463globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),7464[ jqXHR, s, isSuccess ? success : error ] );7465}74667467// Complete7468completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );74697470if ( fireGlobals ) {7471globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );7472// Handle the global AJAX counter7473if ( !( --jQuery.active ) ) {7474jQuery.event.trigger( "ajaxStop" );7475}7476}7477}74787479// Attach deferreds7480deferred.promise( jqXHR );7481jqXHR.success = jqXHR.done;7482jqXHR.error = jqXHR.fail;7483jqXHR.complete = completeDeferred.add;74847485// Status-dependent callbacks7486jqXHR.statusCode = function( map ) {7487if ( map ) {7488var tmp;7489if ( state < 2 ) {7490for ( tmp in map ) {7491statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];7492}7493} else {7494tmp = map[ jqXHR.status ];7495jqXHR.then( tmp, tmp );7496}7497}7498return this;7499};75007501// Remove hash character (#7531: and string promotion)7502// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)7503// We also use the url parameter if available7504s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );75057506// Extract dataTypes list7507s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );75087509// Determine if a cross-domain request is in order7510if ( s.crossDomain == null ) {7511parts = rurl.exec( s.url.toLowerCase() );7512s.crossDomain = !!( parts &&7513( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||7514( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=7515( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )7516);7517}75187519// Convert data if not already a string7520if ( s.data && s.processData && typeof s.data !== "string" ) {7521s.data = jQuery.param( s.data, s.traditional );7522}75237524// Apply prefilters7525inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );75267527// If request was aborted inside a prefiler, stop there7528if ( state === 2 ) {7529return false;7530}75317532// We can fire global events as of now if asked to7533fireGlobals = s.global;75347535// Uppercase the type7536s.type = s.type.toUpperCase();75377538// Determine if request has content7539s.hasContent = !rnoContent.test( s.type );75407541// Watch for a new set of requests7542if ( fireGlobals && jQuery.active++ === 0 ) {7543jQuery.event.trigger( "ajaxStart" );7544}75457546// More options handling for requests with no content7547if ( !s.hasContent ) {75487549// If data is available, append data to url7550if ( s.data ) {7551s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;7552// #9682: remove data so that it's not used in an eventual retry7553delete s.data;7554}75557556// Get ifModifiedKey before adding the anti-cache parameter7557ifModifiedKey = s.url;75587559// Add anti-cache in url if needed7560if ( s.cache === false ) {75617562var ts = jQuery.now(),7563// try replacing _= if it is there7564ret = s.url.replace( rts, "$1_=" + ts );75657566// if nothing was replaced, add timestamp to the end7567s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );7568}7569}75707571// Set the correct header, if data is being sent7572if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {7573jqXHR.setRequestHeader( "Content-Type", s.contentType );7574}75757576// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.7577if ( s.ifModified ) {7578ifModifiedKey = ifModifiedKey || s.url;7579if ( jQuery.lastModified[ ifModifiedKey ] ) {7580jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );7581}7582if ( jQuery.etag[ ifModifiedKey ] ) {7583jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );7584}7585}75867587// Set the Accepts header for the server, depending on the dataType7588jqXHR.setRequestHeader(7589"Accept",7590s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?7591s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :7592s.accepts[ "*" ]7593);75947595// Check for headers option7596for ( i in s.headers ) {7597jqXHR.setRequestHeader( i, s.headers[ i ] );7598}75997600// Allow custom headers/mimetypes and early abort7601if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {7602// Abort if not done already7603jqXHR.abort();7604return false;76057606}76077608// Install callbacks on deferreds7609for ( i in { success: 1, error: 1, complete: 1 } ) {7610jqXHR[ i ]( s[ i ] );7611}76127613// Get transport7614transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );76157616// If no transport, we auto-abort7617if ( !transport ) {7618done( -1, "No Transport" );7619} else {7620jqXHR.readyState = 1;7621// Send global event7622if ( fireGlobals ) {7623globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );7624}7625// Timeout7626if ( s.async && s.timeout > 0 ) {7627timeoutTimer = setTimeout( function(){7628jqXHR.abort( "timeout" );7629}, s.timeout );7630}76317632try {7633state = 1;7634transport.send( requestHeaders, done );7635} catch (e) {7636// Propagate exception as error if not done7637if ( state < 2 ) {7638done( -1, e );7639// Simply rethrow otherwise7640} else {7641jQuery.error( e );7642}7643}7644}76457646return jqXHR;7647},76487649// Serialize an array of form elements or a set of7650// key/values into a query string7651param: function( a, traditional ) {7652var s = [],7653add = function( key, value ) {7654// If value is a function, invoke it and return its value7655value = jQuery.isFunction( value ) ? value() : value;7656s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );7657};76587659// Set traditional to true for jQuery <= 1.3.2 behavior.7660if ( traditional === undefined ) {7661traditional = jQuery.ajaxSettings.traditional;7662}76637664// If an array was passed in, assume that it is an array of form elements.7665if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {7666// Serialize the form elements7667jQuery.each( a, function() {7668add( this.name, this.value );7669});76707671} else {7672// If traditional, encode the "old" way (the way 1.3.2 or older7673// did it), otherwise encode params recursively.7674for ( var prefix in a ) {7675buildParams( prefix, a[ prefix ], traditional, add );7676}7677}76787679// Return the resulting serialization7680return s.join( "&" ).replace( r20, "+" );7681}7682});76837684function buildParams( prefix, obj, traditional, add ) {7685if ( jQuery.isArray( obj ) ) {7686// Serialize array item.7687jQuery.each( obj, function( i, v ) {7688if ( traditional || rbracket.test( prefix ) ) {7689// Treat each array item as a scalar.7690add( prefix, v );76917692} else {7693// If array item is non-scalar (array or object), encode its7694// numeric index to resolve deserialization ambiguity issues.7695// Note that rack (as of 1.0.0) can't currently deserialize7696// nested arrays properly, and attempting to do so may cause7697// a server error. Possible fixes are to modify rack's7698// deserialization algorithm or to provide an option or flag7699// to force array serialization to be shallow.7700buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );7701}7702});77037704} else if ( !traditional && obj != null && typeof obj === "object" ) {7705// Serialize object item.7706for ( var name in obj ) {7707buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );7708}77097710} else {7711// Serialize scalar item.7712add( prefix, obj );7713}7714}77157716// This is still on the jQuery object... for now7717// Want to move this to jQuery.ajax some day7718jQuery.extend({77197720// Counter for holding the number of active queries7721active: 0,77227723// Last-Modified header cache for next request7724lastModified: {},7725etag: {}77267727});77287729/* Handles responses to an ajax request:7730* - sets all responseXXX fields accordingly7731* - finds the right dataType (mediates between content-type and expected dataType)7732* - returns the corresponding response7733*/7734function ajaxHandleResponses( s, jqXHR, responses ) {77357736var contents = s.contents,7737dataTypes = s.dataTypes,7738responseFields = s.responseFields,7739ct,7740type,7741finalDataType,7742firstDataType;77437744// Fill responseXXX fields7745for ( type in responseFields ) {7746if ( type in responses ) {7747jqXHR[ responseFields[type] ] = responses[ type ];7748}7749}77507751// Remove auto dataType and get content-type in the process7752while( dataTypes[ 0 ] === "*" ) {7753dataTypes.shift();7754if ( ct === undefined ) {7755ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );7756}7757}77587759// Check if we're dealing with a known content-type7760if ( ct ) {7761for ( type in contents ) {7762if ( contents[ type ] && contents[ type ].test( ct ) ) {7763dataTypes.unshift( type );7764break;7765}7766}7767}77687769// Check to see if we have a response for the expected dataType7770if ( dataTypes[ 0 ] in responses ) {7771finalDataType = dataTypes[ 0 ];7772} else {7773// Try convertible dataTypes7774for ( type in responses ) {7775if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {7776finalDataType = type;7777break;7778}7779if ( !firstDataType ) {7780firstDataType = type;7781}7782}7783// Or just use first one7784finalDataType = finalDataType || firstDataType;7785}77867787// If we found a dataType7788// We add the dataType to the list if needed7789// and return the corresponding response7790if ( finalDataType ) {7791if ( finalDataType !== dataTypes[ 0 ] ) {7792dataTypes.unshift( finalDataType );7793}7794return responses[ finalDataType ];7795}7796}77977798// Chain conversions given the request and the original response7799function ajaxConvert( s, response ) {78007801// Apply the dataFilter if provided7802if ( s.dataFilter ) {7803response = s.dataFilter( response, s.dataType );7804}78057806var dataTypes = s.dataTypes,7807converters = {},7808i,7809key,7810length = dataTypes.length,7811tmp,7812// Current and previous dataTypes7813current = dataTypes[ 0 ],7814prev,7815// Conversion expression7816conversion,7817// Conversion function7818conv,7819// Conversion functions (transitive conversion)7820conv1,7821conv2;78227823// For each dataType in the chain7824for ( i = 1; i < length; i++ ) {78257826// Create converters map7827// with lowercased keys7828if ( i === 1 ) {7829for ( key in s.converters ) {7830if ( typeof key === "string" ) {7831converters[ key.toLowerCase() ] = s.converters[ key ];7832}7833}7834}78357836// Get the dataTypes7837prev = current;7838current = dataTypes[ i ];78397840// If current is auto dataType, update it to prev7841if ( current === "*" ) {7842current = prev;7843// If no auto and dataTypes are actually different7844} else if ( prev !== "*" && prev !== current ) {78457846// Get the converter7847conversion = prev + " " + current;7848conv = converters[ conversion ] || converters[ "* " + current ];78497850// If there is no direct converter, search transitively7851if ( !conv ) {7852conv2 = undefined;7853for ( conv1 in converters ) {7854tmp = conv1.split( " " );7855if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {7856conv2 = converters[ tmp[1] + " " + current ];7857if ( conv2 ) {7858conv1 = converters[ conv1 ];7859if ( conv1 === true ) {7860conv = conv2;7861} else if ( conv2 === true ) {7862conv = conv1;7863}7864break;7865}7866}7867}7868}7869// If we found no converter, dispatch an error7870if ( !( conv || conv2 ) ) {7871jQuery.error( "No conversion from " + conversion.replace(" "," to ") );7872}7873// If found converter is not an equivalence7874if ( conv !== true ) {7875// Convert with 1 or 2 converters accordingly7876response = conv ? conv( response ) : conv2( conv1(response) );7877}7878}7879}7880return response;7881}78827883788478857886var jsc = jQuery.now(),7887jsre = /(\=)\?(&|$)|\?\?/i;78887889// Default jsonp settings7890jQuery.ajaxSetup({7891jsonp: "callback",7892jsonpCallback: function() {7893return jQuery.expando + "_" + ( jsc++ );7894}7895});78967897// Detect, normalize options and install callbacks for jsonp requests7898jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {78997900var inspectData = s.contentType === "application/x-www-form-urlencoded" &&7901( typeof s.data === "string" );79027903if ( s.dataTypes[ 0 ] === "jsonp" ||7904s.jsonp !== false && ( jsre.test( s.url ) ||7905inspectData && jsre.test( s.data ) ) ) {79067907var responseContainer,7908jsonpCallback = s.jsonpCallback =7909jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,7910previous = window[ jsonpCallback ],7911url = s.url,7912data = s.data,7913replace = "$1" + jsonpCallback + "$2";79147915if ( s.jsonp !== false ) {7916url = url.replace( jsre, replace );7917if ( s.url === url ) {7918if ( inspectData ) {7919data = data.replace( jsre, replace );7920}7921if ( s.data === data ) {7922// Add callback manually7923url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;7924}7925}7926}79277928s.url = url;7929s.data = data;79307931// Install callback7932window[ jsonpCallback ] = function( response ) {7933responseContainer = [ response ];7934};79357936// Clean-up function7937jqXHR.always(function() {7938// Set callback back to previous value7939window[ jsonpCallback ] = previous;7940// Call if it was a function and we have a response7941if ( responseContainer && jQuery.isFunction( previous ) ) {7942window[ jsonpCallback ]( responseContainer[ 0 ] );7943}7944});79457946// Use data converter to retrieve json after script execution7947s.converters["script json"] = function() {7948if ( !responseContainer ) {7949jQuery.error( jsonpCallback + " was not called" );7950}7951return responseContainer[ 0 ];7952};79537954// force json dataType7955s.dataTypes[ 0 ] = "json";79567957// Delegate to script7958return "script";7959}7960});79617962796379647965// Install script dataType7966jQuery.ajaxSetup({7967accepts: {7968script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"7969},7970contents: {7971script: /javascript|ecmascript/7972},7973converters: {7974"text script": function( text ) {7975jQuery.globalEval( text );7976return text;7977}7978}7979});79807981// Handle cache's special case and global7982jQuery.ajaxPrefilter( "script", function( s ) {7983if ( s.cache === undefined ) {7984s.cache = false;7985}7986if ( s.crossDomain ) {7987s.type = "GET";7988s.global = false;7989}7990});79917992// Bind script tag hack transport7993jQuery.ajaxTransport( "script", function(s) {79947995// This transport only deals with cross domain requests7996if ( s.crossDomain ) {79977998var script,7999head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;80008001return {80028003send: function( _, callback ) {80048005script = document.createElement( "script" );80068007script.async = "async";80088009if ( s.scriptCharset ) {8010script.charset = s.scriptCharset;8011}80128013script.src = s.url;80148015// Attach handlers for all browsers8016script.onload = script.onreadystatechange = function( _, isAbort ) {80178018if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {80198020// Handle memory leak in IE8021script.onload = script.onreadystatechange = null;80228023// Remove the script8024if ( head && script.parentNode ) {8025head.removeChild( script );8026}80278028// Dereference the script8029script = undefined;80308031// Callback if not abort8032if ( !isAbort ) {8033callback( 200, "success" );8034}8035}8036};8037// Use insertBefore instead of appendChild to circumvent an IE6 bug.8038// This arises when a base node is used (#2709 and #4378).8039head.insertBefore( script, head.firstChild );8040},80418042abort: function() {8043if ( script ) {8044script.onload( 0, 1 );8045}8046}8047};8048}8049});80508051805280538054var // #5280: Internet Explorer will keep connections alive if we don't abort on unload8055xhrOnUnloadAbort = window.ActiveXObject ? function() {8056// Abort all pending requests8057for ( var key in xhrCallbacks ) {8058xhrCallbacks[ key ]( 0, 1 );8059}8060} : false,8061xhrId = 0,8062xhrCallbacks;80638064// Functions to create xhrs8065function createStandardXHR() {8066try {8067return new window.XMLHttpRequest();8068} catch( e ) {}8069}80708071function createActiveXHR() {8072try {8073return new window.ActiveXObject( "Microsoft.XMLHTTP" );8074} catch( e ) {}8075}80768077// Create the request object8078// (This is still attached to ajaxSettings for backward compatibility)8079jQuery.ajaxSettings.xhr = window.ActiveXObject ?8080/* Microsoft failed to properly8081* implement the XMLHttpRequest in IE7 (can't request local files),8082* so we use the ActiveXObject when it is available8083* Additionally XMLHttpRequest can be disabled in IE7/IE8 so8084* we need a fallback.8085*/8086function() {8087return !this.isLocal && createStandardXHR() || createActiveXHR();8088} :8089// For all other browsers, use the standard XMLHttpRequest object8090createStandardXHR;80918092// Determine support properties8093(function( xhr ) {8094jQuery.extend( jQuery.support, {8095ajax: !!xhr,8096cors: !!xhr && ( "withCredentials" in xhr )8097});8098})( jQuery.ajaxSettings.xhr() );80998100// Create transport if the browser can provide an xhr8101if ( jQuery.support.ajax ) {81028103jQuery.ajaxTransport(function( s ) {8104// Cross domain only allowed if supported through XMLHttpRequest8105if ( !s.crossDomain || jQuery.support.cors ) {81068107var callback;81088109return {8110send: function( headers, complete ) {81118112// Get a new xhr8113var xhr = s.xhr(),8114handle,8115i;81168117// Open the socket8118// Passing null username, generates a login popup on Opera (#2865)8119if ( s.username ) {8120xhr.open( s.type, s.url, s.async, s.username, s.password );8121} else {8122xhr.open( s.type, s.url, s.async );8123}81248125// Apply custom fields if provided8126if ( s.xhrFields ) {8127for ( i in s.xhrFields ) {8128xhr[ i ] = s.xhrFields[ i ];8129}8130}81318132// Override mime type if needed8133if ( s.mimeType && xhr.overrideMimeType ) {8134xhr.overrideMimeType( s.mimeType );8135}81368137// X-Requested-With header8138// For cross-domain requests, seeing as conditions for a preflight are8139// akin to a jigsaw puzzle, we simply never set it to be sure.8140// (it can always be set on a per-request basis or even using ajaxSetup)8141// For same-domain requests, won't change header if already provided.8142if ( !s.crossDomain && !headers["X-Requested-With"] ) {8143headers[ "X-Requested-With" ] = "XMLHttpRequest";8144}81458146// Need an extra try/catch for cross domain requests in Firefox 38147try {8148for ( i in headers ) {8149xhr.setRequestHeader( i, headers[ i ] );8150}8151} catch( _ ) {}81528153// Do send the request8154// This may raise an exception which is actually8155// handled in jQuery.ajax (so no try/catch here)8156xhr.send( ( s.hasContent && s.data ) || null );81578158// Listener8159callback = function( _, isAbort ) {81608161var status,8162statusText,8163responseHeaders,8164responses,8165xml;81668167// Firefox throws exceptions when accessing properties8168// of an xhr when a network error occured8169// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)8170try {81718172// Was never called and is aborted or complete8173if ( callback && ( isAbort || xhr.readyState === 4 ) ) {81748175// Only called once8176callback = undefined;81778178// Do not keep as active anymore8179if ( handle ) {8180xhr.onreadystatechange = jQuery.noop;8181if ( xhrOnUnloadAbort ) {8182delete xhrCallbacks[ handle ];8183}8184}81858186// If it's an abort8187if ( isAbort ) {8188// Abort it manually if needed8189if ( xhr.readyState !== 4 ) {8190xhr.abort();8191}8192} else {8193status = xhr.status;8194responseHeaders = xhr.getAllResponseHeaders();8195responses = {};8196xml = xhr.responseXML;81978198// Construct response list8199if ( xml && xml.documentElement /* #4958 */ ) {8200responses.xml = xml;8201}8202responses.text = xhr.responseText;82038204// Firefox throws an exception when accessing8205// statusText for faulty cross-domain requests8206try {8207statusText = xhr.statusText;8208} catch( e ) {8209// We normalize with Webkit giving an empty statusText8210statusText = "";8211}82128213// Filter status for non standard behaviors82148215// If the request is local and we have data: assume a success8216// (success with no data won't get notified, that's the best we8217// can do given current implementations)8218if ( !status && s.isLocal && !s.crossDomain ) {8219status = responses.text ? 200 : 404;8220// IE - #1450: sometimes returns 1223 when it should be 2048221} else if ( status === 1223 ) {8222status = 204;8223}8224}8225}8226} catch( firefoxAccessException ) {8227if ( !isAbort ) {8228complete( -1, firefoxAccessException );8229}8230}82318232// Call complete if needed8233if ( responses ) {8234complete( status, statusText, responses, responseHeaders );8235}8236};82378238// if we're in sync mode or it's in cache8239// and has been retrieved directly (IE6 & IE7)8240// we need to manually fire the callback8241if ( !s.async || xhr.readyState === 4 ) {8242callback();8243} else {8244handle = ++xhrId;8245if ( xhrOnUnloadAbort ) {8246// Create the active xhrs callbacks list if needed8247// and attach the unload handler8248if ( !xhrCallbacks ) {8249xhrCallbacks = {};8250jQuery( window ).unload( xhrOnUnloadAbort );8251}8252// Add to list of active xhrs callbacks8253xhrCallbacks[ handle ] = callback;8254}8255xhr.onreadystatechange = callback;8256}8257},82588259abort: function() {8260if ( callback ) {8261callback(0,1);8262}8263}8264};8265}8266});8267}82688269827082718272var elemdisplay = {},8273iframe, iframeDoc,8274rfxtypes = /^(?:toggle|show|hide)$/,8275rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,8276timerId,8277fxAttrs = [8278// height animations8279[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],8280// width animations8281[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],8282// opacity animations8283[ "opacity" ]8284],8285fxNow;82868287jQuery.fn.extend({8288show: function( speed, easing, callback ) {8289var elem, display;82908291if ( speed || speed === 0 ) {8292return this.animate( genFx("show", 3), speed, easing, callback );82938294} else {8295for ( var i = 0, j = this.length; i < j; i++ ) {8296elem = this[ i ];82978298if ( elem.style ) {8299display = elem.style.display;83008301// Reset the inline display of this element to learn if it is8302// being hidden by cascaded rules or not8303if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {8304display = elem.style.display = "";8305}83068307// Set elements which have been overridden with display: none8308// in a stylesheet to whatever the default browser style is8309// for such an element8310if ( display === "" && jQuery.css(elem, "display") === "none" ) {8311jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );8312}8313}8314}83158316// Set the display of most of the elements in a second loop8317// to avoid the constant reflow8318for ( i = 0; i < j; i++ ) {8319elem = this[ i ];83208321if ( elem.style ) {8322display = elem.style.display;83238324if ( display === "" || display === "none" ) {8325elem.style.display = jQuery._data( elem, "olddisplay" ) || "";8326}8327}8328}83298330return this;8331}8332},83338334hide: function( speed, easing, callback ) {8335if ( speed || speed === 0 ) {8336return this.animate( genFx("hide", 3), speed, easing, callback);83378338} else {8339var elem, display,8340i = 0,8341j = this.length;83428343for ( ; i < j; i++ ) {8344elem = this[i];8345if ( elem.style ) {8346display = jQuery.css( elem, "display" );83478348if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {8349jQuery._data( elem, "olddisplay", display );8350}8351}8352}83538354// Set the display of the elements in a second loop8355// to avoid the constant reflow8356for ( i = 0; i < j; i++ ) {8357if ( this[i].style ) {8358this[i].style.display = "none";8359}8360}83618362return this;8363}8364},83658366// Save the old toggle function8367_toggle: jQuery.fn.toggle,83688369toggle: function( fn, fn2, callback ) {8370var bool = typeof fn === "boolean";83718372if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {8373this._toggle.apply( this, arguments );83748375} else if ( fn == null || bool ) {8376this.each(function() {8377var state = bool ? fn : jQuery(this).is(":hidden");8378jQuery(this)[ state ? "show" : "hide" ]();8379});83808381} else {8382this.animate(genFx("toggle", 3), fn, fn2, callback);8383}83848385return this;8386},83878388fadeTo: function( speed, to, easing, callback ) {8389return this.filter(":hidden").css("opacity", 0).show().end()8390.animate({opacity: to}, speed, easing, callback);8391},83928393animate: function( prop, speed, easing, callback ) {8394var optall = jQuery.speed( speed, easing, callback );83958396if ( jQuery.isEmptyObject( prop ) ) {8397return this.each( optall.complete, [ false ] );8398}83998400// Do not change referenced properties as per-property easing will be lost8401prop = jQuery.extend( {}, prop );84028403function doAnimation() {8404// XXX 'this' does not always have a nodeName when running the8405// test suite84068407if ( optall.queue === false ) {8408jQuery._mark( this );8409}84108411var opt = jQuery.extend( {}, optall ),8412isElement = this.nodeType === 1,8413hidden = isElement && jQuery(this).is(":hidden"),8414name, val, p, e,8415parts, start, end, unit,8416method;84178418// will store per property easing and be used to determine when an animation is complete8419opt.animatedProperties = {};84208421for ( p in prop ) {84228423// property name normalization8424name = jQuery.camelCase( p );8425if ( p !== name ) {8426prop[ name ] = prop[ p ];8427delete prop[ p ];8428}84298430val = prop[ name ];84318432// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)8433if ( jQuery.isArray( val ) ) {8434opt.animatedProperties[ name ] = val[ 1 ];8435val = prop[ name ] = val[ 0 ];8436} else {8437opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';8438}84398440if ( val === "hide" && hidden || val === "show" && !hidden ) {8441return opt.complete.call( this );8442}84438444if ( isElement && ( name === "height" || name === "width" ) ) {8445// Make sure that nothing sneaks out8446// Record all 3 overflow attributes because IE does not8447// change the overflow attribute when overflowX and8448// overflowY are set to the same value8449opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];84508451// Set display property to inline-block for height/width8452// animations on inline elements that are having width/height animated8453if ( jQuery.css( this, "display" ) === "inline" &&8454jQuery.css( this, "float" ) === "none" ) {84558456// inline-level elements accept inline-block;8457// block-level elements need to be inline with layout8458if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {8459this.style.display = "inline-block";84608461} else {8462this.style.zoom = 1;8463}8464}8465}8466}84678468if ( opt.overflow != null ) {8469this.style.overflow = "hidden";8470}84718472for ( p in prop ) {8473e = new jQuery.fx( this, opt, p );8474val = prop[ p ];84758476if ( rfxtypes.test( val ) ) {84778478// Tracks whether to show or hide based on private8479// data attached to the element8480method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );8481if ( method ) {8482jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );8483e[ method ]();8484} else {8485e[ val ]();8486}84878488} else {8489parts = rfxnum.exec( val );8490start = e.cur();84918492if ( parts ) {8493end = parseFloat( parts[2] );8494unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );84958496// We need to compute starting value8497if ( unit !== "px" ) {8498jQuery.style( this, p, (end || 1) + unit);8499start = ( (end || 1) / e.cur() ) * start;8500jQuery.style( this, p, start + unit);8501}85028503// If a +=/-= token was provided, we're doing a relative animation8504if ( parts[1] ) {8505end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;8506}85078508e.custom( start, end, unit );85098510} else {8511e.custom( start, val, "" );8512}8513}8514}85158516// For JS strict compliance8517return true;8518}85198520return optall.queue === false ?8521this.each( doAnimation ) :8522this.queue( optall.queue, doAnimation );8523},85248525stop: function( type, clearQueue, gotoEnd ) {8526if ( typeof type !== "string" ) {8527gotoEnd = clearQueue;8528clearQueue = type;8529type = undefined;8530}8531if ( clearQueue && type !== false ) {8532this.queue( type || "fx", [] );8533}85348535return this.each(function() {8536var i,8537hadTimers = false,8538timers = jQuery.timers,8539data = jQuery._data( this );85408541// clear marker counters if we know they won't be8542if ( !gotoEnd ) {8543jQuery._unmark( true, this );8544}85458546function stopQueue( elem, data, i ) {8547var hooks = data[ i ];8548jQuery.removeData( elem, i, true );8549hooks.stop( gotoEnd );8550}85518552if ( type == null ) {8553for ( i in data ) {8554if ( data[ i ].stop && i.indexOf(".run") === i.length - 4 ) {8555stopQueue( this, data, i );8556}8557}8558} else if ( data[ i = type + ".run" ] && data[ i ].stop ){8559stopQueue( this, data, i );8560}85618562for ( i = timers.length; i--; ) {8563if ( timers[ i ].elem === this && (type == null || timers[ i ].queue === type) ) {8564if ( gotoEnd ) {85658566// force the next step to be the last8567timers[ i ]( true );8568} else {8569timers[ i ].saveState();8570}8571hadTimers = true;8572timers.splice( i, 1 );8573}8574}85758576// start the next in the queue if the last step wasn't forced8577// timers currently will call their complete callbacks, which will dequeue8578// but only if they were gotoEnd8579if ( !( gotoEnd && hadTimers ) ) {8580jQuery.dequeue( this, type );8581}8582});8583}85848585});85868587// Animations created synchronously will run synchronously8588function createFxNow() {8589setTimeout( clearFxNow, 0 );8590return ( fxNow = jQuery.now() );8591}85928593function clearFxNow() {8594fxNow = undefined;8595}85968597// Generate parameters to create a standard animation8598function genFx( type, num ) {8599var obj = {};86008601jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {8602obj[ this ] = type;8603});86048605return obj;8606}86078608// Generate shortcuts for custom animations8609jQuery.each({8610slideDown: genFx( "show", 1 ),8611slideUp: genFx( "hide", 1 ),8612slideToggle: genFx( "toggle", 1 ),8613fadeIn: { opacity: "show" },8614fadeOut: { opacity: "hide" },8615fadeToggle: { opacity: "toggle" }8616}, function( name, props ) {8617jQuery.fn[ name ] = function( speed, easing, callback ) {8618return this.animate( props, speed, easing, callback );8619};8620});86218622jQuery.extend({8623speed: function( speed, easing, fn ) {8624var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {8625complete: fn || !fn && easing ||8626jQuery.isFunction( speed ) && speed,8627duration: speed,8628easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing8629};86308631opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :8632opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;86338634// normalize opt.queue - true/undefined/null -> "fx"8635if ( opt.queue == null || opt.queue === true ) {8636opt.queue = "fx";8637}86388639// Queueing8640opt.old = opt.complete;86418642opt.complete = function( noUnmark ) {8643if ( jQuery.isFunction( opt.old ) ) {8644opt.old.call( this );8645}86468647if ( opt.queue ) {8648jQuery.dequeue( this, opt.queue );8649} else if ( noUnmark !== false ) {8650jQuery._unmark( this );8651}8652};86538654return opt;8655},86568657easing: {8658linear: function( p, n, firstNum, diff ) {8659return firstNum + diff * p;8660},8661swing: function( p, n, firstNum, diff ) {8662return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum;8663}8664},86658666timers: [],86678668fx: function( elem, options, prop ) {8669this.options = options;8670this.elem = elem;8671this.prop = prop;86728673options.orig = options.orig || {};8674}86758676});86778678jQuery.fx.prototype = {8679// Simple function for setting a style value8680update: function() {8681if ( this.options.step ) {8682this.options.step.call( this.elem, this.now, this );8683}86848685( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );8686},86878688// Get the current size8689cur: function() {8690if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {8691return this.elem[ this.prop ];8692}86938694var parsed,8695r = jQuery.css( this.elem, this.prop );8696// Empty strings, null, undefined and "auto" are converted to 0,8697// complex values such as "rotate(1rad)" are returned as is,8698// simple values such as "10px" are parsed to Float.8699return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;8700},87018702// Start an animation from one number to another8703custom: function( from, to, unit ) {8704var self = this,8705fx = jQuery.fx;87068707this.startTime = fxNow || createFxNow();8708this.end = to;8709this.now = this.start = from;8710this.pos = this.state = 0;8711this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );87128713function t( gotoEnd ) {8714return self.step( gotoEnd );8715}87168717t.queue = this.options.queue;8718t.elem = this.elem;8719t.saveState = function() {8720if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {8721jQuery._data( self.elem, "fxshow" + self.prop, self.start );8722}8723};87248725if ( t() && jQuery.timers.push(t) && !timerId ) {8726timerId = setInterval( fx.tick, fx.interval );8727}8728},87298730// Simple 'show' function8731show: function() {8732var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );87338734// Remember where we started, so that we can go back to it later8735this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );8736this.options.show = true;87378738// Begin the animation8739// Make sure that we start at a small width/height to avoid any flash of content8740if ( dataShow !== undefined ) {8741// This show is picking up where a previous hide or show left off8742this.custom( this.cur(), dataShow );8743} else {8744this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );8745}87468747// Start by showing the element8748jQuery( this.elem ).show();8749},87508751// Simple 'hide' function8752hide: function() {8753// Remember where we started, so that we can go back to it later8754this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );8755this.options.hide = true;87568757// Begin the animation8758this.custom( this.cur(), 0 );8759},87608761// Each step of an animation8762step: function( gotoEnd ) {8763var p, n, complete,8764t = fxNow || createFxNow(),8765done = true,8766elem = this.elem,8767options = this.options;87688769if ( gotoEnd || t >= options.duration + this.startTime ) {8770this.now = this.end;8771this.pos = this.state = 1;8772this.update();87738774options.animatedProperties[ this.prop ] = true;87758776for ( p in options.animatedProperties ) {8777if ( options.animatedProperties[ p ] !== true ) {8778done = false;8779}8780}87818782if ( done ) {8783// Reset the overflow8784if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {87858786jQuery.each( [ "", "X", "Y" ], function( index, value ) {8787elem.style[ "overflow" + value ] = options.overflow[ index ];8788});8789}87908791// Hide the element if the "hide" operation was done8792if ( options.hide ) {8793jQuery( elem ).hide();8794}87958796// Reset the properties, if the item has been hidden or shown8797if ( options.hide || options.show ) {8798for ( p in options.animatedProperties ) {8799jQuery.style( elem, p, options.orig[ p ] );8800jQuery.removeData( elem, "fxshow" + p, true );8801// Toggle data is no longer needed8802jQuery.removeData( elem, "toggle" + p, true );8803}8804}88058806// Execute the complete function8807// in the event that the complete function throws an exception8808// we must ensure it won't be called twice. #568488098810complete = options.complete;8811if ( complete ) {88128813options.complete = false;8814complete.call( elem );8815}8816}88178818return false;88198820} else {8821// classical easing cannot be used with an Infinity duration8822if ( options.duration == Infinity ) {8823this.now = t;8824} else {8825n = t - this.startTime;8826this.state = n / options.duration;88278828// Perform the easing function, defaults to swing8829this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );8830this.now = this.start + ( (this.end - this.start) * this.pos );8831}8832// Perform the next step of the animation8833this.update();8834}88358836return true;8837}8838};88398840jQuery.extend( jQuery.fx, {8841tick: function() {8842var timer,8843timers = jQuery.timers,8844i = 0;88458846for ( ; i < timers.length; i++ ) {8847timer = timers[ i ];8848// Checks the timer has not already been removed8849if ( !timer() && timers[ i ] === timer ) {8850timers.splice( i--, 1 );8851}8852}88538854if ( !timers.length ) {8855jQuery.fx.stop();8856}8857},88588859interval: 13,88608861stop: function() {8862clearInterval( timerId );8863timerId = null;8864},88658866speeds: {8867slow: 600,8868fast: 200,8869// Default speed8870_default: 4008871},88728873step: {8874opacity: function( fx ) {8875jQuery.style( fx.elem, "opacity", fx.now );8876},88778878_default: function( fx ) {8879if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {8880fx.elem.style[ fx.prop ] = fx.now + fx.unit;8881} else {8882fx.elem[ fx.prop ] = fx.now;8883}8884}8885}8886});88878888// Adds width/height step functions8889// Do not set anything below 08890jQuery.each([ "width", "height" ], function( i, prop ) {8891jQuery.fx.step[ prop ] = function( fx ) {8892jQuery.style( fx.elem, prop, Math.max(0, fx.now) );8893};8894});88958896if ( jQuery.expr && jQuery.expr.filters ) {8897jQuery.expr.filters.animated = function( elem ) {8898return jQuery.grep(jQuery.timers, function( fn ) {8899return elem === fn.elem;8900}).length;8901};8902}89038904// Try to restore the default display value of an element8905function defaultDisplay( nodeName ) {89068907if ( !elemdisplay[ nodeName ] ) {89088909var body = document.body,8910elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),8911display = elem.css( "display" );8912elem.remove();89138914// If the simple way fails,8915// get element's real default display by attaching it to a temp iframe8916if ( display === "none" || display === "" ) {8917// No iframe to use yet, so create it8918if ( !iframe ) {8919iframe = document.createElement( "iframe" );8920iframe.frameBorder = iframe.width = iframe.height = 0;8921}89228923body.appendChild( iframe );89248925// Create a cacheable copy of the iframe document on first call.8926// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML8927// document to it; WebKit & Firefox won't allow reusing the iframe document.8928if ( !iframeDoc || !iframe.createElement ) {8929iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;8930iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );8931iframeDoc.close();8932}89338934elem = iframeDoc.createElement( nodeName );89358936iframeDoc.body.appendChild( elem );89378938display = jQuery.css( elem, "display" );8939body.removeChild( iframe );8940}89418942// Store the correct default display8943elemdisplay[ nodeName ] = display;8944}89458946return elemdisplay[ nodeName ];8947}89488949895089518952var rtable = /^t(?:able|d|h)$/i,8953rroot = /^(?:body|html)$/i;89548955if ( "getBoundingClientRect" in document.documentElement ) {8956jQuery.fn.offset = function( options ) {8957var elem = this[0], box;89588959if ( options ) {8960return this.each(function( i ) {8961jQuery.offset.setOffset( this, options, i );8962});8963}89648965if ( !elem || !elem.ownerDocument ) {8966return null;8967}89688969if ( elem === elem.ownerDocument.body ) {8970return jQuery.offset.bodyOffset( elem );8971}89728973try {8974box = elem.getBoundingClientRect();8975} catch(e) {}89768977var doc = elem.ownerDocument,8978docElem = doc.documentElement;89798980// Make sure we're not dealing with a disconnected DOM node8981if ( !box || !jQuery.contains( docElem, elem ) ) {8982return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };8983}89848985var body = doc.body,8986win = getWindow(doc),8987clientTop = docElem.clientTop || body.clientTop || 0,8988clientLeft = docElem.clientLeft || body.clientLeft || 0,8989scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,8990scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,8991top = box.top + scrollTop - clientTop,8992left = box.left + scrollLeft - clientLeft;89938994return { top: top, left: left };8995};89968997} else {8998jQuery.fn.offset = function( options ) {8999var elem = this[0];90009001if ( options ) {9002return this.each(function( i ) {9003jQuery.offset.setOffset( this, options, i );9004});9005}90069007if ( !elem || !elem.ownerDocument ) {9008return null;9009}90109011if ( elem === elem.ownerDocument.body ) {9012return jQuery.offset.bodyOffset( elem );9013}90149015var computedStyle,9016offsetParent = elem.offsetParent,9017prevOffsetParent = elem,9018doc = elem.ownerDocument,9019docElem = doc.documentElement,9020body = doc.body,9021defaultView = doc.defaultView,9022prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,9023top = elem.offsetTop,9024left = elem.offsetLeft;90259026while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {9027if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {9028break;9029}90309031computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;9032top -= elem.scrollTop;9033left -= elem.scrollLeft;90349035if ( elem === offsetParent ) {9036top += elem.offsetTop;9037left += elem.offsetLeft;90389039if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {9040top += parseFloat( computedStyle.borderTopWidth ) || 0;9041left += parseFloat( computedStyle.borderLeftWidth ) || 0;9042}90439044prevOffsetParent = offsetParent;9045offsetParent = elem.offsetParent;9046}90479048if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {9049top += parseFloat( computedStyle.borderTopWidth ) || 0;9050left += parseFloat( computedStyle.borderLeftWidth ) || 0;9051}90529053prevComputedStyle = computedStyle;9054}90559056if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {9057top += body.offsetTop;9058left += body.offsetLeft;9059}90609061if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {9062top += Math.max( docElem.scrollTop, body.scrollTop );9063left += Math.max( docElem.scrollLeft, body.scrollLeft );9064}90659066return { top: top, left: left };9067};9068}90699070jQuery.offset = {90719072bodyOffset: function( body ) {9073var top = body.offsetTop,9074left = body.offsetLeft;90759076if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {9077top += parseFloat( jQuery.css(body, "marginTop") ) || 0;9078left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;9079}90809081return { top: top, left: left };9082},90839084setOffset: function( elem, options, i ) {9085var position = jQuery.css( elem, "position" );90869087// set position first, in-case top/left are set even on static elem9088if ( position === "static" ) {9089elem.style.position = "relative";9090}90919092var curElem = jQuery( elem ),9093curOffset = curElem.offset(),9094curCSSTop = jQuery.css( elem, "top" ),9095curCSSLeft = jQuery.css( elem, "left" ),9096calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,9097props = {}, curPosition = {}, curTop, curLeft;90989099// need to be able to calculate position if either top or left is auto and position is either absolute or fixed9100if ( calculatePosition ) {9101curPosition = curElem.position();9102curTop = curPosition.top;9103curLeft = curPosition.left;9104} else {9105curTop = parseFloat( curCSSTop ) || 0;9106curLeft = parseFloat( curCSSLeft ) || 0;9107}91089109if ( jQuery.isFunction( options ) ) {9110options = options.call( elem, i, curOffset );9111}91129113if ( options.top != null ) {9114props.top = ( options.top - curOffset.top ) + curTop;9115}9116if ( options.left != null ) {9117props.left = ( options.left - curOffset.left ) + curLeft;9118}91199120if ( "using" in options ) {9121options.using.call( elem, props );9122} else {9123curElem.css( props );9124}9125}9126};912791289129jQuery.fn.extend({91309131position: function() {9132if ( !this[0] ) {9133return null;9134}91359136var elem = this[0],91379138// Get *real* offsetParent9139offsetParent = this.offsetParent(),91409141// Get correct offsets9142offset = this.offset(),9143parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();91449145// Subtract element margins9146// note: when an element has margin: auto the offsetLeft and marginLeft9147// are the same in Safari causing offset.left to incorrectly be 09148offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;9149offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;91509151// Add offsetParent borders9152parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;9153parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;91549155// Subtract the two offsets9156return {9157top: offset.top - parentOffset.top,9158left: offset.left - parentOffset.left9159};9160},91619162offsetParent: function() {9163return this.map(function() {9164var offsetParent = this.offsetParent || document.body;9165while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {9166offsetParent = offsetParent.offsetParent;9167}9168return offsetParent;9169});9170}9171});917291739174// Create scrollLeft and scrollTop methods9175jQuery.each( ["Left", "Top"], function( i, name ) {9176var method = "scroll" + name;91779178jQuery.fn[ method ] = function( val ) {9179var elem, win;91809181if ( val === undefined ) {9182elem = this[ 0 ];91839184if ( !elem ) {9185return null;9186}91879188win = getWindow( elem );91899190// Return the scroll offset9191return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :9192jQuery.support.boxModel && win.document.documentElement[ method ] ||9193win.document.body[ method ] :9194elem[ method ];9195}91969197// Set the scroll offset9198return this.each(function() {9199win = getWindow( this );92009201if ( win ) {9202win.scrollTo(9203!i ? val : jQuery( win ).scrollLeft(),9204i ? val : jQuery( win ).scrollTop()9205);92069207} else {9208this[ method ] = val;9209}9210});9211};9212});92139214function getWindow( elem ) {9215return jQuery.isWindow( elem ) ?9216elem :9217elem.nodeType === 9 ?9218elem.defaultView || elem.parentWindow :9219false;9220}92219222922392249225// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods9226jQuery.each([ "Height", "Width" ], function( i, name ) {92279228var type = name.toLowerCase();92299230// innerHeight and innerWidth9231jQuery.fn[ "inner" + name ] = function() {9232var elem = this[0];9233return elem ?9234elem.style ?9235parseFloat( jQuery.css( elem, type, "padding" ) ) :9236this[ type ]() :9237null;9238};92399240// outerHeight and outerWidth9241jQuery.fn[ "outer" + name ] = function( margin ) {9242var elem = this[0];9243return elem ?9244elem.style ?9245parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :9246this[ type ]() :9247null;9248};92499250jQuery.fn[ type ] = function( size ) {9251// Get window width or height9252var elem = this[0];9253if ( !elem ) {9254return size == null ? null : this;9255}92569257if ( jQuery.isFunction( size ) ) {9258return this.each(function( i ) {9259var self = jQuery( this );9260self[ type ]( size.call( this, i, self[ type ]() ) );9261});9262}92639264if ( jQuery.isWindow( elem ) ) {9265// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode9266// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat9267var docElemProp = elem.document.documentElement[ "client" + name ],9268body = elem.document.body;9269return elem.document.compatMode === "CSS1Compat" && docElemProp ||9270body && body[ "client" + name ] || docElemProp;92719272// Get document width or height9273} else if ( elem.nodeType === 9 ) {9274// Either scroll[Width/Height] or offset[Width/Height], whichever is greater9275return Math.max(9276elem.documentElement["client" + name],9277elem.body["scroll" + name], elem.documentElement["scroll" + name],9278elem.body["offset" + name], elem.documentElement["offset" + name]9279);92809281// Get or set width or height on the element9282} else if ( size === undefined ) {9283var orig = jQuery.css( elem, type ),9284ret = parseFloat( orig );92859286return jQuery.isNumeric( ret ) ? ret : orig;92879288// Set the width or height on the element (default to pixels if value is unitless)9289} else {9290return this.css( type, typeof size === "string" ? size : size + "px" );9291}9292};92939294});929592969297// Expose jQuery to the global object9298window.jQuery = window.$ = jQuery;9299})( window );930093019302