Ignore:
Timestamp:
Dec 16, 2010, 7:09:14 AM (13 years ago)
Author:
rvelices
Message:

jquery upgrade to 1.4.4

File:
1 edited

Legend:

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

    r4918 r8162  
    11/*!
    2  * jQuery JavaScript Library v1.4.1
     2 * jQuery JavaScript Library v1.4.4
    33 * http://jquery.com/
    44 *
     
    1212 * Released under the MIT, BSD, and GPL Licenses.
    1313 *
    14  * Date: Mon Jan 25 19:43:33 2010 -0500
     14 * Date: Thu Nov 11 19:04:53 2010 -0500
    1515 */
    1616(function( window, undefined ) {
     17
     18// Use the correct document accordingly with window argument (sandbox)
     19var document = window.document;
     20var jQuery = (function() {
    1721
    1822// Define a local copy of jQuery
     
    2832        _$ = window.$,
    2933
    30         // Use the correct document accordingly with window argument (sandbox)
    31         document = window.document,
    32 
    3334        // A central reference to the root jQuery(document)
    3435        rootjQuery,
     
    3637        // A simple way to check for HTML strings or ID strings
    3738        // (both of which we optimize for)
    38         quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
     39        quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
    3940
    4041        // Is it a simple selector
     
    4344        // Check if a string has a non-whitespace character in it
    4445        rnotwhite = /\S/,
     46        rwhite = /\s/,
    4547
    4648        // Used for trimming whitespace
    47         rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
     49        trimLeft = /^\s+/,
     50        trimRight = /\s+$/,
     51
     52        // Check for non-word characters
     53        rnonword = /\W/,
     54
     55        // Check for digits
     56        rdigit = /\d/,
    4857
    4958        // Match a standalone tag
    5059        rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
     60
     61        // JSON RegExp
     62        rvalidchars = /^[\],:{}\s]*$/,
     63        rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
     64        rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
     65        rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
     66
     67        // Useragent RegExp
     68        rwebkit = /(webkit)[ \/]([\w.]+)/,
     69        ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
     70        rmsie = /(msie) ([\w.]+)/,
     71        rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
    5172
    5273        // Keep a UserAgent string for use with jQuery.browser
     
    6788        // Save a reference to some core methods
    6889        toString = Object.prototype.toString,
    69         hasOwnProperty = Object.prototype.hasOwnProperty,
     90        hasOwn = Object.prototype.hasOwnProperty,
    7091        push = Array.prototype.push,
    7192        slice = Array.prototype.slice,
    72         indexOf = Array.prototype.indexOf;
     93        trim = String.prototype.trim,
     94        indexOf = Array.prototype.indexOf,
     95       
     96        // [[Class]] -> type pairs
     97        class2type = {};
    7398
    7499jQuery.fn = jQuery.prototype = {
     
    87112                        return this;
    88113                }
     114               
     115                // The body element only exists once, optimize finding it
     116                if ( selector === "body" && !context && document.body ) {
     117                        this.context = document;
     118                        this[0] = document.body;
     119                        this.selector = "body";
     120                        this.length = 1;
     121                        return this;
     122                }
    89123
    90124                // Handle HTML strings
     
    114148
    115149                                        } else {
    116                                                 ret = buildFragment( [ match[1] ], [ doc ] );
     150                                                ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
    117151                                                selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
    118152                                        }
    119 
     153                                       
     154                                        return jQuery.merge( this, selector );
     155                                       
    120156                                // HANDLE: $("#id")
    121157                                } else {
    122158                                        elem = document.getElementById( match[2] );
    123159
    124                                         if ( elem ) {
     160                                        // Check parentNode to catch when Blackberry 4.6 returns
     161                                        // nodes that are no longer in the document #6963
     162                                        if ( elem && elem.parentNode ) {
    125163                                                // Handle the case where IE and Opera return items
    126164                                                // by name instead of ID
     
    140178
    141179                        // HANDLE: $("TAG")
    142                         } else if ( !context && /^\w+$/.test( selector ) ) {
     180                        } else if ( !context && !rnonword.test( selector ) ) {
    143181                                this.selector = selector;
    144182                                this.context = document;
    145183                                selector = document.getElementsByTagName( selector );
     184                                return jQuery.merge( this, selector );
    146185
    147186                        // HANDLE: $(expr, $(...))
     
    166205                }
    167206
    168                 return jQuery.isArray( selector ) ?
    169                         this.setArray( selector ) :
    170                         jQuery.makeArray( selector, this );
     207                return jQuery.makeArray( selector, this );
    171208        },
    172209
     
    175212
    176213        // The current version of jQuery being used
    177         jquery: "1.4.1",
     214        jquery: "1.4.4",
    178215
    179216        // The default length of a jQuery object is 0
     
    205242        pushStack: function( elems, name, selector ) {
    206243                // Build a new jQuery matched element set
    207                 var ret = jQuery( elems || null );
     244                var ret = jQuery();
     245
     246                if ( jQuery.isArray( elems ) ) {
     247                        push.apply( ret, elems );
     248               
     249                } else {
     250                        jQuery.merge( ret, elems );
     251                }
    208252
    209253                // Add the old object onto the stack (as a reference)
     
    220264                // Return the newly-formed element set
    221265                return ret;
    222         },
    223 
    224         // Force the current matched set of elements to become
    225         // the specified array of elements (destroying the stack in the process)
    226         // You should use pushStack() in order to do this, but maintain the stack
    227         setArray: function( elems ) {
    228                 // Resetting the length to 0, then using the native Array push
    229                 // is a super-fast way to populate an object with array-like properties
    230                 this.length = 0;
    231                 push.apply( this, elems );
    232 
    233                 return this;
    234266        },
    235267
     
    299331
    300332jQuery.extend = jQuery.fn.extend = function() {
    301         // copy reference to target object
    302         var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
     333         var options, name, src, copy, copyIsArray, clone,
     334                target = arguments[0] || {},
     335                i = 1,
     336                length = arguments.length,
     337                deep = false;
    303338
    304339        // Handle a deep copy situation
     
    334369                                }
    335370
    336                                 // Recurse if we're merging object literal values or arrays
    337                                 if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
    338                                         var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
    339                                                 : jQuery.isArray(copy) ? [] : {};
     371                                // Recurse if we're merging plain objects or arrays
     372                                if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
     373                                        if ( copyIsArray ) {
     374                                                copyIsArray = false;
     375                                                clone = src && jQuery.isArray(src) ? src : [];
     376
     377                                        } else {
     378                                                clone = src && jQuery.isPlainObject(src) ? src : {};
     379                                        }
    340380
    341381                                        // Never move original objects, clone them
     
    367407        // Is the DOM ready to be used? Set to true once it occurs.
    368408        isReady: false,
     409
     410        // A counter to track how many items to wait for before
     411        // the ready event fires. See #6781
     412        readyWait: 1,
    369413       
    370414        // Handle when the DOM is ready
    371         ready: function() {
     415        ready: function( wait ) {
     416                // A third-party is pushing the ready event forwards
     417                if ( wait === true ) {
     418                        jQuery.readyWait--;
     419                }
     420
    372421                // Make sure that the DOM is not already loaded
    373                 if ( !jQuery.isReady ) {
     422                if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
    374423                        // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
    375424                        if ( !document.body ) {
    376                                 return setTimeout( jQuery.ready, 13 );
     425                                return setTimeout( jQuery.ready, 1 );
    377426                        }
    378427
    379428                        // Remember that the DOM is ready
    380429                        jQuery.isReady = true;
     430
     431                        // If a normal DOM Ready event fired, decrement, and wait if need be
     432                        if ( wait !== true && --jQuery.readyWait > 0 ) {
     433                                return;
     434                        }
    381435
    382436                        // If there are functions bound, to execute
    383437                        if ( readyList ) {
    384438                                // Execute all of them
    385                                 var fn, i = 0;
    386                                 while ( (fn = readyList[ i++ ]) ) {
    387                                         fn.call( document, jQuery );
    388                                 }
     439                                var fn,
     440                                        i = 0,
     441                                        ready = readyList;
    389442
    390443                                // Reset the list of functions
    391444                                readyList = null;
    392                         }
    393 
    394                         // Trigger any bound ready events
    395                         if ( jQuery.fn.triggerHandler ) {
    396                                 jQuery( document ).triggerHandler( "ready" );
     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                                }
    397454                        }
    398455                }
     
    409466                // browser event has already occurred.
    410467                if ( document.readyState === "complete" ) {
    411                         return jQuery.ready();
     468                        // Handle it asynchronously to allow scripts the opportunity to delay ready
     469                        return setTimeout( jQuery.ready, 1 );
    412470                }
    413471
     
    447505        // aren't supported. They return false on IE (#2968).
    448506        isFunction: function( obj ) {
    449                 return toString.call(obj) === "[object Function]";
    450         },
    451 
    452         isArray: function( obj ) {
    453                 return toString.call(obj) === "[object Array]";
     507                return jQuery.type(obj) === "function";
     508        },
     509
     510        isArray: Array.isArray || function( obj ) {
     511                return jQuery.type(obj) === "array";
     512        },
     513
     514        // A crude way of determining if an object is a window
     515        isWindow: function( obj ) {
     516                return obj && typeof obj === "object" && "setInterval" in obj;
     517        },
     518
     519        isNaN: function( obj ) {
     520                return obj == null || !rdigit.test( obj ) || isNaN( obj );
     521        },
     522
     523        type: function( obj ) {
     524                return obj == null ?
     525                        String( obj ) :
     526                        class2type[ toString.call(obj) ] || "object";
    454527        },
    455528
     
    458531                // Because of IE, we also have to check the presence of the constructor property.
    459532                // Make sure that DOM nodes and window objects don't pass through, as well
    460                 if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
     533                if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
    461534                        return false;
    462535                }
    463536               
    464537                // Not own constructor property must be Object
    465                 if ( obj.constructor
    466                         && !hasOwnProperty.call(obj, "constructor")
    467                         && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
     538                if ( obj.constructor &&
     539                        !hasOwn.call(obj, "constructor") &&
     540                        !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
    468541                        return false;
    469542                }
     
    475548                for ( key in obj ) {}
    476549               
    477                 return key === undefined || hasOwnProperty.call( obj, key );
     550                return key === undefined || hasOwn.call( obj, key );
    478551        },
    479552
     
    493566                        return null;
    494567                }
     568
     569                // Make sure leading/trailing whitespace is removed (IE can't handle it)
     570                data = jQuery.trim( data );
    495571               
    496572                // Make sure the incoming data is actual JSON
    497573                // Logic borrowed from http://json.org/json2.js
    498                 if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
    499                         .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
    500                         .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) {
     574                if ( rvalidchars.test(data.replace(rvalidescape, "@")
     575                        .replace(rvalidtokens, "]")
     576                        .replace(rvalidbraces, "")) ) {
    501577
    502578                        // Try to use the native JSON parser first
     
    577653        },
    578654
    579         trim: function( text ) {
    580                 return (text || "").replace( rtrim, "" );
    581         },
     655        // Use native String.trim function wherever possible
     656        trim: trim ?
     657                function( text ) {
     658                        return text == null ?
     659                                "" :
     660                                trim.call( text );
     661                } :
     662
     663                // Otherwise use our own trimming functionality
     664                function( text ) {
     665                        return text == null ?
     666                                "" :
     667                                text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
     668                },
    582669
    583670        // results is for internal usage only
     
    589676                        // The extra typeof function check is to prevent crashes
    590677                        // in Safari 2 (See: #3039)
    591                         if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
     678                        // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
     679                        var type = jQuery.type(array);
     680
     681                        if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
    592682                                push.call( ret, array );
    593683                        } else {
     
    614704
    615705        merge: function( first, second ) {
    616                 var i = first.length, j = 0;
     706                var i = first.length,
     707                        j = 0;
    617708
    618709                if ( typeof second.length === "number" ) {
     
    620711                                first[ i++ ] = second[ j ];
    621712                        }
     713               
    622714                } else {
    623715                        while ( second[j] !== undefined ) {
     
    632724
    633725        grep: function( elems, callback, inv ) {
    634                 var ret = [];
     726                var ret = [], retVal;
     727                inv = !!inv;
    635728
    636729                // Go through the array, only saving the items
    637730                // that pass the validator function
    638731                for ( var i = 0, length = elems.length; i < length; i++ ) {
    639                         if ( !inv !== !callback( elems[ i ], i ) ) {
     732                        retVal = !!callback( elems[ i ], i );
     733                        if ( inv !== retVal ) {
    640734                                ret.push( elems[ i ] );
    641735                        }
     
    693787        },
    694788
     789        // Mutifunctional method to get and set values to a collection
     790        // The value/s can be optionally by executed if its a function
     791        access: function( elems, key, value, exec, fn, pass ) {
     792                var length = elems.length;
     793       
     794                // Setting many attributes
     795                if ( typeof key === "object" ) {
     796                        for ( var k in key ) {
     797                                jQuery.access( elems, k, key[k], exec, fn, value );
     798                        }
     799                        return elems;
     800                }
     801       
     802                // Setting one attribute
     803                if ( value !== undefined ) {
     804                        // Optionally, function values get executed if exec is true
     805                        exec = !pass && exec && jQuery.isFunction(value);
     806               
     807                        for ( var i = 0; i < length; i++ ) {
     808                                fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
     809                        }
     810               
     811                        return elems;
     812                }
     813       
     814                // Getting an attribute
     815                return length ? fn( elems[0], key ) : undefined;
     816        },
     817
     818        now: function() {
     819                return (new Date()).getTime();
     820        },
     821
    695822        // Use of jQuery.browser is frowned upon.
    696823        // More details: http://docs.jquery.com/Utilities/jQuery.browser
     
    698825                ua = ua.toLowerCase();
    699826
    700                 var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
    701                         /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
    702                         /(msie) ([\w.]+)/.exec( ua ) ||
    703                         !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
    704                         [];
     827                var match = rwebkit.exec( ua ) ||
     828                        ropera.exec( ua ) ||
     829                        rmsie.exec( ua ) ||
     830                        ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
     831                        [];
    705832
    706833                return { browser: match[1] || "", version: match[2] || "0" };
     
    708835
    709836        browser: {}
     837});
     838
     839// Populate the class2type map
     840jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
     841        class2type[ "[object " + name + "]" ] = name.toLowerCase();
    710842});
    711843
     
    725857                return indexOf.call( array, elem );
    726858        };
     859}
     860
     861// Verify that \s matches non-breaking spaces
     862// (IE fails on this test)
     863if ( !rwhite.test( "\xA0" ) ) {
     864        trimLeft = /^[\s\xA0]+/;
     865        trimRight = /[\s\xA0]+$/;
    727866}
    728867
     
    757896                // http://javascript.nwbox.com/IEContentLoaded/
    758897                document.documentElement.doScroll("left");
    759         } catch( error ) {
     898        } catch(e) {
    760899                setTimeout( doScrollCheck, 1 );
    761900                return;
     
    766905}
    767906
    768 function evalScript( i, elem ) {
    769         if ( elem.src ) {
    770                 jQuery.ajax({
    771                         url: elem.src,
    772                         async: false,
    773                         dataType: "script"
    774                 });
    775         } else {
    776                 jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
    777         }
    778 
    779         if ( elem.parentNode ) {
    780                 elem.parentNode.removeChild( elem );
    781         }
    782 }
    783 
    784 // Mutifunctional method to get and set values to a collection
    785 // The value/s can be optionally by executed if its a function
    786 function access( elems, key, value, exec, fn, pass ) {
    787         var length = elems.length;
    788        
    789         // Setting many attributes
    790         if ( typeof key === "object" ) {
    791                 for ( var k in key ) {
    792                         access( elems, k, key[k], exec, fn, value );
    793                 }
    794                 return elems;
    795         }
    796        
    797         // Setting one attribute
    798         if ( value !== undefined ) {
    799                 // Optionally, function values get executed if exec is true
    800                 exec = !pass && exec && jQuery.isFunction(value);
    801                
    802                 for ( var i = 0; i < length; i++ ) {
    803                         fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
    804                 }
    805                
    806                 return elems;
    807         }
    808        
    809         // Getting an attribute
    810         return length ? fn( elems[0], key ) : null;
    811 }
    812 
    813 function now() {
    814         return (new Date).getTime();
    815 }
     907// Expose jQuery to the global object
     908return (window.jQuery = window.$ = jQuery);
     909
     910})();
     911
     912
    816913(function() {
    817914
     
    821918                script = document.createElement("script"),
    822919                div = document.createElement("div"),
    823                 id = "script" + now();
     920                id = "script" + jQuery.now();
    824921
    825922        div.style.display = "none";
     
    827924
    828925        var all = div.getElementsByTagName("*"),
    829                 a = div.getElementsByTagName("a")[0];
     926                a = div.getElementsByTagName("a")[0],
     927                select = document.createElement("select"),
     928                opt = select.appendChild( document.createElement("option") );
    830929
    831930        // Can't get basic test support
     
    870969                // Make sure that a selected-by-default option has a working selected property.
    871970                // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
    872                 optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
     971                optSelected: opt.selected,
    873972
    874973                // Will be defined later
     974                deleteExpando: true,
     975                optDisabled: false,
    875976                checkClone: false,
    876977                scriptEval: false,
    877978                noCloneEvent: true,
    878                 boxModel: null
     979                boxModel: null,
     980                inlineBlockNeedsLayout: false,
     981                shrinkWrapBlocks: false,
     982                reliableHiddenOffsets: true
    879983        };
     984
     985        // Make sure that the options inside disabled selects aren't marked as disabled
     986        // (WebKit marks them as diabled)
     987        select.disabled = true;
     988        jQuery.support.optDisabled = !opt.disabled;
    880989
    881990        script.type = "text/javascript";
     
    8921001                jQuery.support.scriptEval = true;
    8931002                delete window[ id ];
     1003        }
     1004
     1005        // Test to see if it's possible to delete an expando from an element
     1006        // Fails in Internet Explorer
     1007        try {
     1008                delete script.test;
     1009
     1010        } catch(e) {
     1011                jQuery.support.deleteExpando = false;
    8941012        }
    8951013
     
    9231041                document.body.appendChild( div );
    9241042                jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
    925                 document.body.removeChild( div ).style.display = 'none';
    926                 div = null;
     1043
     1044                if ( "zoom" in div.style ) {
     1045                        // Check if natively block-level elements act like inline-block
     1046                        // elements when setting their display to 'inline' and giving
     1047                        // them layout
     1048                        // (IE < 8 does this)
     1049                        div.style.display = "inline";
     1050                        div.style.zoom = 1;
     1051                        jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
     1052
     1053                        // Check if elements with layout shrink-wrap their children
     1054                        // (IE 6 does this)
     1055                        div.style.display = "";
     1056                        div.innerHTML = "<div style='width:4px;'></div>";
     1057                        jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
     1058                }
     1059
     1060                div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";
     1061                var tds = div.getElementsByTagName("td");
     1062
     1063                // Check if table cells still have offsetWidth/Height when they are set
     1064                // to display:none and there are still other visible table cells in a
     1065                // table row; if so, offsetWidth/Height are not reliable for use when
     1066                // determining if an element has been hidden directly using
     1067                // display:none (it is still safe to use offsets if a parent element is
     1068                // hidden; don safety goggles and see bug #4512 for more information).
     1069                // (only IE 8 fails this test)
     1070                jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
     1071
     1072                tds[0].style.display = "";
     1073                tds[1].style.display = "none";
     1074
     1075                // Check if empty table cells still have offsetWidth/Height
     1076                // (IE < 8 fail this test)
     1077                jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
     1078                div.innerHTML = "";
     1079
     1080                document.body.removeChild( div ).style.display = "none";
     1081                div = tds = null;
    9271082        });
    9281083
    9291084        // Technique from Juriy Zaytsev
    9301085        // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
    931         var eventSupported = function( eventName ) { 
    932                 var el = document.createElement("div"); 
    933                 eventName = "on" + eventName; 
    934 
    935                 var isSupported = (eventName in el); 
    936                 if ( !isSupported ) { 
    937                         el.setAttribute(eventName, "return;"); 
    938                         isSupported = typeof el[eventName] === "function"; 
    939                 } 
    940                 el = null; 
    941 
    942                 return isSupported; 
     1086        var eventSupported = function( eventName ) {
     1087                var el = document.createElement("div");
     1088                eventName = "on" + eventName;
     1089
     1090                var isSupported = (eventName in el);
     1091                if ( !isSupported ) {
     1092                        el.setAttribute(eventName, "return;");
     1093                        isSupported = typeof el[eventName] === "function";
     1094                }
     1095                el = null;
     1096
     1097                return isSupported;
    9431098        };
    944        
     1099
    9451100        jQuery.support.submitBubbles = eventSupported("submit");
    9461101        jQuery.support.changeBubbles = eventSupported("change");
     
    9491104        root = script = div = all = a = null;
    9501105})();
     1106
     1107
     1108
     1109var windowData = {},
     1110        rbrace = /^(?:\{.*\}|\[.*\])$/;
     1111
     1112jQuery.extend({
     1113        cache: {},
     1114
     1115        // Please use with caution
     1116        uuid: 0,
     1117
     1118        // Unique for each copy of jQuery on the page   
     1119        expando: "jQuery" + jQuery.now(),
     1120
     1121        // The following elements throw uncatchable exceptions if you
     1122        // attempt to add expando properties to them.
     1123        noData: {
     1124                "embed": true,
     1125                // Ban all objects except for Flash (which handle expandos)
     1126                "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
     1127                "applet": true
     1128        },
     1129
     1130        data: function( elem, name, data ) {
     1131                if ( !jQuery.acceptData( elem ) ) {
     1132                        return;
     1133                }
     1134
     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 ) {
     1144                        return;
     1145                }
     1146
     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.
     1158                if ( typeof name === "object" ) {
     1159                        if ( isNode ) {
     1160                                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
     1173                if ( data !== undefined ) {
     1174                        thisCache[ name ] = data;
     1175                }
     1176
     1177                return typeof name === "string" ? thisCache[ name ] : thisCache;
     1178        },
     1179
     1180        removeData: function( elem, name ) {
     1181                if ( !jQuery.acceptData( elem ) ) {
     1182                        return;
     1183                }
     1184
     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
     1195                if ( name ) {
     1196                        if ( thisCache ) {
     1197                                // Remove the section of cache data
     1198                                delete thisCache[ name ];
     1199
     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
     1207                } else {
     1208                        if ( isNode && jQuery.support.deleteExpando ) {
     1209                                delete elem[ jQuery.expando ];
     1210
     1211                        } else if ( elem.removeAttribute ) {
     1212                                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
     1219                        } else {
     1220                                for ( var n in elem ) {
     1221                                        delete elem[ n ];
     1222                                }
     1223                        }
     1224                }
     1225        },
     1226
     1227        // A method for determining if a DOM node can handle the data expando
     1228        acceptData: function( elem ) {
     1229                if ( elem.nodeName ) {
     1230                        var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
     1231
     1232                        if ( match ) {
     1233                                return !(match === true || elem.getAttribute("classid") !== match);
     1234                        }
     1235                }
     1236
     1237                return true;
     1238        }
     1239});
     1240
     1241jQuery.fn.extend({
     1242        data: function( key, value ) {
     1243                var data = null;
     1244
     1245                if ( typeof key === "undefined" ) {
     1246                        if ( this.length ) {
     1247                                var attr = this[0].attributes, name;
     1248                                data = jQuery.data( this[0] );
     1249
     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 ] );
     1256                                        }
     1257                                }
     1258                        }
     1259
     1260                        return data;
     1261
     1262                } else if ( typeof key === "object" ) {
     1263                        return this.each(function() {
     1264                                jQuery.data( this, key );
     1265                        });
     1266                }
     1267
     1268                var parts = key.split(".");
     1269                parts[1] = parts[1] ? "." + parts[1] : "";
     1270
     1271                if ( value === undefined ) {
     1272                        data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
     1273
     1274                        // Try to fetch any internally stored data first
     1275                        if ( data === undefined && this.length ) {
     1276                                data = jQuery.data( this[0], key );
     1277                                data = dataAttr( this[0], key, data );
     1278                        }
     1279
     1280                        return data === undefined && parts[1] ?
     1281                                this.data( parts[0] ) :
     1282                                data;
     1283
     1284                } else {
     1285                        return this.each(function() {
     1286                                var $this = jQuery( this ),
     1287                                        args = [ parts[0], value ];
     1288
     1289                                $this.triggerHandler( "setData" + parts[1] + "!", args );
     1290                                jQuery.data( this, key, value );
     1291                                $this.triggerHandler( "changeData" + parts[1] + "!", args );
     1292                        });
     1293                }
     1294        },
     1295
     1296        removeData: function( key ) {
     1297                return this.each(function() {
     1298                        jQuery.removeData( this, key );
     1299                });
     1300        }
     1301});
     1302
     1303function dataAttr( elem, key, data ) {
     1304        // If nothing was found internally, try to fetch any
     1305        // data from the HTML5 data-* attribute
     1306        if ( data === undefined && elem.nodeType === 1 ) {
     1307                data = elem.getAttribute( "data-" + key );
     1308
     1309                if ( typeof data === "string" ) {
     1310                        try {
     1311                                data = data === "true" ? true :
     1312                                data === "false" ? false :
     1313                                data === "null" ? null :
     1314                                !jQuery.isNaN( data ) ? parseFloat( data ) :
     1315                                        rbrace.test( data ) ? jQuery.parseJSON( data ) :
     1316                                        data;
     1317                        } catch( e ) {}
     1318
     1319                        // Make sure we set the data so it isn't changed later
     1320                        jQuery.data( elem, key, data );
     1321
     1322                } else {
     1323                        data = undefined;
     1324                }
     1325        }
     1326
     1327        return data;
     1328}
     1329
     1330
     1331
     1332
     1333jQuery.extend({
     1334        queue: function( elem, type, data ) {
     1335                if ( !elem ) {
     1336                        return;
     1337                }
     1338
     1339                type = (type || "fx") + "queue";
     1340                var q = jQuery.data( elem, type );
     1341
     1342                // Speed up dequeue by getting out quickly if this is just a lookup
     1343                if ( !data ) {
     1344                        return q || [];
     1345                }
     1346
     1347                if ( !q || jQuery.isArray(data) ) {
     1348                        q = jQuery.data( elem, type, jQuery.makeArray(data) );
     1349
     1350                } else {
     1351                        q.push( data );
     1352                }
     1353
     1354                return q;
     1355        },
     1356
     1357        dequeue: function( elem, type ) {
     1358                type = type || "fx";
     1359
     1360                var queue = jQuery.queue( elem, type ),
     1361                        fn = queue.shift();
     1362
     1363                // If the fx queue is dequeued, always remove the progress sentinel
     1364                if ( fn === "inprogress" ) {
     1365                        fn = queue.shift();
     1366                }
     1367
     1368                if ( fn ) {
     1369                        // Add a progress sentinel to prevent the fx queue from being
     1370                        // automatically dequeued
     1371                        if ( type === "fx" ) {
     1372                                queue.unshift("inprogress");
     1373                        }
     1374
     1375                        fn.call(elem, function() {
     1376                                jQuery.dequeue(elem, type);
     1377                        });
     1378                }
     1379        }
     1380});
     1381
     1382jQuery.fn.extend({
     1383        queue: function( type, data ) {
     1384                if ( typeof type !== "string" ) {
     1385                        data = type;
     1386                        type = "fx";
     1387                }
     1388
     1389                if ( data === undefined ) {
     1390                        return jQuery.queue( this[0], type );
     1391                }
     1392                return this.each(function( i ) {
     1393                        var queue = jQuery.queue( this, type, data );
     1394
     1395                        if ( type === "fx" && queue[0] !== "inprogress" ) {
     1396                                jQuery.dequeue( this, type );
     1397                        }
     1398                });
     1399        },
     1400        dequeue: function( type ) {
     1401                return this.each(function() {
     1402                        jQuery.dequeue( this, type );
     1403                });
     1404        },
     1405
     1406        // Based off of the plugin by Clint Helfers, with permission.
     1407        // http://blindsignals.com/index.php/2009/07/jquery-delay/
     1408        delay: function( time, type ) {
     1409                time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
     1410                type = type || "fx";
     1411
     1412                return this.queue( type, function() {
     1413                        var elem = this;
     1414                        setTimeout(function() {
     1415                                jQuery.dequeue( elem, type );
     1416                        }, time );
     1417                });
     1418        },
     1419
     1420        clearQueue: function( type ) {
     1421                return this.queue( type || "fx", [] );
     1422        }
     1423});
     1424
     1425
     1426
     1427
     1428var rclass = /[\n\t]/g,
     1429        rspaces = /\s+/,
     1430        rreturn = /\r/g,
     1431        rspecialurl = /^(?:href|src|style)$/,
     1432        rtype = /^(?:button|input)$/i,
     1433        rfocusable = /^(?:button|input|object|select|textarea)$/i,
     1434        rclickable = /^a(?:rea)?$/i,
     1435        rradiocheck = /^(?:radio|checkbox)$/i;
    9511436
    9521437jQuery.props = {
     
    9621447        frameborder: "frameBorder"
    9631448};
    964 var expando = "jQuery" + now(), uuid = 0, windowData = {};
    965 var emptyObject = {};
    966 
    967 jQuery.extend({
    968         cache: {},
    969        
    970         expando:expando,
    971 
    972         // The following elements throw uncatchable exceptions if you
    973         // attempt to add expando properties to them.
    974         noData: {
    975                 "embed": true,
    976                 "object": true,
    977                 "applet": true
    978         },
    979 
    980         data: function( elem, name, data ) {
    981                 if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
    982                         return;
    983                 }
    984 
    985                 elem = elem == window ?
    986                         windowData :
    987                         elem;
    988 
    989                 var id = elem[ expando ], cache = jQuery.cache, thisCache;
    990 
    991                 // Handle the case where there's no name immediately
    992                 if ( !name && !id ) {
    993                         return null;
    994                 }
    995 
    996                 // Compute a unique ID for the element
    997                 if ( !id ) {
    998                         id = ++uuid;
    999                 }
    1000 
    1001                 // Avoid generating a new cache unless none exists and we
    1002                 // want to manipulate it.
    1003                 if ( typeof name === "object" ) {
    1004                         elem[ expando ] = id;
    1005                         thisCache = cache[ id ] = jQuery.extend(true, {}, name);
    1006                 } else if ( cache[ id ] ) {
    1007                         thisCache = cache[ id ];
    1008                 } else if ( typeof data === "undefined" ) {
    1009                         thisCache = emptyObject;
    1010                 } else {
    1011                         thisCache = cache[ id ] = {};
    1012                 }
    1013 
    1014                 // Prevent overriding the named cache with undefined values
    1015                 if ( data !== undefined ) {
    1016                         elem[ expando ] = id;
    1017                         thisCache[ name ] = data;
    1018                 }
    1019 
    1020                 return typeof name === "string" ? thisCache[ name ] : thisCache;
    1021         },
    1022 
    1023         removeData: function( elem, name ) {
    1024                 if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
    1025                         return;
    1026                 }
    1027 
    1028                 elem = elem == window ?
    1029                         windowData :
    1030                         elem;
    1031 
    1032                 var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
    1033 
    1034                 // If we want to remove a specific section of the element's data
    1035                 if ( name ) {
    1036                         if ( thisCache ) {
    1037                                 // Remove the section of cache data
    1038                                 delete thisCache[ name ];
    1039 
    1040                                 // If we've removed all the data, remove the element's cache
    1041                                 if ( jQuery.isEmptyObject(thisCache) ) {
    1042                                         jQuery.removeData( elem );
    1043                                 }
    1044                         }
    1045 
    1046                 // Otherwise, we want to remove all of the element's data
    1047                 } else {
    1048                         // Clean up the element expando
    1049                         try {
    1050                                 delete elem[ expando ];
    1051                         } catch( e ) {
    1052                                 // IE has trouble directly removing the expando
    1053                                 // but it's ok with using removeAttribute
    1054                                 if ( elem.removeAttribute ) {
    1055                                         elem.removeAttribute( expando );
    1056                                 }
    1057                         }
    1058 
    1059                         // Completely remove the data cache
    1060                         delete cache[ id ];
    1061                 }
    1062         }
    1063 });
    1064 
    1065 jQuery.fn.extend({
    1066         data: function( key, value ) {
    1067                 if ( typeof key === "undefined" && this.length ) {
    1068                         return jQuery.data( this[0] );
    1069 
    1070                 } else if ( typeof key === "object" ) {
    1071                         return this.each(function() {
    1072                                 jQuery.data( this, key );
    1073                         });
    1074                 }
    1075 
    1076                 var parts = key.split(".");
    1077                 parts[1] = parts[1] ? "." + parts[1] : "";
    1078 
    1079                 if ( value === undefined ) {
    1080                         var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
    1081 
    1082                         if ( data === undefined && this.length ) {
    1083                                 data = jQuery.data( this[0], key );
    1084                         }
    1085                         return data === undefined && parts[1] ?
    1086                                 this.data( parts[0] ) :
    1087                                 data;
    1088                 } else {
    1089                         return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
    1090                                 jQuery.data( this, key, value );
    1091                         });
    1092                 }
    1093         },
    1094 
    1095         removeData: function( key ) {
    1096                 return this.each(function() {
    1097                         jQuery.removeData( this, key );
    1098                 });
    1099         }
    1100 });
    1101 jQuery.extend({
    1102         queue: function( elem, type, data ) {
    1103                 if ( !elem ) {
    1104                         return;
    1105                 }
    1106 
    1107                 type = (type || "fx") + "queue";
    1108                 var q = jQuery.data( elem, type );
    1109 
    1110                 // Speed up dequeue by getting out quickly if this is just a lookup
    1111                 if ( !data ) {
    1112                         return q || [];
    1113                 }
    1114 
    1115                 if ( !q || jQuery.isArray(data) ) {
    1116                         q = jQuery.data( elem, type, jQuery.makeArray(data) );
    1117 
    1118                 } else {
    1119                         q.push( data );
    1120                 }
    1121 
    1122                 return q;
    1123         },
    1124 
    1125         dequeue: function( elem, type ) {
    1126                 type = type || "fx";
    1127 
    1128                 var queue = jQuery.queue( elem, type ), fn = queue.shift();
    1129 
    1130                 // If the fx queue is dequeued, always remove the progress sentinel
    1131                 if ( fn === "inprogress" ) {
    1132                         fn = queue.shift();
    1133                 }
    1134 
    1135                 if ( fn ) {
    1136                         // Add a progress sentinel to prevent the fx queue from being
    1137                         // automatically dequeued
    1138                         if ( type === "fx" ) {
    1139                                 queue.unshift("inprogress");
    1140                         }
    1141 
    1142                         fn.call(elem, function() {
    1143                                 jQuery.dequeue(elem, type);
    1144                         });
    1145                 }
    1146         }
    1147 });
    1148 
    1149 jQuery.fn.extend({
    1150         queue: function( type, data ) {
    1151                 if ( typeof type !== "string" ) {
    1152                         data = type;
    1153                         type = "fx";
    1154                 }
    1155 
    1156                 if ( data === undefined ) {
    1157                         return jQuery.queue( this[0], type );
    1158                 }
    1159                 return this.each(function( i, elem ) {
    1160                         var queue = jQuery.queue( this, type, data );
    1161 
    1162                         if ( type === "fx" && queue[0] !== "inprogress" ) {
    1163                                 jQuery.dequeue( this, type );
    1164                         }
    1165                 });
    1166         },
    1167         dequeue: function( type ) {
    1168                 return this.each(function() {
    1169                         jQuery.dequeue( this, type );
    1170                 });
    1171         },
    1172 
    1173         // Based off of the plugin by Clint Helfers, with permission.
    1174         // http://blindsignals.com/index.php/2009/07/jquery-delay/
    1175         delay: function( time, type ) {
    1176                 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
    1177                 type = type || "fx";
    1178 
    1179                 return this.queue( type, function() {
    1180                         var elem = this;
    1181                         setTimeout(function() {
    1182                                 jQuery.dequeue( elem, type );
    1183                         }, time );
    1184                 });
    1185         },
    1186 
    1187         clearQueue: function( type ) {
    1188                 return this.queue( type || "fx", [] );
    1189         }
    1190 });
    1191 var rclass = /[\n\t]/g,
    1192         rspace = /\s+/,
    1193         rreturn = /\r/g,
    1194         rspecialurl = /href|src|style/,
    1195         rtype = /(button|input)/i,
    1196         rfocusable = /(button|input|object|select|textarea)/i,
    1197         rclickable = /^(a|area)$/i,
    1198         rradiocheck = /radio|checkbox/;
    11991449
    12001450jQuery.fn.extend({
    12011451        attr: function( name, value ) {
    1202                 return access( this, name, value, true, jQuery.attr );
     1452                return jQuery.access( this, name, value, true, jQuery.attr );
    12031453        },
    12041454
     
    12211471
    12221472                if ( value && typeof value === "string" ) {
    1223                         var classNames = (value || "").split( rspace );
     1473                        var classNames = (value || "").split( rspaces );
    12241474
    12251475                        for ( var i = 0, l = this.length; i < l; i++ ) {
     
    12311481
    12321482                                        } else {
    1233                                                 var className = " " + elem.className + " ";
     1483                                                var className = " " + elem.className + " ",
     1484                                                        setClass = elem.className;
     1485
    12341486                                                for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
    12351487                                                        if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
    1236                                                                 elem.className += " " + classNames[c];
     1488                                                                setClass += " " + classNames[c];
    12371489                                                        }
    12381490                                                }
     1491                                                elem.className = jQuery.trim( setClass );
    12391492                                        }
    12401493                                }
     
    12541507
    12551508                if ( (value && typeof value === "string") || value === undefined ) {
    1256                         var classNames = (value || "").split(rspace);
     1509                        var classNames = (value || "").split( rspaces );
    12571510
    12581511                        for ( var i = 0, l = this.length; i < l; i++ ) {
     
    12651518                                                        className = className.replace(" " + classNames[c] + " ", " ");
    12661519                                                }
    1267                                                 elem.className = className.substring(1, className.length - 1);
     1520                                                elem.className = jQuery.trim( className );
    12681521
    12691522                                        } else {
     
    12781531
    12791532        toggleClass: function( value, stateVal ) {
    1280                 var type = typeof value, isBool = typeof stateVal === "boolean";
     1533                var type = typeof value,
     1534                        isBool = typeof stateVal === "boolean";
    12811535
    12821536                if ( jQuery.isFunction( value ) ) {
     
    12901544                        if ( type === "string" ) {
    12911545                                // toggle individual class names
    1292                                 var className, i = 0, self = jQuery(this),
     1546                                var className,
     1547                                        i = 0,
     1548                                        self = jQuery( this ),
    12931549                                        state = stateVal,
    1294                                         classNames = value.split( rspace );
     1550                                        classNames = value.split( rspaces );
    12951551
    12961552                                while ( (className = classNames[ i++ ]) ) {
     
    13241580
    13251581        val: function( value ) {
    1326                 if ( value === undefined ) {
     1582                if ( !arguments.length ) {
    13271583                        var elem = this[0];
    13281584
    13291585                        if ( elem ) {
    13301586                                if ( jQuery.nodeName( elem, "option" ) ) {
    1331                                         return (elem.attributes.value || {}).specified ? elem.value : elem.text;
     1587                                        // attributes.value is undefined in Blackberry 4.7 but
     1588                                        // uses .value. See #6932
     1589                                        var val = elem.attributes.value;
     1590                                        return !val || val.specified ? elem.value : elem.text;
    13321591                                }
    13331592
     
    13481607                                                var option = options[ i ];
    13491608
    1350                                                 if ( option.selected ) {
    1351                                                         // Get the specifc value for the option
     1609                                                // 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) &&
     1611                                                                (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
     1612
     1613                                                        // Get the specific value for the option
    13521614                                                        value = jQuery(option).val();
    13531615
     
    13921654                        }
    13931655
    1394                         // Typecast each time if the value is a Function and the appended
    1395                         // value is therefore different each time.
    1396                         if ( typeof val === "number" ) {
     1656                        // Treat null/undefined as ""; convert numbers to string
     1657                        if ( val == null ) {
     1658                                val = "";
     1659                        } else if ( typeof val === "number" ) {
    13971660                                val += "";
     1661                        } else if ( jQuery.isArray(val) ) {
     1662                                val = jQuery.map(val, function (value) {
     1663                                        return value == null ? "" : value + "";
     1664                                });
    13981665                        }
    13991666
     
    14481715                name = notxml && jQuery.props[ name ] || name;
    14491716
    1450                 // Only do all the following if this is a node (faster for style)
    1451                 if ( elem.nodeType === 1 ) {
    1452                         // These attributes require special treatment
    1453                         var special = rspecialurl.test( name );
    1454 
    1455                         // Safari mis-reports the default selected property of an option
    1456                         // Accessing the parent's selectedIndex property fixes it
    1457                         if ( name === "selected" && !jQuery.support.optSelected ) {
    1458                                 var parent = elem.parentNode;
    1459                                 if ( parent ) {
    1460                                         parent.selectedIndex;
    1461        
    1462                                         // Make sure that it also works with optgroups, see #5701
    1463                                         if ( parent.parentNode ) {
    1464                                                 parent.parentNode.selectedIndex;
     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 ) {
     1737                        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 );
    14651746                                        }
    1466                                 }
    1467                         }
    1468 
    1469                         // If applicable, access the attribute via the DOM 0 way
    1470                         if ( name in elem && notxml && !special ) {
    1471                                 if ( set ) {
    1472                                         // We can't allow the type property to be changed (since it causes problems in IE)
    1473                                         if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
    1474                                                 jQuery.error( "type property can't be changed" );
    1475                                         }
    1476 
     1747
     1748                                } else {
    14771749                                        elem[ name ] = value;
    14781750                                }
    1479 
    1480                                 // browsers index elements by id/name on forms, give priority to attributes.
    1481                                 if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
    1482                                         return elem.getAttributeNode( name ).nodeValue;
    1483                                 }
    1484 
    1485                                 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
    1486                                 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
    1487                                 if ( name === "tabIndex" ) {
    1488                                         var attributeNode = elem.getAttributeNode( "tabIndex" );
    1489 
    1490                                         return attributeNode && attributeNode.specified ?
    1491                                                 attributeNode.value :
    1492                                                 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
    1493                                                         0 :
    1494                                                         undefined;
    1495                                 }
    1496 
    1497                                 return elem[ name ];
    1498                         }
    1499 
    1500                         if ( !jQuery.support.style && notxml && name === "style" ) {
    1501                                 if ( set ) {
    1502                                         elem.style.cssText = "" + value;
    1503                                 }
    1504 
    1505                                 return elem.style.cssText;
    1506                         }
    1507 
     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" ) {
    15081774                        if ( set ) {
    1509                                 // convert the value to a string (all browsers do this but IE) see #1070
    1510                                 elem.setAttribute( name, "" + value );
    1511                         }
    1512 
    1513                         var attr = !jQuery.support.hrefNormalized && notxml && special ?
    1514                                         // Some attributes require a special call on IE
    1515                                         elem.getAttribute( name, 2 ) :
    1516                                         elem.getAttribute( name );
    1517 
    1518                         // Non-existent attributes return null, we normalize to undefined
    1519                         return attr === null ? undefined : attr;
    1520                 }
    1521 
    1522                 // elem is actually elem.style ... set the style
    1523                 // Using attr for specific style information is now deprecated. Use style insead.
    1524                 return jQuery.style( elem, name, value );
     1775                                elem.style.cssText = "" + value;
     1776                        }
     1777
     1778                        return elem.style.cssText;
     1779                }
     1780
     1781                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;
    15251799        }
    15261800});
    1527 var fcleanup = function( nm ) {
    1528         return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
    1529                 return "\\" + ch;
    1530         });
    1531 };
     1801
     1802
     1803
     1804
     1805var rnamespaces = /\.(.*)$/,
     1806        rformElems = /^(?:textarea|input|select)$/i,
     1807        rperiod = /\./g,
     1808        rspace = / /g,
     1809        rescape = /[^\w\s.|`]/g,
     1810        fcleanup = function( nm ) {
     1811                return nm.replace(rescape, "\\$&");
     1812        },
     1813        focusCounts = { focusin: 0, focusout: 0 };
    15321814
    15331815/*
     
    15471829                // For whatever reason, IE has trouble passing the window object
    15481830                // around, causing it to be cloned in the process
    1549                 if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
     1831                if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {
    15501832                        elem = window;
     1833                }
     1834
     1835                if ( handler === false ) {
     1836                        handler = returnFalse;
     1837                } else if ( !handler ) {
     1838                        // Fixes bug #7229. Fix recommended by jdalton
     1839                  return;
     1840                }
     1841
     1842                var handleObjIn, handleObj;
     1843
     1844                if ( handler.handler ) {
     1845                        handleObjIn = handler;
     1846                        handler = handleObjIn.handler;
    15511847                }
    15521848
     
    15561852                }
    15571853
    1558                 // if data is passed, bind to handler
    1559                 if ( data !== undefined ) {
    1560                         // Create temporary function pointer to original handler
    1561                         var fn = handler;
    1562 
    1563                         // Create unique handler function, wrapped around original handler
    1564                         handler = jQuery.proxy( fn );
    1565 
    1566                         // Store data in unique handler
    1567                         handler.data = data;
    1568                 }
    1569 
    15701854                // Init the element's event structure
    1571                 var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ),
    1572                         handle = jQuery.data( elem, "handle" ), eventHandle;
    1573 
    1574                 if ( !handle ) {
    1575                         eventHandle = function() {
     1855                var elemData = jQuery.data( elem );
     1856
     1857                // If no elemData is found then we must be trying to bind to one of the
     1858                // banned noData elements
     1859                if ( !elemData ) {
     1860                        return;
     1861                }
     1862
     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 ],
     1867                        eventHandle = elemData.handle;
     1868                       
     1869                if ( typeof events === "function" ) {
     1870                        // On plain objects events is a fn that holds the the data
     1871                        // which prevents this data from being JSON serialized
     1872                        // the function does not need to be called, it just contains the data
     1873                        eventHandle = events.handle;
     1874                        events = events.events;
     1875
     1876                } else if ( !events ) {
     1877                        if ( !elem.nodeType ) {
     1878                                // On plain objects, create a fn that acts as the holder
     1879                                // of the values to avoid JSON serialization of event data
     1880                                elemData[ eventKey ] = elemData = function(){};
     1881                        }
     1882
     1883                        elemData.events = events = {};
     1884                }
     1885
     1886                if ( !eventHandle ) {
     1887                        elemData.handle = eventHandle = function() {
    15761888                                // Handle the second event of a trigger and when
    15771889                                // an event is called after a page has unloaded
     
    15801892                                        undefined;
    15811893                        };
    1582 
    1583                         handle = jQuery.data( elem, "handle", eventHandle );
    1584                 }
    1585 
    1586                 // If no handle is found then we must be trying to bind to one of the
    1587                 // banned noData elements
    1588                 if ( !handle ) {
    1589                         return;
    15901894                }
    15911895
    15921896                // Add elem as a property of the handle function
    1593                 // This is to prevent a memory leak with non-native
    1594                 // event in IE.
    1595                 handle.elem = elem;
     1897                // This is to prevent a memory leak with non-native events in IE.
     1898                eventHandle.elem = elem;
    15961899
    15971900                // Handle multiple events separated by a space
    15981901                // jQuery(...).bind("mouseover mouseout", fn);
    1599                 types = types.split( /\s+/ );
    1600 
    1601                 var type, i = 0;
     1902                types = types.split(" ");
     1903
     1904                var type, i = 0, namespaces;
    16021905
    16031906                while ( (type = types[ i++ ]) ) {
     1907                        handleObj = handleObjIn ?
     1908                                jQuery.extend({}, handleObjIn) :
     1909                                { handler: handler, data: data };
     1910
    16041911                        // Namespaced event handlers
    1605                         var namespaces = type.split(".");
    1606                         type = namespaces.shift();
    1607 
    1608                         if ( i > 1 ) {
    1609                                 handler = jQuery.proxy( handler );
    1610 
    1611                                 if ( data !== undefined ) {
    1612                                         handler.data = data;
    1613                                 }
    1614                         }
    1615 
    1616                         handler.type = namespaces.slice(0).sort().join(".");
     1912                        if ( type.indexOf(".") > -1 ) {
     1913                                namespaces = type.split(".");
     1914                                type = namespaces.shift();
     1915                                handleObj.namespace = namespaces.slice(0).sort().join(".");
     1916
     1917                        } else {
     1918                                namespaces = [];
     1919                                handleObj.namespace = "";
     1920                        }
     1921
     1922                        handleObj.type = type;
     1923                        if ( !handleObj.guid ) {
     1924                                handleObj.guid = handler.guid;
     1925                        }
    16171926
    16181927                        // Get the current list of functions bound to this event
    16191928                        var handlers = events[ type ],
    1620                                 special = this.special[ type ] || {};
     1929                                special = jQuery.event.special[ type ] || {};
    16211930
    16221931                        // Init the event handler queue
    16231932                        if ( !handlers ) {
    1624                                 handlers = events[ type ] = {};
     1933                                handlers = events[ type ] = [];
    16251934
    16261935                                // Check for a special event handler
    16271936                                // Only use addEventListener/attachEvent if the special
    16281937                                // events handler returns false
    1629                                 if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) {
     1938                                if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
    16301939                                        // Bind the global event handler to the element
    16311940                                        if ( elem.addEventListener ) {
    1632                                                 elem.addEventListener( type, handle, false );
     1941                                                elem.addEventListener( type, eventHandle, false );
     1942
    16331943                                        } else if ( elem.attachEvent ) {
    1634                                                 elem.attachEvent( "on" + type, handle );
     1944                                                elem.attachEvent( "on" + type, eventHandle );
    16351945                                        }
    16361946                                }
     
    16381948                       
    16391949                        if ( special.add ) {
    1640                                 var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers );
    1641                                 if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) {
    1642                                         modifiedHandler.guid = modifiedHandler.guid || handler.guid;
    1643                                         modifiedHandler.data = modifiedHandler.data || handler.data;
    1644                                         modifiedHandler.type = modifiedHandler.type || handler.type;
    1645                                         handler = modifiedHandler;
    1646                                 }
    1647                         }
    1648                        
     1950                                special.add.call( elem, handleObj );
     1951
     1952                                if ( !handleObj.handler.guid ) {
     1953                                        handleObj.handler.guid = handler.guid;
     1954                                }
     1955                        }
     1956
    16491957                        // Add the function to the element's handler list
    1650                         handlers[ handler.guid ] = handler;
     1958                        handlers.push( handleObj );
    16511959
    16521960                        // Keep track of which events have been used, for global triggering
    1653                         this.global[ type ] = true;
     1961                        jQuery.event.global[ type ] = true;
    16541962                }
    16551963
     
    16611969
    16621970        // Detach an event or set of events from an element
    1663         remove: function( elem, types, handler ) {
     1971        remove: function( elem, types, handler, pos ) {
    16641972                // don't do events on text and comment nodes
    16651973                if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
     
    16671975                }
    16681976
    1669                 var events = jQuery.data( elem, "events" ), ret, type, fn;
    1670 
    1671                 if ( events ) {
    1672                         // Unbind all events for the element
    1673                         if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) {
    1674                                 for ( type in events ) {
    1675                                         this.remove( elem, type + (types || "") );
    1676                                 }
    1677                         } else {
    1678                                 // types is actually an event object here
    1679                                 if ( types.type ) {
    1680                                         handler = types.handler;
    1681                                         types = types.type;
    1682                                 }
    1683 
    1684                                 // Handle multiple events separated by a space
    1685                                 // jQuery(...).unbind("mouseover mouseout", fn);
    1686                                 types = types.split(/\s+/);
    1687                                 var i = 0;
    1688                                 while ( (type = types[ i++ ]) ) {
    1689                                         // Namespaced event handlers
    1690                                         var namespaces = type.split(".");
    1691                                         type = namespaces.shift();
    1692                                         var all = !namespaces.length,
    1693                                                 cleaned = jQuery.map( namespaces.slice(0).sort(), fcleanup ),
    1694                                                 namespace = new RegExp("(^|\\.)" + cleaned.join("\\.(?:.*\\.)?") + "(\\.|$)"),
    1695                                                 special = this.special[ type ] || {};
    1696 
    1697                                         if ( events[ type ] ) {
    1698                                                 // remove the given handler for the given type
    1699                                                 if ( handler ) {
    1700                                                         fn = events[ type ][ handler.guid ];
    1701                                                         delete events[ type ][ handler.guid ];
    1702 
    1703                                                 // remove all handlers for the given type
    1704                                                 } else {
    1705                                                         for ( var handle in events[ type ] ) {
    1706                                                                 // Handle the removal of namespaced events
    1707                                                                 if ( all || namespace.test( events[ type ][ handle ].type ) ) {
    1708                                                                         delete events[ type ][ handle ];
    1709                                                                 }
    1710                                                         }
     1977                if ( handler === false ) {
     1978                        handler = returnFalse;
     1979                }
     1980
     1981                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 ),
     1984                        events = elemData && elemData[ eventKey ];
     1985
     1986                if ( !elemData || !events ) {
     1987                        return;
     1988                }
     1989               
     1990                if ( typeof events === "function" ) {
     1991                        elemData = events;
     1992                        events = events.events;
     1993                }
     1994
     1995                // types is actually an event object here
     1996                if ( types && types.type ) {
     1997                        handler = types.handler;
     1998                        types = types.type;
     1999                }
     2000
     2001                // Unbind all events for the element
     2002                if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
     2003                        types = types || "";
     2004
     2005                        for ( type in events ) {
     2006                                jQuery.event.remove( elem, type + types );
     2007                        }
     2008
     2009                        return;
     2010                }
     2011
     2012                // Handle multiple events separated by a space
     2013                // jQuery(...).unbind("mouseover mouseout", fn);
     2014                types = types.split(" ");
     2015
     2016                while ( (type = types[ i++ ]) ) {
     2017                        origType = type;
     2018                        handleObj = null;
     2019                        all = type.indexOf(".") < 0;
     2020                        namespaces = [];
     2021
     2022                        if ( !all ) {
     2023                                // Namespaced event handlers
     2024                                namespaces = type.split(".");
     2025                                type = namespaces.shift();
     2026
     2027                                namespace = new RegExp("(^|\\.)" +
     2028                                        jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
     2029                        }
     2030
     2031                        eventType = events[ type ];
     2032
     2033                        if ( !eventType ) {
     2034                                continue;
     2035                        }
     2036
     2037                        if ( !handler ) {
     2038                                for ( j = 0; j < eventType.length; j++ ) {
     2039                                        handleObj = eventType[ j ];
     2040
     2041                                        if ( all || namespace.test( handleObj.namespace ) ) {
     2042                                                jQuery.event.remove( elem, origType, handleObj.handler, j );
     2043                                                eventType.splice( j--, 1 );
     2044                                        }
     2045                                }
     2046
     2047                                continue;
     2048                        }
     2049
     2050                        special = jQuery.event.special[ type ] || {};
     2051
     2052                        for ( j = pos || 0; j < eventType.length; j++ ) {
     2053                                handleObj = eventType[ j ];
     2054
     2055                                if ( handler.guid === handleObj.guid ) {
     2056                                        // remove the given handler for the given type
     2057                                        if ( all || namespace.test( handleObj.namespace ) ) {
     2058                                                if ( pos == null ) {
     2059                                                        eventType.splice( j--, 1 );
    17112060                                                }
    17122061
    17132062                                                if ( special.remove ) {
    1714                                                         special.remove.call( elem, namespaces, fn);
    1715                                                 }
    1716 
    1717                                                 // remove generic event handler if no more handlers exist
    1718                                                 for ( ret in events[ type ] ) {
    1719                                                         break;
    1720                                                 }
    1721                                                 if ( !ret ) {
    1722                                                         if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
    1723                                                                 if ( elem.removeEventListener ) {
    1724                                                                         elem.removeEventListener( type, jQuery.data( elem, "handle" ), false );
    1725                                                                 } else if ( elem.detachEvent ) {
    1726                                                                         elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) );
    1727                                                                 }
    1728                                                         }
    1729                                                         ret = null;
    1730                                                         delete events[ type ];
     2063                                                        special.remove.call( elem, handleObj );
    17312064                                                }
    17322065                                        }
    1733                                 }
    1734                         }
    1735 
    1736                         // Remove the expando if it's no longer used
    1737                         for ( ret in events ) {
    1738                                 break;
    1739                         }
    1740                         if ( !ret ) {
    1741                                 var handle = jQuery.data( elem, "handle" );
    1742                                 if ( handle ) {
    1743                                         handle.elem = null;
    1744                                 }
    1745                                 jQuery.removeData( elem, "events" );
    1746                                 jQuery.removeData( elem, "handle" );
     2066
     2067                                        if ( pos != null ) {
     2068                                                break;
     2069                                        }
     2070                                }
     2071                        }
     2072
     2073                        // remove generic event handler if no more handlers exist
     2074                        if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
     2075                                if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
     2076                                        jQuery.removeEvent( elem, type, elemData.handle );
     2077                                }
     2078
     2079                                ret = null;
     2080                                delete events[ type ];
     2081                        }
     2082                }
     2083
     2084                // Remove the expando if it's no longer used
     2085                if ( jQuery.isEmptyObject( events ) ) {
     2086                        var handle = elemData.handle;
     2087                        if ( handle ) {
     2088                                handle.elem = null;
     2089                        }
     2090
     2091                        delete elemData.events;
     2092                        delete elemData.handle;
     2093
     2094                        if ( typeof elemData === "function" ) {
     2095                                jQuery.removeData( elem, eventKey );
     2096
     2097                        } else if ( jQuery.isEmptyObject( elemData ) ) {
     2098                                jQuery.removeData( elem );
    17472099                        }
    17482100                }
     
    17582110                        event = typeof event === "object" ?
    17592111                                // jQuery.Event object
    1760                                 event[expando] ? event :
     2112                                event[ jQuery.expando ] ? event :
    17612113                                // Object literal
    17622114                                jQuery.extend( jQuery.Event(type), event ) :
     
    17752127
    17762128                                // Only trigger if we've ever bound an event for it
    1777                                 if ( this.global[ type ] ) {
     2129                                if ( jQuery.event.global[ type ] ) {
    17782130                                        jQuery.each( jQuery.cache, function() {
    17792131                                                if ( this.events && this.events[type] ) {
     
    18032155
    18042156                // Trigger the event, it is assumed that "handle" is a function
    1805                 var handle = jQuery.data( elem, "handle" );
     2157                var handle = elem.nodeType ?
     2158                        jQuery.data( elem, "handle" ) :
     2159                        (jQuery.data( elem, "__events__" ) || {}).handle;
     2160
    18062161                if ( handle ) {
    18072162                        handle.apply( elem, data );
     
    18152170                                if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
    18162171                                        event.result = false;
     2172                                        event.preventDefault();
    18172173                                }
    18182174                        }
    18192175
    18202176                // prevent IE from throwing an error for some elements with some event types, see #3533
    1821                 } catch (e) {}
     2177                } catch (inlineError) {}
    18222178
    18232179                if ( !event.isPropagationStopped() && parent ) {
     
    18252181
    18262182                } else if ( !event.isDefaultPrevented() ) {
    1827                         var target = event.target, old,
    1828                                 isClick = jQuery.nodeName(target, "a") && type === "click";
    1829 
    1830                         if ( !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
     2183                        var old,
     2184                                target = event.target,
     2185                                targetType = type.replace( rnamespaces, "" ),
     2186                                isClick = jQuery.nodeName( target, "a" ) && targetType === "click",
     2187                                special = jQuery.event.special[ targetType ] || {};
     2188
     2189                        if ( (!special._default || special._default.call( elem, event ) === false) &&
     2190                                !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
     2191
    18312192                                try {
    1832                                         if ( target[ type ] ) {
     2193                                        if ( target[ targetType ] ) {
    18332194                                                // Make sure that we don't accidentally re-trigger the onFOO events
    1834                                                 old = target[ "on" + type ];
     2195                                                old = target[ "on" + targetType ];
    18352196
    18362197                                                if ( old ) {
    1837                                                         target[ "on" + type ] = null;
     2198                                                        target[ "on" + targetType ] = null;
    18382199                                                }
    18392200
    1840                                                 this.triggered = true;
    1841                                                 target[ type ]();
     2201                                                jQuery.event.triggered = true;
     2202                                                target[ targetType ]();
    18422203                                        }
    18432204
    18442205                                // prevent IE from throwing an error for some elements with some event types, see #3533
    1845                                 } catch (e) {}
     2206                                } catch (triggerError) {}
    18462207
    18472208                                if ( old ) {
    1848                                         target[ "on" + type ] = old;
    1849                                 }
    1850 
    1851                                 this.triggered = false;
     2209                                        target[ "on" + targetType ] = old;
     2210                                }
     2211
     2212                                jQuery.event.triggered = false;
    18522213                        }
    18532214                }
     
    18552216
    18562217        handle: function( event ) {
    1857                 // returned undefined or false
    1858                 var all, handlers;
    1859 
    1860                 event = arguments[0] = jQuery.event.fix( event || window.event );
     2218                var all, handlers, namespaces, namespace_re, events,
     2219                        namespace_sort = [],
     2220                        args = jQuery.makeArray( arguments );
     2221
     2222                event = args[0] = jQuery.event.fix( event || window.event );
    18612223                event.currentTarget = this;
    18622224
    18632225                // Namespaced event handlers
    1864                 var namespaces = event.type.split(".");
    1865                 event.type = namespaces.shift();
    1866 
    1867                 // Cache this now, all = true means, any handler
    1868                 all = !namespaces.length && !event.exclusive;
    1869 
    1870                 var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
    1871 
    1872                 handlers = ( jQuery.data(this, "events") || {} )[ event.type ];
    1873 
    1874                 for ( var j in handlers ) {
    1875                         var handler = handlers[ j ];
    1876 
    1877                         // Filter the functions by class
    1878                         if ( all || namespace.test(handler.type) ) {
    1879                                 // Pass in a reference to the handler function itself
    1880                                 // So that we can later remove it
    1881                                 event.handler = handler;
    1882                                 event.data = handler.data;
    1883 
    1884                                 var ret = handler.apply( this, arguments );
    1885 
    1886                                 if ( ret !== undefined ) {
    1887                                         event.result = ret;
    1888                                         if ( ret === false ) {
    1889                                                 event.preventDefault();
    1890                                                 event.stopPropagation();
     2226                all = event.type.indexOf(".") < 0 && !event.exclusive;
     2227
     2228                if ( !all ) {
     2229                        namespaces = event.type.split(".");
     2230                        event.type = namespaces.shift();
     2231                        namespace_sort = namespaces.slice(0).sort();
     2232                        namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");
     2233                }
     2234
     2235                event.namespace = event.namespace || namespace_sort.join(".");
     2236
     2237                events = jQuery.data(this, this.nodeType ? "events" : "__events__");
     2238
     2239                if ( typeof events === "function" ) {
     2240                        events = events.events;
     2241                }
     2242
     2243                handlers = (events || {})[ event.type ];
     2244
     2245                if ( events && handlers ) {
     2246                        // Clone the handlers to prevent manipulation
     2247                        handlers = handlers.slice(0);
     2248
     2249                        for ( var j = 0, l = handlers.length; j < l; j++ ) {
     2250                                var handleObj = handlers[ j ];
     2251
     2252                                // Filter the functions by class
     2253                                if ( all || namespace_re.test( handleObj.namespace ) ) {
     2254                                        // Pass in a reference to the handler function itself
     2255                                        // So that we can later remove it
     2256                                        event.handler = handleObj.handler;
     2257                                        event.data = handleObj.data;
     2258                                        event.handleObj = handleObj;
     2259       
     2260                                        var ret = handleObj.handler.apply( this, args );
     2261
     2262                                        if ( ret !== undefined ) {
     2263                                                event.result = ret;
     2264                                                if ( ret === false ) {
     2265                                                        event.preventDefault();
     2266                                                        event.stopPropagation();
     2267                                                }
    18912268                                        }
    1892                                 }
    1893 
    1894                                 if ( event.isImmediatePropagationStopped() ) {
    1895                                         break;
    1896                                 }
    1897 
     2269
     2270                                        if ( event.isImmediatePropagationStopped() ) {
     2271                                                break;
     2272                                        }
     2273                                }
    18982274                        }
    18992275                }
     
    19022278        },
    19032279
    1904         props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
     2280        props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
    19052281
    19062282        fix: function( event ) {
    1907                 if ( event[ expando ] ) {
     2283                if ( event[ jQuery.expando ] ) {
    19082284                        return event;
    19092285                }
     
    19212297                // Fix target property, if necessary
    19222298                if ( !event.target ) {
    1923                         event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
     2299                        // Fixes #1925 where srcElement might not be defined either
     2300                        event.target = event.srcElement || document;
    19242301                }
    19252302
     
    19362313                // Calculate pageX/Y if missing and clientX/Y available
    19372314                if ( event.pageX == null && event.clientX != null ) {
    1938                         var doc = document.documentElement, body = document.body;
     2315                        var doc = document.documentElement,
     2316                                body = document.body;
     2317
    19392318                        event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
    19402319                        event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
     
    19422321
    19432322                // Add which for key events
    1944                 if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
    1945                         event.which = event.charCode || event.keyCode;
     2323                if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
     2324                        event.which = event.charCode != null ? event.charCode : event.keyCode;
    19462325                }
    19472326
     
    19742353
    19752354                live: {
    1976                         add: function( proxy, data, namespaces, live ) {
    1977                                 jQuery.extend( proxy, data || {} );
    1978 
    1979                                 proxy.guid += data.selector + data.live;
    1980                                 data.liveProxy = proxy;
    1981 
    1982                                 jQuery.event.add( this, data.live, liveHandler, data );
    1983                                
     2355                        add: function( handleObj ) {
     2356                                jQuery.event.add( this,
     2357                                        liveConvert( handleObj.origType, handleObj.selector ),
     2358                                        jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
    19842359                        },
    19852360
    1986                         remove: function( namespaces ) {
    1987                                 if ( namespaces.length ) {
    1988                                         var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
    1989 
    1990                                         jQuery.each( (jQuery.data(this, "events").live || {}), function() {
    1991                                                 if ( name.test(this.type) ) {
    1992                                                         remove++;
    1993                                                 }
    1994                                         });
    1995 
    1996                                         if ( remove < 1 ) {
    1997                                                 jQuery.event.remove( this, namespaces[0], liveHandler );
    1998                                         }
     2361                        remove: function( handleObj ) {
     2362                                jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
     2363                        }
     2364                },
     2365
     2366                beforeunload: {
     2367                        setup: function( data, namespaces, eventHandle ) {
     2368                                // We only want to do this special case on windows
     2369                                if ( jQuery.isWindow( this ) ) {
     2370                                        this.onbeforeunload = eventHandle;
    19992371                                }
    20002372                        },
    2001                         special: {}
    2002                 },
    2003                 beforeunload: {
    2004                         setup: function( data, namespaces, fn ) {
    2005                                 // We only want to do this special case on windows
    2006                                 if ( this.setInterval ) {
    2007                                         this.onbeforeunload = fn;
    2008                                 }
    2009 
    2010                                 return false;
    2011                         },
    2012                         teardown: function( namespaces, fn ) {
    2013                                 if ( this.onbeforeunload === fn ) {
     2373
     2374                        teardown: function( namespaces, eventHandle ) {
     2375                                if ( this.onbeforeunload === eventHandle ) {
    20142376                                        this.onbeforeunload = null;
    20152377                                }
     
    20182380        }
    20192381};
     2382
     2383jQuery.removeEvent = document.removeEventListener ?
     2384        function( elem, type, handle ) {
     2385                if ( elem.removeEventListener ) {
     2386                        elem.removeEventListener( type, handle, false );
     2387                }
     2388        } :
     2389        function( elem, type, handle ) {
     2390                if ( elem.detachEvent ) {
     2391                        elem.detachEvent( "on" + type, handle );
     2392                }
     2393        };
    20202394
    20212395jQuery.Event = function( src ) {
     
    20362410        // timeStamp is buggy for some events on Firefox(#3843)
    20372411        // So we won't rely on the native value
    2038         this.timeStamp = now();
     2412        this.timeStamp = jQuery.now();
    20392413
    20402414        // Mark it as fixed
    2041         this[ expando ] = true;
     2415        this[ jQuery.expando ] = true;
    20422416};
    20432417
     
    20632437                if ( e.preventDefault ) {
    20642438                        e.preventDefault();
    2065                 }
     2439
    20662440                // otherwise set the returnValue property of the original event to false (IE)
    2067                 e.returnValue = false;
     2441                } else {
     2442                        e.returnValue = false;
     2443                }
    20682444        },
    20692445        stopPropagation: function() {
     
    20962472        var parent = event.relatedTarget;
    20972473
    2098         // Traverse up the tree
    2099         while ( parent && parent !== this ) {
    2100                 // Firefox sometimes assigns relatedTarget a XUL element
    2101                 // which we cannot access the parentNode property of
    2102                 try {
     2474        // Firefox sometimes assigns relatedTarget a XUL element
     2475        // which we cannot access the parentNode property of
     2476        try {
     2477                // Traverse up the tree
     2478                while ( parent && parent !== this ) {
    21032479                        parent = parent.parentNode;
    2104 
    2105                 // assuming we've left the element since we most likely mousedover a xul element
    2106                 } catch(e) {
    2107                         break;
    2108                 }
    2109         }
    2110 
    2111         if ( parent !== this ) {
    2112                 // set the correct event type
    2113                 event.type = event.data;
    2114 
    2115                 // handle event if we actually just moused on to a non sub-element
    2116                 jQuery.event.handle.apply( this, arguments );
    2117         }
    2118 
     2480                }
     2481
     2482                if ( parent !== this ) {
     2483                        // set the correct event type
     2484                        event.type = event.data;
     2485
     2486                        // handle event if we actually just moused on to a non sub-element
     2487                        jQuery.event.handle.apply( this, arguments );
     2488                }
     2489
     2490        // assuming we've left the element since we most likely mousedover a xul element
     2491        } catch(e) { }
    21192492},
    21202493
     
    21442517if ( !jQuery.support.submitBubbles ) {
    21452518
    2146 jQuery.event.special.submit = {
    2147         setup: function( data, namespaces, fn ) {
    2148                 if ( this.nodeName.toLowerCase() !== "form" ) {
    2149                         jQuery.event.add(this, "click.specialSubmit." + fn.guid, function( e ) {
    2150                                 var elem = e.target, type = elem.type;
    2151 
    2152                                 if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
    2153                                         return trigger( "submit", this, arguments );
    2154                                 }
    2155                         });
     2519        jQuery.event.special.submit = {
     2520                setup: function( data, namespaces ) {
     2521                        if ( this.nodeName.toLowerCase() !== "form" ) {
     2522                                jQuery.event.add(this, "click.specialSubmit", function( e ) {
     2523                                        var elem = e.target,
     2524                                                type = elem.type;
     2525
     2526                                        if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
     2527                                                e.liveFired = undefined;
     2528                                                return trigger( "submit", this, arguments );
     2529                                        }
     2530                                });
    21562531         
    2157                         jQuery.event.add(this, "keypress.specialSubmit." + fn.guid, function( e ) {
    2158                                 var elem = e.target, type = elem.type;
    2159 
    2160                                 if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
    2161                                         return trigger( "submit", this, arguments );
    2162                                 }
    2163                         });
    2164 
    2165                 } else {
    2166                         return false;
    2167                 }
    2168         },
    2169 
    2170         remove: function( namespaces, fn ) {
    2171                 jQuery.event.remove( this, "click.specialSubmit" + (fn ? "."+fn.guid : "") );
    2172                 jQuery.event.remove( this, "keypress.specialSubmit" + (fn ? "."+fn.guid : "") );
    2173         }
    2174 };
     2532                                jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
     2533                                        var elem = e.target,
     2534                                                type = elem.type;
     2535
     2536                                        if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
     2537                                                e.liveFired = undefined;
     2538                                                return trigger( "submit", this, arguments );
     2539                                        }
     2540                                });
     2541
     2542                        } else {
     2543                                return false;
     2544                        }
     2545                },
     2546
     2547                teardown: function( namespaces ) {
     2548                        jQuery.event.remove( this, ".specialSubmit" );
     2549                }
     2550        };
    21752551
    21762552}
     
    21792555if ( !jQuery.support.changeBubbles ) {
    21802556
    2181 var formElems = /textarea|input|select/i;
    2182 
    2183 function getVal( elem ) {
    2184         var type = elem.type, val = elem.value;
    2185 
    2186         if ( type === "radio" || type === "checkbox" ) {
    2187                 val = elem.checked;
    2188 
    2189         } else if ( type === "select-multiple" ) {
    2190                 val = elem.selectedIndex > -1 ?
    2191                         jQuery.map( elem.options, function( elem ) {
    2192                                 return elem.selected;
    2193                         }).join("-") :
    2194                         "";
    2195 
    2196         } else if ( elem.nodeName.toLowerCase() === "select" ) {
    2197                 val = elem.selectedIndex;
    2198         }
    2199 
    2200         return val;
    2201 }
    2202 
    2203 function testChange( e ) {
     2557        var changeFilters,
     2558
     2559        getVal = function( elem ) {
     2560                var type = elem.type, val = elem.value;
     2561
     2562                if ( type === "radio" || type === "checkbox" ) {
     2563                        val = elem.checked;
     2564
     2565                } else if ( type === "select-multiple" ) {
     2566                        val = elem.selectedIndex > -1 ?
     2567                                jQuery.map( elem.options, function( elem ) {
     2568                                        return elem.selected;
     2569                                }).join("-") :
     2570                                "";
     2571
     2572                } else if ( elem.nodeName.toLowerCase() === "select" ) {
     2573                        val = elem.selectedIndex;
     2574                }
     2575
     2576                return val;
     2577        },
     2578
     2579        testChange = function testChange( e ) {
    22042580                var elem = e.target, data, val;
    22052581
    2206                 if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
     2582                if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
    22072583                        return;
    22082584                }
     
    22222598                if ( data != null || val ) {
    22232599                        e.type = "change";
     2600                        e.liveFired = undefined;
    22242601                        return jQuery.event.trigger( e, arguments[1], elem );
    22252602                }
    2226 }
    2227 
    2228 jQuery.event.special.change = {
    2229         filters: {
    2230                 focusout: testChange,
    2231 
    2232                 click: function( e ) {
    2233                         var elem = e.target, type = elem.type;
    2234 
    2235                         if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
    2236                                 return testChange.call( this, e );
     2603        };
     2604
     2605        jQuery.event.special.change = {
     2606                filters: {
     2607                        focusout: testChange,
     2608
     2609                        beforedeactivate: testChange,
     2610
     2611                        click: function( e ) {
     2612                                var elem = e.target, type = elem.type;
     2613
     2614                                if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
     2615                                        return testChange.call( this, e );
     2616                                }
     2617                        },
     2618
     2619                        // Change has to be called before submit
     2620                        // Keydown will be called before keypress, which is used in submit-event delegation
     2621                        keydown: function( e ) {
     2622                                var elem = e.target, type = elem.type;
     2623
     2624                                if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
     2625                                        (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
     2626                                        type === "select-multiple" ) {
     2627                                        return testChange.call( this, e );
     2628                                }
     2629                        },
     2630
     2631                        // Beforeactivate happens also before the previous element is blurred
     2632                        // with this event you can't trigger a change event, but you can store
     2633                        // information
     2634                        beforeactivate: function( e ) {
     2635                                var elem = e.target;
     2636                                jQuery.data( elem, "_change_data", getVal(elem) );
    22372637                        }
    22382638                },
    22392639
    2240                 // Change has to be called before submit
    2241                 // Keydown will be called before keypress, which is used in submit-event delegation
    2242                 keydown: function( e ) {
    2243                         var elem = e.target, type = elem.type;
    2244 
    2245                         if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
    2246                                 (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
    2247                                 type === "select-multiple" ) {
    2248                                 return testChange.call( this, e );
    2249                         }
     2640                setup: function( data, namespaces ) {
     2641                        if ( this.type === "file" ) {
     2642                                return false;
     2643                        }
     2644
     2645                        for ( var type in changeFilters ) {
     2646                                jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
     2647                        }
     2648
     2649                        return rformElems.test( this.nodeName );
    22502650                },
    22512651
    2252                 // Beforeactivate happens also before the previous element is blurred
    2253                 // with this event you can't trigger a change event, but you can store
    2254                 // information/focus[in] is not needed anymore
    2255                 beforeactivate: function( e ) {
    2256                         var elem = e.target;
    2257 
    2258                         if ( elem.nodeName.toLowerCase() === "input" && elem.type === "radio" ) {
    2259                                 jQuery.data( elem, "_change_data", getVal(elem) );
    2260                         }
    2261                 }
    2262         },
    2263         setup: function( data, namespaces, fn ) {
    2264                 for ( var type in changeFilters ) {
    2265                         jQuery.event.add( this, type + ".specialChange." + fn.guid, changeFilters[type] );
    2266                 }
    2267 
    2268                 return formElems.test( this.nodeName );
    2269         },
    2270         remove: function( namespaces, fn ) {
    2271                 for ( var type in changeFilters ) {
    2272                         jQuery.event.remove( this, type + ".specialChange" + (fn ? "."+fn.guid : ""), changeFilters[type] );
    2273                 }
    2274 
    2275                 return formElems.test( this.nodeName );
    2276         }
    2277 };
    2278 
    2279 var changeFilters = jQuery.event.special.change.filters;
    2280 
     2652                teardown: function( namespaces ) {
     2653                        jQuery.event.remove( this, ".specialChange" );
     2654
     2655                        return rformElems.test( this.nodeName );
     2656                }
     2657        };
     2658
     2659        changeFilters = jQuery.event.special.change.filters;
     2660
     2661        // Handle when the input is .focus()'d
     2662        changeFilters.focus = changeFilters.beforeactivate;
    22812663}
    22822664
     
    22912673                jQuery.event.special[ fix ] = {
    22922674                        setup: function() {
    2293                                 this.addEventListener( orig, handler, true );
     2675                                if ( focusCounts[fix]++ === 0 ) {
     2676                                        document.addEventListener( orig, handler, true );
     2677                                }
    22942678                        },
    22952679                        teardown: function() {
    2296                                 this.removeEventListener( orig, handler, true );
     2680                                if ( --focusCounts[fix] === 0 ) {
     2681                                        document.removeEventListener( orig, handler, true );
     2682                                }
    22972683                        }
    22982684                };
     
    23012687                        e = jQuery.event.fix( e );
    23022688                        e.type = fix;
    2303                         return jQuery.event.handle.call( this, e );
     2689                        return jQuery.event.trigger( e, null, e.target );
    23042690                }
    23052691        });
     
    23162702                }
    23172703               
    2318                 if ( jQuery.isFunction( data ) ) {
     2704                if ( jQuery.isFunction( data ) || data === false ) {
    23192705                        fn = data;
    23202706                        data = undefined;
     
    23262712                }) : fn;
    23272713
    2328                 return type === "unload" && name !== "one" ?
    2329                         this.one( type, data, fn ) :
    2330                         this.each(function() {
    2331                                 jQuery.event.add( this, type, handler, data );
    2332                         });
     2714                if ( type === "unload" && name !== "one" ) {
     2715                        this.one( type, data, fn );
     2716
     2717                } else {
     2718                        for ( var i = 0, l = this.length; i < l; i++ ) {
     2719                                jQuery.event.add( this[i], type, handler, data );
     2720                        }
     2721                }
     2722
     2723                return this;
    23332724        };
    23342725});
     
    23412732                                this.unbind(key, type[key]);
    23422733                        }
    2343                         return this;
    2344                 }
    2345 
    2346                 return this.each(function() {
    2347                         jQuery.event.remove( this, type, fn );
    2348                 });
    2349         },
     2734
     2735                } else {
     2736                        for ( var i = 0, l = this.length; i < l; i++ ) {
     2737                                jQuery.event.remove( this[i], type, fn );
     2738                        }
     2739                }
     2740
     2741                return this;
     2742        },
     2743       
     2744        delegate: function( selector, types, data, fn ) {
     2745                return this.live( types, data, fn, selector );
     2746        },
     2747       
     2748        undelegate: function( selector, types, fn ) {
     2749                if ( arguments.length === 0 ) {
     2750                                return this.unbind( "live" );
     2751               
     2752                } else {
     2753                        return this.die( types, null, fn, selector );
     2754                }
     2755        },
     2756       
    23502757        trigger: function( type, data ) {
    23512758                return this.each(function() {
     
    23662773        toggle: function( fn ) {
    23672774                // Save reference to arguments for access in closure
    2368                 var args = arguments, i = 1;
     2775                var args = arguments,
     2776                        i = 1;
    23692777
    23702778                // link all the functions, so any of them can unbind this click handler
     
    23912799});
    23922800
     2801var liveMap = {
     2802        focus: "focusin",
     2803        blur: "focusout",
     2804        mouseenter: "mouseover",
     2805        mouseleave: "mouseout"
     2806};
     2807
    23932808jQuery.each(["live", "die"], function( i, name ) {
    2394         jQuery.fn[ name ] = function( types, data, fn ) {
    2395                 var type, i = 0;
     2809        jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
     2810                var type, i = 0, match, namespaces, preType,
     2811                        selector = origSelector || this.selector,
     2812                        context = origSelector ? this : jQuery( this.context );
     2813               
     2814                if ( typeof types === "object" && !types.preventDefault ) {
     2815                        for ( var key in types ) {
     2816                                context[ name ]( key, data, types[key], selector );
     2817                        }
     2818                       
     2819                        return this;
     2820                }
    23962821
    23972822                if ( jQuery.isFunction( data ) ) {
     
    24002825                }
    24012826
    2402                 types = (types || "").split( /\s+/ );
     2827                types = (types || "").split(" ");
    24032828
    24042829                while ( (type = types[ i++ ]) != null ) {
    2405                         type = type === "focus" ? "focusin" : // focus --> focusin
    2406                                         type === "blur" ? "focusout" : // blur --> focusout
    2407                                         type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support
    2408                                         type;
    2409                        
     2830                        match = rnamespaces.exec( type );
     2831                        namespaces = "";
     2832
     2833                        if ( match )  {
     2834                                namespaces = match[0];
     2835                                type = type.replace( rnamespaces, "" );
     2836                        }
     2837
     2838                        if ( type === "hover" ) {
     2839                                types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
     2840                                continue;
     2841                        }
     2842
     2843                        preType = type;
     2844
     2845                        if ( type === "focus" || type === "blur" ) {
     2846                                types.push( liveMap[ type ] + namespaces );
     2847                                type = type + namespaces;
     2848
     2849                        } else {
     2850                                type = (liveMap[ type ] || type) + namespaces;
     2851                        }
     2852
    24102853                        if ( name === "live" ) {
    24112854                                // bind live handler
    2412                                 jQuery( this.context ).bind( liveConvert( type, this.selector ), {
    2413                                         data: data, selector: this.selector, live: type
    2414                                 }, fn );
     2855                                for ( var j = 0, l = context.length; j < l; j++ ) {
     2856                                        jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
     2857                                                { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
     2858                                }
    24152859
    24162860                        } else {
    24172861                                // unbind live handler
    2418                                 jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null );
     2862                                context.unbind( "live." + liveConvert( type, selector ), fn );
    24192863                        }
    24202864                }
    24212865               
    24222866                return this;
    2423         }
     2867        };
    24242868});
    24252869
    24262870function liveHandler( event ) {
    2427         var stop, elems = [], selectors = [], args = arguments,
    2428                 related, match, fn, elem, j, i, l, data,
    2429                 live = jQuery.extend({}, jQuery.data( this, "events" ).live);
     2871        var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
     2872                elems = [],
     2873                selectors = [],
     2874                events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
     2875
     2876        if ( typeof events === "function" ) {
     2877                events = events.events;
     2878        }
    24302879
    24312880        // Make sure we avoid non-left-click bubbling in Firefox (#3861)
    2432         if ( event.button && event.type === "click" ) {
     2881        if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
    24332882                return;
    24342883        }
    2435 
    2436         for ( j in live ) {
    2437                 fn = live[j];
    2438                 if ( fn.live === event.type ||
    2439                                 fn.altLive && jQuery.inArray(event.type, fn.altLive) > -1 ) {
    2440 
    2441                         data = fn.data;
    2442                         if ( !(data.beforeFilter && data.beforeFilter[event.type] &&
    2443                                         !data.beforeFilter[event.type](event)) ) {
    2444                                 selectors.push( fn.selector );
    2445                         }
     2884       
     2885        if ( event.namespace ) {
     2886                namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
     2887        }
     2888
     2889        event.liveFired = this;
     2890
     2891        var live = events.live.slice(0);
     2892
     2893        for ( j = 0; j < live.length; j++ ) {
     2894                handleObj = live[j];
     2895
     2896                if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
     2897                        selectors.push( handleObj.selector );
     2898
    24462899                } else {
    2447                         delete live[j];
     2900                        live.splice( j--, 1 );
    24482901                }
    24492902        }
     
    24522905
    24532906        for ( i = 0, l = match.length; i < l; i++ ) {
    2454                 for ( j in live ) {
    2455                         fn = live[j];
    2456                         elem = match[i].elem;
    2457                         related = null;
    2458 
    2459                         if ( match[i].selector === fn.selector ) {
     2907                close = match[i];
     2908
     2909                for ( j = 0; j < live.length; j++ ) {
     2910                        handleObj = live[j];
     2911
     2912                        if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) {
     2913                                elem = close.elem;
     2914                                related = null;
     2915
    24602916                                // Those two events require additional checking
    2461                                 if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) {
    2462                                         related = jQuery( event.relatedTarget ).closest( fn.selector )[0];
     2917                                if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
     2918                                        event.type = handleObj.preType;
     2919                                        related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
    24632920                                }
    24642921
    24652922                                if ( !related || related !== elem ) {
    2466                                         elems.push({ elem: elem, fn: fn });
     2923                                        elems.push({ elem: elem, handleObj: handleObj, level: close.level });
    24672924                                }
    24682925                        }
     
    24722929        for ( i = 0, l = elems.length; i < l; i++ ) {
    24732930                match = elems[i];
     2931
     2932                if ( maxLevel && match.level > maxLevel ) {
     2933                        break;
     2934                }
     2935
    24742936                event.currentTarget = match.elem;
    2475                 event.data = match.fn.data;
    2476                 if ( match.fn.apply( match.elem, args ) === false ) {
    2477                         stop = false;
    2478                         break;
     2937                event.data = match.handleObj.data;
     2938                event.handleObj = match.handleObj;
     2939
     2940                ret = match.handleObj.origHandler.apply( match.elem, arguments );
     2941
     2942                if ( ret === false || event.isPropagationStopped() ) {
     2943                        maxLevel = match.level;
     2944
     2945                        if ( ret === false ) {
     2946                                stop = false;
     2947                        }
     2948                        if ( event.isImmediatePropagationStopped() ) {
     2949                                break;
     2950                        }
    24792951                }
    24802952        }
     
    24842956
    24852957function liveConvert( type, selector ) {
    2486         return "live." + (type ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&");
     2958        return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");
    24872959}
    24882960
     
    24922964
    24932965        // Handle event binding
    2494         jQuery.fn[ name ] = function( fn ) {
    2495                 return fn ? this.bind( name, fn ) : this.trigger( name );
     2966        jQuery.fn[ name ] = function( data, fn ) {
     2967                if ( fn == null ) {
     2968                        fn = data;
     2969                        data = null;
     2970                }
     2971
     2972                return arguments.length > 0 ?
     2973                        this.bind( name, data, fn ) :
     2974                        this.trigger( name );
    24962975        };
    24972976
     
    25062985//  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
    25072986if ( window.attachEvent && !window.addEventListener ) {
    2508         window.attachEvent("onunload", function() {
     2987        jQuery(window).bind("unload", function() {
    25092988                for ( var id in jQuery.cache ) {
    25102989                        if ( jQuery.cache[ id ].handle ) {
     
    25172996        });
    25182997}
     2998
     2999
    25193000/*!
    25203001 * Sizzle CSS Selector Engine - v1.0
     
    25253006(function(){
    25263007
    2527 var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
     3008var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
    25283009        done = 0,
    25293010        toString = Object.prototype.toString,
     
    25353016// function. If that is the case, discard the hasDuplicate value.
    25363017//   Thus far that includes Google Chrome.
    2537 [0, 0].sort(function(){
     3018[0, 0].sort(function() {
    25383019        baseHasDuplicate = false;
    25393020        return 0;
    25403021});
    25413022
    2542 var Sizzle = function(selector, context, results, seed) {
     3023var Sizzle = function( selector, context, results, seed ) {
    25433024        results = results || [];
    2544         var origContext = context = context || document;
     3025        context = context || document;
     3026
     3027        var origContext = context;
    25453028
    25463029        if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
     
    25523035        }
    25533036
    2554         var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
     3037        var m, set, checkSet, extra, ret, cur, pop, i,
     3038                prune = true,
     3039                contextXML = Sizzle.isXML( context ),
     3040                parts = [],
    25553041                soFar = selector;
    25563042       
    25573043        // Reset the position of the chunker regexp (start from head)
    2558         while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
    2559                 soFar = m[3];
     3044        do {
     3045                chunker.exec( "" );
     3046                m = chunker.exec( soFar );
     3047
     3048                if ( m ) {
     3049                        soFar = m[3];
    25603050               
    2561                 parts.push( m[1] );
     3051                        parts.push( m[1] );
    25623052               
    2563                 if ( m[2] ) {
    2564                         extra = m[3];
    2565                         break;
    2566                 }
    2567         }
     3053                        if ( m[2] ) {
     3054                                extra = m[3];
     3055                                break;
     3056                        }
     3057                }
     3058        } while ( m );
    25683059
    25693060        if ( parts.length > 1 && origPOS.exec( selector ) ) {
     3061
    25703062                if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
    25713063                        set = posProcess( parts[0] + parts[1], context );
     3064
    25723065                } else {
    25733066                        set = Expr.relative[ parts[0] ] ?
     
    25853078                        }
    25863079                }
     3080
    25873081        } else {
    25883082                // Take a shortcut and set the context if the root selector is an ID
     
    25903084                if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
    25913085                                Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
    2592                         var ret = Sizzle.find( parts.shift(), context, contextXML );
    2593                         context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
     3086
     3087                        ret = Sizzle.find( parts.shift(), context, contextXML );
     3088                        context = ret.expr ?
     3089                                Sizzle.filter( ret.expr, ret.set )[0] :
     3090                                ret.set[0];
    25943091                }
    25953092
    25963093                if ( context ) {
    2597                         var ret = seed ?
     3094                        ret = seed ?
    25983095                                { expr: parts.pop(), set: makeArray(seed) } :
    25993096                                Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
    2600                         set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
     3097
     3098                        set = ret.expr ?
     3099                                Sizzle.filter( ret.expr, ret.set ) :
     3100                                ret.set;
    26013101
    26023102                        if ( parts.length > 0 ) {
    2603                                 checkSet = makeArray(set);
     3103                                checkSet = makeArray( set );
     3104
    26043105                        } else {
    26053106                                prune = false;
     
    26073108
    26083109                        while ( parts.length ) {
    2609                                 var cur = parts.pop(), pop = cur;
     3110                                cur = parts.pop();
     3111                                pop = cur;
    26103112
    26113113                                if ( !Expr.relative[ cur ] ) {
     
    26213123                                Expr.relative[ cur ]( checkSet, pop, contextXML );
    26223124                        }
     3125
    26233126                } else {
    26243127                        checkSet = parts = [];
     
    26373140                if ( !prune ) {
    26383141                        results.push.apply( results, checkSet );
     3142
    26393143                } else if ( context && context.nodeType === 1 ) {
    2640                         for ( var i = 0; checkSet[i] != null; i++ ) {
    2641                                 if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
     3144                        for ( i = 0; checkSet[i] != null; i++ ) {
     3145                                if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
    26423146                                        results.push( set[i] );
    26433147                                }
    26443148                        }
     3149
    26453150                } else {
    2646                         for ( var i = 0; checkSet[i] != null; i++ ) {
     3151                        for ( i = 0; checkSet[i] != null; i++ ) {
    26473152                                if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
    26483153                                        results.push( set[i] );
     
    26503155                        }
    26513156                }
     3157
    26523158        } else {
    26533159                makeArray( checkSet, results );
     
    26623168};
    26633169
    2664 Sizzle.uniqueSort = function(results){
     3170Sizzle.uniqueSort = function( results ) {
    26653171        if ( sortOrder ) {
    26663172                hasDuplicate = baseHasDuplicate;
    2667                 results.sort(sortOrder);
     3173                results.sort( sortOrder );
    26683174
    26693175                if ( hasDuplicate ) {
    26703176                        for ( var i = 1; i < results.length; i++ ) {
    2671                                 if ( results[i] === results[i-1] ) {
    2672                                         results.splice(i--, 1);
     3177                                if ( results[i] === results[ i - 1 ] ) {
     3178                                        results.splice( i--, 1 );
    26733179                                }
    26743180                        }
     
    26793185};
    26803186
    2681 Sizzle.matches = function(expr, set){
    2682         return Sizzle(expr, null, null, set);
     3187Sizzle.matches = function( expr, set ) {
     3188        return Sizzle( expr, null, null, set );
    26833189};
    26843190
    2685 Sizzle.find = function(expr, context, isXML){
    2686         var set, match;
     3191Sizzle.matchesSelector = function( node, expr ) {
     3192        return Sizzle( expr, null, null, [node] ).length > 0;
     3193};
     3194
     3195Sizzle.find = function( expr, context, isXML ) {
     3196        var set;
    26873197
    26883198        if ( !expr ) {
     
    26913201
    26923202        for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
    2693                 var type = Expr.order[i], match;
     3203                var match,
     3204                        type = Expr.order[i];
    26943205               
    26953206                if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
    26963207                        var left = match[1];
    2697                         match.splice(1,1);
     3208                        match.splice( 1, 1 );
    26983209
    26993210                        if ( left.substr( left.length - 1 ) !== "\\" ) {
    27003211                                match[1] = (match[1] || "").replace(/\\/g, "");
    27013212                                set = Expr.find[ type ]( match, context, isXML );
     3213
    27023214                                if ( set != null ) {
    27033215                                        expr = expr.replace( Expr.match[ type ], "" );
     
    27093221
    27103222        if ( !set ) {
    2711                 set = context.getElementsByTagName("*");
    2712         }
    2713 
    2714         return {set: set, expr: expr};
     3223                set = context.getElementsByTagName( "*" );
     3224        }
     3225
     3226        return { set: set, expr: expr };
    27153227};
    27163228
    2717 Sizzle.filter = function(expr, set, inplace, not){
    2718         var old = expr, result = [], curLoop = set, match, anyFound,
    2719                 isXMLFilter = set && set[0] && isXML(set[0]);
     3229Sizzle.filter = function( expr, set, inplace, not ) {
     3230        var match, anyFound,
     3231                old = expr,
     3232                result = [],
     3233                curLoop = set,
     3234                isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
    27203235
    27213236        while ( expr && set.length ) {
    27223237                for ( var type in Expr.filter ) {
    27233238                        if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
    2724                                 var filter = Expr.filter[ type ], found, item, left = match[1];
     3239                                var found, item,
     3240                                        filter = Expr.filter[ type ],
     3241                                        left = match[1];
     3242
    27253243                                anyFound = false;
    27263244
     
    27403258                                        if ( !match ) {
    27413259                                                anyFound = found = true;
     3260
    27423261                                        } else if ( match === true ) {
    27433262                                                continue;
     
    27543273                                                                if ( pass ) {
    27553274                                                                        anyFound = true;
     3275
    27563276                                                                } else {
    27573277                                                                        curLoop[i] = false;
    27583278                                                                }
     3279
    27593280                                                        } else if ( pass ) {
    27603281                                                                result.push( item );
     
    27853306                        if ( anyFound == null ) {
    27863307                                Sizzle.error( expr );
     3308
    27873309                        } else {
    27883310                                break;
     
    28023324var Expr = Sizzle.selectors = {
    28033325        order: [ "ID", "NAME", "TAG" ],
     3326
    28043327        match: {
    2805                 ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
    2806                 CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
    2807                 NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
    2808                 ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
    2809                 TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
    2810                 CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
    2811                 POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
    2812                 PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
    2813         },
     3328                ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
     3329                CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
     3330                NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
     3331                ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
     3332                TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
     3333                CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
     3334                POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
     3335                PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
     3336        },
     3337
    28143338        leftMatch: {},
     3339
    28153340        attrMap: {
    28163341                "class": "className",
    28173342                "for": "htmlFor"
    28183343        },
     3344
    28193345        attrHandle: {
    2820                 href: function(elem){
    2821                         return elem.getAttribute("href");
    2822                 }
    2823         },
     3346                href: function( elem ) {
     3347                        return elem.getAttribute( "href" );
     3348                }
     3349        },
     3350
    28243351        relative: {
    28253352                "+": function(checkSet, part){
    28263353                        var isPartStr = typeof part === "string",
    2827                                 isTag = isPartStr && !/\W/.test(part),
     3354                                isTag = isPartStr && !/\W/.test( part ),
    28283355                                isPartStrNotTag = isPartStr && !isTag;
    28293356
     
    28463373                        }
    28473374                },
    2848                 ">": function(checkSet, part){
    2849                         var isPartStr = typeof part === "string";
    2850 
    2851                         if ( isPartStr && !/\W/.test(part) ) {
     3375
     3376                ">": function( checkSet, part ) {
     3377                        var elem,
     3378                                isPartStr = typeof part === "string",
     3379                                i = 0,
     3380                                l = checkSet.length;
     3381
     3382                        if ( isPartStr && !/\W/.test( part ) ) {
    28523383                                part = part.toLowerCase();
    28533384
    2854                                 for ( var i = 0, l = checkSet.length; i < l; i++ ) {
    2855                                         var elem = checkSet[i];
     3385                                for ( ; i < l; i++ ) {
     3386                                        elem = checkSet[i];
     3387
    28563388                                        if ( elem ) {
    28573389                                                var parent = elem.parentNode;
     
    28593391                                        }
    28603392                                }
     3393
    28613394                        } else {
    2862                                 for ( var i = 0, l = checkSet.length; i < l; i++ ) {
    2863                                         var elem = checkSet[i];
     3395                                for ( ; i < l; i++ ) {
     3396                                        elem = checkSet[i];
     3397
    28643398                                        if ( elem ) {
    28653399                                                checkSet[i] = isPartStr ?
     
    28743408                        }
    28753409                },
     3410
    28763411                "": function(checkSet, part, isXML){
    2877                         var doneName = done++, checkFn = dirCheck;
     3412                        var nodeCheck,
     3413                                doneName = done++,
     3414                                checkFn = dirCheck;
    28783415
    28793416                        if ( typeof part === "string" && !/\W/.test(part) ) {
    2880                                 var nodeCheck = part = part.toLowerCase();
     3417                                part = part.toLowerCase();
     3418                                nodeCheck = part;
    28813419                                checkFn = dirNodeCheck;
    28823420                        }
    28833421
    2884                         checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
     3422                        checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
    28853423                },
    2886                 "~": function(checkSet, part, isXML){
    2887                         var doneName = done++, checkFn = dirCheck;
    2888 
    2889                         if ( typeof part === "string" && !/\W/.test(part) ) {
    2890                                 var nodeCheck = part = part.toLowerCase();
     3424
     3425                "~": function( checkSet, part, isXML ) {
     3426                        var nodeCheck,
     3427                                doneName = done++,
     3428                                checkFn = dirCheck;
     3429
     3430                        if ( typeof part === "string" && !/\W/.test( part ) ) {
     3431                                part = part.toLowerCase();
     3432                                nodeCheck = part;
    28913433                                checkFn = dirNodeCheck;
    28923434                        }
    28933435
    2894                         checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
    2895                 }
    2896         },
     3436                        checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
     3437                }
     3438        },
     3439
    28973440        find: {
    2898                 ID: function(match, context, isXML){
     3441                ID: function( match, context, isXML ) {
    28993442                        if ( typeof context.getElementById !== "undefined" && !isXML ) {
    29003443                                var m = context.getElementById(match[1]);
    2901                                 return m ? [m] : [];
     3444                                // Check parentNode to catch when Blackberry 4.6 returns
     3445                                // nodes that are no longer in the document #6963
     3446                                return m && m.parentNode ? [m] : [];
    29023447                        }
    29033448                },
    2904                 NAME: function(match, context){
     3449
     3450                NAME: function( match, context ) {
    29053451                        if ( typeof context.getElementsByName !== "undefined" ) {
    2906                                 var ret = [], results = context.getElementsByName(match[1]);
     3452                                var ret = [],
     3453                                        results = context.getElementsByName( match[1] );
    29073454
    29083455                                for ( var i = 0, l = results.length; i < l; i++ ) {
     
    29153462                        }
    29163463                },
    2917                 TAG: function(match, context){
    2918                         return context.getElementsByTagName(match[1]);
     3464
     3465                TAG: function( match, context ) {
     3466                        return context.getElementsByTagName( match[1] );
    29193467                }
    29203468        },
    29213469        preFilter: {
    2922                 CLASS: function(match, curLoop, inplace, result, not, isXML){
     3470                CLASS: function( match, curLoop, inplace, result, not, isXML ) {
    29233471                        match = " " + match[1].replace(/\\/g, "") + " ";
    29243472
     
    29333481                                                        result.push( elem );
    29343482                                                }
     3483
    29353484                                        } else if ( inplace ) {
    29363485                                                curLoop[i] = false;
     
    29413490                        return false;
    29423491                },
    2943                 ID: function(match){
     3492
     3493                ID: function( match ) {
    29443494                        return match[1].replace(/\\/g, "");
    29453495                },
    2946                 TAG: function(match, curLoop){
     3496
     3497                TAG: function( match, curLoop ) {
    29473498                        return match[1].toLowerCase();
    29483499                },
    2949                 CHILD: function(match){
     3500
     3501                CHILD: function( match ) {
    29503502                        if ( match[1] === "nth" ) {
    29513503                                // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
     
    29643516                        return match;
    29653517                },
    2966                 ATTR: function(match, curLoop, inplace, result, not, isXML){
     3518
     3519                ATTR: function( match, curLoop, inplace, result, not, isXML ) {
    29673520                        var name = match[1].replace(/\\/g, "");
    29683521                       
     
    29773530                        return match;
    29783531                },
    2979                 PSEUDO: function(match, curLoop, inplace, result, not){
     3532
     3533                PSEUDO: function( match, curLoop, inplace, result, not ) {
    29803534                        if ( match[1] === "not" ) {
    29813535                                // If we're dealing with a complex expression, or a simple one
    29823536                                if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
    29833537                                        match[3] = Sizzle(match[3], null, null, curLoop);
     3538
    29843539                                } else {
    29853540                                        var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
     3541
    29863542                                        if ( !inplace ) {
    29873543                                                result.push.apply( result, ret );
    29883544                                        }
     3545
    29893546                                        return false;
    29903547                                }
     3548
    29913549                        } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
    29923550                                return true;
     
    29953553                        return match;
    29963554                },
    2997                 POS: function(match){
     3555
     3556                POS: function( match ) {
    29983557                        match.unshift( true );
     3558
    29993559                        return match;
    30003560                }
    30013561        },
     3562       
    30023563        filters: {
    3003                 enabled: function(elem){
     3564                enabled: function( elem ) {
    30043565                        return elem.disabled === false && elem.type !== "hidden";
    30053566                },
    3006                 disabled: function(elem){
     3567
     3568                disabled: function( elem ) {
    30073569                        return elem.disabled === true;
    30083570                },
    3009                 checked: function(elem){
     3571
     3572                checked: function( elem ) {
    30103573                        return elem.checked === true;
    30113574                },
    3012                 selected: function(elem){
     3575               
     3576                selected: function( elem ) {
    30133577                        // Accessing this property makes selected-by-default
    30143578                        // options in Safari work properly
    30153579                        elem.parentNode.selectedIndex;
     3580                       
    30163581                        return elem.selected === true;
    30173582                },
    3018                 parent: function(elem){
     3583
     3584                parent: function( elem ) {
    30193585                        return !!elem.firstChild;
    30203586                },
    3021                 empty: function(elem){
     3587
     3588                empty: function( elem ) {
    30223589                        return !elem.firstChild;
    30233590                },
    3024                 has: function(elem, i, match){
     3591
     3592                has: function( elem, i, match ) {
    30253593                        return !!Sizzle( match[3], elem ).length;
    30263594                },
    3027                 header: function(elem){
    3028                         return /h\d/i.test( elem.nodeName );
     3595
     3596                header: function( elem ) {
     3597                        return (/h\d/i).test( elem.nodeName );
    30293598                },
    3030                 text: function(elem){
     3599
     3600                text: function( elem ) {
    30313601                        return "text" === elem.type;
    30323602                },
    3033                 radio: function(elem){
     3603                radio: function( elem ) {
    30343604                        return "radio" === elem.type;
    30353605                },
    3036                 checkbox: function(elem){
     3606
     3607                checkbox: function( elem ) {
    30373608                        return "checkbox" === elem.type;
    30383609                },
    3039                 file: function(elem){
     3610
     3611                file: function( elem ) {
    30403612                        return "file" === elem.type;
    30413613                },
    3042                 password: function(elem){
     3614                password: function( elem ) {
    30433615                        return "password" === elem.type;
    30443616                },
    3045                 submit: function(elem){
     3617
     3618                submit: function( elem ) {
    30463619                        return "submit" === elem.type;
    30473620                },
    3048                 image: function(elem){
     3621
     3622                image: function( elem ) {
    30493623                        return "image" === elem.type;
    30503624                },
    3051                 reset: function(elem){
     3625
     3626                reset: function( elem ) {
    30523627                        return "reset" === elem.type;
    30533628                },
    3054                 button: function(elem){
     3629
     3630                button: function( elem ) {
    30553631                        return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
    30563632                },
    3057                 input: function(elem){
    3058                         return /input|select|textarea|button/i.test(elem.nodeName);
     3633
     3634                input: function( elem ) {
     3635                        return (/input|select|textarea|button/i).test( elem.nodeName );
    30593636                }
    30603637        },
    30613638        setFilters: {
    3062                 first: function(elem, i){
     3639                first: function( elem, i ) {
    30633640                        return i === 0;
    30643641                },
    3065                 last: function(elem, i, match, array){
     3642
     3643                last: function( elem, i, match, array ) {
    30663644                        return i === array.length - 1;
    30673645                },
    3068                 even: function(elem, i){
     3646
     3647                even: function( elem, i ) {
    30693648                        return i % 2 === 0;
    30703649                },
    3071                 odd: function(elem, i){
     3650
     3651                odd: function( elem, i ) {
    30723652                        return i % 2 === 1;
    30733653                },
    3074                 lt: function(elem, i, match){
     3654
     3655                lt: function( elem, i, match ) {
    30753656                        return i < match[3] - 0;
    30763657                },
    3077                 gt: function(elem, i, match){
     3658
     3659                gt: function( elem, i, match ) {
    30783660                        return i > match[3] - 0;
    30793661                },
    3080                 nth: function(elem, i, match){
     3662
     3663                nth: function( elem, i, match ) {
    30813664                        return match[3] - 0 === i;
    30823665                },
    3083                 eq: function(elem, i, match){
     3666
     3667                eq: function( elem, i, match ) {
    30843668                        return match[3] - 0 === i;
    30853669                }
    30863670        },
    30873671        filter: {
    3088                 PSEUDO: function(elem, match, i, array){
    3089                         var name = match[1], filter = Expr.filters[ name ];
     3672                PSEUDO: function( elem, match, i, array ) {
     3673                        var name = match[1],
     3674                                filter = Expr.filters[ name ];
    30903675
    30913676                        if ( filter ) {
    30923677                                return filter( elem, i, match, array );
     3678
    30933679                        } else if ( name === "contains" ) {
    3094                                 return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
     3680                                return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
     3681
    30953682                        } else if ( name === "not" ) {
    30963683                                var not = match[3];
    30973684
    3098                                 for ( var i = 0, l = not.length; i < l; i++ ) {
    3099                                         if ( not[i] === elem ) {
     3685                                for ( var j = 0, l = not.length; j < l; j++ ) {
     3686                                        if ( not[j] === elem ) {
    31003687                                                return false;
    31013688                                        }
     
    31033690
    31043691                                return true;
     3692
    31053693                        } else {
    31063694                                Sizzle.error( "Syntax error, unrecognized expression: " + name );
    31073695                        }
    31083696                },
    3109                 CHILD: function(elem, match){
    3110                         var type = match[1], node = elem;
    3111                         switch (type) {
    3112                                 case 'only':
    3113                                 case 'first':
     3697
     3698                CHILD: function( elem, match ) {
     3699                        var type = match[1],
     3700                                node = elem;
     3701
     3702                        switch ( type ) {
     3703                                case "only":
     3704                                case "first":
    31143705                                        while ( (node = node.previousSibling) )  {
    31153706                                                if ( node.nodeType === 1 ) {
     
    31173708                                                }
    31183709                                        }
     3710
    31193711                                        if ( type === "first" ) {
    31203712                                                return true;
    31213713                                        }
     3714
    31223715                                        node = elem;
    3123                                 case 'last':
     3716
     3717                                case "last":
    31243718                                        while ( (node = node.nextSibling) )      {
    31253719                                                if ( node.nodeType === 1 ) {
     
    31273721                                                }
    31283722                                        }
     3723
    31293724                                        return true;
    3130                                 case 'nth':
    3131                                         var first = match[2], last = match[3];
     3725
     3726                                case "nth":
     3727                                        var first = match[2],
     3728                                                last = match[3];
    31323729
    31333730                                        if ( first === 1 && last === 0 ) {
     
    31403737                                        if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
    31413738                                                var count = 0;
     3739                                               
    31423740                                                for ( node = parent.firstChild; node; node = node.nextSibling ) {
    31433741                                                        if ( node.nodeType === 1 ) {
     
    31453743                                                        }
    31463744                                                }
     3745
    31473746                                                parent.sizcache = doneName;
    31483747                                        }
    31493748                                       
    31503749                                        var diff = elem.nodeIndex - last;
     3750
    31513751                                        if ( first === 0 ) {
    31523752                                                return diff === 0;
     3753
    31533754                                        } else {
    31543755                                                return ( diff % first === 0 && diff / first >= 0 );
     
    31563757                        }
    31573758                },
    3158                 ID: function(elem, match){
     3759
     3760                ID: function( elem, match ) {
    31593761                        return elem.nodeType === 1 && elem.getAttribute("id") === match;
    31603762                },
    3161                 TAG: function(elem, match){
     3763
     3764                TAG: function( elem, match ) {
    31623765                        return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
    31633766                },
    3164                 CLASS: function(elem, match){
     3767               
     3768                CLASS: function( elem, match ) {
    31653769                        return (" " + (elem.className || elem.getAttribute("class")) + " ")
    31663770                                .indexOf( match ) > -1;
    31673771                },
    3168                 ATTR: function(elem, match){
     3772
     3773                ATTR: function( elem, match ) {
    31693774                        var name = match[1],
    31703775                                result = Expr.attrHandle[ name ] ?
     
    31973802                                false;
    31983803                },
    3199                 POS: function(elem, match, i, array){
    3200                         var name = match[2], filter = Expr.setFilters[ name ];
     3804
     3805                POS: function( elem, match, i, array ) {
     3806                        var name = match[2],
     3807                                filter = Expr.setFilters[ name ];
    32013808
    32023809                        if ( filter ) {
     
    32073814};
    32083815
    3209 var origPOS = Expr.match.POS;
     3816var origPOS = Expr.match.POS,
     3817        fescape = function(all, num){
     3818                return "\\" + (num - 0 + 1);
     3819        };
    32103820
    32113821for ( var type in Expr.match ) {
    3212         Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
    3213         Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
    3214                 return "\\" + (num - 0 + 1);
    3215         }));
     3822        Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
     3823        Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
    32163824}
    32173825
    3218 var makeArray = function(array, results) {
     3826var makeArray = function( array, results ) {
    32193827        array = Array.prototype.slice.call( array, 0 );
    32203828
     
    32293837// Perform a simple check to determine if the browser is capable of
    32303838// converting a NodeList to an array using builtin methods.
     3839// Also verifies that the returned array holds DOM nodes
     3840// (which is not the case in the Blackberry browser)
    32313841try {
    3232         Array.prototype.slice.call( document.documentElement.childNodes, 0 );
     3842        Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
    32333843
    32343844// Provide a fallback method if it does not work
    3235 } catch(e){
    3236         makeArray = function(array, results) {
    3237                 var ret = results || [];
     3845} catch( e ) {
     3846        makeArray = function( array, results ) {
     3847                var i = 0,
     3848                        ret = results || [];
    32383849
    32393850                if ( toString.call(array) === "[object Array]" ) {
    32403851                        Array.prototype.push.apply( ret, array );
     3852
    32413853                } else {
    32423854                        if ( typeof array.length === "number" ) {
    3243                                 for ( var i = 0, l = array.length; i < l; i++ ) {
     3855                                for ( var l = array.length; i < l; i++ ) {
    32443856                                        ret.push( array[i] );
    32453857                                }
     3858
    32463859                        } else {
    3247                                 for ( var i = 0; array[i]; i++ ) {
     3860                                for ( ; array[i]; i++ ) {
    32483861                                        ret.push( array[i] );
    32493862                                }
     
    32553868}
    32563869
    3257 var sortOrder;
     3870var sortOrder, siblingCheck;
    32583871
    32593872if ( document.documentElement.compareDocumentPosition ) {
    32603873        sortOrder = function( a, b ) {
     3874                if ( a === b ) {
     3875                        hasDuplicate = true;
     3876                        return 0;
     3877                }
     3878
    32613879                if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
    3262                         if ( a == b ) {
    3263                                 hasDuplicate = true;
    3264                         }
    32653880                        return a.compareDocumentPosition ? -1 : 1;
    32663881                }
    32673882
    3268                 var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
    3269                 if ( ret === 0 ) {
     3883                return a.compareDocumentPosition(b) & 4 ? -1 : 1;
     3884        };
     3885
     3886} else {
     3887        sortOrder = function( a, b ) {
     3888                var al, bl,
     3889                        ap = [],
     3890                        bp = [],
     3891                        aup = a.parentNode,
     3892                        bup = b.parentNode,
     3893                        cur = aup;
     3894
     3895                // The nodes are identical, we can exit early
     3896                if ( a === b ) {
    32703897                        hasDuplicate = true;
    3271                 }
    3272                 return ret;
     3898                        return 0;
     3899
     3900                // If the nodes are siblings (or identical) we can do a quick check
     3901                } else if ( aup === bup ) {
     3902                        return siblingCheck( a, b );
     3903
     3904                // If no parents were found then the nodes are disconnected
     3905                } else if ( !aup ) {
     3906                        return -1;
     3907
     3908                } else if ( !bup ) {
     3909                        return 1;
     3910                }
     3911
     3912                // Otherwise they're somewhere else in the tree so we need
     3913                // to build up a full list of the parentNodes for comparison
     3914                while ( cur ) {
     3915                        ap.unshift( cur );
     3916                        cur = cur.parentNode;
     3917                }
     3918
     3919                cur = bup;
     3920
     3921                while ( cur ) {
     3922                        bp.unshift( cur );
     3923                        cur = cur.parentNode;
     3924                }
     3925
     3926                al = ap.length;
     3927                bl = bp.length;
     3928
     3929                // Start walking down the tree looking for a discrepancy
     3930                for ( var i = 0; i < al && i < bl; i++ ) {
     3931                        if ( ap[i] !== bp[i] ) {
     3932                                return siblingCheck( ap[i], bp[i] );
     3933                        }
     3934                }
     3935
     3936                // We ended someplace up the tree so do a sibling check
     3937                return i === al ?
     3938                        siblingCheck( a, bp[i], -1 ) :
     3939                        siblingCheck( ap[i], b, 1 );
    32733940        };
    3274 } else if ( "sourceIndex" in document.documentElement ) {
    3275         sortOrder = function( a, b ) {
    3276                 if ( !a.sourceIndex || !b.sourceIndex ) {
    3277                         if ( a == b ) {
    3278                                 hasDuplicate = true;
    3279                         }
    3280                         return a.sourceIndex ? -1 : 1;
    3281                 }
    3282 
    3283                 var ret = a.sourceIndex - b.sourceIndex;
    3284                 if ( ret === 0 ) {
    3285                         hasDuplicate = true;
    3286                 }
    3287                 return ret;
    3288         };
    3289 } else if ( document.createRange ) {
    3290         sortOrder = function( a, b ) {
    3291                 if ( !a.ownerDocument || !b.ownerDocument ) {
    3292                         if ( a == b ) {
    3293                                 hasDuplicate = true;
    3294                         }
    3295                         return a.ownerDocument ? -1 : 1;
    3296                 }
    3297 
    3298                 var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
    3299                 aRange.setStart(a, 0);
    3300                 aRange.setEnd(a, 0);
    3301                 bRange.setStart(b, 0);
    3302                 bRange.setEnd(b, 0);
    3303                 var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
    3304                 if ( ret === 0 ) {
    3305                         hasDuplicate = true;
    3306                 }
    3307                 return ret;
     3941
     3942        siblingCheck = function( a, b, ret ) {
     3943                if ( a === b ) {
     3944                        return ret;
     3945                }
     3946
     3947                var cur = a.nextSibling;
     3948
     3949                while ( cur ) {
     3950                        if ( cur === b ) {
     3951                                return -1;
     3952                        }
     3953
     3954                        cur = cur.nextSibling;
     3955                }
     3956
     3957                return 1;
    33083958        };
    33093959}
    33103960
    33113961// Utility function for retreiving the text value of an array of DOM nodes
    3312 function getText( elems ) {
     3962Sizzle.getText = function( elems ) {
    33133963        var ret = "", elem;
    33143964
     
    33223972                // Traverse everything else, except comment nodes
    33233973                } else if ( elem.nodeType !== 8 ) {
    3324                         ret += getText( elem.childNodes );
     3974                        ret += Sizzle.getText( elem.childNodes );
    33253975                }
    33263976        }
    33273977
    33283978        return ret;
    3329 }
     3979};
    33303980
    33313981// Check to see if the browser returns elements by name when
     
    33343984        // We're going to inject a fake input element with a specified name
    33353985        var form = document.createElement("div"),
    3336                 id = "script" + (new Date).getTime();
     3986                id = "script" + (new Date()).getTime(),
     3987                root = document.documentElement;
     3988
    33373989        form.innerHTML = "<a name='" + id + "'/>";
    33383990
    33393991        // Inject it into the root element, check its status, and remove it quickly
    3340         var root = document.documentElement;
    33413992        root.insertBefore( form, root.firstChild );
    33423993
     
    33443995        // Which slows things down for other browsers (hence the branching)
    33453996        if ( document.getElementById( id ) ) {
    3346                 Expr.find.ID = function(match, context, isXML){
     3997                Expr.find.ID = function( match, context, isXML ) {
    33473998                        if ( typeof context.getElementById !== "undefined" && !isXML ) {
    33483999                                var m = context.getElementById(match[1]);
    3349                                 return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
     4000
     4001                                return m ?
     4002                                        m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
     4003                                                [m] :
     4004                                                undefined :
     4005                                        [];
    33504006                        }
    33514007                };
    33524008
    3353                 Expr.filter.ID = function(elem, match){
     4009                Expr.filter.ID = function( elem, match ) {
    33544010                        var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
     4011
    33554012                        return elem.nodeType === 1 && node && node.nodeValue === match;
    33564013                };
     
    33584015
    33594016        root.removeChild( form );
    3360         root = form = null; // release memory in IE
     4017
     4018        // release memory in IE
     4019        root = form = null;
    33614020})();
    33624021
     
    33714030        // Make sure no comments are found
    33724031        if ( div.getElementsByTagName("*").length > 0 ) {
    3373                 Expr.find.TAG = function(match, context){
    3374                         var results = context.getElementsByTagName(match[1]);
     4032                Expr.find.TAG = function( match, context ) {
     4033                        var results = context.getElementsByTagName( match[1] );
    33754034
    33764035                        // Filter out possible comments
     
    33934052        // Check to see if an attribute returns normalized href attributes
    33944053        div.innerHTML = "<a href='#'></a>";
     4054
    33954055        if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
    33964056                        div.firstChild.getAttribute("href") !== "#" ) {
    3397                 Expr.attrHandle.href = function(elem){
    3398                         return elem.getAttribute("href", 2);
     4057
     4058                Expr.attrHandle.href = function( elem ) {
     4059                        return elem.getAttribute( "href", 2 );
    33994060                };
    34004061        }
    34014062
    3402         div = null; // release memory in IE
     4063        // release memory in IE
     4064        div = null;
    34034065})();
    34044066
    34054067if ( document.querySelectorAll ) {
    34064068        (function(){
    3407                 var oldSizzle = Sizzle, div = document.createElement("div");
     4069                var oldSizzle = Sizzle,
     4070                        div = document.createElement("div"),
     4071                        id = "__sizzle__";
     4072
    34084073                div.innerHTML = "<p class='TEST'></p>";
    34094074
     
    34144079                }
    34154080       
    3416                 Sizzle = function(query, context, extra, seed){
     4081                Sizzle = function( query, context, extra, seed ) {
    34174082                        context = context || document;
     4083
     4084                        // Make sure that attribute selectors are quoted
     4085                        query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
    34184086
    34194087                        // Only use querySelectorAll on non-XML documents
    34204088                        // (ID selectors don't work in non-HTML documents)
    3421                         if ( !seed && context.nodeType === 9 && !isXML(context) ) {
    3422                                 try {
    3423                                         return makeArray( context.querySelectorAll(query), extra );
    3424                                 } catch(e){}
     4089                        if ( !seed && !Sizzle.isXML(context) ) {
     4090                                if ( context.nodeType === 9 ) {
     4091                                        try {
     4092                                                return makeArray( context.querySelectorAll(query), extra );
     4093                                        } catch(qsaError) {}
     4094
     4095                                // qSA works strangely on Element-rooted queries
     4096                                // We can work around this by specifying an extra ID on the root
     4097                                // and working up from there (Thanks to Andrew Dupont for the technique)
     4098                                // IE 8 doesn't work on object elements
     4099                                } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
     4100                                        var old = context.getAttribute( "id" ),
     4101                                                nid = old || id;
     4102
     4103                                        if ( !old ) {
     4104                                                context.setAttribute( "id", nid );
     4105                                        }
     4106
     4107                                        try {
     4108                                                return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra );
     4109
     4110                                        } catch(pseudoError) {
     4111                                        } finally {
     4112                                                if ( !old ) {
     4113                                                        context.removeAttribute( "id" );
     4114                                                }
     4115                                        }
     4116                                }
    34254117                        }
    34264118               
     
    34324124                }
    34334125
    3434                 div = null; // release memory in IE
     4126                // release memory in IE
     4127                div = null;
    34354128        })();
    34364129}
     4130
     4131(function(){
     4132        var html = document.documentElement,
     4133                matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector,
     4134                pseudoWorks = false;
     4135
     4136        try {
     4137                // This should fail with an exception
     4138                // Gecko does not error, returns false instead
     4139                matches.call( document.documentElement, "[test!='']:sizzle" );
     4140       
     4141        } catch( pseudoError ) {
     4142                pseudoWorks = true;
     4143        }
     4144
     4145        if ( matches ) {
     4146                Sizzle.matchesSelector = function( node, expr ) {
     4147                        // Make sure that attribute selectors are quoted
     4148                        expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
     4149
     4150                        if ( !Sizzle.isXML( node ) ) {
     4151                                try {
     4152                                        if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
     4153                                                return matches.call( node, expr );
     4154                                        }
     4155                                } catch(e) {}
     4156                        }
     4157
     4158                        return Sizzle(expr, null, null, [node]).length > 0;
     4159                };
     4160        }
     4161})();
    34374162
    34384163(function(){
     
    34554180       
    34564181        Expr.order.splice(1, 0, "CLASS");
    3457         Expr.find.CLASS = function(match, context, isXML) {
     4182        Expr.find.CLASS = function( match, context, isXML ) {
    34584183                if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
    34594184                        return context.getElementsByClassName(match[1]);
     
    34614186        };
    34624187
    3463         div = null; // release memory in IE
     4188        // release memory in IE
     4189        div = null;
    34644190})();
    34654191
     
    34674193        for ( var i = 0, l = checkSet.length; i < l; i++ ) {
    34684194                var elem = checkSet[i];
     4195
    34694196                if ( elem ) {
     4197                        var match = false;
     4198
    34704199                        elem = elem[dir];
    3471                         var match = false;
    34724200
    34734201                        while ( elem ) {
     
    34984226        for ( var i = 0, l = checkSet.length; i < l; i++ ) {
    34994227                var elem = checkSet[i];
     4228
    35004229                if ( elem ) {
     4230                        var match = false;
     4231                       
    35014232                        elem = elem[dir];
    3502                         var match = false;
    35034233
    35044234                        while ( elem ) {
     
    35134243                                                elem.sizset = i;
    35144244                                        }
     4245
    35154246                                        if ( typeof cur !== "string" ) {
    35164247                                                if ( elem === cur ) {
     
    35334264}
    35344265
    3535 var contains = document.compareDocumentPosition ? function(a, b){
    3536         return a.compareDocumentPosition(b) & 16;
    3537 } : function(a, b){
    3538         return a !== b && (a.contains ? a.contains(b) : true);
    3539 };
    3540 
    3541 var isXML = function(elem){
     4266if ( document.documentElement.contains ) {
     4267        Sizzle.contains = function( a, b ) {
     4268                return a !== b && (a.contains ? a.contains(b) : true);
     4269        };
     4270
     4271} else if ( document.documentElement.compareDocumentPosition ) {
     4272        Sizzle.contains = function( a, b ) {
     4273                return !!(a.compareDocumentPosition(b) & 16);
     4274        };
     4275
     4276} else {
     4277        Sizzle.contains = function() {
     4278                return false;
     4279        };
     4280}
     4281
     4282Sizzle.isXML = function( elem ) {
    35424283        // documentElement is verified for cases where it doesn't yet exist
    35434284        // (such as loading iframes in IE - #4833)
    35444285        var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
     4286
    35454287        return documentElement ? documentElement.nodeName !== "HTML" : false;
    35464288};
    35474289
    3548 var posProcess = function(selector, context){
    3549         var tmpSet = [], later = "", match,
     4290var posProcess = function( selector, context ) {
     4291        var match,
     4292                tmpSet = [],
     4293                later = "",
    35504294                root = context.nodeType ? [context] : context;
    35514295
     
    35714315jQuery.expr[":"] = jQuery.expr.filters;
    35724316jQuery.unique = Sizzle.uniqueSort;
    3573 jQuery.getText = getText;
    3574 jQuery.isXMLDoc = isXML;
    3575 jQuery.contains = contains;
    3576 
    3577 return;
    3578 
    3579 window.Sizzle = Sizzle;
     4317jQuery.text = Sizzle.getText;
     4318jQuery.isXMLDoc = Sizzle.isXML;
     4319jQuery.contains = Sizzle.contains;
     4320
    35804321
    35814322})();
     4323
     4324
    35824325var runtil = /Until$/,
    35834326        rparentsprev = /^(?:parents|prevUntil|prevAll)/,
    35844327        // Note: This RegExp should be improved, or likely pulled from Sizzle
    35854328        rmultiselector = /,/,
    3586         slice = Array.prototype.slice;
    3587 
    3588 // Implement the identical functionality for filter and not
    3589 var winnow = function( elements, qualifier, keep ) {
    3590         if ( jQuery.isFunction( qualifier ) ) {
    3591                 return jQuery.grep(elements, function( elem, i ) {
    3592                         return !!qualifier.call( elem, i, elem ) === keep;
    3593                 });
    3594 
    3595         } else if ( qualifier.nodeType ) {
    3596                 return jQuery.grep(elements, function( elem, i ) {
    3597                         return (elem === qualifier) === keep;
    3598                 });
    3599 
    3600         } else if ( typeof qualifier === "string" ) {
    3601                 var filtered = jQuery.grep(elements, function( elem ) {
    3602                         return elem.nodeType === 1;
    3603                 });
    3604 
    3605                 if ( isSimple.test( qualifier ) ) {
    3606                         return jQuery.filter(qualifier, filtered, !keep);
    3607                 } else {
    3608                         qualifier = jQuery.filter( qualifier, filtered );
    3609                 }
    3610         }
    3611 
    3612         return jQuery.grep(elements, function( elem, i ) {
    3613                 return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
    3614         });
    3615 };
     4329        isSimple = /^.[^:#\[\.,]*$/,
     4330        slice = Array.prototype.slice,
     4331        POS = jQuery.expr.match.POS;
    36164332
    36174333jQuery.fn.extend({
    36184334        find: function( selector ) {
    3619                 var ret = this.pushStack( "", "find", selector ), length = 0;
     4335                var ret = this.pushStack( "", "find", selector ),
     4336                        length = 0;
    36204337
    36214338                for ( var i = 0, l = this.length; i < l; i++ ) {
     
    36634380
    36644381        closest: function( selectors, context ) {
     4382                var ret = [], i, l, cur = this[0];
     4383
    36654384                if ( jQuery.isArray( selectors ) ) {
    3666                         var ret = [], cur = this[0], match, matches = {}, selector;
     4385                        var match, selector,
     4386                                matches = {},
     4387                                level = 1;
    36674388
    36684389                        if ( cur && selectors.length ) {
    3669                                 for ( var i = 0, l = selectors.length; i < l; i++ ) {
     4390                                for ( i = 0, l = selectors.length; i < l; i++ ) {
    36704391                                        selector = selectors[i];
    36714392
     
    36824403
    36834404                                                if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
    3684                                                         ret.push({ selector: selector, elem: cur });
    3685                                                         delete matches[selector];
     4405                                                        ret.push({ selector: selector, elem: cur, level: level });
    36864406                                                }
    36874407                                        }
     4408
    36884409                                        cur = cur.parentNode;
     4410                                        level++;
    36894411                                }
    36904412                        }
     
    36934415                }
    36944416
    3695                 var pos = jQuery.expr.match.POS.test( selectors ) ?
     4417                var pos = POS.test( selectors ) ?
    36964418                        jQuery( selectors, context || this.context ) : null;
    36974419
    3698                 return this.map(function( i, cur ) {
    3699                         while ( cur && cur.ownerDocument && cur !== context ) {
    3700                                 if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
    3701                                         return cur;
    3702                                 }
    3703                                 cur = cur.parentNode;
    3704                         }
    3705                         return null;
    3706                 });
     4420                for ( i = 0, l = this.length; i < l; i++ ) {
     4421                        cur = this[i];
     4422
     4423                        while ( cur ) {
     4424                                if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
     4425                                        ret.push( cur );
     4426                                        break;
     4427
     4428                                } else {
     4429                                        cur = cur.parentNode;
     4430                                        if ( !cur || !cur.ownerDocument || cur === context ) {
     4431                                                break;
     4432                                        }
     4433                                }
     4434                        }
     4435                }
     4436
     4437                ret = ret.length > 1 ? jQuery.unique(ret) : ret;
     4438               
     4439                return this.pushStack( ret, "closest", selectors );
    37074440        },
    37084441       
     
    38124545                }
    38134546
    3814                 return jQuery.find.matches(expr, elems);
     4547                return elems.length === 1 ?
     4548                        jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
     4549                        jQuery.find.matches(expr, elems);
    38154550        },
    38164551       
    38174552        dir: function( elem, dir, until ) {
    3818                 var matched = [], cur = elem[dir];
     4553                var matched = [],
     4554                        cur = elem[ dir ];
     4555
    38194556                while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
    38204557                        if ( cur.nodeType === 1 ) {
     
    38514588        }
    38524589});
     4590
     4591// Implement the identical functionality for filter and not
     4592function winnow( elements, qualifier, keep ) {
     4593        if ( jQuery.isFunction( qualifier ) ) {
     4594                return jQuery.grep(elements, function( elem, i ) {
     4595                        var retVal = !!qualifier.call( elem, i, elem );
     4596                        return retVal === keep;
     4597                });
     4598
     4599        } else if ( qualifier.nodeType ) {
     4600                return jQuery.grep(elements, function( elem, i ) {
     4601                        return (elem === qualifier) === keep;
     4602                });
     4603
     4604        } else if ( typeof qualifier === "string" ) {
     4605                var filtered = jQuery.grep(elements, function( elem ) {
     4606                        return elem.nodeType === 1;
     4607                });
     4608
     4609                if ( isSimple.test( qualifier ) ) {
     4610                        return jQuery.filter(qualifier, filtered, !keep);
     4611                } else {
     4612                        qualifier = jQuery.filter( qualifier, filtered );
     4613                }
     4614        }
     4615
     4616        return jQuery.grep(elements, function( elem, i ) {
     4617                return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
     4618        });
     4619}
     4620
     4621
     4622
     4623
    38534624var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
    38544625        rleadingWhitespace = /^\s+/,
    3855         rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
    3856         rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
     4626        rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
    38574627        rtagName = /<([\w:]+)/,
    38584628        rtbody = /<tbody/i,
    3859         rhtml = /<|&\w+;/,
    3860         rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,  // checked="checked" or checked (html5)
    3861         fcloseTag = function( all, front, tag ) {
    3862                 return rselfClosing.test( tag ) ?
    3863                         all :
    3864                         front + "></" + tag + ">";
    3865         },
     4629        rhtml = /<|&#?\w+;/,
     4630        rnocache = /<(?:script|object|embed|option|style)/i,
     4631        // checked="checked" or checked (html5)
     4632        rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
     4633        raction = /\=([^="'>\s]+\/)>/g,
    38664634        wrapMap = {
    38674635                option: [ 1, "<select multiple='multiple'>", "</select>" ],
     
    38884656                if ( jQuery.isFunction(text) ) {
    38894657                        return this.each(function(i) {
    3890                                 var self = jQuery(this);
     4658                                var self = jQuery( this );
     4659
    38914660                                self.text( text.call(this, i, self.text()) );
    38924661                        });
     
    38974666                }
    38984667
    3899                 return jQuery.getText( this );
     4668                return jQuery.text( this );
    39004669        },
    39014670
     
    39374706
    39384707                return this.each(function() {
    3939                         var self = jQuery( this ), contents = self.contents();
     4708                        var self = jQuery( this ),
     4709                                contents = self.contents();
    39404710
    39414711                        if ( contents.length ) {
     
    40004770                        return set;
    40014771                }
     4772        },
     4773       
     4774        // keepData is for internal use only--do not document
     4775        remove: function( selector, keepData ) {
     4776                for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
     4777                        if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
     4778                                if ( !keepData && elem.nodeType === 1 ) {
     4779                                        jQuery.cleanData( elem.getElementsByTagName("*") );
     4780                                        jQuery.cleanData( [ elem ] );
     4781                                }
     4782
     4783                                if ( elem.parentNode ) {
     4784                                         elem.parentNode.removeChild( elem );
     4785                                }
     4786                        }
     4787                }
     4788               
     4789                return this;
     4790        },
     4791
     4792        empty: function() {
     4793                for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
     4794                        // Remove element nodes and prevent memory leaks
     4795                        if ( elem.nodeType === 1 ) {
     4796                                jQuery.cleanData( elem.getElementsByTagName("*") );
     4797                        }
     4798
     4799                        // Remove any remaining nodes
     4800                        while ( elem.firstChild ) {
     4801                                elem.removeChild( elem.firstChild );
     4802                        }
     4803                }
     4804               
     4805                return this;
    40024806        },
    40034807
     
    40144818                                // as properties will not be copied (such as the
    40154819                                // the name attribute on an input).
    4016                                 var html = this.outerHTML, ownerDocument = this.ownerDocument;
     4820                                var html = this.outerHTML,
     4821                                        ownerDocument = this.ownerDocument;
     4822
    40174823                                if ( !html ) {
    40184824                                        var div = ownerDocument.createElement("div");
     
    40224828
    40234829                                return jQuery.clean([html.replace(rinlinejQuery, "")
     4830                                        // Handle the case in IE 8 where action=/test/> self-closes a tag
     4831                                        .replace(raction, '="$1">')
    40244832                                        .replace(rleadingWhitespace, "")], ownerDocument)[0];
    40254833                        } else {
     
    40454853
    40464854                // See if we can take a shortcut and just use innerHTML
    4047                 } else if ( typeof value === "string" && !/<script/i.test( value ) &&
     4855                } else if ( typeof value === "string" && !rnocache.test( value ) &&
    40484856                        (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
    40494857                        !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
    40504858
    4051                         value = value.replace(rxhtmlTag, fcloseTag);
     4859                        value = value.replace(rxhtmlTag, "<$1></$2>");
    40524860
    40534861                        try {
     
    40674875                } else if ( jQuery.isFunction( value ) ) {
    40684876                        this.each(function(i){
    4069                                 var self = jQuery(this), old = self.html();
    4070                                 self.empty().append(function(){
    4071                                         return value.call( this, i, old );
    4072                                 });
     4877                                var self = jQuery( this );
     4878
     4879                                self.html( value.call(this, i, self.html()) );
    40734880                        });
    40744881
     
    40844891                        // Make sure that the elements are removed from the DOM before they are inserted
    40854892                        // this can help fix replacing a parent with child elements
    4086                         if ( !jQuery.isFunction( value ) ) {
    4087                                 value = jQuery( value ).detach();
    4088 
    4089                         } else {
     4893                        if ( jQuery.isFunction( value ) ) {
    40904894                                return this.each(function(i) {
    40914895                                        var self = jQuery(this), old = self.html();
     
    40944898                        }
    40954899
     4900                        if ( typeof value !== "string" ) {
     4901                                value = jQuery( value ).detach();
     4902                        }
     4903
    40964904                        return this.each(function() {
    4097                                 var next = this.nextSibling, parent = this.parentNode;
    4098 
    4099                                 jQuery(this).remove();
     4905                                var next = this.nextSibling,
     4906                                        parent = this.parentNode;
     4907
     4908                                jQuery( this ).remove();
    41004909
    41014910                                if ( next ) {
     
    41154924
    41164925        domManip: function( args, table, callback ) {
    4117                 var results, first, value = args[0], scripts = [];
     4926                var results, first, fragment, parent,
     4927                        value = args[0],
     4928                        scripts = [];
    41184929
    41194930                // We can't cloneNode fragments that contain checked, in WebKit
     
    41334944
    41344945                if ( this[0] ) {
     4946                        parent = value && value.parentNode;
     4947
    41354948                        // If we're in a fragment, just use that instead of building a new one
    4136                         if ( args[0] && args[0].parentNode && args[0].parentNode.nodeType === 11 ) {
    4137                                 results = { fragment: args[0].parentNode };
     4949                        if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
     4950                                results = { fragment: parent };
     4951
    41384952                        } else {
    4139                                 results = buildFragment( args, this, scripts );
    4140                         }
    4141 
    4142                         first = results.fragment.firstChild;
     4953                                results = jQuery.buildFragment( args, this, scripts );
     4954                        }
     4955                       
     4956                        fragment = results.fragment;
     4957                       
     4958                        if ( fragment.childNodes.length === 1 ) {
     4959                                first = fragment = fragment.firstChild;
     4960                        } else {
     4961                                first = fragment.firstChild;
     4962                        }
    41434963
    41444964                        if ( first ) {
     
    41504970                                                        root(this[i], first) :
    41514971                                                        this[i],
    4152                                                 results.cacheable || this.length > 1 || i > 0 ?
    4153                                                         results.fragment.cloneNode(true) :
    4154                                                         results.fragment
     4972                                                i > 0 || results.cacheable || this.length > 1 ?
     4973                                                        fragment.cloneNode(true) :
     4974                                                        fragment
    41554975                                        );
    41564976                                }
    41574977                        }
    41584978
    4159                         if ( scripts ) {
     4979                        if ( scripts.length ) {
    41604980                                jQuery.each( scripts, evalScript );
    41614981                        }
     
    41634983
    41644984                return this;
    4165 
    4166                 function root( elem, cur ) {
    4167                         return jQuery.nodeName(elem, "table") ?
    4168                                 (elem.getElementsByTagName("tbody")[0] ||
    4169                                 elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
    4170                                 elem;
    4171                 }
    41724985        }
    41734986});
     4987
     4988function root( elem, cur ) {
     4989        return jQuery.nodeName(elem, "table") ?
     4990                (elem.getElementsByTagName("tbody")[0] ||
     4991                elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
     4992                elem;
     4993}
    41744994
    41754995function cloneCopyEvent(orig, ret) {
     
    41815001                }
    41825002
    4183                 var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
     5003                var oldData = jQuery.data( orig[i++] ),
     5004                        curData = jQuery.data( this, oldData ),
     5005                        events = oldData && oldData.events;
    41845006
    41855007                if ( events ) {
     
    41965018}
    41975019
    4198 function buildFragment( args, nodes, scripts ) {
    4199         var fragment, cacheable, cacheresults, doc;
    4200 
    4201         // webkit does not clone 'checked' attribute of radio inputs on cloneNode, so don't cache if string has a checked
    4202         if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("<option") < 0 && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
     5020jQuery.buildFragment = function( args, nodes, scripts ) {
     5021        var fragment, cacheable, cacheresults,
     5022                doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
     5023
     5024        // Only cache "small" (1/2 KB) strings that are associated with the main document
     5025        // Cloning options loses the selected state, so don't cache them
     5026        // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
     5027        // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
     5028        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] )) ) {
     5030
    42035031                cacheable = true;
    42045032                cacheresults = jQuery.fragments[ args[0] ];
     
    42115039
    42125040        if ( !fragment ) {
    4213                 doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
    42145041                fragment = doc.createDocumentFragment();
    42155042                jQuery.clean( args, doc, fragment, scripts );
     
    42215048
    42225049        return { fragment: fragment, cacheable: cacheable };
    4223 }
     5050};
    42245051
    42255052jQuery.fragments = {};
     
    42335060}, function( name, original ) {
    42345061        jQuery.fn[ name ] = function( selector ) {
    4235                 var ret = [], insert = jQuery( selector );
    4236 
    4237                 for ( var i = 0, l = insert.length; i < l; i++ ) {
    4238                         var elems = (i > 0 ? this.clone(true) : this).get();
    4239                         jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
    4240                         ret = ret.concat( elems );
    4241                 }
    4242                 return this.pushStack( ret, name, insert.selector );
    4243         };
    4244 });
    4245 
    4246 jQuery.each({
    4247         // keepData is for internal use only--do not document
    4248         remove: function( selector, keepData ) {
    4249                 if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
    4250                         if ( !keepData && this.nodeType === 1 ) {
    4251                                 jQuery.cleanData( this.getElementsByTagName("*") );
    4252                                 jQuery.cleanData( [ this ] );
    4253                         }
    4254 
    4255                         if ( this.parentNode ) {
    4256                                  this.parentNode.removeChild( this );
    4257                         }
    4258                 }
    4259         },
    4260 
    4261         empty: function() {
    4262                 // Remove element nodes and prevent memory leaks
    4263                 if ( this.nodeType === 1 ) {
    4264                         jQuery.cleanData( this.getElementsByTagName("*") );
    4265                 }
    4266 
    4267                 // Remove any remaining nodes
    4268                 while ( this.firstChild ) {
    4269                         this.removeChild( this.firstChild );
    4270                 }
    4271         }
    4272 }, function( name, fn ) {
    4273         jQuery.fn[ name ] = function() {
    4274                 return this.each( fn, arguments );
     5062                var ret = [],
     5063                        insert = jQuery( selector ),
     5064                        parent = this.length === 1 && this[0].parentNode;
     5065               
     5066                if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
     5067                        insert[ original ]( this[0] );
     5068                        return this;
     5069                       
     5070                } else {
     5071                        for ( var i = 0, l = insert.length; i < l; i++ ) {
     5072                                var elems = (i > 0 ? this.clone(true) : this).get();
     5073                                jQuery( insert[i] )[ original ]( elems );
     5074                                ret = ret.concat( elems );
     5075                        }
     5076               
     5077                        return this.pushStack( ret, name, insert.selector );
     5078                }
    42755079        };
    42765080});
     
    42875091                var ret = [];
    42885092
    4289                 jQuery.each(elems, function( i, elem ) {
     5093                for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
    42905094                        if ( typeof elem === "number" ) {
    42915095                                elem += "";
     
    42935097
    42945098                        if ( !elem ) {
    4295                                 return;
     5099                                continue;
    42965100                        }
    42975101
     
    43025106                        } else if ( typeof elem === "string" ) {
    43035107                                // Fix "XHTML"-style tags in all browsers
    4304                                 elem = elem.replace(rxhtmlTag, fcloseTag);
     5108                                elem = elem.replace(rxhtmlTag, "<$1></$2>");
    43055109
    43065110                                // Trim whitespace, otherwise indexOf won't work as expected
     
    43445148                                }
    43455149
    4346                                 elem = jQuery.makeArray( div.childNodes );
     5150                                elem = div.childNodes;
    43475151                        }
    43485152
     
    43525156                                ret = jQuery.merge( ret, elem );
    43535157                        }
    4354 
    4355                 });
     5158                }
    43565159
    43575160                if ( fragment ) {
    4358                         for ( var i = 0; ret[i]; i++ ) {
     5161                        for ( i = 0; ret[i]; i++ ) {
    43595162                                if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
    43605163                                        scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
     5164                               
    43615165                                } else {
    43625166                                        if ( ret[i].nodeType === 1 ) {
     
    43725176       
    43735177        cleanData: function( elems ) {
    4374                 for ( var i = 0, elem, id; (elem = elems[i]) != null; i++ ) {
    4375                         jQuery.event.remove( elem );
    4376                         jQuery.removeData( elem );
     5178                var data, id, cache = jQuery.cache,
     5179                        special = jQuery.event.special,
     5180                        deleteExpando = jQuery.support.deleteExpando;
     5181               
     5182                for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
     5183                        if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
     5184                                continue;
     5185                        }
     5186
     5187                        id = elem[ jQuery.expando ];
     5188                       
     5189                        if ( id ) {
     5190                                data = cache[ id ];
     5191                               
     5192                                if ( data && data.events ) {
     5193                                        for ( var type in data.events ) {
     5194                                                if ( special[ type ] ) {
     5195                                                        jQuery.event.remove( elem, type );
     5196
     5197                                                } else {
     5198                                                        jQuery.removeEvent( elem, type, data.handle );
     5199                                                }
     5200                                        }
     5201                                }
     5202                               
     5203                                if ( deleteExpando ) {
     5204                                        delete elem[ jQuery.expando ];
     5205
     5206                                } else if ( elem.removeAttribute ) {
     5207                                        elem.removeAttribute( jQuery.expando );
     5208                                }
     5209                               
     5210                                delete cache[ id ];
     5211                        }
    43775212                }
    43785213        }
    43795214});
    4380 // exclude the following css properties to add px
    4381 var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
    4382         ralpha = /alpha\([^)]*\)/,
     5215
     5216function evalScript( i, elem ) {
     5217        if ( elem.src ) {
     5218                jQuery.ajax({
     5219                        url: elem.src,
     5220                        async: false,
     5221                        dataType: "script"
     5222                });
     5223        } else {
     5224                jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
     5225        }
     5226
     5227        if ( elem.parentNode ) {
     5228                elem.parentNode.removeChild( elem );
     5229        }
     5230}
     5231
     5232
     5233
     5234
     5235var ralpha = /alpha\([^)]*\)/i,
    43835236        ropacity = /opacity=([^)]*)/,
    4384         rfloat = /float/i,
    43855237        rdashAlpha = /-([a-z])/ig,
    43865238        rupper = /([A-Z])/g,
     
    43885240        rnum = /^-?\d/,
    43895241
    4390         cssShow = { position: "absolute", visibility: "hidden", display:"block" },
     5242        cssShow = { position: "absolute", visibility: "hidden", display: "block" },
    43915243        cssWidth = [ "Left", "Right" ],
    43925244        cssHeight = [ "Top", "Bottom" ],
    4393 
    4394         // cache check for defaultView.getComputedStyle
    4395         getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
    4396         // normalize float css property
    4397         styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
     5245        curCSS,
     5246
     5247        getComputedStyle,
     5248        currentStyle,
     5249
    43985250        fcamelCase = function( all, letter ) {
    43995251                return letter.toUpperCase();
     
    44015253
    44025254jQuery.fn.css = function( name, value ) {
    4403         return access( this, name, value, true, function( elem, name, value ) {
    4404                 if ( value === undefined ) {
    4405                         return jQuery.curCSS( elem, name );
    4406                 }
    4407                
    4408                 if ( typeof value === "number" && !rexclude.test(name) ) {
    4409                         value += "px";
    4410                 }
    4411 
    4412                 jQuery.style( elem, name, value );
     5255        // Setting 'undefined' is a no-op
     5256        if ( arguments.length === 2 && value === undefined ) {
     5257                return this;
     5258        }
     5259
     5260        return jQuery.access( this, name, value, true, function( elem, name, value ) {
     5261                return value !== undefined ?
     5262                        jQuery.style( elem, name, value ) :
     5263                        jQuery.css( elem, name );
    44135264        });
    44145265};
    44155266
    44165267jQuery.extend({
    4417         style: function( elem, name, value ) {
    4418                 // don't set styles on text and comment nodes
    4419                 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
    4420                         return undefined;
    4421                 }
    4422 
    4423                 // ignore negative width and height values #1599
    4424                 if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
    4425                         value = undefined;
    4426                 }
    4427 
    4428                 var style = elem.style || elem, set = value !== undefined;
    4429 
    4430                 // IE uses filters for opacity
    4431                 if ( !jQuery.support.opacity && name === "opacity" ) {
    4432                         if ( set ) {
    4433                                 // IE has trouble with opacity if it does not have layout
    4434                                 // Force it by setting the zoom level
    4435                                 style.zoom = 1;
    4436 
    4437                                 // Set the alpha filter to set the opacity
    4438                                 var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
    4439                                 var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
    4440                                 style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
    4441                         }
    4442 
    4443                         return style.filter && style.filter.indexOf("opacity=") >= 0 ?
    4444                                 (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
    4445                                 "";
    4446                 }
    4447 
    4448                 // Make sure we're using the right name for getting the float value
    4449                 if ( rfloat.test( name ) ) {
    4450                         name = styleFloat;
    4451                 }
    4452 
    4453                 name = name.replace(rdashAlpha, fcamelCase);
    4454 
    4455                 if ( set ) {
    4456                         style[ name ] = value;
    4457                 }
    4458 
    4459                 return style[ name ];
    4460         },
    4461 
    4462         css: function( elem, name, force, extra ) {
    4463                 if ( name === "width" || name === "height" ) {
    4464                         var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
    4465 
    4466                         function getWH() {
    4467                                 val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
    4468 
    4469                                 if ( extra === "border" ) {
    4470                                         return;
    4471                                 }
    4472 
    4473                                 jQuery.each( which, function() {
    4474                                         if ( !extra ) {
    4475                                                 val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
    4476                                         }
    4477 
    4478                                         if ( extra === "margin" ) {
    4479                                                 val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
    4480                                         } else {
    4481                                                 val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
    4482                                         }
    4483                                 });
    4484                         }
    4485 
    4486                         if ( elem.offsetWidth !== 0 ) {
    4487                                 getWH();
    4488                         } else {
    4489                                 jQuery.swap( elem, props, getWH );
    4490                         }
    4491 
    4492                         return Math.max(0, Math.round(val));
    4493                 }
    4494 
    4495                 return jQuery.curCSS( elem, name, force );
    4496         },
    4497 
    4498         curCSS: function( elem, name, force ) {
    4499                 var ret, style = elem.style, filter;
    4500 
    4501                 // IE uses filters for opacity
    4502                 if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
    4503                         ret = ropacity.test(elem.currentStyle.filter || "") ?
    4504                                 (parseFloat(RegExp.$1) / 100) + "" :
    4505                                 "";
    4506 
    4507                         return ret === "" ?
    4508                                 "1" :
    4509                                 ret;
    4510                 }
    4511 
    4512                 // Make sure we're using the right name for getting the float value
    4513                 if ( rfloat.test( name ) ) {
    4514                         name = styleFloat;
    4515                 }
    4516 
    4517                 if ( !force && style && style[ name ] ) {
    4518                         ret = style[ name ];
    4519 
    4520                 } else if ( getComputedStyle ) {
    4521 
    4522                         // Only "float" is needed here
    4523                         if ( rfloat.test( name ) ) {
    4524                                 name = "float";
    4525                         }
    4526 
    4527                         name = name.replace( rupper, "-$1" ).toLowerCase();
    4528 
    4529                         var defaultView = elem.ownerDocument.defaultView;
    4530 
    4531                         if ( !defaultView ) {
    4532                                 return null;
    4533                         }
    4534 
    4535                         var computedStyle = defaultView.getComputedStyle( elem, null );
    4536 
    4537                         if ( computedStyle ) {
    4538                                 ret = computedStyle.getPropertyValue( name );
    4539                         }
    4540 
    4541                         // We should always get a number back from opacity
    4542                         if ( name === "opacity" && ret === "" ) {
    4543                                 ret = "1";
    4544                         }
    4545 
    4546                 } else if ( elem.currentStyle ) {
    4547                         var camelCase = name.replace(rdashAlpha, fcamelCase);
    4548 
    4549                         ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
    4550 
    4551                         // From the awesome hack by Dean Edwards
    4552                         // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
    4553 
    4554                         // If we're not dealing with a regular pixel number
    4555                         // but a number that has a weird ending, we need to convert it to pixels
    4556                         if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
    4557                                 // Remember the original values
    4558                                 var left = style.left, rsLeft = elem.runtimeStyle.left;
    4559 
    4560                                 // Put in the new values to get a computed value out
    4561                                 elem.runtimeStyle.left = elem.currentStyle.left;
    4562                                 style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
    4563                                 ret = style.pixelLeft + "px";
    4564 
    4565                                 // Revert the changed values
    4566                                 style.left = left;
    4567                                 elem.runtimeStyle.left = rsLeft;
    4568                         }
    4569                 }
    4570 
    4571                 return ret;
     5268        // Add in style property hooks for overriding the default
     5269        // behavior of getting and setting a style property
     5270        cssHooks: {
     5271                opacity: {
     5272                        get: function( elem, computed ) {
     5273                                if ( computed ) {
     5274                                        // We should always get a number back from opacity
     5275                                        var ret = curCSS( elem, "opacity", "opacity" );
     5276                                        return ret === "" ? "1" : ret;
     5277
     5278                                } else {
     5279                                        return elem.style.opacity;
     5280                                }
     5281                        }
     5282                }
     5283        },
     5284
     5285        // Exclude the following css properties to add px
     5286        cssNumber: {
     5287                "zIndex": true,
     5288                "fontWeight": true,
     5289                "opacity": true,
     5290                "zoom": true,
     5291                "lineHeight": true
     5292        },
     5293
     5294        // Add in properties whose names you wish to fix before
     5295        // setting or getting the value
     5296        cssProps: {
     5297                // normalize float css property
     5298                "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
     5299        },
     5300
     5301        // Get and set the style property on a DOM Node
     5302        style: function( elem, name, value, extra ) {
     5303                // Don't set styles on text and comment nodes
     5304                if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
     5305                        return;
     5306                }
     5307
     5308                // Make sure that we're working with the right name
     5309                var ret, origName = jQuery.camelCase( name ),
     5310                        style = elem.style, hooks = jQuery.cssHooks[ origName ];
     5311
     5312                name = jQuery.cssProps[ origName ] || origName;
     5313
     5314                // Check if we're setting a value
     5315                if ( value !== undefined ) {
     5316                        // Make sure that NaN and null values aren't set. See: #7116
     5317                        if ( typeof value === "number" && isNaN( value ) || value == null ) {
     5318                                return;
     5319                        }
     5320
     5321                        // If a number was passed in, add 'px' to the (except for certain CSS properties)
     5322                        if ( typeof value === "number" && !jQuery.cssNumber[ origName ] ) {
     5323                                value += "px";
     5324                        }
     5325
     5326                        // If a hook was provided, use that value, otherwise just set the specified value
     5327                        if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
     5328                                // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
     5329                                // Fixes bug #5509
     5330                                try {
     5331                                        style[ name ] = value;
     5332                                } catch(e) {}
     5333                        }
     5334
     5335                } else {
     5336                        // If a hook was provided get the non-computed value from there
     5337                        if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
     5338                                return ret;
     5339                        }
     5340
     5341                        // Otherwise just get the value from the style object
     5342                        return style[ name ];
     5343                }
     5344        },
     5345
     5346        css: function( elem, name, extra ) {
     5347                // Make sure that we're working with the right name
     5348                var ret, origName = jQuery.camelCase( name ),
     5349                        hooks = jQuery.cssHooks[ origName ];
     5350
     5351                name = jQuery.cssProps[ origName ] || origName;
     5352
     5353                // If a hook was provided get the computed value from there
     5354                if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
     5355                        return ret;
     5356
     5357                // Otherwise, if a way to get the computed value exists, use that
     5358                } else if ( curCSS ) {
     5359                        return curCSS( elem, name, origName );
     5360                }
    45725361        },
    45735362
     
    45855374
    45865375                // Revert the old values
    4587                 for ( var name in options ) {
     5376                for ( name in options ) {
    45885377                        elem.style[ name ] = old[ name ];
    45895378                }
     5379        },
     5380
     5381        camelCase: function( string ) {
     5382                return string.replace( rdashAlpha, fcamelCase );
    45905383        }
    45915384});
     5385
     5386// DEPRECATED, Use jQuery.css() instead
     5387jQuery.curCSS = jQuery.css;
     5388
     5389jQuery.each(["height", "width"], function( i, name ) {
     5390        jQuery.cssHooks[ name ] = {
     5391                get: function( elem, computed, extra ) {
     5392                        var val;
     5393
     5394                        if ( computed ) {
     5395                                if ( elem.offsetWidth !== 0 ) {
     5396                                        val = getWH( elem, name, extra );
     5397
     5398                                } else {
     5399                                        jQuery.swap( elem, cssShow, function() {
     5400                                                val = getWH( elem, name, extra );
     5401                                        });
     5402                                }
     5403
     5404                                if ( val <= 0 ) {
     5405                                        val = curCSS( elem, name, name );
     5406
     5407                                        if ( val === "0px" && currentStyle ) {
     5408                                                val = currentStyle( elem, name, name );
     5409                                        }
     5410
     5411                                        if ( val != null ) {
     5412                                                // Should return "auto" instead of 0, use 0 for
     5413                                                // temporary backwards-compat
     5414                                                return val === "" || val === "auto" ? "0px" : val;
     5415                                        }
     5416                                }
     5417
     5418                                if ( val < 0 || val == null ) {
     5419                                        val = elem.style[ name ];
     5420
     5421                                        // Should return "auto" instead of 0, use 0 for
     5422                                        // temporary backwards-compat
     5423                                        return val === "" || val === "auto" ? "0px" : val;
     5424                                }
     5425
     5426                                return typeof val === "string" ? val : val + "px";
     5427                        }
     5428                },
     5429
     5430                set: function( elem, value ) {
     5431                        if ( rnumpx.test( value ) ) {
     5432                                // ignore negative width and height values #1599
     5433                                value = parseFloat(value);
     5434
     5435                                if ( value >= 0 ) {
     5436                                        return value + "px";
     5437                                }
     5438
     5439                        } else {
     5440                                return value;
     5441                        }
     5442                }
     5443        };
     5444});
     5445
     5446if ( !jQuery.support.opacity ) {
     5447        jQuery.cssHooks.opacity = {
     5448                get: function( elem, computed ) {
     5449                        // IE uses filters for opacity
     5450                        return ropacity.test((computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "") ?
     5451                                (parseFloat(RegExp.$1) / 100) + "" :
     5452                                computed ? "1" : "";
     5453                },
     5454
     5455                set: function( elem, value ) {
     5456                        var style = elem.style;
     5457
     5458                        // IE has trouble with opacity if it does not have layout
     5459                        // Force it by setting the zoom level
     5460                        style.zoom = 1;
     5461
     5462                        // Set the alpha filter to set the opacity
     5463                        var opacity = jQuery.isNaN(value) ?
     5464                                "" :
     5465                                "alpha(opacity=" + value * 100 + ")",
     5466                                filter = style.filter || "";
     5467
     5468                        style.filter = ralpha.test(filter) ?
     5469                                filter.replace(ralpha, opacity) :
     5470                                style.filter + ' ' + opacity;
     5471                }
     5472        };
     5473}
     5474
     5475if ( document.defaultView && document.defaultView.getComputedStyle ) {
     5476        getComputedStyle = function( elem, newName, name ) {
     5477                var ret, defaultView, computedStyle;
     5478
     5479                name = name.replace( rupper, "-$1" ).toLowerCase();
     5480
     5481                if ( !(defaultView = elem.ownerDocument.defaultView) ) {
     5482                        return undefined;
     5483                }
     5484
     5485                if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
     5486                        ret = computedStyle.getPropertyValue( name );
     5487                        if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
     5488                                ret = jQuery.style( elem, name );
     5489                        }
     5490                }
     5491
     5492                return ret;
     5493        };
     5494}
     5495
     5496if ( document.documentElement.currentStyle ) {
     5497        currentStyle = function( elem, name ) {
     5498                var left, rsLeft,
     5499                        ret = elem.currentStyle && elem.currentStyle[ name ],
     5500                        style = elem.style;
     5501
     5502                // From the awesome hack by Dean Edwards
     5503                // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
     5504
     5505                // If we're not dealing with a regular pixel number
     5506                // but a number that has a weird ending, we need to convert it to pixels
     5507                if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
     5508                        // Remember the original values
     5509                        left = style.left;
     5510                        rsLeft = elem.runtimeStyle.left;
     5511
     5512                        // Put in the new values to get a computed value out
     5513                        elem.runtimeStyle.left = elem.currentStyle.left;
     5514                        style.left = name === "fontSize" ? "1em" : (ret || 0);
     5515                        ret = style.pixelLeft + "px";
     5516
     5517                        // Revert the changed values
     5518                        style.left = left;
     5519                        elem.runtimeStyle.left = rsLeft;
     5520                }
     5521
     5522                return ret === "" ? "auto" : ret;
     5523        };
     5524}
     5525
     5526curCSS = getComputedStyle || currentStyle;
     5527
     5528function getWH( elem, name, extra ) {
     5529        var which = name === "width" ? cssWidth : cssHeight,
     5530                val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
     5531
     5532        if ( extra === "border" ) {
     5533                return val;
     5534        }
     5535
     5536        jQuery.each( which, function() {
     5537                if ( !extra ) {
     5538                        val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
     5539                }
     5540
     5541                if ( extra === "margin" ) {
     5542                        val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
     5543
     5544                } else {
     5545                        val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
     5546                }
     5547        });
     5548
     5549        return val;
     5550}
    45925551
    45935552if ( jQuery.expr && jQuery.expr.filters ) {
    45945553        jQuery.expr.filters.hidden = function( elem ) {
    4595                 var width = elem.offsetWidth, height = elem.offsetHeight,
    4596                         skip = elem.nodeName.toLowerCase() === "tr";
    4597 
    4598                 return width === 0 && height === 0 && !skip ?
    4599                         true :
    4600                         width > 0 && height > 0 && !skip ?
    4601                                 false :
    4602                                 jQuery.curCSS(elem, "display") === "none";
     5554                var width = elem.offsetWidth,
     5555                        height = elem.offsetHeight;
     5556
     5557                return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
    46035558        };
    46045559
     
    46075562        };
    46085563}
    4609 var jsc = now(),
    4610         rscript = /<script(.|\s)*?\/script>/gi,
    4611         rselectTextarea = /select|textarea/i,
    4612         rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
    4613         jsre = /=\?(&|$)/,
     5564
     5565
     5566
     5567
     5568var jsc = jQuery.now(),
     5569        rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
     5570        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 = /\=\?(&|$)/,
    46145575        rquery = /\?/,
    4615         rts = /(\?|&)_=.*?(&|$)/,
     5576        rts = /([?&])_=[^&]*/,
    46165577        rurl = /^(\w+:)?\/\/([^\/?#]+)/,
    4617         r20 = /%20/g;
     5578        r20 = /%20/g,
     5579        rhash = /#.*$/,
     5580
     5581        // Keep a copy of the old load method
     5582        _load = jQuery.fn.load;
    46185583
    46195584jQuery.fn.extend({
    4620         // Keep a copy of the old load
    4621         _load: jQuery.fn.load,
    4622 
    46235585        load: function( url, params, callback ) {
    4624                 if ( typeof url !== "string" ) {
    4625                         return this._load( url );
     5586                if ( typeof url !== "string" && _load ) {
     5587                        return _load.apply( this, arguments );
    46265588
    46275589                // Don't do a request if no elements are being requested
     
    46685630                                        self.html( selector ?
    46695631                                                // Create a dummy div to hold the results
    4670                                                 jQuery("<div />")
     5632                                                jQuery("<div>")
    46715633                                                        // inject the contents of the document in, removing the scripts
    46725634                                                        // to avoid any 'Permission Denied' errors in IE
     
    46925654                return jQuery.param(this.serializeArray());
    46935655        },
     5656
    46945657        serializeArray: function() {
    46955658                return this.map(function() {
     
    47235686
    47245687jQuery.extend({
    4725 
    47265688        get: function( url, data, callback, type ) {
    47275689                // shift arguments if data argument was omited
     
    47845746                traditional: false,
    47855747                */
    4786                 // Create the request object; Microsoft failed to properly
    4787                 // implement the XMLHttpRequest in IE7 (can't request local files),
    4788                 // so we use the ActiveXObject when it is available
    47895748                // This function can be overriden by calling jQuery.ajaxSetup
    4790                 xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
    4791                         function() {
    4792                                 return new window.XMLHttpRequest();
    4793                         } :
    4794                         function() {
    4795                                 try {
    4796                                         return new window.ActiveXObject("Microsoft.XMLHTTP");
    4797                                 } catch(e) {}
    4798                         },
     5749                xhr: function() {
     5750                        return new window.XMLHttpRequest();
     5751                },
    47995752                accepts: {
    48005753                        xml: "application/xml, text/xml",
     
    48075760        },
    48085761
    4809         // Last-Modified header cache for next request
    4810         lastModified: {},
    4811         etag: {},
    4812 
    48135762        ajax: function( origSettings ) {
    4814                 var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
    4815                
    4816                 var jsonp, status, data,
    4817                         callbackContext = origSettings && origSettings.context || s,
    4818                         type = s.type.toUpperCase();
     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;
    48195770
    48205771                // convert data if not already a string
     
    48515802
    48525803                        // Handle JSONP-style loading
    4853                         window[ jsonp ] = window[ jsonp ] || function( tmp ) {
     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
    48545819                                data = tmp;
    4855                                 success();
    4856                                 complete();
    4857                                 // Garbage collect
    4858                                 window[ jsonp ] = undefined;
    4859 
    4860                                 try {
    4861                                         delete window[ jsonp ];
    4862                                 } catch(e) {}
    4863 
     5820                                jQuery.handleSuccess( s, xhr, status, data );
     5821                                jQuery.handleComplete( s, xhr, status, data );
     5822                               
    48645823                                if ( head ) {
    48655824                                        head.removeChild( script );
     
    48725831                }
    48735832
    4874                 if ( s.cache === false && type === "GET" ) {
    4875                         var ts = now();
     5833                if ( s.cache === false && noContent ) {
     5834                        var ts = jQuery.now();
    48765835
    48775836                        // try replacing _= if it is there
    4878                         var ret = s.url.replace(rts, "$1_=" + ts + "$2");
     5837                        var ret = s.url.replace(rts, "$1_=" + ts);
    48795838
    48805839                        // if nothing was replaced, add timestamp to the end
     
    48825841                }
    48835842
    4884                 // If data is available, append data to url for get requests
    4885                 if ( s.data && type === "GET" ) {
     5843                // If data is available, append data to url for GET/HEAD requests
     5844                if ( s.data && noContent ) {
    48865845                        s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
    48875846                }
    48885847
    48895848                // Watch for a new set of requests
    4890                 if ( s.global && ! jQuery.active++ ) {
     5849                if ( s.global && jQuery.active++ === 0 ) {
    48915850                        jQuery.event.trigger( "ajaxStart" );
    48925851                }
     
    48945853                // Matches an absolute URL, and saves the domain
    48955854                var parts = rurl.exec( s.url ),
    4896                         remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
     5855                        remote = parts && (parts[1] && parts[1].toLowerCase() !== location.protocol || parts[2].toLowerCase() !== location.host);
    48975856
    48985857                // If we're requesting a remote document
     
    49015860                        var head = document.getElementsByTagName("head")[0] || document.documentElement;
    49025861                        var script = document.createElement("script");
    4903                         script.src = s.url;
    49045862                        if ( s.scriptCharset ) {
    49055863                                script.charset = s.scriptCharset;
    49065864                        }
     5865                        script.src = s.url;
    49075866
    49085867                        // Handle Script loading
     
    49155874                                                        this.readyState === "loaded" || this.readyState === "complete") ) {
    49165875                                                done = true;
    4917                                                 success();
    4918                                                 complete();
     5876                                                jQuery.handleSuccess( s, xhr, status, data );
     5877                                                jQuery.handleComplete( s, xhr, status, data );
    49195878
    49205879                                                // Handle memory leak in IE
     
    49545913                // Need an extra try/catch for cross domain requests in Firefox 3
    49555914                try {
    4956                         // Set the correct header, if data is being sent
    4957                         if ( s.data || origSettings && origSettings.contentType ) {
     5915                        // Set content-type if data specified and content-body is valid for this type
     5916                        if ( (s.data != null && !noContent) || (origSettings && origSettings.contentType) ) {
    49585917                                xhr.setRequestHeader("Content-Type", s.contentType);
    49595918                        }
     
    49785937                        // Set the Accepts header for the server, depending on the dataType
    49795938                        xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
    4980                                 s.accepts[ s.dataType ] + ", */*" :
     5939                                s.accepts[ s.dataType ] + ", */*; q=0.01" :
    49815940                                s.accepts._default );
    4982                 } catch(e) {}
     5941                } catch( headerError ) {}
    49835942
    49845943                // Allow custom headers/mimetypes and early abort
    4985                 if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
     5944                if ( s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false ) {
    49865945                        // Handle the global AJAX counter
    4987                         if ( s.global && ! --jQuery.active ) {
     5946                        if ( s.global && jQuery.active-- === 1 ) {
    49885947                                jQuery.event.trigger( "ajaxStop" );
    49895948                        }
     
    49955954
    49965955                if ( s.global ) {
    4997                         trigger("ajaxSend", [xhr, s]);
     5956                        jQuery.triggerGlobal( s, "ajaxSend", [xhr, s] );
    49985957                }
    49995958
     
    50055964                                // so we simulate the call
    50065965                                if ( !requestDone ) {
    5007                                         complete();
     5966                                        jQuery.handleComplete( s, xhr, status, data );
    50085967                                }
    50095968
     
    50335992                                                // process the data (runs the xml through httpData regardless of callback)
    50345993                                                data = jQuery.httpData( xhr, s.dataType, s );
    5035                                         } catch(err) {
     5994                                        } catch( parserError ) {
    50365995                                                status = "parsererror";
    5037                                                 errMsg = err;
     5996                                                errMsg = parserError;
    50385997                                        }
    50395998                                }
     
    50436002                                        // JSONP handles its own success callback
    50446003                                        if ( !jsonp ) {
    5045                                                 success();
     6004                                                jQuery.handleSuccess( s, xhr, status, data );
    50466005                                        }
    50476006                                } else {
    5048                                         jQuery.handleError(s, xhr, status, errMsg);
     6007                                        jQuery.handleError( s, xhr, status, errMsg );
    50496008                                }
    50506009
    50516010                                // Fire the complete handlers
    5052                                 complete();
     6011                                if ( !jsonp ) {
     6012                                        jQuery.handleComplete( s, xhr, status, data );
     6013                                }
    50536014
    50546015                                if ( isTimeout === "timeout" ) {
     
    50636024                };
    50646025
    5065                 // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
     6026                // Override the abort handler, if we can (IE 6 doesn't allow it, but that's OK)
    50666027                // Opera doesn't fire onreadystatechange at all on abort
    50676028                try {
     
    50696030                        xhr.abort = function() {
    50706031                                if ( xhr ) {
    5071                                         oldAbort.call( 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 );
    50726036                                }
    50736037
    50746038                                onreadystatechange( "abort" );
    50756039                        };
    5076                 } catch(e) { }
     6040                } catch( abortError ) {}
    50776041
    50786042                // Timeout checker
     
    50886052                // Send the data
    50896053                try {
    5090                         xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
    5091                 } catch(e) {
    5092                         jQuery.handleError(s, xhr, null, e);
     6054                        xhr.send( noContent || s.data == null ? null : s.data );
     6055
     6056                } catch( sendError ) {
     6057                        jQuery.handleError( s, xhr, null, sendError );
     6058
    50936059                        // Fire the complete handlers
    5094                         complete();
     6060                        jQuery.handleComplete( s, xhr, status, data );
    50956061                }
    50966062
     
    51006066                }
    51016067
    5102                 function success() {
    5103                         // If a local callback was specified, fire it and pass it the data
    5104                         if ( s.success ) {
    5105                                 s.success.call( callbackContext, data, status, xhr );
    5106                         }
    5107 
    5108                         // Fire the global callback
    5109                         if ( s.global ) {
    5110                                 trigger( "ajaxSuccess", [xhr, s] );
    5111                         }
    5112                 }
    5113 
    5114                 function complete() {
    5115                         // Process result
    5116                         if ( s.complete ) {
    5117                                 s.complete.call( callbackContext, xhr, status);
    5118                         }
    5119 
    5120                         // The request was completed
    5121                         if ( s.global ) {
    5122                                 trigger( "ajaxComplete", [xhr, s] );
    5123                         }
    5124 
    5125                         // Handle the global AJAX counter
    5126                         if ( s.global && ! --jQuery.active ) {
    5127                                 jQuery.event.trigger( "ajaxStop" );
    5128                         }
    5129                 }
    5130                
    5131                 function trigger(type, args) {
    5132                         (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
    5133                 }
    5134 
    51356068                // return XMLHttpRequest to allow aborting the request etc.
    51366069                return xhr;
    5137         },
    5138 
    5139         handleError: function( s, xhr, status, e ) {
    5140                 // If a local callback was specified, fire it
    5141                 if ( s.error ) {
    5142                         s.error.call( s.context || s, xhr, status, e );
    5143                 }
    5144 
    5145                 // Fire the global callback
    5146                 if ( s.global ) {
    5147                         (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
    5148                 }
    5149         },
    5150 
    5151         // Counter for holding the number of active queries
    5152         active: 0,
    5153 
    5154         // Determines if an XMLHttpRequest was successful or not
    5155         httpSuccess: function( xhr ) {
    5156                 try {
    5157                         // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
    5158                         return !xhr.status && location.protocol === "file:" ||
    5159                                 // Opera returns 0 when status is 304
    5160                                 ( xhr.status >= 200 && xhr.status < 300 ) ||
    5161                                 xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
    5162                 } catch(e) {}
    5163 
    5164                 return false;
    5165         },
    5166 
    5167         // Determines if an XMLHttpRequest returns NotModified
    5168         httpNotModified: function( xhr, url ) {
    5169                 var lastModified = xhr.getResponseHeader("Last-Modified"),
    5170                         etag = xhr.getResponseHeader("Etag");
    5171 
    5172                 if ( lastModified ) {
    5173                         jQuery.lastModified[url] = lastModified;
    5174                 }
    5175 
    5176                 if ( etag ) {
    5177                         jQuery.etag[url] = etag;
    5178                 }
    5179 
    5180                 // Opera returns 0 when status is 304
    5181                 return xhr.status === 304 || xhr.status === 0;
    5182         },
    5183 
    5184         httpData: function( xhr, type, s ) {
    5185                 var ct = xhr.getResponseHeader("content-type") || "",
    5186                         xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
    5187                         data = xml ? xhr.responseXML : xhr.responseText;
    5188 
    5189                 if ( xml && data.documentElement.nodeName === "parsererror" ) {
    5190                         jQuery.error( "parsererror" );
    5191                 }
    5192 
    5193                 // Allow a pre-filtering function to sanitize the response
    5194                 // s is checked to keep backwards compatibility
    5195                 if ( s && s.dataFilter ) {
    5196                         data = s.dataFilter( data, type );
    5197                 }
    5198 
    5199                 // The filter can actually parse the response
    5200                 if ( typeof data === "string" ) {
    5201                         // Get the JavaScript object, if JSON is used.
    5202                         if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
    5203                                 data = jQuery.parseJSON( data );
    5204 
    5205                         // If the type is "script", eval it in global context
    5206                         } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
    5207                                 jQuery.globalEval( data );
    5208                         }
    5209                 }
    5210 
    5211                 return data;
    52126070        },
    52136071
     
    52156073        // key/values into a query string
    52166074        param: function( a, traditional ) {
    5217                 var s = [];
     6075                var s = [],
     6076                        add = function( key, value ) {
     6077                                // 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);
     6080                        };
    52186081               
    52196082                // Set traditional to true for jQuery <= 1.3.2 behavior.
     
    52336096                        // did it), otherwise encode params recursively.
    52346097                        for ( var prefix in a ) {
    5235                                 buildParams( prefix, a[prefix] );
     6098                                buildParams( prefix, a[prefix], traditional, add );
    52366099                        }
    52376100                }
     
    52396102                // Return the resulting serialization
    52406103                return s.join("&").replace(r20, "+");
    5241 
    5242                 function buildParams( prefix, obj ) {
    5243                         if ( jQuery.isArray(obj) ) {
    5244                                 // Serialize array item.
    5245                                 jQuery.each( obj, function( i, v ) {
    5246                                         if ( traditional ) {
    5247                                                 // Treat each array item as a scalar.
    5248                                                 add( prefix, v );
    5249                                         } else {
    5250                                                 // If array item is non-scalar (array or object), encode its
    5251                                                 // numeric index to resolve deserialization ambiguity issues.
    5252                                                 // Note that rack (as of 1.0.0) can't currently deserialize
    5253                                                 // nested arrays properly, and attempting to do so may cause
    5254                                                 // a server error. Possible fixes are to modify rack's
    5255                                                 // deserialization algorithm or to provide an option or flag
    5256                                                 // to force array serialization to be shallow.
    5257                                                 buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
    5258                                         }
    5259                                 });
     6104        }
     6105});
     6106
     6107function buildParams( prefix, obj, traditional, add ) {
     6108        if ( jQuery.isArray(obj) && obj.length ) {
     6109                // Serialize array item.
     6110                jQuery.each( obj, function( i, v ) {
     6111                        if ( traditional || rbracket.test( prefix ) ) {
     6112                                // Treat each array item as a scalar.
     6113                                add( prefix, v );
     6114
     6115                        } else {
     6116                                // If array item is non-scalar (array or object), encode its
     6117                                // numeric index to resolve deserialization ambiguity issues.
     6118                                // Note that rack (as of 1.0.0) can't currently deserialize
     6119                                // nested arrays properly, and attempting to do so may cause
     6120                                // a server error. Possible fixes are to modify rack's
     6121                                // deserialization algorithm or to provide an option or flag
     6122                                // to force array serialization to be shallow.
     6123                                buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
     6124                        }
     6125                });
     6126                       
     6127        } else if ( !traditional && obj != null && typeof obj === "object" ) {
     6128                if ( jQuery.isEmptyObject( obj ) ) {
     6129                        add( prefix, "" );
     6130
     6131                // Serialize object item.
     6132                } else {
     6133                        jQuery.each( obj, function( k, v ) {
     6134                                buildParams( prefix + "[" + k + "]", v, traditional, add );
     6135                        });
     6136                }
    52606137                                       
    5261                         } else if ( !traditional && obj != null && typeof obj === "object" ) {
    5262                                 // Serialize object item.
    5263                                 jQuery.each( obj, function( k, v ) {
    5264                                         buildParams( prefix + "[" + k + "]", v );
    5265                                 });
    5266                                        
    5267                         } else {
    5268                                 // Serialize scalar item.
    5269                                 add( prefix, obj );
    5270                         }
    5271                 }
    5272 
    5273                 function add( key, value ) {
    5274                         // If value is a function, invoke it and return its value
    5275                         value = jQuery.isFunction(value) ? value() : value;
    5276                         s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
    5277                 }
    5278         }
     6138        } else {
     6139                // Serialize scalar item.
     6140                add( prefix, obj );
     6141        }
     6142}
     6143
     6144// This is still on the jQuery object... for now
     6145// Want to move this to jQuery.ajax some day
     6146jQuery.extend({
     6147
     6148        // Counter for holding the number of active queries
     6149        active: 0,
     6150
     6151        // Last-Modified header cache for next request
     6152        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        }
     6257
    52796258});
     6259
     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.
     6266 */
     6267if ( window.ActiveXObject ) {
     6268        jQuery.ajaxSettings.xhr = function() {
     6269                if ( window.location.protocol !== "file:" ) {
     6270                        try {
     6271                                return new window.XMLHttpRequest();
     6272                        } catch(xhrError) {}
     6273                }
     6274
     6275                try {
     6276                        return new window.ActiveXObject("Microsoft.XMLHTTP");
     6277                } catch(activeError) {}
     6278        };
     6279}
     6280
     6281// Does this browser support XHR requests?
     6282jQuery.support.ajax = !!jQuery.ajaxSettings.xhr();
     6283
     6284
     6285
     6286
    52806287var elemdisplay = {},
    5281         rfxtypes = /toggle|show|hide/,
    5282         rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
     6288        rfxtypes = /^(?:toggle|show|hide)$/,
     6289        rfxnum = /^([+\-]=)?([\d+.\-]+)(.*)$/,
    52836290        timerId,
    52846291        fxAttrs = [
     
    52926299
    52936300jQuery.fn.extend({
    5294         show: function( speed, callback ) {
    5295                 if ( speed || speed === 0) {
    5296                         return this.animate( genFx("show", 3), speed, callback);
     6301        show: function( speed, easing, callback ) {
     6302                var elem, display;
     6303
     6304                if ( speed || speed === 0 ) {
     6305                        return this.animate( genFx("show", 3), speed, easing, callback);
    52976306
    52986307                } else {
    5299                         for ( var i = 0, l = this.length; i < l; i++ ) {
    5300                                 var old = jQuery.data(this[i], "olddisplay");
    5301 
    5302                                 this[i].style.display = old || "";
    5303 
    5304                                 if ( jQuery.css(this[i], "display") === "none" ) {
    5305                                         var nodeName = this[i].nodeName, display;
    5306 
    5307                                         if ( elemdisplay[ nodeName ] ) {
    5308                                                 display = elemdisplay[ nodeName ];
    5309 
    5310                                         } else {
    5311                                                 var elem = jQuery("<" + nodeName + " />").appendTo("body");
    5312 
    5313                                                 display = elem.css("display");
    5314 
    5315                                                 if ( display === "none" ) {
    5316                                                         display = "block";
    5317                                                 }
    5318 
    5319                                                 elem.remove();
    5320 
    5321                                                 elemdisplay[ nodeName ] = display;
    5322                                         }
    5323 
    5324                                         jQuery.data(this[i], "olddisplay", display);
     6308                        for ( var i = 0, j = this.length; i < j; i++ ) {
     6309                                elem = this[i];
     6310                                display = elem.style.display;
     6311
     6312                                // Reset the inline display of this element to learn if it is
     6313                                // being hidden by cascaded rules or not
     6314                                if ( !jQuery.data(elem, "olddisplay") && display === "none" ) {
     6315                                        display = elem.style.display = "";
     6316                                }
     6317
     6318                                // Set elements which have been overridden with display: none
     6319                                // in a stylesheet to whatever the default browser style is
     6320                                // for such an element
     6321                                if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
     6322                                        jQuery.data(elem, "olddisplay", defaultDisplay(elem.nodeName));
     6323                                }
     6324                        }
     6325
     6326                        // Set the display of most of the elements in a second loop
     6327                        // to avoid the constant reflow
     6328                        for ( i = 0; i < j; i++ ) {
     6329                                elem = this[i];
     6330                                display = elem.style.display;
     6331
     6332                                if ( display === "" || display === "none" ) {
     6333                                        elem.style.display = jQuery.data(elem, "olddisplay") || "";
     6334                                }
     6335                        }
     6336
     6337                        return this;
     6338                }
     6339        },
     6340
     6341        hide: function( speed, easing, callback ) {
     6342                if ( speed || speed === 0 ) {
     6343                        return this.animate( genFx("hide", 3), speed, easing, callback);
     6344
     6345                } else {
     6346                        for ( var i = 0, j = this.length; i < j; i++ ) {
     6347                                var display = jQuery.css( this[i], "display" );
     6348
     6349                                if ( display !== "none" ) {
     6350                                        jQuery.data( this[i], "olddisplay", display );
    53256351                                }
    53266352                        }
     
    53286354                        // Set the display of the elements in a second loop
    53296355                        // to avoid the constant reflow
    5330                         for ( var j = 0, k = this.length; j < k; j++ ) {
    5331                                 this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
    5332                         }
    5333 
    5334                         return this;
    5335                 }
    5336         },
    5337 
    5338         hide: function( speed, callback ) {
    5339                 if ( speed || speed === 0 ) {
    5340                         return this.animate( genFx("hide", 3), speed, callback);
    5341 
    5342                 } else {
    5343                         for ( var i = 0, l = this.length; i < l; i++ ) {
    5344                                 var old = jQuery.data(this[i], "olddisplay");
    5345                                 if ( !old && old !== "none" ) {
    5346                                         jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
    5347                                 }
    5348                         }
    5349 
    5350                         // Set the display of the elements in a second loop
    5351                         // to avoid the constant reflow
    5352                         for ( var j = 0, k = this.length; j < k; j++ ) {
    5353                                 this[j].style.display = "none";
     6356                        for ( i = 0; i < j; i++ ) {
     6357                                this[i].style.display = "none";
    53546358                        }
    53556359
     
    53616365        _toggle: jQuery.fn.toggle,
    53626366
    5363         toggle: function( fn, fn2 ) {
     6367        toggle: function( fn, fn2, callback ) {
    53646368                var bool = typeof fn === "boolean";
    53656369
     
    53746378
    53756379                } else {
    5376                         this.animate(genFx("toggle", 3), fn, fn2);
     6380                        this.animate(genFx("toggle", 3), fn, fn2, callback);
    53776381                }
    53786382
     
    53806384        },
    53816385
    5382         fadeTo: function( speed, to, callback ) {
     6386        fadeTo: function( speed, to, easing, callback ) {
    53836387                return this.filter(":hidden").css("opacity", 0).show().end()
    5384                                         .animate({opacity: to}, speed, callback);
     6388                                        .animate({opacity: to}, speed, easing, callback);
    53856389        },
    53866390
     
    53936397
    53946398                return this[ optall.queue === false ? "each" : "queue" ](function() {
     6399                        // XXX 'this' does not always have a nodeName when running the
     6400                        // test suite
     6401
    53956402                        var opt = jQuery.extend({}, optall), p,
    5396                                 hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
     6403                                isElement = this.nodeType === 1,
     6404                                hidden = isElement && jQuery(this).is(":hidden"),
    53976405                                self = this;
    53986406
    53996407                        for ( p in prop ) {
    5400                                 var name = p.replace(rdashAlpha, fcamelCase);
     6408                                var name = jQuery.camelCase( p );
    54016409
    54026410                                if ( p !== name ) {
     
    54106418                                }
    54116419
    5412                                 if ( ( p === "height" || p === "width" ) && this.style ) {
    5413                                         // Store display property
    5414                                         opt.display = jQuery.css(this, "display");
    5415 
     6420                                if ( isElement && ( p === "height" || p === "width" ) ) {
    54166421                                        // Make sure that nothing sneaks out
    5417                                         opt.overflow = this.style.overflow;
     6422                                        // Record all 3 overflow attributes because IE does not
     6423                                        // change the overflow attribute when overflowX and
     6424                                        // overflowY are set to the same value
     6425                                        opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
     6426
     6427                                        // Set display property to inline-block for height/width
     6428                                        // animations on inline elements that are having width/height
     6429                                        // animated
     6430                                        if ( jQuery.css( this, "display" ) === "inline" &&
     6431                                                        jQuery.css( this, "float" ) === "none" ) {
     6432                                                if ( !jQuery.support.inlineBlockNeedsLayout ) {
     6433                                                        this.style.display = "inline-block";
     6434
     6435                                                } else {
     6436                                                        var display = defaultDisplay(this.nodeName);
     6437
     6438                                                        // inline-level elements accept inline-block;
     6439                                                        // block-level elements need to be inline with layout
     6440                                                        if ( display === "inline" ) {
     6441                                                                this.style.display = "inline-block";
     6442
     6443                                                        } else {
     6444                                                                this.style.display = "inline";
     6445                                                                this.style.zoom = 1;
     6446                                                        }
     6447                                                }
     6448                                        }
    54186449                                }
    54196450
     
    54396470                                } else {
    54406471                                        var parts = rfxnum.exec(val),
    5441                                                 start = e.cur(true) || 0;
     6472                                                start = e.cur() || 0;
    54426473
    54436474                                        if ( parts ) {
     
    54476478                                                // We need to compute starting value
    54486479                                                if ( unit !== "px" ) {
    5449                                                         self.style[ name ] = (end || 1) + unit;
    5450                                                         start = ((end || 1) / e.cur(true)) * start;
    5451                                                         self.style[ name ] = start + unit;
     6480                                                        jQuery.style( self, name, (end || 1) + unit);
     6481                                                        start = ((end || 1) / e.cur()) * start;
     6482                                                        jQuery.style( self, name, start + unit);
    54526483                                                }
    54536484
     
    55016532});
    55026533
     6534function genFx( type, num ) {
     6535        var obj = {};
     6536
     6537        jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
     6538                obj[ this ] = type;
     6539        });
     6540
     6541        return obj;
     6542}
     6543
    55036544// Generate shortcuts for custom animations
    55046545jQuery.each({
     
    55076548        slideToggle: genFx("toggle", 1),
    55086549        fadeIn: { opacity: "show" },
    5509         fadeOut: { opacity: "hide" }
     6550        fadeOut: { opacity: "hide" },
     6551        fadeToggle: { opacity: "toggle" }
    55106552}, function( name, props ) {
    5511         jQuery.fn[ name ] = function( speed, callback ) {
    5512                 return this.animate( props, speed, callback );
     6553        jQuery.fn[ name ] = function( speed, easing, callback ) {
     6554                return this.animate( props, speed, easing, callback );
    55136555        };
    55146556});
     
    55166558jQuery.extend({
    55176559        speed: function( speed, easing, fn ) {
    5518                 var opt = speed && typeof speed === "object" ? speed : {
     6560                var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
    55196561                        complete: fn || !fn && easing ||
    55206562                                jQuery.isFunction( speed ) && speed,
     
    55246566
    55256567                opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
    5526                         jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
     6568                        opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
    55276569
    55286570                // Queueing
     
    55716613
    55726614                (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
    5573 
    5574                 // Set display property to block for height/width animations
    5575                 if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
    5576                         this.elem.style.display = "block";
    5577                 }
    55786615        },
    55796616
    55806617        // Get the current size
    5581         cur: function( force ) {
     6618        cur: function() {
    55826619                if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
    55836620                        return this.elem[ this.prop ];
    55846621                }
    55856622
    5586                 var r = parseFloat(jQuery.css(this.elem, this.prop, force));
    5587                 return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
     6623                var r = parseFloat( jQuery.css( this.elem, this.prop ) );
     6624                return r && r > -10000 ? r : 0;
    55886625        },
    55896626
    55906627        // Start an animation from one number to another
    55916628        custom: function( from, to, unit ) {
    5592                 this.startTime = now();
     6629                var self = this,
     6630                        fx = jQuery.fx;
     6631
     6632                this.startTime = jQuery.now();
    55936633                this.start = from;
    55946634                this.end = to;
     
    55976637                this.pos = this.state = 0;
    55986638
    5599                 var self = this;
    56006639                function t( gotoEnd ) {
    56016640                        return self.step(gotoEnd);
     
    56056644
    56066645                if ( t() && jQuery.timers.push(t) && !timerId ) {
    5607                         timerId = setInterval(jQuery.fx.tick, 13);
     6646                        timerId = setInterval(fx.tick, fx.interval);
    56086647                }
    56096648        },
     
    56366675        // Each step of an animation
    56376676        step: function( gotoEnd ) {
    5638                 var t = now(), done = true;
     6677                var t = jQuery.now(), done = true;
    56396678
    56406679                if ( gotoEnd || t >= this.options.duration + this.startTime ) {
     
    56526691
    56536692                        if ( done ) {
    5654                                 if ( this.options.display != null ) {
    5655                                         // Reset the overflow
    5656                                         this.elem.style.overflow = this.options.overflow;
    5657 
    5658                                         // Reset the display
    5659                                         var old = jQuery.data(this.elem, "olddisplay");
    5660                                         this.elem.style.display = old ? old : this.options.display;
    5661 
    5662                                         if ( jQuery.css(this.elem, "display") === "none" ) {
    5663                                                 this.elem.style.display = "block";
    5664                                         }
     6693                                // Reset the overflow
     6694                                if ( this.options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
     6695                                        var elem = this.elem,
     6696                                                options = this.options;
     6697
     6698                                        jQuery.each( [ "", "X", "Y" ], function (index, value) {
     6699                                                elem.style[ "overflow" + value ] = options.overflow[index];
     6700                                        } );
    56656701                                }
    56666702
     
    56736709                                if ( this.options.hide || this.options.show ) {
    56746710                                        for ( var p in this.options.curAnim ) {
    5675                                                 jQuery.style(this.elem, p, this.options.orig[p]);
     6711                                                jQuery.style( this.elem, p, this.options.orig[p] );
    56766712                                        }
    56776713                                }
     
    57156751                }
    57166752        },
    5717                
     6753
     6754        interval: 13,
     6755
    57186756        stop: function() {
    57196757                clearInterval( timerId );
    57206758                timerId = null;
    57216759        },
    5722        
     6760
    57236761        speeds: {
    57246762                slow: 600,
    5725                 fast: 200,
    5726                 // Default speed
    5727                 _default: 400
     6763                fast: 200,
     6764                // Default speed
     6765                _default: 400
    57286766        },
    57296767
    57306768        step: {
    57316769                opacity: function( fx ) {
    5732                         jQuery.style(fx.elem, "opacity", fx.now);
     6770                        jQuery.style( fx.elem, "opacity", fx.now );
    57336771                },
    57346772
     
    57516789}
    57526790
    5753 function genFx( type, num ) {
    5754         var obj = {};
    5755 
    5756         jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
    5757                 obj[ this ] = type;
    5758         });
    5759 
    5760         return obj;
     6791function defaultDisplay( nodeName ) {
     6792        if ( !elemdisplay[ nodeName ] ) {
     6793                var elem = jQuery("<" + nodeName + ">").appendTo("body"),
     6794                        display = elem.css("display");
     6795
     6796                elem.remove();
     6797
     6798                if ( display === "none" || display === "" ) {
     6799                        display = "block";
     6800                }
     6801
     6802                elemdisplay[ nodeName ] = display;
     6803        }
     6804
     6805        return elemdisplay[ nodeName ];
    57616806}
     6807
     6808
     6809
     6810
     6811var rtable = /^t(?:able|d|h)$/i,
     6812        rroot = /^(?:body|html)$/i;
     6813
    57626814if ( "getBoundingClientRect" in document.documentElement ) {
    57636815        jQuery.fn.offset = function( options ) {
    5764                 var elem = this[0];
     6816                var elem = this[0], box;
    57656817
    57666818                if ( options ) {
     
    57786830                }
    57796831
    5780                 var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
    5781                         clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
    5782                         top  = box.top  + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,
    5783                         left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
     6832                try {
     6833                        box = elem.getBoundingClientRect();
     6834                } catch(e) {}
     6835
     6836                var doc = elem.ownerDocument,
     6837                        docElem = doc.documentElement;
     6838
     6839                // Make sure we're not dealing with a disconnected DOM node
     6840                if ( !box || !jQuery.contains( docElem, elem ) ) {
     6841                        return box || { top: 0, left: 0 };
     6842                }
     6843
     6844                var body = doc.body,
     6845                        win = getWindow(doc),
     6846                        clientTop  = docElem.clientTop  || body.clientTop  || 0,
     6847                        clientLeft = docElem.clientLeft || body.clientLeft || 0,
     6848                        scrollTop  = (win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ),
     6849                        scrollLeft = (win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft),
     6850                        top  = box.top  + scrollTop  - clientTop,
     6851                        left = box.left + scrollLeft - clientLeft;
    57846852
    57856853                return { top: top, left: left };
     
    58066874                jQuery.offset.initialize();
    58076875
    5808                 var offsetParent = elem.offsetParent, prevOffsetParent = elem,
    5809                         doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
    5810                         body = doc.body, defaultView = doc.defaultView,
     6876                var computedStyle,
     6877                        offsetParent = elem.offsetParent,
     6878                        prevOffsetParent = elem,
     6879                        doc = elem.ownerDocument,
     6880                        docElem = doc.documentElement,
     6881                        body = doc.body,
     6882                        defaultView = doc.defaultView,
    58116883                        prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
    5812                         top = elem.offsetTop, left = elem.offsetLeft;
     6884                        top = elem.offsetTop,
     6885                        left = elem.offsetLeft;
    58136886
    58146887                while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
     
    58256898                                left += elem.offsetLeft;
    58266899
    5827                                 if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
     6900                                if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
    58286901                                        top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
    58296902                                        left += parseFloat( computedStyle.borderLeftWidth ) || 0;
    58306903                                }
    58316904
    5832                                 prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
     6905                                prevOffsetParent = offsetParent;
     6906                                offsetParent = elem.offsetParent;
    58336907                        }
    58346908
     
    58576931jQuery.offset = {
    58586932        initialize: function() {
    5859                 var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
     6933                var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
    58606934                        html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
    58616935
     
    58716945                this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
    58726946
    5873                 checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
     6947                checkDiv.style.position = "fixed";
     6948                checkDiv.style.top = "20px";
     6949
    58746950                // safari subtracts parent border width here which is 5px
    58756951                this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
    58766952                checkDiv.style.position = checkDiv.style.top = "";
    58776953
    5878                 innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
     6954                innerDiv.style.overflow = "hidden";
     6955                innerDiv.style.position = "relative";
     6956
    58796957                this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
    58806958
     
    58876965
    58886966        bodyOffset: function( body ) {
    5889                 var top = body.offsetTop, left = body.offsetLeft;
     6967                var top = body.offsetTop,
     6968                        left = body.offsetLeft;
    58906969
    58916970                jQuery.offset.initialize();
    58926971
    58936972                if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
    5894                         top  += parseFloat( jQuery.curCSS(body, "marginTop",  true) ) || 0;
    5895                         left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
     6973                        top  += parseFloat( jQuery.css(body, "marginTop") ) || 0;
     6974                        left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
    58966975                }
    58976976
     
    59006979       
    59016980        setOffset: function( elem, options, i ) {
     6981                var position = jQuery.css( elem, "position" );
     6982
    59026983                // set position first, in-case top/left are set even on static elem
    5903                 if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
     6984                if ( position === "static" ) {
    59046985                        elem.style.position = "relative";
    59056986                }
    5906                 var curElem   = jQuery( elem ),
     6987
     6988                var curElem = jQuery( elem ),
    59076989                        curOffset = curElem.offset(),
    5908                         curTop    = parseInt( jQuery.curCSS( elem, "top",  true ), 10 ) || 0,
    5909                         curLeft   = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
     6990                        curCSSTop = jQuery.css( elem, "top" ),
     6991                        curCSSLeft = jQuery.css( elem, "left" ),
     6992                        calculatePosition = (position === "absolute" && jQuery.inArray('auto', [curCSSTop, curCSSLeft]) > -1),
     6993                        props = {}, curPosition = {}, curTop, curLeft;
     6994
     6995                // need to be able to calculate position if either top or left is auto and position is absolute
     6996                if ( calculatePosition ) {
     6997                        curPosition = curElem.position();
     6998                }
     6999
     7000                curTop  = calculatePosition ? curPosition.top  : parseInt( curCSSTop,  10 ) || 0;
     7001                curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0;
    59107002
    59117003                if ( jQuery.isFunction( options ) ) {
     
    59137005                }
    59147006
    5915                 var props = {
    5916                         top:  (options.top  - curOffset.top)  + curTop,
    5917                         left: (options.left - curOffset.left) + curLeft
    5918                 };
     7007                if (options.top != null) {
     7008                        props.top = (options.top - curOffset.top) + curTop;
     7009                }
     7010                if (options.left != null) {
     7011                        props.left = (options.left - curOffset.left) + curLeft;
     7012                }
    59197013               
    59207014                if ( "using" in options ) {
     
    59407034                // Get correct offsets
    59417035                offset       = this.offset(),
    5942                 parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
     7036                parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
    59437037
    59447038                // Subtract element margins
    59457039                // note: when an element has margin: auto the offsetLeft and marginLeft
    59467040                // are the same in Safari causing offset.left to incorrectly be 0
    5947                 offset.top  -= parseFloat( jQuery.curCSS(elem, "marginTop",  true) ) || 0;
    5948                 offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
     7041                offset.top  -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
     7042                offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
    59497043
    59507044                // Add offsetParent borders
    5951                 parentOffset.top  += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth",  true) ) || 0;
    5952                 parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
     7045                parentOffset.top  += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
     7046                parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
    59537047
    59547048                // Subtract the two offsets
     
    59627056                return this.map(function() {
    59637057                        var offsetParent = this.offsetParent || document.body;
    5964                         while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
     7058                        while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
    59657059                                offsetParent = offsetParent.offsetParent;
    59667060                        }
     
    60107104
    60117105function getWindow( elem ) {
    6012         return ("scrollTo" in elem && elem.document) ?
     7106        return jQuery.isWindow( elem ) ?
    60137107                elem :
    60147108                elem.nodeType === 9 ?
     
    60167110                        false;
    60177111}
     7112
     7113
     7114
     7115
    60187116// Create innerHeight, innerWidth, outerHeight and outerWidth methods
    60197117jQuery.each([ "Height", "Width" ], function( i, name ) {
     
    60247122        jQuery.fn["inner" + name] = function() {
    60257123                return this[0] ?
    6026                         jQuery.css( this[0], type, false, "padding" ) :
     7124                        parseFloat( jQuery.css( this[0], type, "padding" ) ) :
    60277125                        null;
    60287126        };
     
    60317129        jQuery.fn["outer" + name] = function( margin ) {
    60327130                return this[0] ?
    6033                         jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
     7131                        parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :
    60347132                        null;
    60357133        };
     
    60497147                }
    60507148
    6051                 return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
     7149                if ( jQuery.isWindow( elem ) ) {
    60527150                        // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
    6053                         elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
    6054                         elem.document.body[ "client" + name ] :
    6055 
    6056                         // Get document width or height
    6057                         (elem.nodeType === 9) ? // is it a document
    6058                                 // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
    6059                                 Math.max(
    6060                                         elem.documentElement["client" + name],
    6061                                         elem.body["scroll" + name], elem.documentElement["scroll" + name],
    6062                                         elem.body["offset" + name], elem.documentElement["offset" + name]
    6063                                 ) :
    6064 
    6065                                 // Get or set width or height on the element
    6066                                 size === undefined ?
    6067                                         // Get width or height on the element
    6068                                         jQuery.css( elem, type ) :
    6069 
    6070                                         // Set the width or height on the element (default to pixels if value is unitless)
    6071                                         this.css( type, typeof size === "string" ? size : size + "px" );
     7151                        return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
     7152                                elem.document.body[ "client" + name ];
     7153
     7154                // Get document width or height
     7155                } else if ( elem.nodeType === 9 ) {
     7156                        // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
     7157                        return Math.max(
     7158                                elem.documentElement["client" + name],
     7159                                elem.body["scroll" + name], elem.documentElement["scroll" + name],
     7160                                elem.body["offset" + name], elem.documentElement["offset" + name]
     7161                        );
     7162
     7163                // Get or set width or height on the element
     7164                } else if ( size === undefined ) {
     7165                        var orig = jQuery.css( elem, type ),
     7166                                ret = parseFloat( orig );
     7167
     7168                        return jQuery.isNaN( ret ) ? orig : ret;
     7169
     7170                // Set the width or height on the element (default to pixels if value is unitless)
     7171                } else {
     7172                        return this.css( type, typeof size === "string" ? size : size + "px" );
     7173                }
    60727174        };
    60737175
    60747176});
    6075 // Expose jQuery to the global object
    6076 window.jQuery = window.$ = jQuery;
     7177
    60777178
    60787179})(window);
Note: See TracChangeset for help on using the changeset viewer.