Ignore:
Timestamp:
Feb 11, 2011, 4:57:04 PM (13 years ago)
Author:
patdenice
Message:

Update jQuery to 1.5 and jQuery UI to 1.8.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/default/js/jquery.js

    r8162 r9172  
    11/*!
    2  * jQuery JavaScript Library v1.4.4
     2 * jQuery JavaScript Library v1.5
    33 * http://jquery.com/
    44 *
    5  * Copyright 2010, John Resig
     5 * Copyright 2011, John Resig
    66 * Dual licensed under the MIT or GPL Version 2 licenses.
    77 * http://jquery.org/license
     
    99 * Includes Sizzle.js
    1010 * http://sizzlejs.com/
    11  * Copyright 2010, The Dojo Foundation
     11 * Copyright 2011, The Dojo Foundation
    1212 * Released under the MIT, BSD, and GPL Licenses.
    1313 *
    14  * Date: Thu Nov 11 19:04:53 2010 -0500
     14 * Date: Mon Jan 31 08:31:29 2011 -0500
    1515 */
    1616(function( window, undefined ) {
     
    2323var jQuery = function( selector, context ) {
    2424                // The jQuery object is actually just the init constructor 'enhanced'
    25                 return new jQuery.fn.init( selector, context );
     25                return new jQuery.fn.init( selector, context, rootjQuery );
    2626        },
    2727
     
    3939        quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
    4040
    41         // Is it a simple selector
    42         isSimple = /^.[^:#\[\.,]*$/,
    43 
    4441        // Check if a string has a non-whitespace character in it
    4542        rnotwhite = /\S/,
    46         rwhite = /\s/,
    4743
    4844        // Used for trimming whitespace
    4945        trimLeft = /^\s+/,
    5046        trimRight = /\s+$/,
    51 
    52         // Check for non-word characters
    53         rnonword = /\W/,
    5447
    5548        // Check for digits
     
    7669        // For matching the engine and version of the browser
    7770        browserMatch,
    78        
     71
    7972        // Has the ready events already been bound?
    8073        readyBound = false,
    81        
    82         // The functions to execute on DOM ready
    83         readyList = [],
     74
     75        // The deferred used on DOM ready
     76        readyList,
     77
     78        // Promise methods
     79        promiseMethods = "then done fail isResolved isRejected promise".split( " " ),
    8480
    8581        // The ready event handler
     
    9389        trim = String.prototype.trim,
    9490        indexOf = Array.prototype.indexOf,
    95        
     91
    9692        // [[Class]] -> type pairs
    9793        class2type = {};
    9894
    9995jQuery.fn = jQuery.prototype = {
    100         init: function( selector, context ) {
     96        constructor: jQuery,
     97        init: function( selector, context, rootjQuery ) {
    10198                var match, elem, ret, doc;
    10299
     
    112109                        return this;
    113110                }
    114                
     111
    115112                // The body element only exists once, optimize finding it
    116113                if ( selector === "body" && !context && document.body ) {
     
    132129                                // HANDLE: $(html) -> $(array)
    133130                                if ( match[1] ) {
     131                                        context = context instanceof jQuery ? context[0] : context;
    134132                                        doc = (context ? context.ownerDocument || context : document);
    135133
     
    149147                                        } else {
    150148                                                ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
    151                                                 selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
    152                                         }
    153                                        
     149                                                selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
     150                                        }
     151
    154152                                        return jQuery.merge( this, selector );
    155                                        
     153
    156154                                // HANDLE: $("#id")
    157155                                } else {
     
    177175                                }
    178176
    179                         // HANDLE: $("TAG")
    180                         } else if ( !context && !rnonword.test( selector ) ) {
    181                                 this.selector = selector;
    182                                 this.context = document;
    183                                 selector = document.getElementsByTagName( selector );
    184                                 return jQuery.merge( this, selector );
    185 
    186177                        // HANDLE: $(expr, $(...))
    187178                        } else if ( !context || context.jquery ) {
     
    191182                        // (which is just equivalent to: $(context).find(expr)
    192183                        } else {
    193                                 return jQuery( context ).find( selector );
     184                                return this.constructor( context ).find( selector );
    194185                        }
    195186
     
    212203
    213204        // The current version of jQuery being used
    214         jquery: "1.4.4",
     205        jquery: "1.5",
    215206
    216207        // The default length of a jQuery object is 0
     
    235226
    236227                        // Return just the object
    237                         ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
     228                        ( num < 0 ? this[ this.length + num ] : this[ num ] );
    238229        },
    239230
     
    242233        pushStack: function( elems, name, selector ) {
    243234                // Build a new jQuery matched element set
    244                 var ret = jQuery();
     235                var ret = this.constructor();
    245236
    246237                if ( jQuery.isArray( elems ) ) {
    247238                        push.apply( ret, elems );
    248                
     239
    249240                } else {
    250241                        jQuery.merge( ret, elems );
     
    272263                return jQuery.each( this, callback, args );
    273264        },
    274        
     265
    275266        ready: function( fn ) {
    276267                // Attach the listeners
    277268                jQuery.bindReady();
    278269
    279                 // If the DOM is already ready
    280                 if ( jQuery.isReady ) {
    281                         // Execute the function immediately
    282                         fn.call( document, jQuery );
    283 
    284                 // Otherwise, remember the function for later
    285                 } else if ( readyList ) {
    286                         // Add the function to the wait list
    287                         readyList.push( fn );
    288                 }
     270                // Add the callback
     271                readyList.done( fn );
    289272
    290273                return this;
    291274        },
    292        
     275
    293276        eq: function( i ) {
    294277                return i === -1 ?
     
    315298                }));
    316299        },
    317        
     300
    318301        end: function() {
    319                 return this.prevObject || jQuery(null);
     302                return this.prevObject || this.constructor(null);
    320303        },
    321304
     
    404387                return jQuery;
    405388        },
    406        
     389
    407390        // Is the DOM ready to be used? Set to true once it occurs.
    408391        isReady: false,
     
    411394        // the ready event fires. See #6781
    412395        readyWait: 1,
    413        
     396
    414397        // Handle when the DOM is ready
    415398        ready: function( wait ) {
     
    435418
    436419                        // If there are functions bound, to execute
    437                         if ( readyList ) {
    438                                 // Execute all of them
    439                                 var fn,
    440                                         i = 0,
    441                                         ready = readyList;
    442 
    443                                 // Reset the list of functions
    444                                 readyList = null;
    445 
    446                                 while ( (fn = ready[ i++ ]) ) {
    447                                         fn.call( document, jQuery );
    448                                 }
    449 
    450                                 // Trigger any bound ready events
    451                                 if ( jQuery.fn.trigger ) {
    452                                         jQuery( document ).trigger( "ready" ).unbind( "ready" );
    453                                 }
    454                         }
    455                 }
    456         },
    457        
     420                        readyList.resolveWith( document, [ jQuery ] );
     421
     422                        // Trigger any bound ready events
     423                        if ( jQuery.fn.trigger ) {
     424                                jQuery( document ).trigger( "ready" ).unbind( "ready" );
     425                        }
     426                }
     427        },
     428
    458429        bindReady: function() {
    459430                if ( readyBound ) {
     
    474445                        // Use the handy event callback
    475446                        document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
    476                        
     447
    477448                        // A fallback to window.onload, that will always work
    478449                        window.addEventListener( "load", jQuery.ready, false );
     
    483454                        // maybe late but safe also for iframes
    484455                        document.attachEvent("onreadystatechange", DOMContentLoaded);
    485                        
     456
    486457                        // A fallback to window.onload, that will always work
    487458                        window.attachEvent( "onload", jQuery.ready );
     
    534505                        return false;
    535506                }
    536                
     507
    537508                // Not own constructor property must be Object
    538509                if ( obj.constructor &&
     
    541512                        return false;
    542513                }
    543                
     514
    544515                // Own properties are enumerated firstly, so to speed up,
    545516                // if last one is own, then all properties are own.
    546        
     517
    547518                var key;
    548519                for ( key in obj ) {}
    549                
     520
    550521                return key === undefined || hasOwn.call( obj, key );
    551522        },
     
    557528                return true;
    558529        },
    559        
     530
    560531        error: function( msg ) {
    561532                throw msg;
    562533        },
    563        
     534
    564535        parseJSON: function( data ) {
    565536                if ( typeof data !== "string" || !data ) {
     
    569540                // Make sure leading/trailing whitespace is removed (IE can't handle it)
    570541                data = jQuery.trim( data );
    571                
     542
    572543                // Make sure the incoming data is actual JSON
    573544                // Logic borrowed from http://json.org/json2.js
     
    584555                        jQuery.error( "Invalid JSON: " + data );
    585556                }
     557        },
     558
     559        // Cross-browser xml parsing
     560        // (xml & tmp used internally)
     561        parseXML: function( data , xml , tmp ) {
     562
     563                if ( window.DOMParser ) { // Standard
     564                        tmp = new DOMParser();
     565                        xml = tmp.parseFromString( data , "text/xml" );
     566                } else { // IE
     567                        xml = new ActiveXObject( "Microsoft.XMLDOM" );
     568                        xml.async = "false";
     569                        xml.loadXML( data );
     570                }
     571
     572                tmp = xml.documentElement;
     573
     574                if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
     575                        jQuery.error( "Invalid XML: " + data );
     576                }
     577
     578                return xml;
    586579        },
    587580
     
    598591                        script.type = "text/javascript";
    599592
    600                         if ( jQuery.support.scriptEval ) {
     593                        if ( jQuery.support.scriptEval() ) {
    601594                                script.appendChild( document.createTextNode( data ) );
    602595                        } else {
     
    711704                                first[ i++ ] = second[ j ];
    712705                        }
    713                
     706
    714707                } else {
    715708                        while ( second[j] !== undefined ) {
     
    753746                }
    754747
     748                // Flatten any nested arrays
    755749                return ret.concat.apply( [], ret );
    756750        },
     
    791785        access: function( elems, key, value, exec, fn, pass ) {
    792786                var length = elems.length;
    793        
     787
    794788                // Setting many attributes
    795789                if ( typeof key === "object" ) {
     
    799793                        return elems;
    800794                }
    801        
     795
    802796                // Setting one attribute
    803797                if ( value !== undefined ) {
    804798                        // Optionally, function values get executed if exec is true
    805799                        exec = !pass && exec && jQuery.isFunction(value);
    806                
     800
    807801                        for ( var i = 0; i < length; i++ ) {
    808802                                fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
    809803                        }
    810                
     804
    811805                        return elems;
    812806                }
    813        
     807
    814808                // Getting an attribute
    815809                return length ? fn( elems[0], key ) : undefined;
     
    818812        now: function() {
    819813                return (new Date()).getTime();
     814        },
     815
     816        // Create a simple deferred (one callbacks list)
     817        _Deferred: function() {
     818                var // callbacks list
     819                        callbacks = [],
     820                        // stored [ context , args ]
     821                        fired,
     822                        // to avoid firing when already doing so
     823                        firing,
     824                        // flag to know if the deferred has been cancelled
     825                        cancelled,
     826                        // the deferred itself
     827                        deferred  = {
     828
     829                                // done( f1, f2, ...)
     830                                done: function() {
     831                                        if ( !cancelled ) {
     832                                                var args = arguments,
     833                                                        i,
     834                                                        length,
     835                                                        elem,
     836                                                        type,
     837                                                        _fired;
     838                                                if ( fired ) {
     839                                                        _fired = fired;
     840                                                        fired = 0;
     841                                                }
     842                                                for ( i = 0, length = args.length; i < length; i++ ) {
     843                                                        elem = args[ i ];
     844                                                        type = jQuery.type( elem );
     845                                                        if ( type === "array" ) {
     846                                                                deferred.done.apply( deferred, elem );
     847                                                        } else if ( type === "function" ) {
     848                                                                callbacks.push( elem );
     849                                                        }
     850                                                }
     851                                                if ( _fired ) {
     852                                                        deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
     853                                                }
     854                                        }
     855                                        return this;
     856                                },
     857
     858                                // resolve with given context and args
     859                                resolveWith: function( context, args ) {
     860                                        if ( !cancelled && !fired && !firing ) {
     861                                                firing = 1;
     862                                                try {
     863                                                        while( callbacks[ 0 ] ) {
     864                                                                callbacks.shift().apply( context, args );
     865                                                        }
     866                                                }
     867                                                finally {
     868                                                        fired = [ context, args ];
     869                                                        firing = 0;
     870                                                }
     871                                        }
     872                                        return this;
     873                                },
     874
     875                                // resolve with this as context and given arguments
     876                                resolve: function() {
     877                                        deferred.resolveWith( jQuery.isFunction( this.promise ) ? this.promise() : this, arguments );
     878                                        return this;
     879                                },
     880
     881                                // Has this deferred been resolved?
     882                                isResolved: function() {
     883                                        return !!( firing || fired );
     884                                },
     885
     886                                // Cancel
     887                                cancel: function() {
     888                                        cancelled = 1;
     889                                        callbacks = [];
     890                                        return this;
     891                                }
     892                        };
     893
     894                return deferred;
     895        },
     896
     897        // Full fledged deferred (two callbacks list)
     898        Deferred: function( func ) {
     899                var deferred = jQuery._Deferred(),
     900                        failDeferred = jQuery._Deferred(),
     901                        promise;
     902                // Add errorDeferred methods, then and promise
     903                jQuery.extend( deferred, {
     904                        then: function( doneCallbacks, failCallbacks ) {
     905                                deferred.done( doneCallbacks ).fail( failCallbacks );
     906                                return this;
     907                        },
     908                        fail: failDeferred.done,
     909                        rejectWith: failDeferred.resolveWith,
     910                        reject: failDeferred.resolve,
     911                        isRejected: failDeferred.isResolved,
     912                        // Get a promise for this deferred
     913                        // If obj is provided, the promise aspect is added to the object
     914                        promise: function( obj , i /* internal */ ) {
     915                                if ( obj == null ) {
     916                                        if ( promise ) {
     917                                                return promise;
     918                                        }
     919                                        promise = obj = {};
     920                                }
     921                                i = promiseMethods.length;
     922                                while( i-- ) {
     923                                        obj[ promiseMethods[ i ] ] = deferred[ promiseMethods[ i ] ];
     924                                }
     925                                return obj;
     926                        }
     927                } );
     928                // Make sure only one callback list will be used
     929                deferred.then( failDeferred.cancel, deferred.cancel );
     930                // Unexpose cancel
     931                delete deferred.cancel;
     932                // Call given func if any
     933                if ( func ) {
     934                        func.call( deferred, deferred );
     935                }
     936                return deferred;
     937        },
     938
     939        // Deferred helper
     940        when: function( object ) {
     941                var args = arguments,
     942                        length = args.length,
     943                        deferred = length <= 1 && object && jQuery.isFunction( object.promise ) ?
     944                                object :
     945                                jQuery.Deferred(),
     946                        promise = deferred.promise(),
     947                        resolveArray;
     948
     949                if ( length > 1 ) {
     950                        resolveArray = new Array( length );
     951                        jQuery.each( args, function( index, element ) {
     952                                jQuery.when( element ).then( function( value ) {
     953                                        resolveArray[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value;
     954                                        if( ! --length ) {
     955                                                deferred.resolveWith( promise, resolveArray );
     956                                        }
     957                                }, deferred.reject );
     958                        } );
     959                } else if ( deferred !== object ) {
     960                        deferred.resolve( object );
     961                }
     962                return promise;
    820963        },
    821964
     
    834977        },
    835978
     979        sub: function() {
     980                function jQuerySubclass( selector, context ) {
     981                        return new jQuerySubclass.fn.init( selector, context );
     982                }
     983                jQuery.extend( true, jQuerySubclass, this );
     984                jQuerySubclass.superclass = this;
     985                jQuerySubclass.fn = jQuerySubclass.prototype = this();
     986                jQuerySubclass.fn.constructor = jQuerySubclass;
     987                jQuerySubclass.subclass = this.subclass;
     988                jQuerySubclass.fn.init = function init( selector, context ) {
     989                        if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) {
     990                                context = jQuerySubclass(context);
     991                        }
     992
     993                        return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass );
     994                };
     995                jQuerySubclass.fn.init.prototype = jQuerySubclass.fn;
     996                var rootjQuerySubclass = jQuerySubclass(document);
     997                return jQuerySubclass;
     998        },
     999
    8361000        browser: {}
    8371001});
     1002
     1003// Create readyList deferred
     1004readyList = jQuery._Deferred();
    8381005
    8391006// Populate the class2type map
     
    8591026}
    8601027
    861 // Verify that \s matches non-breaking spaces
    862 // (IE fails on this test)
    863 if ( !rwhite.test( "\xA0" ) ) {
     1028// IE doesn't match non-breaking spaces with \s
     1029if ( rnotwhite.test( "\xA0" ) ) {
    8641030        trimLeft = /^[\s\xA0]+/;
    8651031        trimRight = /[\s\xA0]+$/;
     
    9151081        jQuery.support = {};
    9161082
    917         var root = document.documentElement,
    918                 script = document.createElement("script"),
    919                 div = document.createElement("div"),
    920                 id = "script" + jQuery.now();
     1083        var div = document.createElement("div");
    9211084
    9221085        div.style.display = "none";
     
    9751138                optDisabled: false,
    9761139                checkClone: false,
    977                 scriptEval: false,
     1140                _scriptEval: null,
    9781141                noCloneEvent: true,
    9791142                boxModel: null,
     
    9881151        jQuery.support.optDisabled = !opt.disabled;
    9891152
    990         script.type = "text/javascript";
    991         try {
    992                 script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
    993         } catch(e) {}
    994 
    995         root.insertBefore( script, root.firstChild );
    996 
    997         // Make sure that the execution of code works by injecting a script
    998         // tag with appendChild/createTextNode
    999         // (IE doesn't support this, fails, and uses .text instead)
    1000         if ( window[ id ] ) {
    1001                 jQuery.support.scriptEval = true;
    1002                 delete window[ id ];
    1003         }
     1153        jQuery.support.scriptEval = function() {
     1154                if ( jQuery.support._scriptEval === null ) {
     1155                        var root = document.documentElement,
     1156                                script = document.createElement("script"),
     1157                                id = "script" + jQuery.now();
     1158
     1159                        script.type = "text/javascript";
     1160                        try {
     1161                                script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
     1162                        } catch(e) {}
     1163
     1164                        root.insertBefore( script, root.firstChild );
     1165
     1166                        // Make sure that the execution of code works by injecting a script
     1167                        // tag with appendChild/createTextNode
     1168                        // (IE doesn't support this, fails, and uses .text instead)
     1169                        if ( window[ id ] ) {
     1170                                jQuery.support._scriptEval = true;
     1171                                delete window[ id ];
     1172                        } else {
     1173                                jQuery.support._scriptEval = false;
     1174                        }
     1175
     1176                        root.removeChild( script );
     1177                        // release memory in IE
     1178                        root = script = id  = null;
     1179                }
     1180
     1181                return jQuery.support._scriptEval;
     1182        };
    10041183
    10051184        // Test to see if it's possible to delete an expando from an element
    10061185        // Fails in Internet Explorer
    10071186        try {
    1008                 delete script.test;
     1187                delete div.test;
    10091188
    10101189        } catch(e) {
    10111190                jQuery.support.deleteExpando = false;
    10121191        }
    1013 
    1014         root.removeChild( script );
    10151192
    10161193        if ( div.attachEvent && div.fireEvent ) {
     
    10361213        // document.body must exist before we can do this
    10371214        jQuery(function() {
    1038                 var div = document.createElement("div");
     1215                var div = document.createElement("div"),
     1216                        body = document.getElementsByTagName("body")[0];
     1217
     1218                // Frameset documents with no body should not run this code
     1219                if ( !body ) {
     1220                        return;
     1221                }
     1222
    10391223                div.style.width = div.style.paddingLeft = "1px";
    1040 
    1041                 document.body.appendChild( div );
     1224                body.appendChild( div );
    10421225                jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
    10431226
     
    10581241                }
    10591242
    1060                 div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";
     1243                div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
    10611244                var tds = div.getElementsByTagName("td");
    10621245
     
    10781261                div.innerHTML = "";
    10791262
    1080                 document.body.removeChild( div ).style.display = "none";
     1263                body.removeChild( div ).style.display = "none";
    10811264                div = tds = null;
    10821265        });
     
    10881271                eventName = "on" + eventName;
    10891272
     1273                // We only care about the case where non-standard event systems
     1274                // are used, namely in IE. Short-circuiting here helps us to
     1275                // avoid an eval call (in setAttribute) which can cause CSP
     1276                // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
     1277                if ( !el.attachEvent ) {
     1278                        return true;
     1279                }
     1280
    10901281                var isSupported = (eventName in el);
    10911282                if ( !isSupported ) {
     
    11021293
    11031294        // release memory in IE
    1104         root = script = div = all = a = null;
     1295        div = all = a = null;
    11051296})();
    11061297
    11071298
    11081299
    1109 var windowData = {},
    1110         rbrace = /^(?:\{.*\}|\[.*\])$/;
     1300var rbrace = /^(?:\{.*\}|\[.*\])$/;
    11111301
    11121302jQuery.extend({
     
    11161306        uuid: 0,
    11171307
    1118         // Unique for each copy of jQuery on the page   
    1119         expando: "jQuery" + jQuery.now(),
     1308        // Unique for each copy of jQuery on the page
     1309        // Non-digits removed to match rinlinejQuery
     1310        expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
    11201311
    11211312        // The following elements throw uncatchable exceptions if you
     
    11281319        },
    11291320
    1130         data: function( elem, name, data ) {
     1321        hasData: function( elem ) {
     1322                elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
     1323
     1324                return !!elem && !jQuery.isEmptyObject(elem);
     1325        },
     1326
     1327        data: function( elem, name, data, pvt /* Internal Use Only */ ) {
    11311328                if ( !jQuery.acceptData( elem ) ) {
    11321329                        return;
    11331330                }
    11341331
    1135                 elem = elem == window ?
    1136                         windowData :
    1137                         elem;
    1138 
    1139                 var isNode = elem.nodeType,
    1140                         id = isNode ? elem[ jQuery.expando ] : null,
    1141                         cache = jQuery.cache, thisCache;
    1142 
    1143                 if ( isNode && !id && typeof name === "string" && data === undefined ) {
     1332                var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
     1333
     1334                        // We have to handle DOM nodes and JS objects differently because IE6-7
     1335                        // can't GC object references properly across the DOM-JS boundary
     1336                        isNode = elem.nodeType,
     1337
     1338                        // Only DOM nodes need the global jQuery cache; JS object data is
     1339                        // attached directly to the object so GC can occur automatically
     1340                        cache = isNode ? jQuery.cache : elem,
     1341
     1342                        // Only defining an ID for JS objects if its cache already exists allows
     1343                        // the code to shortcut on the same path as a DOM node with no cache
     1344                        id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
     1345
     1346                // Avoid doing any more work than we need to when trying to get data on an
     1347                // object that has no data at all
     1348                if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
    11441349                        return;
    11451350                }
    11461351
    1147                 // Get the data from the object directly
    1148                 if ( !isNode ) {
    1149                         cache = elem;
    1150 
    1151                 // Compute a unique ID for the element
    1152                 } else if ( !id ) {
    1153                         elem[ jQuery.expando ] = id = ++jQuery.uuid;
    1154                 }
    1155 
    1156                 // Avoid generating a new cache unless none exists and we
    1157                 // want to manipulate it.
     1352                if ( !id ) {
     1353                        // Only DOM nodes need a new unique ID for each element since their data
     1354                        // ends up in the global cache
     1355                        if ( isNode ) {
     1356                                elem[ jQuery.expando ] = id = ++jQuery.uuid;
     1357                        } else {
     1358                                id = jQuery.expando;
     1359                        }
     1360                }
     1361
     1362                if ( !cache[ id ] ) {
     1363                        cache[ id ] = {};
     1364                }
     1365
     1366                // An object can be passed to jQuery.data instead of a key/value pair; this gets
     1367                // shallow copied over onto the existing cache
    11581368                if ( typeof name === "object" ) {
    1159                         if ( isNode ) {
     1369                        if ( pvt ) {
     1370                                cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
     1371                        } else {
    11601372                                cache[ id ] = jQuery.extend(cache[ id ], name);
    1161 
    1162                         } else {
    1163                                 jQuery.extend( cache, name );
    1164                         }
    1165 
    1166                 } else if ( isNode && !cache[ id ] ) {
    1167                         cache[ id ] = {};
    1168                 }
    1169 
    1170                 thisCache = isNode ? cache[ id ] : cache;
    1171 
    1172                 // Prevent overriding the named cache with undefined values
     1373                        }
     1374                }
     1375
     1376                thisCache = cache[ id ];
     1377
     1378                // Internal jQuery data is stored in a separate object inside the object's data
     1379                // cache in order to avoid key collisions between internal data and user-defined
     1380                // data
     1381                if ( pvt ) {
     1382                        if ( !thisCache[ internalKey ] ) {
     1383                                thisCache[ internalKey ] = {};
     1384                        }
     1385
     1386                        thisCache = thisCache[ internalKey ];
     1387                }
     1388
    11731389                if ( data !== undefined ) {
    11741390                        thisCache[ name ] = data;
    11751391                }
    11761392
    1177                 return typeof name === "string" ? thisCache[ name ] : thisCache;
    1178         },
    1179 
    1180         removeData: function( elem, name ) {
     1393                // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
     1394                // not attempt to inspect the internal events object using jQuery.data, as this
     1395                // internal data object is undocumented and subject to change.
     1396                if ( name === "events" && !thisCache[name] ) {
     1397                        return thisCache[ internalKey ] && thisCache[ internalKey ].events;
     1398                }
     1399
     1400                return getByName ? thisCache[ name ] : thisCache;
     1401        },
     1402
     1403        removeData: function( elem, name, pvt /* Internal Use Only */ ) {
    11811404                if ( !jQuery.acceptData( elem ) ) {
    11821405                        return;
    11831406                }
    11841407
    1185                 elem = elem == window ?
    1186                         windowData :
    1187                         elem;
    1188 
    1189                 var isNode = elem.nodeType,
    1190                         id = isNode ? elem[ jQuery.expando ] : elem,
    1191                         cache = jQuery.cache,
    1192                         thisCache = isNode ? cache[ id ] : id;
    1193 
    1194                 // If we want to remove a specific section of the element's data
     1408                var internalKey = jQuery.expando, isNode = elem.nodeType,
     1409
     1410                        // See jQuery.data for more information
     1411                        cache = isNode ? jQuery.cache : elem,
     1412
     1413                        // See jQuery.data for more information
     1414                        id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
     1415
     1416                // If there is already no cache entry for this object, there is no
     1417                // purpose in continuing
     1418                if ( !cache[ id ] ) {
     1419                        return;
     1420                }
     1421
    11951422                if ( name ) {
     1423                        var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
     1424
    11961425                        if ( thisCache ) {
    1197                                 // Remove the section of cache data
    11981426                                delete thisCache[ name ];
    11991427
    1200                                 // If we've removed all the data, remove the element's cache
    1201                                 if ( isNode && jQuery.isEmptyObject(thisCache) ) {
    1202                                         jQuery.removeData( elem );
    1203                                 }
    1204                         }
    1205 
    1206                 // Otherwise, we want to remove all of the element's data
     1428                                // If there is no data left in the cache, we want to continue
     1429                                // and let the cache object itself get destroyed
     1430                                if ( !jQuery.isEmptyObject(thisCache) ) {
     1431                                        return;
     1432                                }
     1433                        }
     1434                }
     1435
     1436                // See jQuery.data for more information
     1437                if ( pvt ) {
     1438                        delete cache[ id ][ internalKey ];
     1439
     1440                        // Don't destroy the parent cache unless the internal data object
     1441                        // had been the only thing left in it
     1442                        if ( !jQuery.isEmptyObject(cache[ id ]) ) {
     1443                                return;
     1444                        }
     1445                }
     1446
     1447                var internalCache = cache[ id ][ internalKey ];
     1448
     1449                // Browsers that fail expando deletion also refuse to delete expandos on
     1450                // the window, but it will allow it on all other JS objects; other browsers
     1451                // don't care
     1452                if ( jQuery.support.deleteExpando || cache != window ) {
     1453                        delete cache[ id ];
    12071454                } else {
    1208                         if ( isNode && jQuery.support.deleteExpando ) {
     1455                        cache[ id ] = null;
     1456                }
     1457
     1458                // We destroyed the entire user cache at once because it's faster than
     1459                // iterating through each key, but we need to continue to persist internal
     1460                // data if it existed
     1461                if ( internalCache ) {
     1462                        cache[ id ] = {};
     1463                        cache[ id ][ internalKey ] = internalCache;
     1464
     1465                // Otherwise, we need to eliminate the expando on the node to avoid
     1466                // false lookups in the cache for entries that no longer exist
     1467                } else if ( isNode ) {
     1468                        // IE does not allow us to delete expando properties from nodes,
     1469                        // nor does it have a removeAttribute function on Document nodes;
     1470                        // we must handle all of these cases
     1471                        if ( jQuery.support.deleteExpando ) {
    12091472                                delete elem[ jQuery.expando ];
    1210 
    12111473                        } else if ( elem.removeAttribute ) {
    12121474                                elem.removeAttribute( jQuery.expando );
    1213 
    1214                         // Completely remove the data cache
    1215                         } else if ( isNode ) {
    1216                                 delete cache[ id ];
    1217 
    1218                         // Remove all fields from the object
    12191475                        } else {
    1220                                 for ( var n in elem ) {
    1221                                         delete elem[ n ];
    1222                                 }
    1223                         }
    1224                 }
     1476                                elem[ jQuery.expando ] = null;
     1477                        }
     1478                }
     1479        },
     1480
     1481        // For internal use only.
     1482        _data: function( elem, name, data ) {
     1483                return jQuery.data( elem, name, data, true );
    12251484        },
    12261485
     
    12451504                if ( typeof key === "undefined" ) {
    12461505                        if ( this.length ) {
    1247                                 var attr = this[0].attributes, name;
    12481506                                data = jQuery.data( this[0] );
    12491507
    1250                                 for ( var i = 0, l = attr.length; i < l; i++ ) {
    1251                                         name = attr[i].name;
    1252 
    1253                                         if ( name.indexOf( "data-" ) === 0 ) {
    1254                                                 name = name.substr( 5 );
    1255                                                 dataAttr( this[0], name, data[ name ] );
     1508                                if ( this[0].nodeType === 1 ) {
     1509                                        var attr = this[0].attributes, name;
     1510                                        for ( var i = 0, l = attr.length; i < l; i++ ) {
     1511                                                name = attr[i].name;
     1512
     1513                                                if ( name.indexOf( "data-" ) === 0 ) {
     1514                                                        name = name.substr( 5 );
     1515                                                        dataAttr( this[0], name, data[ name ] );
     1516                                                }
    12561517                                        }
    12571518                                }
     
    13381599
    13391600                type = (type || "fx") + "queue";
    1340                 var q = jQuery.data( elem, type );
     1601                var q = jQuery._data( elem, type );
    13411602
    13421603                // Speed up dequeue by getting out quickly if this is just a lookup
     
    13461607
    13471608                if ( !q || jQuery.isArray(data) ) {
    1348                         q = jQuery.data( elem, type, jQuery.makeArray(data) );
     1609                        q = jQuery._data( elem, type, jQuery.makeArray(data) );
    13491610
    13501611                } else {
     
    13761637                                jQuery.dequeue(elem, type);
    13771638                        });
     1639                }
     1640
     1641                if ( !queue.length ) {
     1642                        jQuery.removeData( elem, type + "queue", true );
    13781643                }
    13791644        }
     
    14261691
    14271692
    1428 var rclass = /[\n\t]/g,
     1693var rclass = /[\n\t\r]/g,
    14291694        rspaces = /\s+/,
    14301695        rreturn = /\r/g,
     
    15591824                                if ( this.className ) {
    15601825                                        // store className if set
    1561                                         jQuery.data( this, "__className__", this.className );
     1826                                        jQuery._data( this, "__className__", this.className );
    15621827                                }
    15631828
    15641829                                // toggle whole className
    1565                                 this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
     1830                                this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
    15661831                        }
    15671832                });
     
    16081873
    16091874                                                // Don't return options that are disabled or in a disabled optgroup
    1610                                                 if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && 
     1875                                                if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
    16111876                                                                (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
    16121877
     
    16311896                                        return elem.getAttribute("value") === null ? "on" : elem.value;
    16321897                                }
    1633                                
    16341898
    16351899                                // Everything else, we just grab the value
     
    16971961                offset: true
    16981962        },
    1699                
     1963
    17001964        attr: function( elem, name, value, pass ) {
    1701                 // don't set attributes on text and comment nodes
    1702                 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
     1965                // don't get/set attributes on text, comment and attribute nodes
     1966                if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || elem.nodeType === 2 ) {
    17031967                        return undefined;
    17041968                }
     
    17151979                name = notxml && jQuery.props[ name ] || name;
    17161980
    1717                 // These attributes require special treatment
    1718                 var special = rspecialurl.test( name );
    1719 
    1720                 // Safari mis-reports the default selected property of an option
    1721                 // Accessing the parent's selectedIndex property fixes it
    1722                 if ( name === "selected" && !jQuery.support.optSelected ) {
    1723                         var parent = elem.parentNode;
    1724                         if ( parent ) {
    1725                                 parent.selectedIndex;
    1726 
    1727                                 // Make sure that it also works with optgroups, see #5701
    1728                                 if ( parent.parentNode ) {
    1729                                         parent.parentNode.selectedIndex;
    1730                                 }
    1731                         }
    1732                 }
    1733 
    1734                 // If applicable, access the attribute via the DOM 0 way
    1735                 // 'in' checks fail in Blackberry 4.7 #6931
    1736                 if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {
     1981                // Only do all the following if this is a node (faster for style)
     1982                if ( elem.nodeType === 1 ) {
     1983                        // These attributes require special treatment
     1984                        var special = rspecialurl.test( name );
     1985
     1986                        // Safari mis-reports the default selected property of an option
     1987                        // Accessing the parent's selectedIndex property fixes it
     1988                        if ( name === "selected" && !jQuery.support.optSelected ) {
     1989                                var parent = elem.parentNode;
     1990                                if ( parent ) {
     1991                                        parent.selectedIndex;
     1992
     1993                                        // Make sure that it also works with optgroups, see #5701
     1994                                        if ( parent.parentNode ) {
     1995                                                parent.parentNode.selectedIndex;
     1996                                        }
     1997                                }
     1998                        }
     1999
     2000                        // If applicable, access the attribute via the DOM 0 way
     2001                        // 'in' checks fail in Blackberry 4.7 #6931
     2002                        if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {
     2003                                if ( set ) {
     2004                                        // We can't allow the type property to be changed (since it causes problems in IE)
     2005                                        if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
     2006                                                jQuery.error( "type property can't be changed" );
     2007                                        }
     2008
     2009                                        if ( value === null ) {
     2010                                                if ( elem.nodeType === 1 ) {
     2011                                                        elem.removeAttribute( name );
     2012                                                }
     2013
     2014                                        } else {
     2015                                                elem[ name ] = value;
     2016                                        }
     2017                                }
     2018
     2019                                // browsers index elements by id/name on forms, give priority to attributes.
     2020                                if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
     2021                                        return elem.getAttributeNode( name ).nodeValue;
     2022                                }
     2023
     2024                                // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
     2025                                // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
     2026                                if ( name === "tabIndex" ) {
     2027                                        var attributeNode = elem.getAttributeNode( "tabIndex" );
     2028
     2029                                        return attributeNode && attributeNode.specified ?
     2030                                                attributeNode.value :
     2031                                                rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
     2032                                                        0 :
     2033                                                        undefined;
     2034                                }
     2035
     2036                                return elem[ name ];
     2037                        }
     2038
     2039                        if ( !jQuery.support.style && notxml && name === "style" ) {
     2040                                if ( set ) {
     2041                                        elem.style.cssText = "" + value;
     2042                                }
     2043
     2044                                return elem.style.cssText;
     2045                        }
     2046
    17372047                        if ( set ) {
    1738                                 // We can't allow the type property to be changed (since it causes problems in IE)
    1739                                 if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
    1740                                         jQuery.error( "type property can't be changed" );
    1741                                 }
    1742 
    1743                                 if ( value === null ) {
    1744                                         if ( elem.nodeType === 1 ) {
    1745                                                 elem.removeAttribute( name );
    1746                                         }
    1747 
    1748                                 } else {
    1749                                         elem[ name ] = value;
    1750                                 }
    1751                         }
    1752 
    1753                         // browsers index elements by id/name on forms, give priority to attributes.
    1754                         if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
    1755                                 return elem.getAttributeNode( name ).nodeValue;
    1756                         }
    1757 
    1758                         // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
    1759                         // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
    1760                         if ( name === "tabIndex" ) {
    1761                                 var attributeNode = elem.getAttributeNode( "tabIndex" );
    1762 
    1763                                 return attributeNode && attributeNode.specified ?
    1764                                         attributeNode.value :
    1765                                         rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
    1766                                                 0 :
    1767                                                 undefined;
    1768                         }
    1769 
    1770                         return elem[ name ];
    1771                 }
    1772 
    1773                 if ( !jQuery.support.style && notxml && name === "style" ) {
    1774                         if ( set ) {
    1775                                 elem.style.cssText = "" + value;
    1776                         }
    1777 
    1778                         return elem.style.cssText;
    1779                 }
    1780 
     2048                                // convert the value to a string (all browsers do this but IE) see #1070
     2049                                elem.setAttribute( name, "" + value );
     2050                        }
     2051
     2052                        // Ensure that missing attributes return undefined
     2053                        // Blackberry 4.7 returns "" from getAttribute #6938
     2054                        if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
     2055                                return undefined;
     2056                        }
     2057
     2058                        var attr = !jQuery.support.hrefNormalized && notxml && special ?
     2059                                        // Some attributes require a special call on IE
     2060                                        elem.getAttribute( name, 2 ) :
     2061                                        elem.getAttribute( name );
     2062
     2063                        // Non-existent attributes return null, we normalize to undefined
     2064                        return attr === null ? undefined : attr;
     2065                }
     2066                // Handle everything which isn't a DOM element node
    17812067                if ( set ) {
    1782                         // convert the value to a string (all browsers do this but IE) see #1070
    1783                         elem.setAttribute( name, "" + value );
    1784                 }
    1785 
    1786                 // Ensure that missing attributes return undefined
    1787                 // Blackberry 4.7 returns "" from getAttribute #6938
    1788                 if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
    1789                         return undefined;
    1790                 }
    1791 
    1792                 var attr = !jQuery.support.hrefNormalized && notxml && special ?
    1793                                 // Some attributes require a special call on IE
    1794                                 elem.getAttribute( name, 2 ) :
    1795                                 elem.getAttribute( name );
    1796 
    1797                 // Non-existent attributes return null, we normalize to undefined
    1798                 return attr === null ? undefined : attr;
     2068                        elem[ name ] = value;
     2069                }
     2070                return elem[ name ];
    17992071        }
    18002072});
     
    18112083                return nm.replace(rescape, "\\$&");
    18122084        },
    1813         focusCounts = { focusin: 0, focusout: 0 };
     2085        eventKey = "events";
    18142086
    18152087/*
     
    18532125
    18542126                // Init the element's event structure
    1855                 var elemData = jQuery.data( elem );
     2127                var elemData = jQuery._data( elem );
    18562128
    18572129                // If no elemData is found then we must be trying to bind to one of the
     
    18612133                }
    18622134
    1863                 // Use a key less likely to result in collisions for plain JS objects.
    1864                 // Fixes bug #7150.
    1865                 var eventKey = elem.nodeType ? "events" : "__events__",
    1866                         events = elemData[ eventKey ],
     2135                var events = elemData[ eventKey ],
    18672136                        eventHandle = elemData.handle;
    1868                        
     2137
    18692138                if ( typeof events === "function" ) {
    18702139                        // On plain objects events is a fn that holds the the data
     
    19462215                                }
    19472216                        }
    1948                        
    1949                         if ( special.add ) { 
    1950                                 special.add.call( elem, handleObj ); 
     2217
     2218                        if ( special.add ) {
     2219                                special.add.call( elem, handleObj );
    19512220
    19522221                                if ( !handleObj.handler.guid ) {
     
    19802249
    19812250                var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
    1982                         eventKey = elem.nodeType ? "events" : "__events__",
    1983                         elemData = jQuery.data( elem ),
     2251                        elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
    19842252                        events = elemData && elemData[ eventKey ];
    19852253
     
    19872255                        return;
    19882256                }
    1989                
     2257
    19902258                if ( typeof events === "function" ) {
    19912259                        elemData = events;
     
    20252293                                type = namespaces.shift();
    20262294
    2027                                 namespace = new RegExp("(^|\\.)" + 
     2295                                namespace = new RegExp("(^|\\.)" +
    20282296                                        jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
    20292297                        }
     
    20932361
    20942362                        if ( typeof elemData === "function" ) {
    2095                                 jQuery.removeData( elem, eventKey );
     2363                                jQuery.removeData( elem, eventKey, true );
    20962364
    20972365                        } else if ( jQuery.isEmptyObject( elemData ) ) {
    2098                                 jQuery.removeData( elem );
     2366                                jQuery.removeData( elem, undefined, true );
    20992367                        }
    21002368                }
     
    21282396                                // Only trigger if we've ever bound an event for it
    21292397                                if ( jQuery.event.global[ type ] ) {
     2398                                        // XXX This code smells terrible. event.js should not be directly
     2399                                        // inspecting the data cache
    21302400                                        jQuery.each( jQuery.cache, function() {
    2131                                                 if ( this.events && this.events[type] ) {
    2132                                                         jQuery.event.trigger( event, data, this.handle.elem );
     2401                                                // internalKey variable is just used to make it easier to find
     2402                                                // and potentially change this stuff later; currently it just
     2403                                                // points to jQuery.expando
     2404                                                var internalKey = jQuery.expando,
     2405                                                        internalCache = this[ internalKey ];
     2406                                                if ( internalCache && internalCache.events && internalCache.events[type] ) {
     2407                                                        jQuery.event.trigger( event, data, internalCache.handle.elem );
    21332408                                                }
    21342409                                        });
     
    21562431                // Trigger the event, it is assumed that "handle" is a function
    21572432                var handle = elem.nodeType ?
    2158                         jQuery.data( elem, "handle" ) :
    2159                         (jQuery.data( elem, "__events__" ) || {}).handle;
     2433                        jQuery._data( elem, "handle" ) :
     2434                        (jQuery._data( elem, eventKey ) || {}).handle;
    21602435
    21612436                if ( handle ) {
     
    21872462                                special = jQuery.event.special[ targetType ] || {};
    21882463
    2189                         if ( (!special._default || special._default.call( elem, event ) === false) && 
     2464                        if ( (!special._default || special._default.call( elem, event ) === false) &&
    21902465                                !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
    21912466
     
    22352510                event.namespace = event.namespace || namespace_sort.join(".");
    22362511
    2237                 events = jQuery.data(this, this.nodeType ? "events" : "__events__");
     2512                events = jQuery._data(this, eventKey);
    22382513
    22392514                if ( typeof events === "function" ) {
     
    22572532                                        event.data = handleObj.data;
    22582533                                        event.handleObj = handleObj;
    2259        
     2534
    22602535                                        var ret = handleObj.handler.apply( this, args );
    22612536
     
    23562631                                jQuery.event.add( this,
    23572632                                        liveConvert( handleObj.origType, handleObj.selector ),
    2358                                         jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); 
     2633                                        jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
    23592634                        },
    23602635
     
    23862661                        elem.removeEventListener( type, handle, false );
    23872662                }
    2388         } : 
     2663        } :
    23892664        function( elem, type, handle ) {
    23902665                if ( elem.detachEvent ) {
     
    24032678                this.originalEvent = src;
    24042679                this.type = src.type;
     2680
     2681                // Events bubbling up the document may have been marked as prevented
     2682                // by a handler lower down the tree; reflect the correct value.
     2683                this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
     2684                        src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
     2685
    24052686        // Event type
    24062687        } else {
     
    24332714                        return;
    24342715                }
    2435                
     2716
    24362717                // if preventDefault exists run it on the original event
    24372718                if ( e.preventDefault ) {
     
    25192800        jQuery.event.special.submit = {
    25202801                setup: function( data, namespaces ) {
    2521                         if ( this.nodeName.toLowerCase() !== "form" ) {
     2802                        if ( this.nodeName && this.nodeName.toLowerCase() !== "form" ) {
    25222803                                jQuery.event.add(this, "click.specialSubmit", function( e ) {
    25232804                                        var elem = e.target,
     
    25292810                                        }
    25302811                                });
    2531          
     2812
    25322813                                jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
    25332814                                        var elem = e.target,
     
    25842865                }
    25852866
    2586                 data = jQuery.data( elem, "_change_data" );
     2867                data = jQuery._data( elem, "_change_data" );
    25872868                val = getVal(elem);
    25882869
    25892870                // the current data will be also retrieved by beforeactivate
    25902871                if ( e.type !== "focusout" || elem.type !== "radio" ) {
    2591                         jQuery.data( elem, "_change_data", val );
    2592                 }
    2593                
     2872                        jQuery._data( elem, "_change_data", val );
     2873                }
     2874
    25942875                if ( data === undefined || val === data ) {
    25952876                        return;
     
    26052886        jQuery.event.special.change = {
    26062887                filters: {
    2607                         focusout: testChange, 
     2888                        focusout: testChange,
    26082889
    26092890                        beforedeactivate: testChange,
     
    26342915                        beforeactivate: function( e ) {
    26352916                                var elem = e.target;
    2636                                 jQuery.data( elem, "_change_data", getVal(elem) );
     2917                                jQuery._data( elem, "_change_data", getVal(elem) );
    26372918                        }
    26382919                },
     
    26732954                jQuery.event.special[ fix ] = {
    26742955                        setup: function() {
    2675                                 if ( focusCounts[fix]++ === 0 ) {
    2676                                         document.addEventListener( orig, handler, true );
    2677                                 }
     2956                                this.addEventListener( orig, handler, true );
    26782957                        },
    26792958                        teardown: function() {
    2680                                 if ( --focusCounts[fix] === 0 ) {
    2681                                         document.removeEventListener( orig, handler, true );
    2682                                 }
     2959                                this.removeEventListener( orig, handler, true );
    26832960                        }
    26842961                };
    26852962
    2686                 function handler( e ) { 
     2963                function handler( e ) {
    26872964                        e = jQuery.event.fix( e );
    26882965                        e.type = fix;
    2689                         return jQuery.event.trigger( e, null, e.target );
     2966                        return jQuery.event.handle.call( this, e );
    26902967                }
    26912968        });
     
    27012978                        return this;
    27022979                }
    2703                
     2980
    27042981                if ( jQuery.isFunction( data ) || data === false ) {
    27052982                        fn = data;
     
    27413018                return this;
    27423019        },
    2743        
     3020
    27443021        delegate: function( selector, types, data, fn ) {
    27453022                return this.live( types, data, fn, selector );
    27463023        },
    2747        
     3024
    27483025        undelegate: function( selector, types, fn ) {
    27493026                if ( arguments.length === 0 ) {
    27503027                                return this.unbind( "live" );
    2751                
     3028
    27523029                } else {
    27533030                        return this.die( types, null, fn, selector );
    27543031                }
    27553032        },
    2756        
     3033
    27573034        trigger: function( type, data ) {
    27583035                return this.each(function() {
     
    27833060                return this.click( jQuery.proxy( fn, function( event ) {
    27843061                        // Figure out which function to execute
    2785                         var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
    2786                         jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
     3062                        var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
     3063                        jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
    27873064
    27883065                        // Make sure that clicks stop
     
    28113088                        selector = origSelector || this.selector,
    28123089                        context = origSelector ? this : jQuery( this.context );
    2813                
     3090
    28143091                if ( typeof types === "object" && !types.preventDefault ) {
    28153092                        for ( var key in types ) {
    28163093                                context[ name ]( key, data, types[key], selector );
    28173094                        }
    2818                        
     3095
    28193096                        return this;
    28203097                }
     
    28633140                        }
    28643141                }
    2865                
     3142
    28663143                return this;
    28673144        };
     
    28723149                elems = [],
    28733150                selectors = [],
    2874                 events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
     3151                events = jQuery._data( this, eventKey );
    28753152
    28763153        if ( typeof events === "function" ) {
     
    28783155        }
    28793156
    2880         // Make sure we avoid non-left-click bubbling in Firefox (#3861)
    2881         if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
     3157        // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
     3158        if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
    28823159                return;
    28833160        }
    2884        
     3161
    28853162        if ( event.namespace ) {
    28863163                namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
     
    29803257});
    29813258
    2982 // Prevent memory leaks in IE
    2983 // Window isn't included so as not to unbind existing unload events
    2984 // More info:
    2985 //  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
    2986 if ( window.attachEvent && !window.addEventListener ) {
    2987         jQuery(window).bind("unload", function() {
    2988                 for ( var id in jQuery.cache ) {
    2989                         if ( jQuery.cache[ id ].handle ) {
    2990                                 // Try/Catch is to handle iframes being unloaded, see #4280
    2991                                 try {
    2992                                         jQuery.event.remove( jQuery.cache[ id ].handle.elem );
    2993                                 } catch(e) {}
    2994                         }
    2995                 }
    2996         });
    2997 }
    2998 
    29993259
    30003260/*!
    3001  * Sizzle CSS Selector Engine - v1.0
    3002  *  Copyright 2009, The Dojo Foundation
     3261 * Sizzle CSS Selector Engine
     3262 *  Copyright 2011, The Dojo Foundation
    30033263 *  Released under the MIT, BSD, and GPL Licenses.
    30043264 *  More information: http://sizzlejs.com/
     
    32213481
    32223482        if ( !set ) {
    3223                 set = context.getElementsByTagName( "*" );
     3483                set = typeof context.getElementsByTagName !== "undefined" ?
     3484                        context.getElementsByTagName( "*" ) :
     3485                        [];
    32243486        }
    32253487
     
    33293591                CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
    33303592                NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
    3331                 ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
     3593                ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
    33323594                TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
    3333                 CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
     3595                CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
    33343596                POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
    33353597                PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
     
    34643726
    34653727                TAG: function( match, context ) {
    3466                         return context.getElementsByTagName( match[1] );
     3728                        if ( typeof context.getElementsByTagName !== "undefined" ) {
     3729                                return context.getElementsByTagName( match[1] );
     3730                        }
    34673731                }
    34683732        },
     
    34773741                        for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
    34783742                                if ( elem ) {
    3479                                         if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
     3743                                        if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
    34803744                                                if ( !inplace ) {
    34813745                                                        result.push( elem );
     
    35013765                CHILD: function( match ) {
    35023766                        if ( match[1] === "nth" ) {
     3767                                if ( !match[2] ) {
     3768                                        Sizzle.error( match[0] );
     3769                                }
     3770
     3771                                match[2] = match[2].replace(/^\+|\s*/g, '');
     3772
    35033773                                // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
    3504                                 var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
     3774                                var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
    35053775                                        match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
    35063776                                        !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
     
    35103780                                match[3] = test[3] - 0;
    35113781                        }
     3782                        else if ( match[2] ) {
     3783                                Sizzle.error( match[0] );
     3784                        }
    35123785
    35133786                        // TODO: Move to normal caching system
     
    35183791
    35193792                ATTR: function( match, curLoop, inplace, result, not, isXML ) {
    3520                         var name = match[1].replace(/\\/g, "");
     3793                        var name = match[1] = match[1].replace(/\\/g, "");
    35213794                       
    35223795                        if ( !isXML && Expr.attrMap[name] ) {
    35233796                                match[1] = Expr.attrMap[name];
    35243797                        }
     3798
     3799                        // Handle if an un-quoted value was used
     3800                        match[4] = ( match[4] || match[5] || "" ).replace(/\\/g, "");
    35253801
    35263802                        if ( match[2] === "~=" ) {
     
    36923968
    36933969                        } else {
    3694                                 Sizzle.error( "Syntax error, unrecognized expression: " + name );
     3970                                Sizzle.error( name );
    36953971                        }
    36963972                },
     
    40824358                        context = context || document;
    40834359
    4084                         // Make sure that attribute selectors are quoted
    4085                         query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
    4086 
    40874360                        // Only use querySelectorAll on non-XML documents
    40884361                        // (ID selectors don't work in non-HTML documents)
    40894362                        if ( !seed && !Sizzle.isXML(context) ) {
     4363                                // See if we find a selector to speed up
     4364                                var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
     4365                               
     4366                                if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
     4367                                        // Speed-up: Sizzle("TAG")
     4368                                        if ( match[1] ) {
     4369                                                return makeArray( context.getElementsByTagName( query ), extra );
     4370                                       
     4371                                        // Speed-up: Sizzle(".CLASS")
     4372                                        } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
     4373                                                return makeArray( context.getElementsByClassName( match[2] ), extra );
     4374                                        }
     4375                                }
     4376                               
    40904377                                if ( context.nodeType === 9 ) {
     4378                                        // Speed-up: Sizzle("body")
     4379                                        // The body element only exists once, optimize finding it
     4380                                        if ( query === "body" && context.body ) {
     4381                                                return makeArray( [ context.body ], extra );
     4382                                               
     4383                                        // Speed-up: Sizzle("#ID")
     4384                                        } else if ( match && match[3] ) {
     4385                                                var elem = context.getElementById( match[3] );
     4386
     4387                                                // Check parentNode to catch when Blackberry 4.6 returns
     4388                                                // nodes that are no longer in the document #6963
     4389                                                if ( elem && elem.parentNode ) {
     4390                                                        // Handle the case where IE and Opera return items
     4391                                                        // by name instead of ID
     4392                                                        if ( elem.id === match[3] ) {
     4393                                                                return makeArray( [ elem ], extra );
     4394                                                        }
     4395                                                       
     4396                                                } else {
     4397                                                        return makeArray( [], extra );
     4398                                                }
     4399                                        }
     4400                                       
    40914401                                        try {
    40924402                                                return makeArray( context.querySelectorAll(query), extra );
     
    40994409                                } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
    41004410                                        var old = context.getAttribute( "id" ),
    4101                                                 nid = old || id;
     4411                                                nid = old || id,
     4412                                                hasParent = context.parentNode,
     4413                                                relativeHierarchySelector = /^\s*[+~]/.test( query );
    41024414
    41034415                                        if ( !old ) {
    41044416                                                context.setAttribute( "id", nid );
     4417                                        } else {
     4418                                                nid = nid.replace( /'/g, "\\$&" );
     4419                                        }
     4420                                        if ( relativeHierarchySelector && hasParent ) {
     4421                                                context = context.parentNode;
    41054422                                        }
    41064423
    41074424                                        try {
    4108                                                 return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra );
     4425                                                if ( !relativeHierarchySelector || hasParent ) {
     4426                                                        return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
     4427                                                }
    41094428
    41104429                                        } catch(pseudoError) {
     
    43294648        isSimple = /^.[^:#\[\.,]*$/,
    43304649        slice = Array.prototype.slice,
    4331         POS = jQuery.expr.match.POS;
     4650        POS = jQuery.expr.match.POS,
     4651        // methods guaranteed to produce a unique set when starting from a unique set
     4652        guaranteedUnique = {
     4653                children: true,
     4654                contents: true,
     4655                next: true,
     4656                prev: true
     4657        };
    43324658
    43334659jQuery.fn.extend({
     
    43744700                return this.pushStack( winnow(this, selector, true), "filter", selector );
    43754701        },
    4376        
     4702
    43774703        is: function( selector ) {
    43784704                return !!selector && jQuery.filter( selector, this ).length > 0;
     
    43924718
    43934719                                        if ( !matches[selector] ) {
    4394                                                 matches[selector] = jQuery.expr.match.POS.test( selector ) ? 
     4720                                                matches[selector] = jQuery.expr.match.POS.test( selector ) ?
    43954721                                                        jQuery( selector, context || this.context ) :
    43964722                                                        selector;
     
    44154741                }
    44164742
    4417                 var pos = POS.test( selectors ) ? 
     4743                var pos = POS.test( selectors ) ?
    44184744                        jQuery( selectors, context || this.context ) : null;
    44194745
     
    44364762
    44374763                ret = ret.length > 1 ? jQuery.unique(ret) : ret;
    4438                
     4764
    44394765                return this.pushStack( ret, "closest", selectors );
    44404766        },
    4441        
     4767
    44424768        // Determine the position of an element within
    44434769        // the matched set of elements
     
    44574783        add: function( selector, context ) {
    44584784                var set = typeof selector === "string" ?
    4459                                 jQuery( selector, context || this.context ) :
     4785                                jQuery( selector, context ) :
    44604786                                jQuery.makeArray( selector ),
    44614787                        all = jQuery.merge( this.get(), set );
     
    45194845}, function( name, fn ) {
    45204846        jQuery.fn[ name ] = function( until, selector ) {
    4521                 var ret = jQuery.map( this, fn, until );
    4522                
     4847                var ret = jQuery.map( this, fn, until ),
     4848                // The variable 'args' was introduced in
     4849                // https://github.com/jquery/jquery/commit/52a0238
     4850                // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
     4851                // http://code.google.com/p/v8/issues/detail?id=1050
     4852                    args = slice.call(arguments);
     4853
    45234854                if ( !runtil.test( name ) ) {
    45244855                        selector = until;
     
    45294860                }
    45304861
    4531                 ret = this.length > 1 ? jQuery.unique( ret ) : ret;
     4862                ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
    45324863
    45334864                if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
     
    45354866                }
    45364867
    4537                 return this.pushStack( ret, name, slice.call(arguments).join(",") );
     4868                return this.pushStack( ret, name, args.join(",") );
    45384869        };
    45394870});
     
    45494880                        jQuery.find.matches(expr, elems);
    45504881        },
    4551        
     4882
    45524883        dir: function( elem, dir, until ) {
    45534884                var matched = [],
     
    46314962        // checked="checked" or checked (html5)
    46324963        rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
    4633         raction = /\=([^="'>\s]+\/)>/g,
    46344964        wrapMap = {
    46354965                option: [ 1, "<select multiple='multiple'>", "</select>" ],
     
    47715101                }
    47725102        },
    4773        
     5103
    47745104        // keepData is for internal use only--do not document
    47755105        remove: function( selector, keepData ) {
     
    47865116                        }
    47875117                }
    4788                
     5118
    47895119                return this;
    47905120        },
     
    48025132                        }
    48035133                }
    4804                
     5134
    48055135                return this;
    48065136        },
    48075137
    4808         clone: function( events ) {
    4809                 // Do the clone
    4810                 var ret = this.map(function() {
    4811                         if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
    4812                                 // IE copies events bound via attachEvent when
    4813                                 // using cloneNode. Calling detachEvent on the
    4814                                 // clone will also remove the events from the orignal
    4815                                 // In order to get around this, we use innerHTML.
    4816                                 // Unfortunately, this means some modifications to
    4817                                 // attributes in IE that are actually only stored
    4818                                 // as properties will not be copied (such as the
    4819                                 // the name attribute on an input).
    4820                                 var html = this.outerHTML,
    4821                                         ownerDocument = this.ownerDocument;
    4822 
    4823                                 if ( !html ) {
    4824                                         var div = ownerDocument.createElement("div");
    4825                                         div.appendChild( this.cloneNode(true) );
    4826                                         html = div.innerHTML;
    4827                                 }
    4828 
    4829                                 return jQuery.clean([html.replace(rinlinejQuery, "")
    4830                                         // Handle the case in IE 8 where action=/test/> self-closes a tag
    4831                                         .replace(raction, '="$1">')
    4832                                         .replace(rleadingWhitespace, "")], ownerDocument)[0];
    4833                         } else {
    4834                                 return this.cloneNode(true);
    4835                         }
     5138        clone: function( dataAndEvents, deepDataAndEvents ) {
     5139                dataAndEvents = dataAndEvents == null ? true : dataAndEvents;
     5140                deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
     5141
     5142                return this.map( function () {
     5143                        return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
    48365144                });
    4837 
    4838                 // Copy the events from the original to the clone
    4839                 if ( events === true ) {
    4840                         cloneCopyEvent( this, ret );
    4841                         cloneCopyEvent( this.find("*"), ret.find("*") );
    4842                 }
    4843 
    4844                 // Return the cloned set
    4845                 return ret;
    48465145        },
    48475146
     
    49535252                                results = jQuery.buildFragment( args, this, scripts );
    49545253                        }
    4955                        
     5254
    49565255                        fragment = results.fragment;
    4957                        
     5256
    49585257                        if ( fragment.childNodes.length === 1 ) {
    49595258                                first = fragment = fragment.firstChild;
     
    49655264                                table = table && jQuery.nodeName( first, "tr" );
    49665265
    4967                                 for ( var i = 0, l = this.length; i < l; i++ ) {
     5266                                for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
    49685267                                        callback.call(
    49695268                                                table ?
    49705269                                                        root(this[i], first) :
    49715270                                                        this[i],
    4972                                                 i > 0 || results.cacheable || this.length > 1  ?
    4973                                                         fragment.cloneNode(true) :
     5271                                                // Make sure that we do not leak memory by inadvertently discarding
     5272                                                // the original fragment (which might have attached data) instead of
     5273                                                // using it; in addition, use the original fragment object for the last
     5274                                                // item instead of first because it can end up being emptied incorrectly
     5275                                                // in certain situations (Bug #8070).
     5276                                                // Fragments from the fragment cache must always be cloned and never used
     5277                                                // in place.
     5278                                                results.cacheable || (l > 1 && i < lastIndex) ?
     5279                                                        jQuery.clone( fragment, true, true ) :
    49745280                                                        fragment
    49755281                                        );
     
    49935299}
    49945300
    4995 function cloneCopyEvent(orig, ret) {
    4996         var i = 0;
    4997 
    4998         ret.each(function() {
    4999                 if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
    5000                         return;
    5001                 }
    5002 
    5003                 var oldData = jQuery.data( orig[i++] ),
    5004                         curData = jQuery.data( this, oldData ),
    5005                         events = oldData && oldData.events;
     5301function cloneCopyEvent( src, dest ) {
     5302
     5303        if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
     5304                return;
     5305        }
     5306
     5307        var internalKey = jQuery.expando,
     5308                        oldData = jQuery.data( src ),
     5309                        curData = jQuery.data( dest, oldData );
     5310
     5311        // Switch to use the internal data object, if it exists, for the next
     5312        // stage of data copying
     5313        if ( (oldData = oldData[ internalKey ]) ) {
     5314                var events = oldData.events;
     5315                                curData = curData[ internalKey ] = jQuery.extend({}, oldData);
    50065316
    50075317                if ( events ) {
     
    50105320
    50115321                        for ( var type in events ) {
    5012                                 for ( var handler in events[ type ] ) {
    5013                                         jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
    5014                                 }
    5015                         }
    5016                 }
    5017         });
     5322                                for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
     5323                                        jQuery.event.add( dest, type, events[ type ][ i ], events[ type ][ i ].data );
     5324                                }
     5325                        }
     5326                }
     5327        }
     5328}
     5329
     5330function cloneFixAttributes(src, dest) {
     5331        // We do not need to do anything for non-Elements
     5332        if ( dest.nodeType !== 1 ) {
     5333                return;
     5334        }
     5335
     5336        var nodeName = dest.nodeName.toLowerCase();
     5337
     5338        // clearAttributes removes the attributes, which we don't want,
     5339        // but also removes the attachEvent events, which we *do* want
     5340        dest.clearAttributes();
     5341
     5342        // mergeAttributes, in contrast, only merges back on the
     5343        // original attributes, not the events
     5344        dest.mergeAttributes(src);
     5345
     5346        // IE6-8 fail to clone children inside object elements that use
     5347        // the proprietary classid attribute value (rather than the type
     5348        // attribute) to identify the type of content to display
     5349        if ( nodeName === "object" ) {
     5350                dest.outerHTML = src.outerHTML;
     5351
     5352        } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
     5353                // IE6-8 fails to persist the checked state of a cloned checkbox
     5354                // or radio button. Worse, IE6-7 fail to give the cloned element
     5355                // a checked appearance if the defaultChecked value isn't also set
     5356                if ( src.checked ) {
     5357                        dest.defaultChecked = dest.checked = src.checked;
     5358                }
     5359
     5360                // IE6-7 get confused and end up setting the value of a cloned
     5361                // checkbox/radio button to an empty string instead of "on"
     5362                if ( dest.value !== src.value ) {
     5363                        dest.value = src.value;
     5364                }
     5365
     5366        // IE6-8 fails to return the selected option to the default selected
     5367        // state when cloning options
     5368        } else if ( nodeName === "option" ) {
     5369                dest.selected = src.defaultSelected;
     5370
     5371        // IE6-8 fails to set the defaultValue to the correct value when
     5372        // cloning other types of input fields
     5373        } else if ( nodeName === "input" || nodeName === "textarea" ) {
     5374                dest.defaultValue = src.defaultValue;
     5375        }
     5376
     5377        // Event data gets referenced instead of copied if the expando
     5378        // gets copied too
     5379        dest.removeAttribute( jQuery.expando );
    50185380}
    50195381
     
    50225384                doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
    50235385
    5024         // Only cache "small" (1/2 KB) strings that are associated with the main document
     5386        // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
    50255387        // Cloning options loses the selected state, so don't cache them
    50265388        // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
    50275389        // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
    50285390        if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
    5029                 !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
     5391                args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
    50305392
    50315393                cacheable = true;
     
    50635425                        insert = jQuery( selector ),
    50645426                        parent = this.length === 1 && this[0].parentNode;
    5065                
     5427
    50665428                if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
    50675429                        insert[ original ]( this[0] );
    50685430                        return this;
    5069                        
     5431
    50705432                } else {
    50715433                        for ( var i = 0, l = insert.length; i < l; i++ ) {
     
    50745436                                ret = ret.concat( elems );
    50755437                        }
    5076                
     5438
    50775439                        return this.pushStack( ret, name, insert.selector );
    50785440                }
     
    50815443
    50825444jQuery.extend({
     5445        clone: function( elem, dataAndEvents, deepDataAndEvents ) {
     5446                var clone = elem.cloneNode(true),
     5447                                srcElements,
     5448                                destElements,
     5449                                i;
     5450
     5451                if ( !jQuery.support.noCloneEvent && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
     5452                        // IE copies events bound via attachEvent when using cloneNode.
     5453                        // Calling detachEvent on the clone will also remove the events
     5454                        // from the original. In order to get around this, we use some
     5455                        // proprietary methods to clear the events. Thanks to MooTools
     5456                        // guys for this hotness.
     5457
     5458                        // Using Sizzle here is crazy slow, so we use getElementsByTagName
     5459                        // instead
     5460                        srcElements = elem.getElementsByTagName("*");
     5461                        destElements = clone.getElementsByTagName("*");
     5462
     5463                        // Weird iteration because IE will replace the length property
     5464                        // with an element if you are cloning the body and one of the
     5465                        // elements on the page has a name or id of "length"
     5466                        for ( i = 0; srcElements[i]; ++i ) {
     5467                                cloneFixAttributes( srcElements[i], destElements[i] );
     5468                        }
     5469
     5470                        cloneFixAttributes( elem, clone );
     5471                }
     5472
     5473                // Copy the events from the original to the clone
     5474                if ( dataAndEvents ) {
     5475
     5476                        cloneCopyEvent( elem, clone );
     5477
     5478                        if ( deepDataAndEvents && "getElementsByTagName" in elem ) {
     5479
     5480                                srcElements = elem.getElementsByTagName("*");
     5481                                destElements = clone.getElementsByTagName("*");
     5482
     5483                                if ( srcElements.length ) {
     5484                                        for ( i = 0; srcElements[i]; ++i ) {
     5485                                                cloneCopyEvent( srcElements[i], destElements[i] );
     5486                                        }
     5487                                }
     5488                        }
     5489                }
     5490                // Return the cloned set
     5491                return clone;
     5492  },
    50835493        clean: function( elems, context, fragment, scripts ) {
    50845494                context = context || document;
     
    51625572                                if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
    51635573                                        scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
    5164                                
     5574
    51655575                                } else {
    51665576                                        if ( ret[i].nodeType === 1 ) {
     
    51745584                return ret;
    51755585        },
    5176        
     5586
    51775587        cleanData: function( elems ) {
    5178                 var data, id, cache = jQuery.cache,
    5179                         special = jQuery.event.special,
     5588                var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
    51805589                        deleteExpando = jQuery.support.deleteExpando;
    5181                
     5590
    51825591                for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
    51835592                        if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
     
    51865595
    51875596                        id = elem[ jQuery.expando ];
    5188                        
     5597
    51895598                        if ( id ) {
    5190                                 data = cache[ id ];
    5191                                
     5599                                data = cache[ id ] && cache[ id ][ internalKey ];
     5600
    51925601                                if ( data && data.events ) {
    51935602                                        for ( var type in data.events ) {
     
    51955604                                                        jQuery.event.remove( elem, type );
    51965605
     5606                                                // This is a shortcut to avoid jQuery.event.remove's overhead
    51975607                                                } else {
    51985608                                                        jQuery.removeEvent( elem, type, data.handle );
    51995609                                                }
    52005610                                        }
    5201                                 }
    5202                                
     5611
     5612                                        // Null the DOM reference to avoid IE6/7/8 leak (#7054)
     5613                                        if ( data.handle ) {
     5614                                                data.handle.elem = null;
     5615                                        }
     5616                                }
     5617
    52035618                                if ( deleteExpando ) {
    52045619                                        delete elem[ jQuery.expando ];
     
    52075622                                        elem.removeAttribute( jQuery.expando );
    52085623                                }
    5209                                
     5624
    52105625                                delete cache[ id ];
    52115626                        }
     
    54965911if ( document.documentElement.currentStyle ) {
    54975912        currentStyle = function( elem, name ) {
    5498                 var left, rsLeft,
     5913                var left,
    54995914                        ret = elem.currentStyle && elem.currentStyle[ name ],
     5915                        rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
    55005916                        style = elem.style;
    55015917
     
    55085924                        // Remember the original values
    55095925                        left = style.left;
    5510                         rsLeft = elem.runtimeStyle.left;
    55115926
    55125927                        // Put in the new values to get a computed value out
    5513                         elem.runtimeStyle.left = elem.currentStyle.left;
     5928                        if ( rsLeft ) {
     5929                                elem.runtimeStyle.left = elem.currentStyle.left;
     5930                        }
    55145931                        style.left = name === "fontSize" ? "1em" : (ret || 0);
    55155932                        ret = style.pixelLeft + "px";
     
    55175934                        // Revert the changed values
    55185935                        style.left = left;
    5519                         elem.runtimeStyle.left = rsLeft;
     5936                        if ( rsLeft ) {
     5937                                elem.runtimeStyle.left = rsLeft;
     5938                        }
    55205939                }
    55215940
     
    55665985
    55675986
    5568 var jsc = jQuery.now(),
     5987var r20 = /%20/g,
     5988        rbracket = /\[\]$/,
     5989        rCRLF = /\r?\n/g,
     5990        rhash = /#.*$/,
     5991        rheaders = /^(.*?):\s*(.*?)\r?$/mg, // IE leaves an \r character at EOL
     5992        rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
     5993        rnoContent = /^(?:GET|HEAD)$/,
     5994        rprotocol = /^\/\//,
     5995        rquery = /\?/,
    55695996        rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
    55705997        rselectTextarea = /^(?:select|textarea)/i,
    5571         rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
    5572         rnoContent = /^(?:GET|HEAD)$/,
    5573         rbracket = /\[\]$/,
    5574         jsre = /\=\?(&|$)/,
    5575         rquery = /\?/,
     5998        rspacesAjax = /\s+/,
    55765999        rts = /([?&])_=[^&]*/,
    5577         rurl = /^(\w+:)?\/\/([^\/?#]+)/,
    5578         r20 = /%20/g,
    5579         rhash = /#.*$/,
     6000        rurl = /^(\w+:)\/\/([^\/?#:]+)(?::(\d+))?/,
    55806001
    55816002        // Keep a copy of the old load method
    5582         _load = jQuery.fn.load;
     6003        _load = jQuery.fn.load,
     6004
     6005        /* Prefilters
     6006         * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
     6007         * 2) These are called:
     6008         *    - BEFORE asking for a transport
     6009         *    - AFTER param serialization (s.data is a string if s.processData is true)
     6010         * 3) key is the dataType
     6011         * 4) the catchall symbol "*" can be used
     6012         * 5) execution will start with transport dataType and THEN continue down to "*" if needed
     6013         */
     6014        prefilters = {},
     6015
     6016        /* Transports bindings
     6017         * 1) key is the dataType
     6018         * 2) the catchall symbol "*" can be used
     6019         * 3) selection will start with transport dataType and THEN go to "*" if needed
     6020         */
     6021        transports = {};
     6022
     6023// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
     6024function addToPrefiltersOrTransports( structure ) {
     6025
     6026        // dataTypeExpression is optional and defaults to "*"
     6027        return function( dataTypeExpression, func ) {
     6028
     6029                if ( typeof dataTypeExpression !== "string" ) {
     6030                        func = dataTypeExpression;
     6031                        dataTypeExpression = "*";
     6032                }
     6033
     6034                if ( jQuery.isFunction( func ) ) {
     6035                        var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
     6036                                i = 0,
     6037                                length = dataTypes.length,
     6038                                dataType,
     6039                                list,
     6040                                placeBefore;
     6041
     6042                        // For each dataType in the dataTypeExpression
     6043                        for(; i < length; i++ ) {
     6044                                dataType = dataTypes[ i ];
     6045                                // We control if we're asked to add before
     6046                                // any existing element
     6047                                placeBefore = /^\+/.test( dataType );
     6048                                if ( placeBefore ) {
     6049                                        dataType = dataType.substr( 1 ) || "*";
     6050                                }
     6051                                list = structure[ dataType ] = structure[ dataType ] || [];
     6052                                // then we add to the structure accordingly
     6053                                list[ placeBefore ? "unshift" : "push" ]( func );
     6054                        }
     6055                }
     6056        };
     6057}
     6058
     6059//Base inspection function for prefilters and transports
     6060function inspectPrefiltersOrTransports( structure, options, originalOptions, jXHR,
     6061                dataType /* internal */, inspected /* internal */ ) {
     6062
     6063        dataType = dataType || options.dataTypes[ 0 ];
     6064        inspected = inspected || {};
     6065
     6066        inspected[ dataType ] = true;
     6067
     6068        var list = structure[ dataType ],
     6069                i = 0,
     6070                length = list ? list.length : 0,
     6071                executeOnly = ( structure === prefilters ),
     6072                selection;
     6073
     6074        for(; i < length && ( executeOnly || !selection ); i++ ) {
     6075                selection = list[ i ]( options, originalOptions, jXHR );
     6076                // If we got redirected to another dataType
     6077                // we try there if not done already
     6078                if ( typeof selection === "string" ) {
     6079                        if ( inspected[ selection ] ) {
     6080                                selection = undefined;
     6081                        } else {
     6082                                options.dataTypes.unshift( selection );
     6083                                selection = inspectPrefiltersOrTransports(
     6084                                                structure, options, originalOptions, jXHR, selection, inspected );
     6085                        }
     6086                }
     6087        }
     6088        // If we're only executing or nothing was selected
     6089        // we try the catchall dataType if not done already
     6090        if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
     6091                selection = inspectPrefiltersOrTransports(
     6092                                structure, options, originalOptions, jXHR, "*", inspected );
     6093        }
     6094        // unnecessary when only executing (prefilters)
     6095        // but it'll be ignored by the caller in that case
     6096        return selection;
     6097}
    55836098
    55846099jQuery.fn.extend({
     
    55926107                }
    55936108
    5594                 var off = url.indexOf(" ");
     6109                var off = url.indexOf( " " );
    55956110                if ( off >= 0 ) {
    5596                         var selector = url.slice(off, url.length);
    5597                         url = url.slice(0, off);
     6111                        var selector = url.slice( off, url.length );
     6112                        url = url.slice( 0, off );
    55986113                }
    55996114
     
    56246139                        dataType: "html",
    56256140                        data: params,
    5626                         complete: function( res, status ) {
     6141                        // Complete callback (responseText is used internally)
     6142                        complete: function( jXHR, status, responseText ) {
     6143                                // Store the response as specified by the jXHR object
     6144                                responseText = jXHR.responseText;
    56276145                                // If successful, inject the HTML into all the matched elements
    5628                                 if ( status === "success" || status === "notmodified" ) {
     6146                                if ( jXHR.isResolved() ) {
     6147                                        // #4825: Get the actual response in case
     6148                                        // a dataFilter is present in ajaxSettings
     6149                                        jXHR.done(function( r ) {
     6150                                                responseText = r;
     6151                                        });
    56296152                                        // See if a selector was specified
    56306153                                        self.html( selector ?
     
    56336156                                                        // inject the contents of the document in, removing the scripts
    56346157                                                        // to avoid any 'Permission Denied' errors in IE
    5635                                                         .append(res.responseText.replace(rscript, ""))
     6158                                                        .append(responseText.replace(rscript, ""))
    56366159
    56376160                                                        // Locate the specified elements
     
    56396162
    56406163                                                // If not, just inject the full result
    5641                                                 res.responseText );
     6164                                                responseText );
    56426165                                }
    56436166
    56446167                                if ( callback ) {
    5645                                         self.each( callback, [res.responseText, status, res] );
     6168                                        self.each( callback, [ responseText, status, jXHR ] );
    56466169                                }
    56476170                        }
     
    56526175
    56536176        serialize: function() {
    5654                 return jQuery.param(this.serializeArray());
     6177                return jQuery.param( this.serializeArray() );
    56556178        },
    56566179
    56576180        serializeArray: function() {
    5658                 return this.map(function() {
    5659                         return this.elements ? jQuery.makeArray(this.elements) : this;
     6181                return this.map(function(){
     6182                        return this.elements ? jQuery.makeArray( this.elements ) : this;
    56606183                })
    5661                 .filter(function() {
     6184                .filter(function(){
    56626185                        return this.name && !this.disabled &&
    5663                                 (this.checked || rselectTextarea.test(this.nodeName) ||
    5664                                         rinput.test(this.type));
     6186                                ( this.checked || rselectTextarea.test( this.nodeName ) ||
     6187                                        rinput.test( this.type ) );
    56656188                })
    5666                 .map(function( i, elem ) {
    5667                         var val = jQuery(this).val();
     6189                .map(function( i, elem ){
     6190                        var val = jQuery( this ).val();
    56686191
    56696192                        return val == null ?
    56706193                                null :
    5671                                 jQuery.isArray(val) ?
    5672                                         jQuery.map( val, function( val, i ) {
    5673                                                 return { name: elem.name, value: val };
     6194                                jQuery.isArray( val ) ?
     6195                                        jQuery.map( val, function( val, i ){
     6196                                                return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
    56746197                                        }) :
    5675                                         { name: elem.name, value: val };
     6198                                        { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
    56766199                }).get();
    56776200        }
     
    56796202
    56806203// Attach a bunch of functions for handling common AJAX events
    5681 jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
    5682         jQuery.fn[o] = function( f ) {
    5683                 return this.bind(o, f);
     6204jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
     6205        jQuery.fn[ o ] = function( f ){
     6206                return this.bind( o, f );
    56846207        };
    5685 });
    5686 
    5687 jQuery.extend({
    5688         get: function( url, data, callback, type ) {
    5689                 // shift arguments if data argument was omited
     6208} );
     6209
     6210jQuery.each( [ "get", "post" ], function( i, method ) {
     6211        jQuery[ method ] = function( url, data, callback, type ) {
     6212                // shift arguments if data argument was omitted
    56906213                if ( jQuery.isFunction( data ) ) {
    56916214                        type = type || callback;
     
    56956218
    56966219                return jQuery.ajax({
    5697                         type: "GET",
     6220                        type: method,
    56986221                        url: url,
    56996222                        data: data,
     
    57016224                        dataType: type
    57026225                });
    5703         },
     6226        };
     6227} );
     6228
     6229jQuery.extend({
    57046230
    57056231        getScript: function( url, callback ) {
    5706                 return jQuery.get(url, null, callback, "script");
     6232                return jQuery.get( url, null, callback, "script" );
    57076233        },
    57086234
    57096235        getJSON: function( url, data, callback ) {
    5710                 return jQuery.get(url, data, callback, "json");
    5711         },
    5712 
    5713         post: function( url, data, callback, type ) {
    5714                 // shift arguments if data argument was omited
    5715                 if ( jQuery.isFunction( data ) ) {
    5716                         type = type || callback;
    5717                         callback = data;
    5718                         data = {};
    5719                 }
    5720 
    5721                 return jQuery.ajax({
    5722                         type: "POST",
    5723                         url: url,
    5724                         data: data,
    5725                         success: callback,
    5726                         dataType: type
    5727                 });
     6236                return jQuery.get( url, data, callback, "json" );
    57286237        },
    57296238
    57306239        ajaxSetup: function( settings ) {
    5731                 jQuery.extend( jQuery.ajaxSettings, settings );
     6240                jQuery.extend( true, jQuery.ajaxSettings, settings );
     6241                if ( settings.context ) {
     6242                        jQuery.ajaxSettings.context = settings.context;
     6243                }
    57326244        },
    57336245
     
    57426254                timeout: 0,
    57436255                data: null,
     6256                dataType: null,
    57446257                username: null,
    57456258                password: null,
     6259                cache: null,
    57466260                traditional: false,
     6261                headers: {},
     6262                crossDomain: null,
    57476263                */
    5748                 // This function can be overriden by calling jQuery.ajaxSetup
    5749                 xhr: function() {
    5750                         return new window.XMLHttpRequest();
    5751                 },
     6264
    57526265                accepts: {
    57536266                        xml: "application/xml, text/xml",
    57546267                        html: "text/html",
    5755                         script: "text/javascript, application/javascript",
     6268                        text: "text/plain",
    57566269                        json: "application/json, text/javascript",
    5757                         text: "text/plain",
    5758                         _default: "*/*"
    5759                 }
    5760         },
    5761 
    5762         ajax: function( origSettings ) {
    5763                 var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings),
    5764                         jsonp, status, data, type = s.type.toUpperCase(), noContent = rnoContent.test(type);
    5765 
    5766                 s.url = s.url.replace( rhash, "" );
    5767 
    5768                 // Use original (not extended) context object if it was provided
    5769                 s.context = origSettings && origSettings.context != null ? origSettings.context : s;
    5770 
    5771                 // convert data if not already a string
     6270                        "*": "*/*"
     6271                },
     6272
     6273                contents: {
     6274                        xml: /xml/,
     6275                        html: /html/,
     6276                        json: /json/
     6277                },
     6278
     6279                responseFields: {
     6280                        xml: "responseXML",
     6281                        text: "responseText"
     6282                },
     6283
     6284                // List of data converters
     6285                // 1) key format is "source_type destination_type" (a single space in-between)
     6286                // 2) the catchall symbol "*" can be used for source_type
     6287                converters: {
     6288
     6289                        // Convert anything to text
     6290                        "* text": window.String,
     6291
     6292                        // Text to html (true = no transformation)
     6293                        "text html": true,
     6294
     6295                        // Evaluate text as a json expression
     6296                        "text json": jQuery.parseJSON,
     6297
     6298                        // Parse text as xml
     6299                        "text xml": jQuery.parseXML
     6300                }
     6301        },
     6302
     6303        ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
     6304        ajaxTransport: addToPrefiltersOrTransports( transports ),
     6305
     6306        // Main method
     6307        ajax: function( url, options ) {
     6308
     6309                // If options is not an object,
     6310                // we simulate pre-1.5 signature
     6311                if ( typeof options !== "object" ) {
     6312                        options = url;
     6313                        url = undefined;
     6314                }
     6315
     6316                // Force options to be an object
     6317                options = options || {};
     6318
     6319                var // Create the final options object
     6320                        s = jQuery.extend( true, {}, jQuery.ajaxSettings, options ),
     6321                        // Callbacks contexts
     6322                        // We force the original context if it exists
     6323                        // or take it from jQuery.ajaxSettings otherwise
     6324                        // (plain objects used as context get extended)
     6325                        callbackContext =
     6326                                ( s.context = ( "context" in options ? options : jQuery.ajaxSettings ).context ) || s,
     6327                        globalEventContext = callbackContext === s ? jQuery.event : jQuery( callbackContext ),
     6328                        // Deferreds
     6329                        deferred = jQuery.Deferred(),
     6330                        completeDeferred = jQuery._Deferred(),
     6331                        // Status-dependent callbacks
     6332                        statusCode = s.statusCode || {},
     6333                        // Headers (they are sent all at once)
     6334                        requestHeaders = {},
     6335                        // Response headers
     6336                        responseHeadersString,
     6337                        responseHeaders,
     6338                        // transport
     6339                        transport,
     6340                        // timeout handle
     6341                        timeoutTimer,
     6342                        // Cross-domain detection vars
     6343                        loc = document.location,
     6344                        protocol = loc.protocol || "http:",
     6345                        parts,
     6346                        // The jXHR state
     6347                        state = 0,
     6348                        // Loop variable
     6349                        i,
     6350                        // Fake xhr
     6351                        jXHR = {
     6352
     6353                                readyState: 0,
     6354
     6355                                // Caches the header
     6356                                setRequestHeader: function( name, value ) {
     6357                                        if ( state === 0 ) {
     6358                                                requestHeaders[ name.toLowerCase() ] = value;
     6359                                        }
     6360                                        return this;
     6361                                },
     6362
     6363                                // Raw string
     6364                                getAllResponseHeaders: function() {
     6365                                        return state === 2 ? responseHeadersString : null;
     6366                                },
     6367
     6368                                // Builds headers hashtable if needed
     6369                                getResponseHeader: function( key ) {
     6370                                        var match;
     6371                                        if ( state === 2 ) {
     6372                                                if ( !responseHeaders ) {
     6373                                                        responseHeaders = {};
     6374                                                        while( ( match = rheaders.exec( responseHeadersString ) ) ) {
     6375                                                                responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
     6376                                                        }
     6377                                                }
     6378                                                match = responseHeaders[ key.toLowerCase() ];
     6379                                        }
     6380                                        return match || null;
     6381                                },
     6382
     6383                                // Cancel the request
     6384                                abort: function( statusText ) {
     6385                                        statusText = statusText || "abort";
     6386                                        if ( transport ) {
     6387                                                transport.abort( statusText );
     6388                                        }
     6389                                        done( 0, statusText );
     6390                                        return this;
     6391                                }
     6392                        };
     6393
     6394                // Callback for when everything is done
     6395                // It is defined here because jslint complains if it is declared
     6396                // at the end of the function (which would be more logical and readable)
     6397                function done( status, statusText, responses, headers) {
     6398
     6399                        // Called once
     6400                        if ( state === 2 ) {
     6401                                return;
     6402                        }
     6403
     6404                        // State is "done" now
     6405                        state = 2;
     6406
     6407                        // Clear timeout if it exists
     6408                        if ( timeoutTimer ) {
     6409                                clearTimeout( timeoutTimer );
     6410                        }
     6411
     6412                        // Dereference transport for early garbage collection
     6413                        // (no matter how long the jXHR object will be used)
     6414                        transport = undefined;
     6415
     6416                        // Cache response headers
     6417                        responseHeadersString = headers || "";
     6418
     6419                        // Set readyState
     6420                        jXHR.readyState = status ? 4 : 0;
     6421
     6422                        var isSuccess,
     6423                                success,
     6424                                error,
     6425                                response = responses ? ajaxHandleResponses( s, jXHR, responses ) : undefined,
     6426                                lastModified,
     6427                                etag;
     6428
     6429                        // If successful, handle type chaining
     6430                        if ( status >= 200 && status < 300 || status === 304 ) {
     6431
     6432                                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
     6433                                if ( s.ifModified ) {
     6434
     6435                                        if ( ( lastModified = jXHR.getResponseHeader( "Last-Modified" ) ) ) {
     6436                                                jQuery.lastModified[ s.url ] = lastModified;
     6437                                        }
     6438                                        if ( ( etag = jXHR.getResponseHeader( "Etag" ) ) ) {
     6439                                                jQuery.etag[ s.url ] = etag;
     6440                                        }
     6441                                }
     6442
     6443                                // If not modified
     6444                                if ( status === 304 ) {
     6445
     6446                                        statusText = "notmodified";
     6447                                        isSuccess = true;
     6448
     6449                                // If we have data
     6450                                } else {
     6451
     6452                                        try {
     6453                                                success = ajaxConvert( s, response );
     6454                                                statusText = "success";
     6455                                                isSuccess = true;
     6456                                        } catch(e) {
     6457                                                // We have a parsererror
     6458                                                statusText = "parsererror";
     6459                                                error = e;
     6460                                        }
     6461                                }
     6462                        } else {
     6463                                // We extract error from statusText
     6464                                // then normalize statusText and status for non-aborts
     6465                                error = statusText;
     6466                                if( status ) {
     6467                                        statusText = "error";
     6468                                        if ( status < 0 ) {
     6469                                                status = 0;
     6470                                        }
     6471                                }
     6472                        }
     6473
     6474                        // Set data for the fake xhr object
     6475                        jXHR.status = status;
     6476                        jXHR.statusText = statusText;
     6477
     6478                        // Success/Error
     6479                        if ( isSuccess ) {
     6480                                deferred.resolveWith( callbackContext, [ success, statusText, jXHR ] );
     6481                        } else {
     6482                                deferred.rejectWith( callbackContext, [ jXHR, statusText, error ] );
     6483                        }
     6484
     6485                        // Status-dependent callbacks
     6486                        jXHR.statusCode( statusCode );
     6487                        statusCode = undefined;
     6488
     6489                        if ( s.global ) {
     6490                                globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
     6491                                                [ jXHR, s, isSuccess ? success : error ] );
     6492                        }
     6493
     6494                        // Complete
     6495                        completeDeferred.resolveWith( callbackContext, [ jXHR, statusText ] );
     6496
     6497                        if ( s.global ) {
     6498                                globalEventContext.trigger( "ajaxComplete", [ jXHR, s] );
     6499                                // Handle the global AJAX counter
     6500                                if ( !( --jQuery.active ) ) {
     6501                                        jQuery.event.trigger( "ajaxStop" );
     6502                                }
     6503                        }
     6504                }
     6505
     6506                // Attach deferreds
     6507                deferred.promise( jXHR );
     6508                jXHR.success = jXHR.done;
     6509                jXHR.error = jXHR.fail;
     6510                jXHR.complete = completeDeferred.done;
     6511
     6512                // Status-dependent callbacks
     6513                jXHR.statusCode = function( map ) {
     6514                        if ( map ) {
     6515                                var tmp;
     6516                                if ( state < 2 ) {
     6517                                        for( tmp in map ) {
     6518                                                statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
     6519                                        }
     6520                                } else {
     6521                                        tmp = map[ jXHR.status ];
     6522                                        jXHR.then( tmp, tmp );
     6523                                }
     6524                        }
     6525                        return this;
     6526                };
     6527
     6528                // Remove hash character (#7531: and string promotion)
     6529                // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
     6530                // We also use the url parameter if available
     6531                s.url = ( "" + ( url || s.url ) ).replace( rhash, "" ).replace( rprotocol, protocol + "//" );
     6532
     6533                // Extract dataTypes list
     6534                s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
     6535
     6536                // Determine if a cross-domain request is in order
     6537                if ( !s.crossDomain ) {
     6538                        parts = rurl.exec( s.url.toLowerCase() );
     6539                        s.crossDomain = !!( parts &&
     6540                                ( parts[ 1 ] != protocol || parts[ 2 ] != loc.hostname ||
     6541                                        ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
     6542                                                ( loc.port || ( protocol === "http:" ? 80 : 443 ) ) )
     6543                        );
     6544                }
     6545
     6546                // Convert data if not already a string
    57726547                if ( s.data && s.processData && typeof s.data !== "string" ) {
    57736548                        s.data = jQuery.param( s.data, s.traditional );
    57746549                }
    57756550
    5776                 // Handle JSONP Parameter Callbacks
    5777                 if ( s.dataType === "jsonp" ) {
    5778                         if ( type === "GET" ) {
    5779                                 if ( !jsre.test( s.url ) ) {
    5780                                         s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
    5781                                 }
    5782                         } else if ( !s.data || !jsre.test(s.data) ) {
    5783                                 s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
    5784                         }
    5785                         s.dataType = "json";
    5786                 }
    5787 
    5788                 // Build temporary JSONP function
    5789                 if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
    5790                         jsonp = s.jsonpCallback || ("jsonp" + jsc++);
    5791 
    5792                         // Replace the =? sequence both in the query string and the data
    5793                         if ( s.data ) {
    5794                                 s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
    5795                         }
    5796 
    5797                         s.url = s.url.replace(jsre, "=" + jsonp + "$1");
    5798 
    5799                         // We need to make sure
    5800                         // that a JSONP style response is executed properly
    5801                         s.dataType = "script";
    5802 
    5803                         // Handle JSONP-style loading
    5804                         var customJsonp = window[ jsonp ];
    5805 
    5806                         window[ jsonp ] = function( tmp ) {
    5807                                 if ( jQuery.isFunction( customJsonp ) ) {
    5808                                         customJsonp( tmp );
    5809 
    5810                                 } else {
    5811                                         // Garbage collect
    5812                                         window[ jsonp ] = undefined;
    5813 
    5814                                         try {
    5815                                                 delete window[ jsonp ];
    5816                                         } catch( jsonpError ) {}
    5817                                 }
    5818 
    5819                                 data = tmp;
    5820                                 jQuery.handleSuccess( s, xhr, status, data );
    5821                                 jQuery.handleComplete( s, xhr, status, data );
    5822                                
    5823                                 if ( head ) {
    5824                                         head.removeChild( script );
    5825                                 }
    5826                         };
    5827                 }
    5828 
    5829                 if ( s.dataType === "script" && s.cache === null ) {
    5830                         s.cache = false;
    5831                 }
    5832 
    5833                 if ( s.cache === false && noContent ) {
    5834                         var ts = jQuery.now();
    5835 
    5836                         // try replacing _= if it is there
    5837                         var ret = s.url.replace(rts, "$1_=" + ts);
    5838 
    5839                         // if nothing was replaced, add timestamp to the end
    5840                         s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
    5841                 }
    5842 
    5843                 // If data is available, append data to url for GET/HEAD requests
    5844                 if ( s.data && noContent ) {
    5845                         s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
    5846                 }
     6551                // Apply prefilters
     6552                inspectPrefiltersOrTransports( prefilters, s, options, jXHR );
     6553
     6554                // Uppercase the type
     6555                s.type = s.type.toUpperCase();
     6556
     6557                // Determine if request has content
     6558                s.hasContent = !rnoContent.test( s.type );
    58476559
    58486560                // Watch for a new set of requests
     
    58516563                }
    58526564
    5853                 // Matches an absolute URL, and saves the domain
    5854                 var parts = rurl.exec( s.url ),
    5855                         remote = parts && (parts[1] && parts[1].toLowerCase() !== location.protocol || parts[2].toLowerCase() !== location.host);
    5856 
    5857                 // If we're requesting a remote document
    5858                 // and trying to load JSON or Script with a GET
    5859                 if ( s.dataType === "script" && type === "GET" && remote ) {
    5860                         var head = document.getElementsByTagName("head")[0] || document.documentElement;
    5861                         var script = document.createElement("script");
    5862                         if ( s.scriptCharset ) {
    5863                                 script.charset = s.scriptCharset;
    5864                         }
    5865                         script.src = s.url;
    5866 
    5867                         // Handle Script loading
    5868                         if ( !jsonp ) {
    5869                                 var done = false;
    5870 
    5871                                 // Attach handlers for all browsers
    5872                                 script.onload = script.onreadystatechange = function() {
    5873                                         if ( !done && (!this.readyState ||
    5874                                                         this.readyState === "loaded" || this.readyState === "complete") ) {
    5875                                                 done = true;
    5876                                                 jQuery.handleSuccess( s, xhr, status, data );
    5877                                                 jQuery.handleComplete( s, xhr, status, data );
    5878 
    5879                                                 // Handle memory leak in IE
    5880                                                 script.onload = script.onreadystatechange = null;
    5881                                                 if ( head && script.parentNode ) {
    5882                                                         head.removeChild( script );
    5883                                                 }
    5884                                         }
    5885                                 };
    5886                         }
    5887 
    5888                         // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
    5889                         // This arises when a base node is used (#2709 and #4378).
    5890                         head.insertBefore( script, head.firstChild );
    5891 
    5892                         // We handle everything using the script element injection
    5893                         return undefined;
    5894                 }
    5895 
    5896                 var requestDone = false;
    5897 
    5898                 // Create the request object
    5899                 var xhr = s.xhr();
    5900 
    5901                 if ( !xhr ) {
    5902                         return;
    5903                 }
    5904 
    5905                 // Open the socket
    5906                 // Passing null username, generates a login popup on Opera (#2865)
    5907                 if ( s.username ) {
    5908                         xhr.open(type, s.url, s.async, s.username, s.password);
     6565                // More options handling for requests with no content
     6566                if ( !s.hasContent ) {
     6567
     6568                        // If data is available, append data to url
     6569                        if ( s.data ) {
     6570                                s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
     6571                        }
     6572
     6573                        // Add anti-cache in url if needed
     6574                        if ( s.cache === false ) {
     6575
     6576                                var ts = jQuery.now(),
     6577                                        // try replacing _= if it is there
     6578                                        ret = s.url.replace( rts, "$1_=" + ts );
     6579
     6580                                // if nothing was replaced, add timestamp to the end
     6581                                s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
     6582                        }
     6583                }
     6584
     6585                // Set the correct header, if data is being sent
     6586                if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
     6587                        requestHeaders[ "content-type" ] = s.contentType;
     6588                }
     6589
     6590                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
     6591                if ( s.ifModified ) {
     6592                        if ( jQuery.lastModified[ s.url ] ) {
     6593                                requestHeaders[ "if-modified-since" ] = jQuery.lastModified[ s.url ];
     6594                        }
     6595                        if ( jQuery.etag[ s.url ] ) {
     6596                                requestHeaders[ "if-none-match" ] = jQuery.etag[ s.url ];
     6597                        }
     6598                }
     6599
     6600                // Set the Accepts header for the server, depending on the dataType
     6601                requestHeaders.accept = s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
     6602                        s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", */*; q=0.01" : "" ) :
     6603                        s.accepts[ "*" ];
     6604
     6605                // Check for headers option
     6606                for ( i in s.headers ) {
     6607                        requestHeaders[ i.toLowerCase() ] = s.headers[ i ];
     6608                }
     6609
     6610                // Allow custom headers/mimetypes and early abort
     6611                if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jXHR, s ) === false || state === 2 ) ) {
     6612                                // Abort if not done already
     6613                                done( 0, "abort" );
     6614                                // Return false
     6615                                jXHR = false;
     6616
    59096617                } else {
    5910                         xhr.open(type, s.url, s.async);
    5911                 }
    5912 
    5913                 // Need an extra try/catch for cross domain requests in Firefox 3
    5914                 try {
    5915                         // Set content-type if data specified and content-body is valid for this type
    5916                         if ( (s.data != null && !noContent) || (origSettings && origSettings.contentType) ) {
    5917                                 xhr.setRequestHeader("Content-Type", s.contentType);
    5918                         }
    5919 
    5920                         // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
    5921                         if ( s.ifModified ) {
    5922                                 if ( jQuery.lastModified[s.url] ) {
    5923                                         xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
    5924                                 }
    5925 
    5926                                 if ( jQuery.etag[s.url] ) {
    5927                                         xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
    5928                                 }
    5929                         }
    5930 
    5931                         // Set header so the called script knows that it's an XMLHttpRequest
    5932                         // Only send the header if it's not a remote XHR
    5933                         if ( !remote ) {
    5934                                 xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
    5935                         }
    5936 
    5937                         // Set the Accepts header for the server, depending on the dataType
    5938                         xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
    5939                                 s.accepts[ s.dataType ] + ", */*; q=0.01" :
    5940                                 s.accepts._default );
    5941                 } catch( headerError ) {}
    5942 
    5943                 // Allow custom headers/mimetypes and early abort
    5944                 if ( s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false ) {
    5945                         // Handle the global AJAX counter
    5946                         if ( s.global && jQuery.active-- === 1 ) {
    5947                                 jQuery.event.trigger( "ajaxStop" );
    5948                         }
    5949 
    5950                         // close opended socket
    5951                         xhr.abort();
    5952                         return false;
    5953                 }
    5954 
    5955                 if ( s.global ) {
    5956                         jQuery.triggerGlobal( s, "ajaxSend", [xhr, s] );
    5957                 }
    5958 
    5959                 // Wait for a response to come back
    5960                 var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
    5961                         // The request was aborted
    5962                         if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
    5963                                 // Opera doesn't call onreadystatechange before this point
    5964                                 // so we simulate the call
    5965                                 if ( !requestDone ) {
    5966                                         jQuery.handleComplete( s, xhr, status, data );
    5967                                 }
    5968 
    5969                                 requestDone = true;
    5970                                 if ( xhr ) {
    5971                                         xhr.onreadystatechange = jQuery.noop;
    5972                                 }
    5973 
    5974                         // The transfer is complete and the data is available, or the request timed out
    5975                         } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
    5976                                 requestDone = true;
    5977                                 xhr.onreadystatechange = jQuery.noop;
    5978 
    5979                                 status = isTimeout === "timeout" ?
    5980                                         "timeout" :
    5981                                         !jQuery.httpSuccess( xhr ) ?
    5982                                                 "error" :
    5983                                                 s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
    5984                                                         "notmodified" :
    5985                                                         "success";
    5986 
    5987                                 var errMsg;
    5988 
    5989                                 if ( status === "success" ) {
    5990                                         // Watch for, and catch, XML document parse errors
    5991                                         try {
    5992                                                 // process the data (runs the xml through httpData regardless of callback)
    5993                                                 data = jQuery.httpData( xhr, s.dataType, s );
    5994                                         } catch( parserError ) {
    5995                                                 status = "parsererror";
    5996                                                 errMsg = parserError;
    5997                                         }
    5998                                 }
    5999 
    6000                                 // Make sure that the request was successful or notmodified
    6001                                 if ( status === "success" || status === "notmodified" ) {
    6002                                         // JSONP handles its own success callback
    6003                                         if ( !jsonp ) {
    6004                                                 jQuery.handleSuccess( s, xhr, status, data );
    6005                                         }
    6006                                 } else {
    6007                                         jQuery.handleError( s, xhr, status, errMsg );
    6008                                 }
    6009 
    6010                                 // Fire the complete handlers
    6011                                 if ( !jsonp ) {
    6012                                         jQuery.handleComplete( s, xhr, status, data );
    6013                                 }
    6014 
    6015                                 if ( isTimeout === "timeout" ) {
    6016                                         xhr.abort();
    6017                                 }
    6018 
    6019                                 // Stop memory leaks
    6020                                 if ( s.async ) {
    6021                                         xhr = null;
    6022                                 }
    6023                         }
    6024                 };
    6025 
    6026                 // Override the abort handler, if we can (IE 6 doesn't allow it, but that's OK)
    6027                 // Opera doesn't fire onreadystatechange at all on abort
    6028                 try {
    6029                         var oldAbort = xhr.abort;
    6030                         xhr.abort = function() {
    6031                                 if ( xhr ) {
    6032                                         // oldAbort has no call property in IE7 so
    6033                                         // just do it this way, which works in all
    6034                                         // browsers
    6035                                         Function.prototype.call.call( oldAbort, xhr );
    6036                                 }
    6037 
    6038                                 onreadystatechange( "abort" );
    6039                         };
    6040                 } catch( abortError ) {}
    6041 
    6042                 // Timeout checker
    6043                 if ( s.async && s.timeout > 0 ) {
    6044                         setTimeout(function() {
    6045                                 // Check to see if the request is still happening
    6046                                 if ( xhr && !requestDone ) {
    6047                                         onreadystatechange( "timeout" );
    6048                                 }
    6049                         }, s.timeout);
    6050                 }
    6051 
    6052                 // Send the data
    6053                 try {
    6054                         xhr.send( noContent || s.data == null ? null : s.data );
    6055 
    6056                 } catch( sendError ) {
    6057                         jQuery.handleError( s, xhr, null, sendError );
    6058 
    6059                         // Fire the complete handlers
    6060                         jQuery.handleComplete( s, xhr, status, data );
    6061                 }
    6062 
    6063                 // firefox 1.5 doesn't fire statechange for sync requests
    6064                 if ( !s.async ) {
    6065                         onreadystatechange();
    6066                 }
    6067 
    6068                 // return XMLHttpRequest to allow aborting the request etc.
    6069                 return xhr;
     6618
     6619                        // Install callbacks on deferreds
     6620                        for ( i in { success: 1, error: 1, complete: 1 } ) {
     6621                                jXHR[ i ]( s[ i ] );
     6622                        }
     6623
     6624                        // Get transport
     6625                        transport = inspectPrefiltersOrTransports( transports, s, options, jXHR );
     6626
     6627                        // If no transport, we auto-abort
     6628                        if ( !transport ) {
     6629                                done( -1, "No Transport" );
     6630                        } else {
     6631                                // Set state as sending
     6632                                state = jXHR.readyState = 1;
     6633                                // Send global event
     6634                                if ( s.global ) {
     6635                                        globalEventContext.trigger( "ajaxSend", [ jXHR, s ] );
     6636                                }
     6637                                // Timeout
     6638                                if ( s.async && s.timeout > 0 ) {
     6639                                        timeoutTimer = setTimeout( function(){
     6640                                                jXHR.abort( "timeout" );
     6641                                        }, s.timeout );
     6642                                }
     6643
     6644                                try {
     6645                                        transport.send( requestHeaders, done );
     6646                                } catch (e) {
     6647                                        // Propagate exception as error if not done
     6648                                        if ( status < 2 ) {
     6649                                                done( -1, e );
     6650                                        // Simply rethrow otherwise
     6651                                        } else {
     6652                                                jQuery.error( e );
     6653                                        }
     6654                                }
     6655                        }
     6656                }
     6657                return jXHR;
    60706658        },
    60716659
     
    60766664                        add = function( key, value ) {
    60776665                                // If value is a function, invoke it and return its value
    6078                                 value = jQuery.isFunction(value) ? value() : value;
    6079                                 s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
     6666                                value = jQuery.isFunction( value ) ? value() : value;
     6667                                s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
    60806668                        };
    6081                
     6669
    60826670                // Set traditional to true for jQuery <= 1.3.2 behavior.
    60836671                if ( traditional === undefined ) {
    60846672                        traditional = jQuery.ajaxSettings.traditional;
    60856673                }
    6086                
     6674
    60876675                // If an array was passed in, assume that it is an array of form elements.
    6088                 if ( jQuery.isArray(a) || a.jquery ) {
     6676                if ( jQuery.isArray( a ) || a.jquery ) {
    60896677                        // Serialize the form elements
    60906678                        jQuery.each( a, function() {
    60916679                                add( this.name, this.value );
    6092                         });
    6093                        
     6680                        } );
     6681
    60946682                } else {
    60956683                        // If traditional, encode the "old" way (the way 1.3.2 or older
    60966684                        // did it), otherwise encode params recursively.
    60976685                        for ( var prefix in a ) {
    6098                                 buildParams( prefix, a[prefix], traditional, add );
     6686                                buildParams( prefix, a[ prefix ], traditional, add );
    60996687                        }
    61006688                }
    61016689
    61026690                // Return the resulting serialization
    6103                 return s.join("&").replace(r20, "+");
     6691                return s.join( "&" ).replace( r20, "+" );
    61046692        }
    61056693});
    61066694
    61076695function buildParams( prefix, obj, traditional, add ) {
    6108         if ( jQuery.isArray(obj) && obj.length ) {
     6696        if ( jQuery.isArray( obj ) && obj.length ) {
    61096697                // Serialize array item.
    61106698                jQuery.each( obj, function( i, v ) {
     
    61246712                        }
    61256713                });
    6126                        
     6714
    61276715        } else if ( !traditional && obj != null && typeof obj === "object" ) {
    6128                 if ( jQuery.isEmptyObject( obj ) ) {
     6716                // If we see an array here, it is empty and should be treated as an empty
     6717                // object
     6718                if ( jQuery.isArray( obj ) || jQuery.isEmptyObject( obj ) ) {
    61296719                        add( prefix, "" );
    61306720
     
    61356725                        });
    61366726                }
    6137                                        
     6727
    61386728        } else {
    61396729                // Serialize scalar item.
     
    61516741        // Last-Modified header cache for next request
    61526742        lastModified: {},
    6153         etag: {},
    6154 
    6155         handleError: function( s, xhr, status, e ) {
    6156                 // If a local callback was specified, fire it
    6157                 if ( s.error ) {
    6158                         s.error.call( s.context, xhr, status, e );
    6159                 }
    6160 
    6161                 // Fire the global callback
    6162                 if ( s.global ) {
    6163                         jQuery.triggerGlobal( s, "ajaxError", [xhr, s, e] );
    6164                 }
    6165         },
    6166 
    6167         handleSuccess: function( s, xhr, status, data ) {
    6168                 // If a local callback was specified, fire it and pass it the data
    6169                 if ( s.success ) {
    6170                         s.success.call( s.context, data, status, xhr );
    6171                 }
    6172 
    6173                 // Fire the global callback
    6174                 if ( s.global ) {
    6175                         jQuery.triggerGlobal( s, "ajaxSuccess", [xhr, s] );
    6176                 }
    6177         },
    6178 
    6179         handleComplete: function( s, xhr, status ) {
    6180                 // Process result
    6181                 if ( s.complete ) {
    6182                         s.complete.call( s.context, xhr, status );
    6183                 }
    6184 
    6185                 // The request was completed
    6186                 if ( s.global ) {
    6187                         jQuery.triggerGlobal( s, "ajaxComplete", [xhr, s] );
    6188                 }
    6189 
    6190                 // Handle the global AJAX counter
    6191                 if ( s.global && jQuery.active-- === 1 ) {
    6192                         jQuery.event.trigger( "ajaxStop" );
    6193                 }
    6194         },
    6195                
    6196         triggerGlobal: function( s, type, args ) {
    6197                 (s.context && s.context.url == null ? jQuery(s.context) : jQuery.event).trigger(type, args);
    6198         },
    6199 
    6200         // Determines if an XMLHttpRequest was successful or not
    6201         httpSuccess: function( xhr ) {
    6202                 try {
    6203                         // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
    6204                         return !xhr.status && location.protocol === "file:" ||
    6205                                 xhr.status >= 200 && xhr.status < 300 ||
    6206                                 xhr.status === 304 || xhr.status === 1223;
    6207                 } catch(e) {}
    6208 
    6209                 return false;
    6210         },
    6211 
    6212         // Determines if an XMLHttpRequest returns NotModified
    6213         httpNotModified: function( xhr, url ) {
    6214                 var lastModified = xhr.getResponseHeader("Last-Modified"),
    6215                         etag = xhr.getResponseHeader("Etag");
    6216 
    6217                 if ( lastModified ) {
    6218                         jQuery.lastModified[url] = lastModified;
    6219                 }
    6220 
    6221                 if ( etag ) {
    6222                         jQuery.etag[url] = etag;
    6223                 }
    6224 
    6225                 return xhr.status === 304;
    6226         },
    6227 
    6228         httpData: function( xhr, type, s ) {
    6229                 var ct = xhr.getResponseHeader("content-type") || "",
    6230                         xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
    6231                         data = xml ? xhr.responseXML : xhr.responseText;
    6232 
    6233                 if ( xml && data.documentElement.nodeName === "parsererror" ) {
    6234                         jQuery.error( "parsererror" );
    6235                 }
    6236 
    6237                 // Allow a pre-filtering function to sanitize the response
    6238                 // s is checked to keep backwards compatibility
    6239                 if ( s && s.dataFilter ) {
    6240                         data = s.dataFilter( data, type );
    6241                 }
    6242 
    6243                 // The filter can actually parse the response
    6244                 if ( typeof data === "string" ) {
    6245                         // Get the JavaScript object, if JSON is used.
    6246                         if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
    6247                                 data = jQuery.parseJSON( data );
    6248 
    6249                         // If the type is "script", eval it in global context
    6250                         } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
    6251                                 jQuery.globalEval( data );
    6252                         }
    6253                 }
    6254 
    6255                 return data;
    6256         }
     6743        etag: {}
    62576744
    62586745});
    62596746
    6260 /*
    6261  * Create the request object; Microsoft failed to properly
    6262  * implement the XMLHttpRequest in IE7 (can't request local files),
    6263  * so we use the ActiveXObject when it is available
    6264  * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
    6265  * we need a fallback.
     6747/* Handles responses to an ajax request:
     6748 * - sets all responseXXX fields accordingly
     6749 * - finds the right dataType (mediates between content-type and expected dataType)
     6750 * - returns the corresponding response
    62666751 */
    6267 if ( window.ActiveXObject ) {
    6268         jQuery.ajaxSettings.xhr = function() {
     6752function ajaxHandleResponses( s, jXHR, responses ) {
     6753
     6754        var contents = s.contents,
     6755                dataTypes = s.dataTypes,
     6756                responseFields = s.responseFields,
     6757                ct,
     6758                type,
     6759                finalDataType,
     6760                firstDataType;
     6761
     6762        // Fill responseXXX fields
     6763        for( type in responseFields ) {
     6764                if ( type in responses ) {
     6765                        jXHR[ responseFields[type] ] = responses[ type ];
     6766                }
     6767        }
     6768
     6769        // Remove auto dataType and get content-type in the process
     6770        while( dataTypes[ 0 ] === "*" ) {
     6771                dataTypes.shift();
     6772                if ( ct === undefined ) {
     6773                        ct = jXHR.getResponseHeader( "content-type" );
     6774                }
     6775        }
     6776
     6777        // Check if we're dealing with a known content-type
     6778        if ( ct ) {
     6779                for ( type in contents ) {
     6780                        if ( contents[ type ] && contents[ type ].test( ct ) ) {
     6781                                dataTypes.unshift( type );
     6782                                break;
     6783                        }
     6784                }
     6785        }
     6786
     6787        // Check to see if we have a response for the expected dataType
     6788        if ( dataTypes[ 0 ] in responses ) {
     6789                finalDataType = dataTypes[ 0 ];
     6790        } else {
     6791                // Try convertible dataTypes
     6792                for ( type in responses ) {
     6793                        if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
     6794                                finalDataType = type;
     6795                                break;
     6796                        }
     6797                        if ( !firstDataType ) {
     6798                                firstDataType = type;
     6799                        }
     6800                }
     6801                // Or just use first one
     6802                finalDataType = finalDataType || firstDataType;
     6803        }
     6804
     6805        // If we found a dataType
     6806        // We add the dataType to the list if needed
     6807        // and return the corresponding response
     6808        if ( finalDataType ) {
     6809                if ( finalDataType !== dataTypes[ 0 ] ) {
     6810                        dataTypes.unshift( finalDataType );
     6811                }
     6812                return responses[ finalDataType ];
     6813        }
     6814}
     6815
     6816// Chain conversions given the request and the original response
     6817function ajaxConvert( s, response ) {
     6818
     6819        // Apply the dataFilter if provided
     6820        if ( s.dataFilter ) {
     6821                response = s.dataFilter( response, s.dataType );
     6822        }
     6823
     6824        var dataTypes = s.dataTypes,
     6825                converters = s.converters,
     6826                i,
     6827                length = dataTypes.length,
     6828                tmp,
     6829                // Current and previous dataTypes
     6830                current = dataTypes[ 0 ],
     6831                prev,
     6832                // Conversion expression
     6833                conversion,
     6834                // Conversion function
     6835                conv,
     6836                // Conversion functions (transitive conversion)
     6837                conv1,
     6838                conv2;
     6839
     6840        // For each dataType in the chain
     6841        for( i = 1; i < length; i++ ) {
     6842
     6843                // Get the dataTypes
     6844                prev = current;
     6845                current = dataTypes[ i ];
     6846
     6847                // If current is auto dataType, update it to prev
     6848                if( current === "*" ) {
     6849                        current = prev;
     6850                // If no auto and dataTypes are actually different
     6851                } else if ( prev !== "*" && prev !== current ) {
     6852
     6853                        // Get the converter
     6854                        conversion = prev + " " + current;
     6855                        conv = converters[ conversion ] || converters[ "* " + current ];
     6856
     6857                        // If there is no direct converter, search transitively
     6858                        if ( !conv ) {
     6859                                conv2 = undefined;
     6860                                for( conv1 in converters ) {
     6861                                        tmp = conv1.split( " " );
     6862                                        if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
     6863                                                conv2 = converters[ tmp[1] + " " + current ];
     6864                                                if ( conv2 ) {
     6865                                                        conv1 = converters[ conv1 ];
     6866                                                        if ( conv1 === true ) {
     6867                                                                conv = conv2;
     6868                                                        } else if ( conv2 === true ) {
     6869                                                                conv = conv1;
     6870                                                        }
     6871                                                        break;
     6872                                                }
     6873                                        }
     6874                                }
     6875                        }
     6876                        // If we found no converter, dispatch an error
     6877                        if ( !( conv || conv2 ) ) {
     6878                                jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
     6879                        }
     6880                        // If found converter is not an equivalence
     6881                        if ( conv !== true ) {
     6882                                // Convert with 1 or 2 converters accordingly
     6883                                response = conv ? conv( response ) : conv2( conv1(response) );
     6884                        }
     6885                }
     6886        }
     6887        return response;
     6888}
     6889
     6890
     6891
     6892
     6893var jsc = jQuery.now(),
     6894        jsre = /(\=)\?(&|$)|()\?\?()/i;
     6895
     6896// Default jsonp settings
     6897jQuery.ajaxSetup({
     6898        jsonp: "callback",
     6899        jsonpCallback: function() {
     6900                return jQuery.expando + "_" + ( jsc++ );
     6901        }
     6902});
     6903
     6904// Detect, normalize options and install callbacks for jsonp requests
     6905jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, dataIsString /* internal */ ) {
     6906
     6907        dataIsString = ( typeof s.data === "string" );
     6908
     6909        if ( s.dataTypes[ 0 ] === "jsonp" ||
     6910                originalSettings.jsonpCallback ||
     6911                originalSettings.jsonp != null ||
     6912                s.jsonp !== false && ( jsre.test( s.url ) ||
     6913                                dataIsString && jsre.test( s.data ) ) ) {
     6914
     6915                var responseContainer,
     6916                        jsonpCallback = s.jsonpCallback =
     6917                                jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
     6918                        previous = window[ jsonpCallback ],
     6919                        url = s.url,
     6920                        data = s.data,
     6921                        replace = "$1" + jsonpCallback + "$2";
     6922
     6923                if ( s.jsonp !== false ) {
     6924                        url = url.replace( jsre, replace );
     6925                        if ( s.url === url ) {
     6926                                if ( dataIsString ) {
     6927                                        data = data.replace( jsre, replace );
     6928                                }
     6929                                if ( s.data === data ) {
     6930                                        // Add callback manually
     6931                                        url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
     6932                                }
     6933                        }
     6934                }
     6935
     6936                s.url = url;
     6937                s.data = data;
     6938
     6939                window[ jsonpCallback ] = function( response ) {
     6940                        responseContainer = [ response ];
     6941                };
     6942
     6943                s.complete = [ function() {
     6944
     6945                        // Set callback back to previous value
     6946                        window[ jsonpCallback ] = previous;
     6947
     6948                        // Call if it was a function and we have a response
     6949                        if ( previous) {
     6950                                if ( responseContainer && jQuery.isFunction( previous ) ) {
     6951                                        window[ jsonpCallback ] ( responseContainer[ 0 ] );
     6952                                }
     6953                        } else {
     6954                                // else, more memory leak avoidance
     6955                                try{
     6956                                        delete window[ jsonpCallback ];
     6957                                } catch( e ) {}
     6958                        }
     6959
     6960                }, s.complete ];
     6961
     6962                // Use data converter to retrieve json after script execution
     6963                s.converters["script json"] = function() {
     6964                        if ( ! responseContainer ) {
     6965                                jQuery.error( jsonpCallback + " was not called" );
     6966                        }
     6967                        return responseContainer[ 0 ];
     6968                };
     6969
     6970                // force json dataType
     6971                s.dataTypes[ 0 ] = "json";
     6972
     6973                // Delegate to script
     6974                return "script";
     6975        }
     6976} );
     6977
     6978
     6979
     6980
     6981// Install script dataType
     6982jQuery.ajaxSetup({
     6983        accepts: {
     6984                script: "text/javascript, application/javascript"
     6985        },
     6986        contents: {
     6987                script: /javascript/
     6988        },
     6989        converters: {
     6990                "text script": function( text ) {
     6991                        jQuery.globalEval( text );
     6992                        return text;
     6993                }
     6994        }
     6995});
     6996
     6997// Handle cache's special case and global
     6998jQuery.ajaxPrefilter( "script", function( s ) {
     6999        if ( s.cache === undefined ) {
     7000                s.cache = false;
     7001        }
     7002        if ( s.crossDomain ) {
     7003                s.type = "GET";
     7004                s.global = false;
     7005        }
     7006} );
     7007
     7008// Bind script tag hack transport
     7009jQuery.ajaxTransport( "script", function(s) {
     7010
     7011        // This transport only deals with cross domain requests
     7012        if ( s.crossDomain ) {
     7013
     7014                var script,
     7015                        head = document.getElementsByTagName( "head" )[ 0 ] || document.documentElement;
     7016
     7017                return {
     7018
     7019                        send: function( _, callback ) {
     7020
     7021                                script = document.createElement( "script" );
     7022
     7023                                script.async = "async";
     7024
     7025                                if ( s.scriptCharset ) {
     7026                                        script.charset = s.scriptCharset;
     7027                                }
     7028
     7029                                script.src = s.url;
     7030
     7031                                // Attach handlers for all browsers
     7032                                script.onload = script.onreadystatechange = function( _, isAbort ) {
     7033
     7034                                        if ( !script.readyState || /loaded|complete/.test( script.readyState ) ) {
     7035
     7036                                                // Handle memory leak in IE
     7037                                                script.onload = script.onreadystatechange = null;
     7038
     7039                                                // Remove the script
     7040                                                if ( head && script.parentNode ) {
     7041                                                        head.removeChild( script );
     7042                                                }
     7043
     7044                                                // Dereference the script
     7045                                                script = undefined;
     7046
     7047                                                // Callback if not abort
     7048                                                if ( !isAbort ) {
     7049                                                        callback( 200, "success" );
     7050                                                }
     7051                                        }
     7052                                };
     7053                                // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
     7054                                // This arises when a base node is used (#2709 and #4378).
     7055                                head.insertBefore( script, head.firstChild );
     7056                        },
     7057
     7058                        abort: function() {
     7059                                if ( script ) {
     7060                                        script.onload( 0, 1 );
     7061                                }
     7062                        }
     7063                };
     7064        }
     7065} );
     7066
     7067
     7068
     7069
     7070var // Next active xhr id
     7071        xhrId = jQuery.now(),
     7072
     7073        // active xhrs
     7074        xhrs = {},
     7075
     7076        // #5280: see below
     7077        xhrUnloadAbortInstalled,
     7078
     7079        // XHR used to determine supports properties
     7080        testXHR;
     7081
     7082// Create the request object
     7083// (This is still attached to ajaxSettings for backward compatibility)
     7084jQuery.ajaxSettings.xhr = window.ActiveXObject ?
     7085        /* Microsoft failed to properly
     7086         * implement the XMLHttpRequest in IE7 (can't request local files),
     7087         * so we use the ActiveXObject when it is available
     7088         * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
     7089         * we need a fallback.
     7090         */
     7091        function() {
    62697092                if ( window.location.protocol !== "file:" ) {
    62707093                        try {
    62717094                                return new window.XMLHttpRequest();
    6272                         } catch(xhrError) {}
     7095                        } catch( xhrError ) {}
    62737096                }
    62747097
    62757098                try {
    62767099                        return new window.ActiveXObject("Microsoft.XMLHTTP");
    6277                 } catch(activeError) {}
     7100                } catch( activeError ) {}
     7101        } :
     7102        // For all other browsers, use the standard XMLHttpRequest object
     7103        function() {
     7104                return new window.XMLHttpRequest();
    62787105        };
     7106
     7107// Test if we can create an xhr object
     7108try {
     7109        testXHR = jQuery.ajaxSettings.xhr();
     7110} catch( xhrCreationException ) {}
     7111
     7112//Does this browser support XHR requests?
     7113jQuery.support.ajax = !!testXHR;
     7114
     7115// Does this browser support crossDomain XHR requests
     7116jQuery.support.cors = testXHR && ( "withCredentials" in testXHR );
     7117
     7118// No need for the temporary xhr anymore
     7119testXHR = undefined;
     7120
     7121// Create transport if the browser can provide an xhr
     7122if ( jQuery.support.ajax ) {
     7123
     7124        jQuery.ajaxTransport(function( s ) {
     7125                // Cross domain only allowed if supported through XMLHttpRequest
     7126                if ( !s.crossDomain || jQuery.support.cors ) {
     7127
     7128                        var callback;
     7129
     7130                        return {
     7131                                send: function( headers, complete ) {
     7132
     7133                                        // #5280: we need to abort on unload or IE will keep connections alive
     7134                                        if ( !xhrUnloadAbortInstalled ) {
     7135
     7136                                                xhrUnloadAbortInstalled = 1;
     7137
     7138                                                jQuery(window).bind( "unload", function() {
     7139
     7140                                                        // Abort all pending requests
     7141                                                        jQuery.each( xhrs, function( _, xhr ) {
     7142                                                                if ( xhr.onreadystatechange ) {
     7143                                                                        xhr.onreadystatechange( 1 );
     7144                                                                }
     7145                                                        } );
     7146
     7147                                                } );
     7148                                        }
     7149
     7150                                        // Get a new xhr
     7151                                        var xhr = s.xhr(),
     7152                                                handle;
     7153
     7154                                        // Open the socket
     7155                                        // Passing null username, generates a login popup on Opera (#2865)
     7156                                        if ( s.username ) {
     7157                                                xhr.open( s.type, s.url, s.async, s.username, s.password );
     7158                                        } else {
     7159                                                xhr.open( s.type, s.url, s.async );
     7160                                        }
     7161
     7162                                        // Requested-With header
     7163                                        // Not set for crossDomain requests with no content
     7164                                        // (see why at http://trac.dojotoolkit.org/ticket/9486)
     7165                                        // Won't change header if already provided
     7166                                        if ( !( s.crossDomain && !s.hasContent ) && !headers["x-requested-with"] ) {
     7167                                                headers[ "x-requested-with" ] = "XMLHttpRequest";
     7168                                        }
     7169
     7170                                        // Need an extra try/catch for cross domain requests in Firefox 3
     7171                                        try {
     7172                                                jQuery.each( headers, function( key, value ) {
     7173                                                        xhr.setRequestHeader( key, value );
     7174                                                } );
     7175                                        } catch( _ ) {}
     7176
     7177                                        // Do send the request
     7178                                        // This may raise an exception which is actually
     7179                                        // handled in jQuery.ajax (so no try/catch here)
     7180                                        xhr.send( ( s.hasContent && s.data ) || null );
     7181
     7182                                        // Listener
     7183                                        callback = function( _, isAbort ) {
     7184
     7185                                                // Was never called and is aborted or complete
     7186                                                if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
     7187
     7188                                                        // Only called once
     7189                                                        callback = 0;
     7190
     7191                                                        // Do not keep as active anymore
     7192                                                        if ( handle ) {
     7193                                                                xhr.onreadystatechange = jQuery.noop;
     7194                                                                delete xhrs[ handle ];
     7195                                                        }
     7196
     7197                                                        // If it's an abort
     7198                                                        if ( isAbort ) {
     7199                                                                // Abort it manually if needed
     7200                                                                if ( xhr.readyState !== 4 ) {
     7201                                                                        xhr.abort();
     7202                                                                }
     7203                                                        } else {
     7204                                                                // Get info
     7205                                                                var status = xhr.status,
     7206                                                                        statusText,
     7207                                                                        responseHeaders = xhr.getAllResponseHeaders(),
     7208                                                                        responses = {},
     7209                                                                        xml = xhr.responseXML;
     7210
     7211                                                                // Construct response list
     7212                                                                if ( xml && xml.documentElement /* #4958 */ ) {
     7213                                                                        responses.xml = xml;
     7214                                                                }
     7215                                                                responses.text = xhr.responseText;
     7216
     7217                                                                // Firefox throws an exception when accessing
     7218                                                                // statusText for faulty cross-domain requests
     7219                                                                try {
     7220                                                                        statusText = xhr.statusText;
     7221                                                                } catch( e ) {
     7222                                                                        // We normalize with Webkit giving an empty statusText
     7223                                                                        statusText = "";
     7224                                                                }
     7225
     7226                                                                // Filter status for non standard behaviours
     7227                                                                status =
     7228                                                                        // Opera returns 0 when it should be 304
     7229                                                                        // Webkit returns 0 for failing cross-domain no matter the real status
     7230                                                                        status === 0 ?
     7231                                                                                (
     7232                                                                                        // Webkit, Firefox: filter out faulty cross-domain requests
     7233                                                                                        !s.crossDomain || statusText ?
     7234                                                                                        (
     7235                                                                                                // Opera: filter out real aborts #6060
     7236                                                                                                responseHeaders ?
     7237                                                                                                304 :
     7238                                                                                                0
     7239                                                                                        ) :
     7240                                                                                        // We assume 302 but could be anything cross-domain related
     7241                                                                                        302
     7242                                                                                ) :
     7243                                                                                (
     7244                                                                                        // IE sometimes returns 1223 when it should be 204 (see #1450)
     7245                                                                                        status == 1223 ?
     7246                                                                                                204 :
     7247                                                                                                status
     7248                                                                                );
     7249
     7250                                                                // Call complete
     7251                                                                complete( status, statusText, responses, responseHeaders );
     7252                                                        }
     7253                                                }
     7254                                        };
     7255
     7256                                        // if we're in sync mode or it's in cache
     7257                                        // and has been retrieved directly (IE6 & IE7)
     7258                                        // we need to manually fire the callback
     7259                                        if ( !s.async || xhr.readyState === 4 ) {
     7260                                                callback();
     7261                                        } else {
     7262                                                // Add to list of active xhrs
     7263                                                handle = xhrId++;
     7264                                                xhrs[ handle ] = xhr;
     7265                                                xhr.onreadystatechange = callback;
     7266                                        }
     7267                                },
     7268
     7269                                abort: function() {
     7270                                        if ( callback ) {
     7271                                                callback(0,1);
     7272                                        }
     7273                                }
     7274                        };
     7275                }
     7276        });
    62797277}
    6280 
    6281 // Does this browser support XHR requests?
    6282 jQuery.support.ajax = !!jQuery.ajaxSettings.xhr();
    62837278
    62847279
     
    62877282var elemdisplay = {},
    62887283        rfxtypes = /^(?:toggle|show|hide)$/,
    6289         rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/,
     7284        rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
    62907285        timerId,
    62917286        fxAttrs = [
     
    63127307                                // Reset the inline display of this element to learn if it is
    63137308                                // being hidden by cascaded rules or not
    6314                                 if ( !jQuery.data(elem, "olddisplay") && display === "none" ) {
     7309                                if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
    63157310                                        display = elem.style.display = "";
    63167311                                }
     
    63207315                                // for such an element
    63217316                                if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
    6322                                         jQuery.data(elem, "olddisplay", defaultDisplay(elem.nodeName));
     7317                                        jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
    63237318                                }
    63247319                        }
     
    63317326
    63327327                                if ( display === "" || display === "none" ) {
    6333                                         elem.style.display = jQuery.data(elem, "olddisplay") || "";
     7328                                        elem.style.display = jQuery._data(elem, "olddisplay") || "";
    63347329                                }
    63357330                        }
     
    63477342                                var display = jQuery.css( this[i], "display" );
    63487343
    6349                                 if ( display !== "none" ) {
    6350                                         jQuery.data( this[i], "olddisplay", display );
     7344                                if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
     7345                                        jQuery._data( this[i], "olddisplay", display );
    63517346                                }
    63527347                        }
     
    66227617
    66237618                var r = parseFloat( jQuery.css( this.elem, this.prop ) );
    6624                 return r && r > -10000 ? r : 0;
     7619                return r || 0;
    66257620        },
    66267621
     
    68167811                var elem = this[0], box;
    68177812
    6818                 if ( options ) { 
     7813                if ( options ) {
    68197814                        return this.each(function( i ) {
    68207815                                jQuery.offset.setOffset( this, options, i );
     
    68397834                // Make sure we're not dealing with a disconnected DOM node
    68407835                if ( !box || !jQuery.contains( docElem, elem ) ) {
    6841                         return box || { top: 0, left: 0 };
     7836                        return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
    68427837                }
    68437838
     
    68587853                var elem = this[0];
    68597854
    6860                 if ( options ) { 
     7855                if ( options ) {
    68617856                        return this.each(function( i ) {
    68627857                                jQuery.offset.setOffset( this, options, i );
     
    69777972                return { top: top, left: left };
    69787973        },
    6979        
     7974
    69807975        setOffset: function( elem, options, i ) {
    69817976                var position = jQuery.css( elem, "position" );
     
    70118006                        props.left = (options.left - curOffset.left) + curLeft;
    70128007                }
    7013                
     8008
    70148009                if ( "using" in options ) {
    70158010                        options.using.call( elem, props );
     
    70718066        jQuery.fn[ method ] = function(val) {
    70728067                var elem = this[0], win;
    7073                
     8068
    70748069                if ( !elem ) {
    70758070                        return null;
     
    71398134                        return size == null ? null : this;
    71408135                }
    7141                
     8136
    71428137                if ( jQuery.isFunction( size ) ) {
    71438138                        return this.each(function( i ) {
     
    71498144                if ( jQuery.isWindow( elem ) ) {
    71508145                        // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
    7151                         return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
    7152                                 elem.document.body[ "client" + name ];
     8146                        // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
     8147                        var docElemProp = elem.document.documentElement[ "client" + name ];
     8148                        return elem.document.compatMode === "CSS1Compat" && docElemProp ||
     8149                                elem.document.body[ "client" + name ] || docElemProp;
    71538150
    71548151                // Get document width or height
Note: See TracChangeset for help on using the changeset viewer.