Advertisement
Guest User

jquery selector caching test

a guest
Oct 11th, 2011
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 381.92 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
  2. <html>
  3.   <head>
  4.     <meta name="generator" content="HTML Tidy for Windows (vers 14 February 2006), see www.w3.org">
  5.     <script type='text/javascript'>
  6. /*!
  7.     * jQuery JavaScript Library v1.6.4
  8.     * http://jquery.com/
  9.     *
  10.     * Copyright 2011, John Resig
  11.     * Dual licensed under the MIT or GPL Version 2 licenses.
  12.     * http://jquery.org/license
  13.     *
  14.     * Includes Sizzle.js
  15.     * http://sizzlejs.com/
  16.     * Copyright 2011, The Dojo Foundation
  17.     * Released under the MIT, BSD, and GPL Licenses.
  18.     *
  19.     * Date: Mon Sep 12 18:54:48 2011 -0400
  20.     */
  21.     (function( window, undefined ) {
  22.  
  23.     // Use the correct document accordingly with window argument (sandbox)
  24.     var document = window.document,
  25.         navigator = window.navigator,
  26.         location = window.location;
  27.     var jQuery = (function() {
  28.  
  29.     // Define a local copy of jQuery
  30.     var jQuery = function( selector, context ) {
  31.                 // The jQuery object is actually just the init constructor 'enhanced'
  32.                 return new jQuery.fn.init( selector, context, rootjQuery );
  33.         },
  34.  
  35.         // Map over jQuery in case of overwrite
  36.         _jQuery = window.jQuery,
  37.  
  38.         // Map over the $ in case of overwrite
  39.         _$ = window.$,
  40.  
  41.         // A central reference to the root jQuery(document)
  42.         rootjQuery,
  43.  
  44.         // A simple way to check for HTML strings or ID strings
  45.         // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  46.         quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
  47.  
  48.         // Check if a string has a non-whitespace character in it
  49.         rnotwhite = /\S/,
  50.  
  51.         // Used for trimming whitespace
  52.         trimLeft = /^\s+/,
  53.         trimRight = /\s+$/,
  54.  
  55.         // Check for digits
  56.         rdigit = /\d/,
  57.  
  58.         // Match a standalone tag
  59.         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.]+))?/,
  72.  
  73.         // Matches dashed string for camelizing
  74.         rdashAlpha = /-([a-z]|[0-9])/ig,
  75.         rmsPrefix = /^-ms-/,
  76.  
  77.         // Used by jQuery.camelCase as callback to replace()
  78.         fcamelCase = function( all, letter ) {
  79.                 return ( letter + "" ).toUpperCase();
  80.         },
  81.  
  82.         // Keep a UserAgent string for use with jQuery.browser
  83.         userAgent = navigator.userAgent,
  84.  
  85.         // For matching the engine and version of the browser
  86.         browserMatch,
  87.  
  88.         // The deferred used on DOM ready
  89.         readyList,
  90.  
  91.         // The ready event handler
  92.         DOMContentLoaded,
  93.  
  94.         // Save a reference to some core methods
  95.         toString = Object.prototype.toString,
  96.         hasOwn = Object.prototype.hasOwnProperty,
  97.         push = Array.prototype.push,
  98.         slice = Array.prototype.slice,
  99.         trim = String.prototype.trim,
  100.         indexOf = Array.prototype.indexOf,
  101.  
  102.         // [[Class]] -> type pairs
  103.         class2type = {};
  104.  
  105.     jQuery.fn = jQuery.prototype = {
  106.         constructor: jQuery,
  107.         init: function( selector, context, rootjQuery ) {
  108.                 var match, elem, ret, doc;
  109.  
  110.                 // Handle $(""), $(null), or $(undefined)
  111.                 if ( !selector ) {
  112.                         return this;
  113.                 }
  114.  
  115.                 // Handle $(DOMElement)
  116.                 if ( selector.nodeType ) {
  117.                         this.context = this[0] = selector;
  118.                         this.length = 1;
  119.                         return this;
  120.                 }
  121.  
  122.                 // The body element only exists once, optimize finding it
  123.                 if ( selector === "body" && !context && document.body ) {
  124.                        this.context = document;
  125.                         this[0] = document.body;
  126.                         this.selector = selector;
  127.                         this.length = 1;
  128.                         return this;
  129.                 }
  130.  
  131.                 // Handle HTML strings
  132.                 if ( typeof selector === "string" ) {
  133.                         // Are we dealing with HTML string or an ID?
  134.                         if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
  135.                                // Assume that strings that start and end with <> are HTML and skip the regex check
  136.                                match = [ null, selector, null ];
  137.  
  138.                         } else {
  139.                                 match = quickExpr.exec( selector );
  140.                         }
  141.  
  142.                         // Verify a match, and that no context was specified for #id
  143.                         if ( match && (match[1] || !context) ) {
  144.  
  145.                                // HANDLE: $(html) -> $(array)
  146.                                if ( match[1] ) {
  147.                                        context = context instanceof jQuery ? context[0] : context;
  148.                                         doc = (context ? context.ownerDocument || context : document);
  149.  
  150.                                         // If a single string is passed in and it's a single tag
  151.                                         // just do a createElement and skip the rest
  152.                                         ret = rsingleTag.exec( selector );
  153.  
  154.                                         if ( ret ) {
  155.                                                 if ( jQuery.isPlainObject( context ) ) {
  156.                                                         selector = [ document.createElement( ret[1] ) ];
  157.                                                         jQuery.fn.attr.call( selector, context, true );
  158.  
  159.                                                 } else {
  160.                                                         selector = [ doc.createElement( ret[1] ) ];
  161.                                                 }
  162.  
  163.                                         } else {
  164.                                                 ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
  165.                                                 selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
  166.                                         }
  167.  
  168.                                         return jQuery.merge( this, selector );
  169.  
  170.                                 // HANDLE: $("#id")
  171.                                 } else {
  172.                                         elem = document.getElementById( match[2] );
  173.  
  174.                                         // Check parentNode to catch when Blackberry 4.6 returns
  175.                                         // nodes that are no longer in the document #6963
  176.                                         if ( elem && elem.parentNode ) {
  177.                                                // Handle the case where IE and Opera return items
  178.                                                // by name instead of ID
  179.                                                if ( elem.id !== match[2] ) {
  180.                                                        return rootjQuery.find( selector );
  181.                                                 }
  182.  
  183.                                                 // Otherwise, we inject the element directly into the jQuery object
  184.                                                 this.length = 1;
  185.                                                 this[0] = elem;
  186.                                         }
  187.  
  188.                                         this.context = document;
  189.                                         this.selector = selector;
  190.                                         return this;
  191.                                 }
  192.  
  193.                         // HANDLE: $(expr, $(...))
  194.                         } else if ( !context || context.jquery ) {
  195.                                 return (context || rootjQuery).find( selector );
  196.  
  197.                         // HANDLE: $(expr, context)
  198.                         // (which is just equivalent to: $(context).find(expr)
  199.                         } else {
  200.                                 return this.constructor( context ).find( selector );
  201.                         }
  202.  
  203.                 // HANDLE: $(function)
  204.                 // Shortcut for document ready
  205.                 } else if ( jQuery.isFunction( selector ) ) {
  206.                         return rootjQuery.ready( selector );
  207.                 }
  208.  
  209.                 if (selector.selector !== undefined) {
  210.                         this.selector = selector.selector;
  211.                         this.context = selector.context;
  212.                 }
  213.  
  214.                 return jQuery.makeArray( selector, this );
  215.         },
  216.  
  217.         // Start with an empty selector
  218.         selector: "",
  219.  
  220.         // The current version of jQuery being used
  221.         jquery: "1.6.4",
  222.  
  223.         // The default length of a jQuery object is 0
  224.         length: 0,
  225.  
  226.         // The number of elements contained in the matched element set
  227.         size: function() {
  228.                 return this.length;
  229.         },
  230.  
  231.         toArray: function() {
  232.                 return slice.call( this, 0 );
  233.         },
  234.  
  235.         // Get the Nth element in the matched element set OR
  236.         // Get the whole matched element set as a clean array
  237.         get: function( num ) {
  238.                 return num == null ?
  239.  
  240.                         // Return a 'clean' array
  241.                         this.toArray() :
  242.  
  243.                         // Return just the object
  244.                         ( num < 0 ? this[ this.length + num ] : this[ num ] );
  245.        },
  246.  
  247.        // Take an array of elements and push it onto the stack
  248.        // (returning the new matched element set)
  249.        pushStack: function( elems, name, selector ) {
  250.                // Build a new jQuery matched element set
  251.                var ret = this.constructor();
  252.  
  253.                if ( jQuery.isArray( elems ) ) {
  254.                        push.apply( ret, elems );
  255.  
  256.                } else {
  257.                        jQuery.merge( ret, elems );
  258.                }
  259.  
  260.                // Add the old object onto the stack (as a reference)
  261.                ret.prevObject = this;
  262.  
  263.                ret.context = this.context;
  264.  
  265.                if ( name === "find" ) {
  266.                        ret.selector = this.selector + (this.selector ? " " : "") + selector;
  267.                } else if ( name ) {
  268.                        ret.selector = this.selector + "." + name + "(" + selector + ")";
  269.                }
  270.  
  271.                // Return the newly-formed element set
  272.                return ret;
  273.        },
  274.  
  275.        // Execute a callback for every element in the matched set.
  276.        // (You can seed the arguments with an array of args, but this is
  277.        // only used internally.)
  278.        each: function( callback, args ) {
  279.                return jQuery.each( this, callback, args );
  280.        },
  281.  
  282.        ready: function( fn ) {
  283.                // Attach the listeners
  284.                jQuery.bindReady();
  285.  
  286.                // Add the callback
  287.                readyList.done( fn );
  288.  
  289.                return this;
  290.        },
  291.  
  292.        eq: function( i ) {
  293.                return i === -1 ?
  294.                        this.slice( i ) :
  295.                        this.slice( i, +i + 1 );
  296.        },
  297.  
  298.        first: function() {
  299.                return this.eq( 0 );
  300.        },
  301.  
  302.        last: function() {
  303.                return this.eq( -1 );
  304.        },
  305.  
  306.        slice: function() {
  307.                return this.pushStack( slice.apply( this, arguments ),
  308.                        "slice", slice.call(arguments).join(",") );
  309.        },
  310.  
  311.        map: function( callback ) {
  312.                return this.pushStack( jQuery.map(this, function( elem, i ) {
  313.                        return callback.call( elem, i, elem );
  314.                }));
  315.        },
  316.  
  317.        end: function() {
  318.                return this.prevObject || this.constructor(null);
  319.        },
  320.  
  321.        // For internal use only.
  322.        // Behaves like an Array's method, not like a jQuery method.
  323.        push: push,
  324.        sort: [].sort,
  325.        splice: [].splice
  326.    };
  327.    // Give the init function the jQuery prototype for later instantiation
  328.    jQuery.fn.init.prototype = jQuery.fn;
  329.    jQuery.extend = jQuery.fn.extend = function() {
  330.        var options, name, src, copy, copyIsArray, clone,
  331.                target = arguments[0] || {},
  332.                i = 1,
  333.                length = arguments.length,
  334.                deep = false;
  335.        // Handle a deep copy situation
  336.        if ( typeof target === "boolean" ) {
  337.                deep = target;
  338.                target = arguments[1] || {};
  339.                // skip the boolean and the target
  340.                i = 2;
  341.        }
  342.        // Handle case when target is a string or something (possible in deep copy)
  343.        if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
  344.                target = {};
  345.        }
  346.        // extend jQuery itself if only one argument is passed
  347.        if ( length === i ) {
  348.                target = this;
  349.                --i;
  350.        }
  351.        for ( ; i < length; i++ ) {
  352.                // Only deal with non-null/undefined values
  353.                if ( (options = arguments[ i ]) != null ) {
  354.                        // Extend the base object
  355.                        for ( name in options ) {
  356.                                src = target[ name ];
  357.                                copy = options[ name ];
  358.                                // Prevent never-ending loop
  359.                                if ( target === copy ) {
  360.                                        continue;
  361.                                }
  362.                                // Recurse if we're merging plain objects or arrays
  363.                                if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
  364.                                        if ( copyIsArray ) {
  365.                                                copyIsArray = false;
  366.                                                clone = src && jQuery.isArray(src) ? src : [];
  367.  
  368.                                        } else {
  369.                                                clone = src && jQuery.isPlainObject(src) ? src : {};
  370.                                        }
  371.  
  372.                                        // Never move original objects, clone them
  373.                                        target[ name ] = jQuery.extend( deep, clone, copy );
  374.  
  375.                                // Don't bring in undefined values
  376.                                } else if ( copy !== undefined ) {
  377.                                        target[ name ] = copy;
  378.                                }
  379.                        }
  380.                }
  381.        }
  382.        // Return the modified object
  383.        return target;
  384.    };
  385.    jQuery.extend({
  386.        noConflict: function( deep ) {
  387.                if ( window.$ === jQuery ) {
  388.                        window.$ = _$;
  389.                }
  390.                if ( deep && window.jQuery === jQuery ) {
  391.                        window.jQuery = _jQuery;
  392.                }
  393.                return jQuery;
  394.        },
  395.        // Is the DOM ready to be used? Set to true once it occurs.
  396.        isReady: false,
  397.        // A counter to track how many items to wait for before
  398.        // the ready event fires. See #6781
  399.        readyWait: 1,
  400.        // Hold (or release) the ready event
  401.        holdReady: function( hold ) {
  402.                if ( hold ) {
  403.                        jQuery.readyWait++;
  404.                } else {
  405.                        jQuery.ready( true );
  406.                }
  407.        },
  408.        // Handle when the DOM is ready
  409.        ready: function( wait ) {
  410.                // Either a released hold or an DOMready/load event and not yet ready
  411.                if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
  412.                        // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  413.                        if ( !document.body ) {
  414.                                return setTimeout( jQuery.ready, 1 );
  415.                        }
  416.                        // Remember that the DOM is ready
  417.                        jQuery.isReady = true;
  418.                        // If a normal DOM Ready event fired, decrement, and wait if need be
  419.                        if ( wait !== true && --jQuery.readyWait > 0 ) {
  420.                                 return;
  421.                         }
  422.  
  423.                         // If there are functions bound, to execute
  424.                         readyList.resolveWith( document, [ jQuery ] );
  425.  
  426.                         // Trigger any bound ready events
  427.                         if ( jQuery.fn.trigger ) {
  428.                                 jQuery( document ).trigger( "ready" ).unbind( "ready" );
  429.                         }
  430.                 }
  431.         },
  432.  
  433.         bindReady: function() {
  434.                 if ( readyList ) {
  435.                         return;
  436.                 }
  437.  
  438.                 readyList = jQuery._Deferred();
  439.  
  440.                 // Catch cases where $(document).ready() is called after the
  441.                 // browser event has already occurred.
  442.                 if ( document.readyState === "complete" ) {
  443.                         // Handle it asynchronously to allow scripts the opportunity to delay ready
  444.                         return setTimeout( jQuery.ready, 1 );
  445.                 }
  446.  
  447.                 // Mozilla, Opera and webkit nightlies currently support this event
  448.                 if ( document.addEventListener ) {
  449.                         // Use the handy event callback
  450.                         document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  451.  
  452.                         // A fallback to window.onload, that will always work
  453.                         window.addEventListener( "load", jQuery.ready, false );
  454.  
  455.                 // If IE event model is used
  456.                 } else if ( document.attachEvent ) {
  457.                         // ensure firing before onload,
  458.                         // maybe late but safe also for iframes
  459.                         document.attachEvent( "onreadystatechange", DOMContentLoaded );
  460.  
  461.                         // A fallback to window.onload, that will always work
  462.                         window.attachEvent( "onload", jQuery.ready );
  463.  
  464.                         // If IE and not a frame
  465.                         // continually check to see if the document is ready
  466.                         var toplevel = false;
  467.  
  468.                         try {
  469.                                 toplevel = window.frameElement == null;
  470.                         } catch(e) {}
  471.  
  472.                         if ( document.documentElement.doScroll && toplevel ) {
  473.                                doScrollCheck();
  474.                         }
  475.                 }
  476.         },
  477.  
  478.         // See test/unit/core.js for details concerning isFunction.
  479.         // Since version 1.3, DOM methods and functions like alert
  480.         // aren't supported. They return false on IE (#2968).
  481.         isFunction: function( obj ) {
  482.                 return jQuery.type(obj) === "function";
  483.         },
  484.  
  485.         isArray: Array.isArray || function( obj ) {
  486.                 return jQuery.type(obj) === "array";
  487.         },
  488.  
  489.         // A crude way of determining if an object is a window
  490.         isWindow: function( obj ) {
  491.                 return obj && typeof obj === "object" && "setInterval" in obj;
  492.         },
  493.  
  494.         isNaN: function( obj ) {
  495.                 return obj == null || !rdigit.test( obj ) || isNaN( obj );
  496.         },
  497.  
  498.         type: function( obj ) {
  499.                 return obj == null ?
  500.                         String( obj ) :
  501.                         class2type[ toString.call(obj) ] || "object";
  502.         },
  503.  
  504.         isPlainObject: function( obj ) {
  505.                 // Must be an Object.
  506.                 // Because of IE, we also have to check the presence of the constructor property.
  507.                 // Make sure that DOM nodes and window objects don't pass through, as well
  508.                 if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  509.                         return false;
  510.                 }
  511.  
  512.                 try {
  513.                         // Not own constructor property must be Object
  514.                         if ( obj.constructor &&
  515.                                !hasOwn.call(obj, "constructor") &&
  516.                                !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
  517.                                return false;
  518.                         }
  519.                 } catch ( e ) {
  520.                         // IE8,9 Will throw exceptions on certain host objects #9897
  521.                         return false;
  522.                 }
  523.  
  524.                 // Own properties are enumerated firstly, so to speed up,
  525.                 // if last one is own, then all properties are own.
  526.  
  527.                 var key;
  528.                 for ( key in obj ) {}
  529.  
  530.                 return key === undefined || hasOwn.call( obj, key );
  531.         },
  532.  
  533.         isEmptyObject: function( obj ) {
  534.                 for ( var name in obj ) {
  535.                         return false;
  536.                 }
  537.                 return true;
  538.         },
  539.  
  540.         error: function( msg ) {
  541.                 throw msg;
  542.         },
  543.  
  544.         parseJSON: function( data ) {
  545.                 if ( typeof data !== "string" || !data ) {
  546.                         return null;
  547.                 }
  548.  
  549.                 // Make sure leading/trailing whitespace is removed (IE can't handle it)
  550.                 data = jQuery.trim( data );
  551.  
  552.                 // Attempt to parse using the native JSON parser first
  553.                 if ( window.JSON && window.JSON.parse ) {
  554.                        return window.JSON.parse( data );
  555.                 }
  556.  
  557.                 // Make sure the incoming data is actual JSON
  558.                 // Logic borrowed from http://json.org/json2.js
  559.                 if ( rvalidchars.test( data.replace( rvalidescape, "@" )
  560.                         .replace( rvalidtokens, "]" )
  561.                         .replace( rvalidbraces, "")) ) {
  562.  
  563.                         return (new Function( "return " + data ))();
  564.  
  565.                 }
  566.                 jQuery.error( "Invalid JSON: " + data );
  567.         },
  568.  
  569.         // Cross-browser xml parsing
  570.         parseXML: function( data ) {
  571.                 var xml, tmp;
  572.                 try {
  573.                         if ( window.DOMParser ) { // Standard
  574.                                 tmp = new DOMParser();
  575.                                 xml = tmp.parseFromString( data , "text/xml" );
  576.                         } else { // IE
  577.                                 xml = new ActiveXObject( "Microsoft.XMLDOM" );
  578.                                 xml.async = "false";
  579.                                 xml.loadXML( data );
  580.                         }
  581.                 } catch( e ) {
  582.                         xml = undefined;
  583.                 }
  584.                 if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
  585.                         jQuery.error( "Invalid XML: " + data );
  586.                 }
  587.                 return xml;
  588.         },
  589.  
  590.         noop: function() {},
  591.  
  592.         // Evaluates a script in a global context
  593.         // Workarounds based on findings by Jim Driscoll
  594.         // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
  595.         globalEval: function( data ) {
  596.                 if ( data && rnotwhite.test( data ) ) {
  597.                        // We use execScript on Internet Explorer
  598.                        // We use an anonymous function so that context is window
  599.                        // rather than jQuery in Firefox
  600.                        ( window.execScript || function( data ) {
  601.                                window[ "eval" ].call( window, data );
  602.                         } )( data );
  603.                 }
  604.         },
  605.  
  606.         // Convert dashed to camelCase; used by the css and data modules
  607.         // Microsoft forgot to hump their vendor prefix (#9572)
  608.         camelCase: function( string ) {
  609.                 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  610.         },
  611.  
  612.         nodeName: function( elem, name ) {
  613.                 return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
  614.         },
  615.  
  616.         // args is for internal usage only
  617.         each: function( object, callback, args ) {
  618.                 var name, i = 0,
  619.                         length = object.length,
  620.                         isObj = length === undefined || jQuery.isFunction( object );
  621.  
  622.                 if ( args ) {
  623.                         if ( isObj ) {
  624.                                 for ( name in object ) {
  625.                                         if ( callback.apply( object[ name ], args ) === false ) {
  626.                                                 break;
  627.                                         }
  628.                                 }
  629.                         } else {
  630.                                 for ( ; i < length; ) {
  631.                                        if ( callback.apply( object[ i++ ], args ) === false ) {
  632.                                                break;
  633.                                        }
  634.                                }
  635.                        }
  636.  
  637.                // A special, fast, case for the most common use of each
  638.                } else {
  639.                        if ( isObj ) {
  640.                                for ( name in object ) {
  641.                                        if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
  642.                                                break;
  643.                                        }
  644.                                }
  645.                        } else {
  646.                                for ( ; i < length; ) {
  647.                                        if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
  648.                                                break;
  649.                                        }
  650.                                }
  651.                        }
  652.                }
  653.  
  654.                return object;
  655.        },
  656.  
  657.        // Use native String.trim function wherever possible
  658.        trim: trim ?
  659.                function( text ) {
  660.                        return text == null ?
  661.                                "" :
  662.                                trim.call( text );
  663.                } :
  664.  
  665.                // Otherwise use our own trimming functionality
  666.                function( text ) {
  667.                        return text == null ?
  668.                                "" :
  669.                                text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
  670.                },
  671.  
  672.        // results is for internal usage only
  673.        makeArray: function( array, results ) {
  674.                var ret = results || [];
  675.  
  676.                if ( array != null ) {
  677.                        // The window, strings (and functions) also have 'length'
  678.                        // The extra typeof function check is to prevent crashes
  679.                        // in Safari 2 (See: #3039)
  680.                        // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
  681.                        var type = jQuery.type( array );
  682.  
  683.                        if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
  684.                                push.call( ret, array );
  685.                        } else {
  686.                                jQuery.merge( ret, array );
  687.                        }
  688.                }
  689.  
  690.                return ret;
  691.        },
  692.  
  693.        inArray: function( elem, array ) {
  694.                if ( !array ) {
  695.                        return -1;
  696.                }
  697.  
  698.                if ( indexOf ) {
  699.                        return indexOf.call( array, elem );
  700.                }
  701.  
  702.                for ( var i = 0, length = array.length; i < length; i++ ) {
  703.                        if ( array[ i ] === elem ) {
  704.                                return i;
  705.                        }
  706.                }
  707.  
  708.                return -1;
  709.        },
  710.  
  711.        merge: function( first, second ) {
  712.                var i = first.length,
  713.                        j = 0;
  714.  
  715.                if ( typeof second.length === "number" ) {
  716.                        for ( var l = second.length; j < l; j++ ) {
  717.                                first[ i++ ] = second[ j ];
  718.                        }
  719.  
  720.                } else {
  721.                        while ( second[j] !== undefined ) {
  722.                                first[ i++ ] = second[ j++ ];
  723.                        }
  724.                }
  725.  
  726.                first.length = i;
  727.  
  728.                return first;
  729.        },
  730.  
  731.        grep: function( elems, callback, inv ) {
  732.                var ret = [], retVal;
  733.                inv = !!inv;
  734.  
  735.                // Go through the array, only saving the items
  736.                // that pass the validator function
  737.                for ( var i = 0, length = elems.length; i < length; i++ ) {
  738.                        retVal = !!callback( elems[ i ], i );
  739.                        if ( inv !== retVal ) {
  740.                                ret.push( elems[ i ] );
  741.                        }
  742.                }
  743.  
  744.                return ret;
  745.        },
  746.  
  747.        // arg is for internal usage only
  748.        map: function( elems, callback, arg ) {
  749.                var value, key, ret = [],
  750.                        i = 0,
  751.                        length = elems.length,
  752.                        // jquery objects are treated as arrays
  753.                        isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
  754.  
  755.                 // Go through the array, translating each of the items to their
  756.                 if ( isArray ) {
  757.                         for ( ; i < length; i++ ) {
  758.                                value = callback( elems[ i ], i, arg );
  759.  
  760.                                if ( value != null ) {
  761.                                        ret[ ret.length ] = value;
  762.                                }
  763.                        }
  764.  
  765.                // Go through every key on the object,
  766.                } else {
  767.                        for ( key in elems ) {
  768.                                value = callback( elems[ key ], key, arg );
  769.  
  770.                                if ( value != null ) {
  771.                                        ret[ ret.length ] = value;
  772.                                }
  773.                        }
  774.                }
  775.  
  776.                // Flatten any nested arrays
  777.                return ret.concat.apply( [], ret );
  778.        },
  779.  
  780.        // A global GUID counter for objects
  781.        guid: 1,
  782.  
  783.        // Bind a function to a context, optionally partially applying any
  784.        // arguments.
  785.        proxy: function( fn, context ) {
  786.                if ( typeof context === "string" ) {
  787.                        var tmp = fn[ context ];
  788.                        context = fn;
  789.                        fn = tmp;
  790.                }
  791.  
  792.                // Quick check to determine if target is callable, in the spec
  793.                // this throws a TypeError, but we will just return undefined.
  794.                if ( !jQuery.isFunction( fn ) ) {
  795.                        return undefined;
  796.                }
  797.  
  798.                // Simulated bind
  799.                var args = slice.call( arguments, 2 ),
  800.                        proxy = function() {
  801.                                return fn.apply( context, args.concat( slice.call( arguments ) ) );
  802.                        };
  803.  
  804.                // Set the guid of unique handler to the same of original handler, so it can be removed
  805.                proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
  806.  
  807.                return proxy;
  808.        },
  809.  
  810.        // Mutifunctional method to get and set values to a collection
  811.        // The value/s can optionally be executed if it's a function
  812.        access: function( elems, key, value, exec, fn, pass ) {
  813.                var length = elems.length;
  814.                // Setting many attributes
  815.                if ( typeof key === "object" ) {
  816.                        for ( var k in key ) {
  817.                                jQuery.access( elems, k, key[k], exec, fn, value );
  818.                        }
  819.                        return elems;
  820.                }
  821.                // Setting one attribute
  822.                if ( value !== undefined ) {
  823.                        // Optionally, function values get executed if exec is true
  824.                        exec = !pass && exec && jQuery.isFunction(value);
  825.                        for ( var i = 0; i < length; i++ ) {
  826.                                fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
  827.                        }
  828.                        return elems;
  829.                }
  830.                // Getting an attribute
  831.                return length ? fn( elems[0], key ) : undefined;
  832.        },
  833.        now: function() {
  834.                return (new Date()).getTime();
  835.        },
  836.        // Use of jQuery.browser is frowned upon.
  837.        // More details: http://docs.jquery.com/Utilities/jQuery.browser
  838.        uaMatch: function( ua ) {
  839.                ua = ua.toLowerCase();
  840.                var match = rwebkit.exec( ua ) ||
  841.                        ropera.exec( ua ) ||
  842.                        rmsie.exec( ua ) ||
  843.                        ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
  844.                        [];
  845.                return { browser: match[1] || "", version: match[2] || "0" };
  846.        },
  847.        sub: function() {
  848.                function jQuerySub( selector, context ) {
  849.                        return new jQuerySub.fn.init( selector, context );
  850.                }
  851.                jQuery.extend( true, jQuerySub, this );
  852.                jQuerySub.superclass = this;
  853.                jQuerySub.fn = jQuerySub.prototype = this();
  854.                jQuerySub.fn.constructor = jQuerySub;
  855.                jQuerySub.sub = this.sub;
  856.                jQuerySub.fn.init = function init( selector, context ) {
  857.                        if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
  858.                                context = jQuerySub( context );
  859.                        }
  860.                        return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
  861.                };
  862.                jQuerySub.fn.init.prototype = jQuerySub.fn;
  863.                var rootjQuerySub = jQuerySub(document);
  864.                return jQuerySub;
  865.        },
  866.        browser: {}
  867.    });
  868.    // Populate the class2type map
  869.    jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
  870.        class2type[ "[object " + name + "]" ] = name.toLowerCase();
  871.    });
  872.    browserMatch = jQuery.uaMatch( userAgent );
  873.    if ( browserMatch.browser ) {
  874.        jQuery.browser[ browserMatch.browser ] = true;
  875.        jQuery.browser.version = browserMatch.version;
  876.    }
  877.    // Deprecated, use jQuery.browser.webkit instead
  878.    if ( jQuery.browser.webkit ) {
  879.        jQuery.browser.safari = true;
  880.    }
  881.    // IE doesn't match non-breaking spaces with \s
  882.    if ( rnotwhite.test( "\xA0" ) ) {
  883.        trimLeft = /^[\s\xA0]+/;
  884.        trimRight = /[\s\xA0]+$/;
  885.    }
  886.  
  887.    // All jQuery objects should point back to these
  888.    rootjQuery = jQuery(document);
  889.  
  890.    // Cleanup functions for the document ready method
  891.    if ( document.addEventListener ) {
  892.        DOMContentLoaded = function() {
  893.                document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  894.                jQuery.ready();
  895.        };
  896.  
  897.    } else if ( document.attachEvent ) {
  898.        DOMContentLoaded = function() {
  899.                // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  900.                if ( document.readyState === "complete" ) {
  901.                        document.detachEvent( "onreadystatechange", DOMContentLoaded );
  902.                        jQuery.ready();
  903.                }
  904.        };
  905.    }
  906.  
  907.    // The DOM ready check for Internet Explorer
  908.    function doScrollCheck() {
  909.        if ( jQuery.isReady ) {
  910.                return;
  911.        }
  912.  
  913.        try {
  914.                // If IE is used, use the trick by Diego Perini
  915.                // http://javascript.nwbox.com/IEContentLoaded/
  916.                document.documentElement.doScroll("left");
  917.        } catch(e) {
  918.                setTimeout( doScrollCheck, 1 );
  919.                return;
  920.        }
  921.  
  922.        // and execute any waiting functions
  923.        jQuery.ready();
  924.    }
  925.  
  926.    return jQuery;
  927.  
  928.    })();
  929.  
  930.  
  931.    var // Promise methods
  932.        promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
  933.        // Static reference to slice
  934.        sliceDeferred = [].slice;
  935.  
  936.    jQuery.extend({
  937.        // Create a simple deferred (one callbacks list)
  938.        _Deferred: function() {
  939.                var // callbacks list
  940.                        callbacks = [],
  941.                        // stored [ context , args ]
  942.                        fired,
  943.                        // to avoid firing when already doing so
  944.                        firing,
  945.                        // flag to know if the deferred has been cancelled
  946.                        cancelled,
  947.                        // the deferred itself
  948.                        deferred  = {
  949.  
  950.                                // done( f1, f2, ...)
  951.                                done: function() {
  952.                                        if ( !cancelled ) {
  953.                                                var args = arguments,
  954.                                                        i,
  955.                                                        length,
  956.                                                        elem,
  957.                                                        type,
  958.                                                        _fired;
  959.                                                if ( fired ) {
  960.                                                        _fired = fired;
  961.                                                        fired = 0;
  962.                                                }
  963.                                                for ( i = 0, length = args.length; i < length; i++ ) {
  964.                                                        elem = args[ i ];
  965.                                                        type = jQuery.type( elem );
  966.                                                        if ( type === "array" ) {
  967.                                                                deferred.done.apply( deferred, elem );
  968.                                                        } else if ( type === "function" ) {
  969.                                                                callbacks.push( elem );
  970.                                                        }
  971.                                                }
  972.                                                if ( _fired ) {
  973.                                                        deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
  974.                                                }
  975.                                        }
  976.                                        return this;
  977.                                },
  978.  
  979.                                // resolve with given context and args
  980.                                resolveWith: function( context, args ) {
  981.                                        if ( !cancelled && !fired && !firing ) {
  982.                                                // make sure args are available (#8421)
  983.                                                args = args || [];
  984.                                                firing = 1;
  985.                                                try {
  986.                                                        while( callbacks[ 0 ] ) {
  987.                                                                callbacks.shift().apply( context, args );
  988.                                                        }
  989.                                                }
  990.                                                finally {
  991.                                                        fired = [ context, args ];
  992.                                                        firing = 0;
  993.                                                }
  994.                                        }
  995.                                        return this;
  996.                                },
  997.  
  998.                                // resolve with this as context and given arguments
  999.                                resolve: function() {
  1000.                                        deferred.resolveWith( this, arguments );
  1001.                                        return this;
  1002.                                },
  1003.  
  1004.                                // Has this deferred been resolved?
  1005.                                isResolved: function() {
  1006.                                        return !!( firing || fired );
  1007.                                },
  1008.  
  1009.                                // Cancel
  1010.                                cancel: function() {
  1011.                                        cancelled = 1;
  1012.                                        callbacks = [];
  1013.                                        return this;
  1014.                                }
  1015.                        };
  1016.  
  1017.                return deferred;
  1018.        },
  1019.  
  1020.        // Full fledged deferred (two callbacks list)
  1021.        Deferred: function( func ) {
  1022.                var deferred = jQuery._Deferred(),
  1023.                        failDeferred = jQuery._Deferred(),
  1024.                        promise;
  1025.                // Add errorDeferred methods, then and promise
  1026.                jQuery.extend( deferred, {
  1027.                        then: function( doneCallbacks, failCallbacks ) {
  1028.                                deferred.done( doneCallbacks ).fail( failCallbacks );
  1029.                                return this;
  1030.                        },
  1031.                        always: function() {
  1032.                                return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments );
  1033.                        },
  1034.                        fail: failDeferred.done,
  1035.                        rejectWith: failDeferred.resolveWith,
  1036.                        reject: failDeferred.resolve,
  1037.                        isRejected: failDeferred.isResolved,
  1038.                        pipe: function( fnDone, fnFail ) {
  1039.                                return jQuery.Deferred(function( newDefer ) {
  1040.                                        jQuery.each( {
  1041.                                                done: [ fnDone, "resolve" ],
  1042.                                                fail: [ fnFail, "reject" ]
  1043.                                        }, function( handler, data ) {
  1044.                                                var fn = data[ 0 ],
  1045.                                                        action = data[ 1 ],
  1046.                                                        returned;
  1047.                                                if ( jQuery.isFunction( fn ) ) {
  1048.                                                        deferred[ handler ](function() {
  1049.                                                                returned = fn.apply( this, arguments );
  1050.                                                                if ( returned && jQuery.isFunction( returned.promise ) ) {
  1051.                                                                        returned.promise().then( newDefer.resolve, newDefer.reject );
  1052.                                                                } else {
  1053.                                                                        newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
  1054.                                                                }
  1055.                                                        });
  1056.                                                } else {
  1057.                                                        deferred[ handler ]( newDefer[ action ] );
  1058.                                                }
  1059.                                        });
  1060.                                }).promise();
  1061.                        },
  1062.                        // Get a promise for this deferred
  1063.                        // If obj is provided, the promise aspect is added to the object
  1064.                        promise: function( obj ) {
  1065.                                if ( obj == null ) {
  1066.                                        if ( promise ) {
  1067.                                                return promise;
  1068.                                        }
  1069.                                        promise = obj = {};
  1070.                                }
  1071.                                var i = promiseMethods.length;
  1072.                                while( i-- ) {
  1073.                                        obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
  1074.                                }
  1075.                                return obj;
  1076.                        }
  1077.                });
  1078.                // Make sure only one callback list will be used
  1079.                deferred.done( failDeferred.cancel ).fail( deferred.cancel );
  1080.                // Unexpose cancel
  1081.                delete deferred.cancel;
  1082.                // Call given func if any
  1083.                if ( func ) {
  1084.                        func.call( deferred, deferred );
  1085.                }
  1086.                return deferred;
  1087.        },
  1088.  
  1089.        // Deferred helper
  1090.        when: function( firstParam ) {
  1091.                var args = arguments,
  1092.                        i = 0,
  1093.                        length = args.length,
  1094.                        count = length,
  1095.                        deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
  1096.                                firstParam :
  1097.                                jQuery.Deferred();
  1098.                function resolveFunc( i ) {
  1099.                        return function( value ) {
  1100.                                args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
  1101.                                 if ( !( --count ) ) {
  1102.                                         // Strange bug in FF4:
  1103.                                         // Values changed onto the arguments object sometimes end up as undefined values
  1104.                                         // outside the $.when method. Cloning the object into a fresh array solves the issue
  1105.                                         deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
  1106.                                 }
  1107.                         };
  1108.                 }
  1109.                 if ( length > 1 ) {
  1110.                         for( ; i < length; i++ ) {
  1111.                                if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
  1112.                                        args[ i ].promise().then( resolveFunc(i), deferred.reject );
  1113.                                } else {
  1114.                                        --count;
  1115.                                }
  1116.                        }
  1117.                        if ( !count ) {
  1118.                                deferred.resolveWith( deferred, args );
  1119.                        }
  1120.                } else if ( deferred !== firstParam ) {
  1121.                        deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
  1122.                }
  1123.                return deferred.promise();
  1124.        }
  1125.    });
  1126.  
  1127.  
  1128.  
  1129.    jQuery.support = (function() {
  1130.  
  1131.        var div = document.createElement( "div" ),
  1132.                documentElement = document.documentElement,
  1133.                all,
  1134.                a,
  1135.                select,
  1136.                opt,
  1137.                input,
  1138.                marginDiv,
  1139.                support,
  1140.                fragment,
  1141.                body,
  1142.                testElementParent,
  1143.                testElement,
  1144.                testElementStyle,
  1145.                tds,
  1146.                events,
  1147.                eventName,
  1148.                i,
  1149.                isSupported;
  1150.  
  1151.        // Preliminary tests
  1152.        div.setAttribute("className", "t");
  1153.        div.innerHTML = "   <link/><table><\/table><a href='/a' style='top:1px;float:left;opacity:.55;'>a<\/a><input type='checkbox'/>";
  1154.  
  1155.  
  1156.         all = div.getElementsByTagName( "*" );
  1157.         a = div.getElementsByTagName( "a" )[ 0 ];
  1158.  
  1159.         // Can't get basic test support
  1160.         if ( !all || !all.length || !a ) {
  1161.                 return {};
  1162.         }
  1163.  
  1164.         // First batch of supports tests
  1165.         select = document.createElement( "select" );
  1166.         opt = select.appendChild( document.createElement("option") );
  1167.         input = div.getElementsByTagName( "input" )[ 0 ];
  1168.  
  1169.         support = {
  1170.                 // IE strips leading whitespace when .innerHTML is used
  1171.                 leadingWhitespace: ( div.firstChild.nodeType === 3 ),
  1172.  
  1173.                 // Make sure that tbody elements aren't automatically inserted
  1174.                 // IE will insert them into empty tables
  1175.                 tbody: !div.getElementsByTagName( "tbody" ).length,
  1176.  
  1177.                 // Make sure that link elements get serialized correctly by innerHTML
  1178.                 // This requires a wrapper element in IE
  1179.                 htmlSerialize: !!div.getElementsByTagName( "link" ).length,
  1180.  
  1181.                 // Get the style information from getAttribute
  1182.                 // (IE uses .cssText instead)
  1183.                 style: /top/.test( a.getAttribute("style") ),
  1184.  
  1185.                 // Make sure that URLs aren't manipulated
  1186.                 // (IE normalizes it by default)
  1187.                 hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
  1188.  
  1189.                 // Make sure that element opacity exists
  1190.                 // (IE uses filter instead)
  1191.                 // Use a regex to work around a WebKit issue. See #5145
  1192.                 opacity: /^0.55$/.test( a.style.opacity ),
  1193.  
  1194.                 // Verify style float existence
  1195.                 // (IE uses styleFloat instead of cssFloat)
  1196.                 cssFloat: !!a.style.cssFloat,
  1197.  
  1198.                 // Make sure that if no value is specified for a checkbox
  1199.                 // that it defaults to "on".
  1200.                 // (WebKit defaults to "" instead)
  1201.                 checkOn: ( input.value === "on" ),
  1202.  
  1203.                 // Make sure that a selected-by-default option has a working selected property.
  1204.                 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
  1205.                 optSelected: opt.selected,
  1206.  
  1207.                 // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
  1208.                 getSetAttribute: div.className !== "t",
  1209.  
  1210.                 // Will be defined later
  1211.                 submitBubbles: true,
  1212.                 changeBubbles: true,
  1213.                 focusinBubbles: false,
  1214.                 deleteExpando: true,
  1215.                 noCloneEvent: true,
  1216.                 inlineBlockNeedsLayout: false,
  1217.                 shrinkWrapBlocks: false,
  1218.                 reliableMarginRight: true
  1219.         };
  1220.  
  1221.         // Make sure checked status is properly cloned
  1222.         input.checked = true;
  1223.         support.noCloneChecked = input.cloneNode( true ).checked;
  1224.  
  1225.         // Make sure that the options inside disabled selects aren't marked as disabled
  1226.         // (WebKit marks them as disabled)
  1227.         select.disabled = true;
  1228.         support.optDisabled = !opt.disabled;
  1229.  
  1230.         // Test to see if it's possible to delete an expando from an element
  1231.         // Fails in Internet Explorer
  1232.         try {
  1233.                 delete div.test;
  1234.         } catch( e ) {
  1235.                 support.deleteExpando = false;
  1236.         }
  1237.  
  1238.         if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
  1239.                div.attachEvent( "onclick", function() {
  1240.                        // Cloning a node shouldn't copy over any
  1241.                        // bound event handlers (IE does this)
  1242.                        support.noCloneEvent = false;
  1243.                 });
  1244.                 div.cloneNode( true ).fireEvent( "onclick" );
  1245.         }
  1246.  
  1247.         // Check if a radio maintains it's value
  1248.         // after being appended to the DOM
  1249.         input = document.createElement("input");
  1250.         input.value = "t";
  1251.         input.setAttribute("type", "radio");
  1252.         support.radioValue = input.value === "t";
  1253.  
  1254.         input.setAttribute("checked", "checked");
  1255.         div.appendChild( input );
  1256.         fragment = document.createDocumentFragment();
  1257.         fragment.appendChild( div.firstChild );
  1258.  
  1259.         // WebKit doesn't clone checked state correctly in fragments
  1260.         support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
  1261.  
  1262.         div.innerHTML = "";
  1263.  
  1264.         // Figure out if the W3C box model works as expected
  1265.         div.style.width = div.style.paddingLeft = "1px";
  1266.  
  1267.         body = document.getElementsByTagName( "body" )[ 0 ];
  1268.         // We use our own, invisible, body unless the body is already present
  1269.         // in which case we use a div (#9239)
  1270.         testElement = document.createElement( body ? "div" : "body" );
  1271.         testElementStyle = {
  1272.                 visibility: "hidden",
  1273.                 width: 0,
  1274.                 height: 0,
  1275.                 border: 0,
  1276.                 margin: 0,
  1277.                 background: "none"
  1278.         };
  1279.         if ( body ) {
  1280.                 jQuery.extend( testElementStyle, {
  1281.                         position: "absolute",
  1282.                         left: "-1000px",
  1283.                         top: "-1000px"
  1284.                 });
  1285.         }
  1286.         for ( i in testElementStyle ) {
  1287.                 testElement.style[ i ] = testElementStyle[ i ];
  1288.         }
  1289.         testElement.appendChild( div );
  1290.         testElementParent = body || documentElement;
  1291.         testElementParent.insertBefore( testElement, testElementParent.firstChild );
  1292.  
  1293.         // Check if a disconnected checkbox will retain its checked
  1294.         // value of true after appended to the DOM (IE6/7)
  1295.         support.appendChecked = input.checked;
  1296.  
  1297.         support.boxModel = div.offsetWidth === 2;
  1298.  
  1299.         if ( "zoom" in div.style ) {
  1300.                 // Check if natively block-level elements act like inline-block
  1301.                 // elements when setting their display to 'inline' and giving
  1302.                 // them layout
  1303.                 // (IE < 8 does this)
  1304.                div.style.display = "inline";
  1305.                div.style.zoom = 1;
  1306.                support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
  1307.  
  1308.                // Check if elements with layout shrink-wrap their children
  1309.                // (IE 6 does this)
  1310.                div.style.display = "";
  1311.                div.innerHTML = "<div style='width:4px;'><\/div>";
  1312.                 support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
  1313.         }
  1314.  
  1315.         div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'><\/td><td>t<\/td><\/tr><\/table>";
  1316.         tds = div.getElementsByTagName( "td" );
  1317.  
  1318.         // Check if table cells still have offsetWidth/Height when they are set
  1319.         // to display:none and there are still other visible table cells in a
  1320.         // table row; if so, offsetWidth/Height are not reliable for use when
  1321.         // determining if an element has been hidden directly using
  1322.         // display:none (it is still safe to use offsets if a parent element is
  1323.         // hidden; don safety goggles and see bug #4512 for more information).
  1324.         // (only IE 8 fails this test)
  1325.         isSupported = ( tds[ 0 ].offsetHeight === 0 );
  1326.  
  1327.         tds[ 0 ].style.display = "";
  1328.         tds[ 1 ].style.display = "none";
  1329.  
  1330.         // Check if empty table cells still have offsetWidth/Height
  1331.         // (IE < 8 fail this test)
  1332.        support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
  1333.        div.innerHTML = "";
  1334.  
  1335.        // Check if div with explicit width and no margin-right incorrectly
  1336.        // gets computed margin-right based on width of container. For more
  1337.        // info see bug #3333
  1338.        // Fails in WebKit before Feb 2011 nightlies
  1339.        // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  1340.        if ( document.defaultView && document.defaultView.getComputedStyle ) {
  1341.                marginDiv = document.createElement( "div" );
  1342.                marginDiv.style.width = "0";
  1343.                marginDiv.style.marginRight = "0";
  1344.                div.appendChild( marginDiv );
  1345.                support.reliableMarginRight =
  1346.                        ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
  1347.        }
  1348.  
  1349.        // Remove the body element we added
  1350.        testElement.innerHTML = "";
  1351.        testElementParent.removeChild( testElement );
  1352.  
  1353.        // Technique from Juriy Zaytsev
  1354.        // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
  1355.        // We only care about the case where non-standard event systems
  1356.        // are used, namely in IE. Short-circuiting here helps us to
  1357.        // avoid an eval call (in setAttribute) which can cause CSP
  1358.        // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
  1359.        if ( div.attachEvent ) {
  1360.                for( i in {
  1361.                        submit: 1,
  1362.                        change: 1,
  1363.                        focusin: 1
  1364.                } ) {
  1365.                        eventName = "on" + i;
  1366.                        isSupported = ( eventName in div );
  1367.                        if ( !isSupported ) {
  1368.                                div.setAttribute( eventName, "return;" );
  1369.                                isSupported = ( typeof div[ eventName ] === "function" );
  1370.                        }
  1371.                        support[ i + "Bubbles" ] = isSupported;
  1372.                }
  1373.        }
  1374.  
  1375.        // Null connected elements to avoid leaks in IE
  1376.        testElement = fragment = select = opt = body = marginDiv = div = input = null;
  1377.  
  1378.        return support;
  1379.    })();
  1380.  
  1381.    // Keep track of boxModel
  1382.    jQuery.boxModel = jQuery.support.boxModel;
  1383.  
  1384.  
  1385.  
  1386.  
  1387.    var rbrace = /^(?:\{.*\}|\[.*\])$/,
  1388.        rmultiDash = /([A-Z])/g;
  1389.  
  1390.    jQuery.extend({
  1391.        cache: {},
  1392.  
  1393.        // Please use with caution
  1394.        uuid: 0,
  1395.  
  1396.        // Unique for each copy of jQuery on the page
  1397.        // Non-digits removed to match rinlinejQuery
  1398.        expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
  1399.  
  1400.        // The following elements throw uncatchable exceptions if you
  1401.        // attempt to add expando properties to them.
  1402.        noData: {
  1403.                "embed": true,
  1404.                // Ban all objects except for Flash (which handle expandos)
  1405.                "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
  1406.                "applet": true
  1407.        },
  1408.  
  1409.        hasData: function( elem ) {
  1410.                elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
  1411.  
  1412.                return !!elem && !isEmptyDataObject( elem );
  1413.        },
  1414.  
  1415.        data: function( elem, name, data, pvt /* Internal Use Only */ ) {
  1416.                if ( !jQuery.acceptData( elem ) ) {
  1417.                        return;
  1418.                }
  1419.  
  1420.                var thisCache, ret,
  1421.                        internalKey = jQuery.expando,
  1422.                        getByName = typeof name === "string",
  1423.  
  1424.                        // We have to handle DOM nodes and JS objects differently because IE6-7
  1425.                        // can't GC object references properly across the DOM-JS boundary
  1426.                        isNode = elem.nodeType,
  1427.                        // Only DOM nodes need the global jQuery cache; JS object data is
  1428.                        // attached directly to the object so GC can occur automatically
  1429.                        cache = isNode ? jQuery.cache : elem,
  1430.                        // Only defining an ID for JS objects if its cache already exists allows
  1431.                        // the code to shortcut on the same path as a DOM node with no cache
  1432.                        id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
  1433.                // Avoid doing any more work than we need to when trying to get data on an
  1434.                // object that has no data at all
  1435.                if ( (!id || (pvt && id && (cache[ id ] && !cache[ id ][ internalKey ]))) && getByName && data === undefined ) {
  1436.                        return;
  1437.                }
  1438.                if ( !id ) {
  1439.                        // Only DOM nodes need a new unique ID for each element since their data
  1440.                        // ends up in the global cache
  1441.                        if ( isNode ) {
  1442.                                elem[ jQuery.expando ] = id = ++jQuery.uuid;
  1443.                        } else {
  1444.                                id = jQuery.expando;
  1445.                        }
  1446.                }
  1447.                if ( !cache[ id ] ) {
  1448.                        cache[ id ] = {};
  1449.                        // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
  1450.                        // metadata on plain JS objects when the object is serialized using
  1451.                        // JSON.stringify
  1452.                        if ( !isNode ) {
  1453.                                cache[ id ].toJSON = jQuery.noop;
  1454.                        }
  1455.                }
  1456.                // An object can be passed to jQuery.data instead of a key/value pair; this gets
  1457.                // shallow copied over onto the existing cache
  1458.                if ( typeof name === "object" || typeof name === "function" ) {
  1459.                        if ( pvt ) {
  1460.                                cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
  1461.                        } else {
  1462.                                cache[ id ] = jQuery.extend(cache[ id ], name);
  1463.                        }
  1464.                }
  1465.                thisCache = cache[ id ];
  1466.                // Internal jQuery data is stored in a separate object inside the object's data
  1467.                // cache in order to avoid key collisions between internal data and user-defined
  1468.                // data
  1469.                if ( pvt ) {
  1470.                        if ( !thisCache[ internalKey ] ) {
  1471.                                thisCache[ internalKey ] = {};
  1472.                        }
  1473.  
  1474.                        thisCache = thisCache[ internalKey ];
  1475.                }
  1476.  
  1477.                if ( data !== undefined ) {
  1478.                        thisCache[ jQuery.camelCase( name ) ] = data;
  1479.                }
  1480.  
  1481.                // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
  1482.                // not attempt to inspect the internal events object using jQuery.data, as this
  1483.                // internal data object is undocumented and subject to change.
  1484.                if ( name === "events" && !thisCache[name] ) {
  1485.                        return thisCache[ internalKey ] && thisCache[ internalKey ].events;
  1486.                }
  1487.  
  1488.                // Check for both converted-to-camel and non-converted data property names
  1489.                // If a data property was specified
  1490.                if ( getByName ) {
  1491.  
  1492.                        // First Try to find as-is property data
  1493.                        ret = thisCache[ name ];
  1494.  
  1495.                        // Test for null|undefined property data
  1496.                        if ( ret == null ) {
  1497.  
  1498.                                // Try to find the camelCased property
  1499.                                ret = thisCache[ jQuery.camelCase( name ) ];
  1500.                        }
  1501.                } else {
  1502.                        ret = thisCache;
  1503.                }
  1504.  
  1505.                return ret;
  1506.        },
  1507.  
  1508.        removeData: function( elem, name, pvt /* Internal Use Only */ ) {
  1509.                if ( !jQuery.acceptData( elem ) ) {
  1510.                        return;
  1511.                }
  1512.  
  1513.                var thisCache,
  1514.  
  1515.                        // Reference to internal data cache key
  1516.                        internalKey = jQuery.expando,
  1517.  
  1518.                        isNode = elem.nodeType,
  1519.  
  1520.                        // See jQuery.data for more information
  1521.                        cache = isNode ? jQuery.cache : elem,
  1522.  
  1523.                        // See jQuery.data for more information
  1524.                        id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
  1525.  
  1526.                // If there is already no cache entry for this object, there is no
  1527.                // purpose in continuing
  1528.                if ( !cache[ id ] ) {
  1529.                        return;
  1530.                }
  1531.  
  1532.                if ( name ) {
  1533.  
  1534.                        thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
  1535.  
  1536.                        if ( thisCache ) {
  1537.  
  1538.                                // Support interoperable removal of hyphenated or camelcased keys
  1539.                                if ( !thisCache[ name ] ) {
  1540.                                        name = jQuery.camelCase( name );
  1541.                                }
  1542.  
  1543.                                delete thisCache[ name ];
  1544.  
  1545.                                // If there is no data left in the cache, we want to continue
  1546.                                // and let the cache object itself get destroyed
  1547.                                if ( !isEmptyDataObject(thisCache) ) {
  1548.                                        return;
  1549.                                }
  1550.                        }
  1551.                }
  1552.  
  1553.                // See jQuery.data for more information
  1554.                if ( pvt ) {
  1555.                        delete cache[ id ][ internalKey ];
  1556.  
  1557.                        // Don't destroy the parent cache unless the internal data object
  1558.                        // had been the only thing left in it
  1559.                        if ( !isEmptyDataObject(cache[ id ]) ) {
  1560.                                return;
  1561.                        }
  1562.                }
  1563.                var internalCache = cache[ id ][ internalKey ];
  1564.                // Browsers that fail expando deletion also refuse to delete expandos on
  1565.                // the window, but it will allow it on all other JS objects; other browsers
  1566.                // don't care
  1567.                // Ensure that `cache` is not a window object #10080
  1568.                if ( jQuery.support.deleteExpando || !cache.setInterval ) {
  1569.                        delete cache[ id ];
  1570.                } else {
  1571.                        cache[ id ] = null;
  1572.                }
  1573.  
  1574.                // We destroyed the entire user cache at once because it's faster than
  1575.                // iterating through each key, but we need to continue to persist internal
  1576.                // data if it existed
  1577.                if ( internalCache ) {
  1578.                        cache[ id ] = {};
  1579.                        // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
  1580.                        // metadata on plain JS objects when the object is serialized using
  1581.                        // JSON.stringify
  1582.                        if ( !isNode ) {
  1583.                                cache[ id ].toJSON = jQuery.noop;
  1584.                        }
  1585.                        cache[ id ][ internalKey ] = internalCache;
  1586.                // Otherwise, we need to eliminate the expando on the node to avoid
  1587.                // false lookups in the cache for entries that no longer exist
  1588.                } else if ( isNode ) {
  1589.                        // IE does not allow us to delete expando properties from nodes,
  1590.                        // nor does it have a removeAttribute function on Document nodes;
  1591.                        // we must handle all of these cases
  1592.                        if ( jQuery.support.deleteExpando ) {
  1593.                                delete elem[ jQuery.expando ];
  1594.                        } else if ( elem.removeAttribute ) {
  1595.                                elem.removeAttribute( jQuery.expando );
  1596.                        } else {
  1597.                                elem[ jQuery.expando ] = null;
  1598.                        }
  1599.                }
  1600.        },
  1601.        // For internal use only.
  1602.        _data: function( elem, name, data ) {
  1603.                return jQuery.data( elem, name, data, true );
  1604.        },
  1605.        // A method for determining if a DOM node can handle the data expando
  1606.        acceptData: function( elem ) {
  1607.                if ( elem.nodeName ) {
  1608.                        var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
  1609.                        if ( match ) {
  1610.                                return !(match === true || elem.getAttribute("classid") !== match);
  1611.                        }
  1612.                }
  1613.                return true;
  1614.        }
  1615.    });
  1616.    jQuery.fn.extend({
  1617.        data: function( key, value ) {
  1618.                var data = null;
  1619.                if ( typeof key === "undefined" ) {
  1620.                        if ( this.length ) {
  1621.                                data = jQuery.data( this[0] );
  1622.                                if ( this[0].nodeType === 1 ) {
  1623.                            var attr = this[0].attributes, name;
  1624.                                        for ( var i = 0, l = attr.length; i < l; i++ ) {
  1625.                                                name = attr[i].name;
  1626.                                                if ( name.indexOf( "data-" ) === 0 ) {
  1627.                                                        name = jQuery.camelCase( name.substring(5) );
  1628.                                                        dataAttr( this[0], name, data[ name ] );
  1629.                                                }
  1630.                                        }
  1631.                                }
  1632.                        }
  1633.                        return data;
  1634.                } else if ( typeof key === "object" ) {
  1635.                        return this.each(function() {
  1636.                                jQuery.data( this, key );
  1637.                        });
  1638.                }
  1639.                var parts = key.split(".");
  1640.                parts[1] = parts[1] ? "." + parts[1] : "";
  1641.                if ( value === undefined ) {
  1642.                        data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
  1643.                        // Try to fetch any internally stored data first
  1644.                        if ( data === undefined && this.length ) {
  1645.                                data = jQuery.data( this[0], key );
  1646.                                data = dataAttr( this[0], key, data );
  1647.                        }
  1648.                        return data === undefined && parts[1] ?
  1649.                                this.data( parts[0] ) :
  1650.                                data;
  1651.                } else {
  1652.                        return this.each(function() {
  1653.                                var $this = jQuery( this ),
  1654.                                        args = [ parts[0], value ];
  1655.                                $this.triggerHandler( "setData" + parts[1] + "!", args );
  1656.                                jQuery.data( this, key, value );
  1657.                                $this.triggerHandler( "changeData" + parts[1] + "!", args );
  1658.                        });
  1659.                }
  1660.        },
  1661.        removeData: function( key ) {
  1662.                return this.each(function() {
  1663.                        jQuery.removeData( this, key );
  1664.                });
  1665.        }
  1666.    });
  1667.    function dataAttr( elem, key, data ) {
  1668.        // If nothing was found internally, try to fetch any
  1669.        // data from the HTML5 data-* attribute
  1670.        if ( data === undefined && elem.nodeType === 1 ) {
  1671.                var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
  1672.                data = elem.getAttribute( name );
  1673.                if ( typeof data === "string" ) {
  1674.                        try {
  1675.                                data = data === "true" ? true :
  1676.                                data === "false" ? false :
  1677.                                data === "null" ? null :
  1678.                                !jQuery.isNaN( data ) ? parseFloat( data ) :
  1679.                                        rbrace.test( data ) ? jQuery.parseJSON( data ) :
  1680.                                        data;
  1681.                        } catch( e ) {}
  1682.                        // Make sure we set the data so it isn't changed later
  1683.                        jQuery.data( elem, key, data );
  1684.  
  1685.                } else {
  1686.                        data = undefined;
  1687.                }
  1688.        }
  1689.  
  1690.        return data;
  1691.    }
  1692.  
  1693.    // TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
  1694.    // property to be considered empty objects; this property always exists in
  1695.    // order to make sure JSON.stringify does not expose internal metadata
  1696.    function isEmptyDataObject( obj ) {
  1697.        for ( var name in obj ) {
  1698.                if ( name !== "toJSON" ) {
  1699.                        return false;
  1700.                }
  1701.        }
  1702.  
  1703.        return true;
  1704.    }
  1705.  
  1706.  
  1707.  
  1708.  
  1709.    function handleQueueMarkDefer( elem, type, src ) {
  1710.        var deferDataKey = type + "defer",
  1711.                queueDataKey = type + "queue",
  1712.                markDataKey = type + "mark",
  1713.                defer = jQuery.data( elem, deferDataKey, undefined, true );
  1714.        if ( defer &&
  1715.                ( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
  1716.                ( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
  1717.                // Give room for hard-coded callbacks to fire first
  1718.                // and eventually mark/queue something else on the element
  1719.                setTimeout( function() {
  1720.                        if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
  1721.                                !jQuery.data( elem, markDataKey, undefined, true ) ) {
  1722.                                jQuery.removeData( elem, deferDataKey, true );
  1723.                                defer.resolve();
  1724.                        }
  1725.                }, 0 );
  1726.        }
  1727.    }
  1728.  
  1729.    jQuery.extend({
  1730.  
  1731.        _mark: function( elem, type ) {
  1732.                if ( elem ) {
  1733.                        type = (type || "fx") + "mark";
  1734.                        jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
  1735.                }
  1736.        },
  1737.  
  1738.        _unmark: function( force, elem, type ) {
  1739.                if ( force !== true ) {
  1740.                        type = elem;
  1741.                        elem = force;
  1742.                        force = false;
  1743.                }
  1744.                if ( elem ) {
  1745.                        type = type || "fx";
  1746.                        var key = type + "mark",
  1747.                                count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
  1748.                        if ( count ) {
  1749.                                jQuery.data( elem, key, count, true );
  1750.                        } else {
  1751.                                jQuery.removeData( elem, key, true );
  1752.                                handleQueueMarkDefer( elem, type, "mark" );
  1753.                        }
  1754.                }
  1755.        },
  1756.  
  1757.        queue: function( elem, type, data ) {
  1758.                if ( elem ) {
  1759.                        type = (type || "fx") + "queue";
  1760.                        var q = jQuery.data( elem, type, undefined, true );
  1761.                        // Speed up dequeue by getting out quickly if this is just a lookup
  1762.                        if ( data ) {
  1763.                                if ( !q || jQuery.isArray(data) ) {
  1764.                                        q = jQuery.data( elem, type, jQuery.makeArray(data), true );
  1765.                                } else {
  1766.                                        q.push( data );
  1767.                                }
  1768.                        }
  1769.                        return q || [];
  1770.                }
  1771.        },
  1772.  
  1773.        dequeue: function( elem, type ) {
  1774.                type = type || "fx";
  1775.  
  1776.                var queue = jQuery.queue( elem, type ),
  1777.                        fn = queue.shift(),
  1778.                        defer;
  1779.  
  1780.                // If the fx queue is dequeued, always remove the progress sentinel
  1781.                if ( fn === "inprogress" ) {
  1782.                        fn = queue.shift();
  1783.                }
  1784.  
  1785.                if ( fn ) {
  1786.                        // Add a progress sentinel to prevent the fx queue from being
  1787.                        // automatically dequeued
  1788.                        if ( type === "fx" ) {
  1789.                                queue.unshift("inprogress");
  1790.                        }
  1791.  
  1792.                        fn.call(elem, function() {
  1793.                                jQuery.dequeue(elem, type);
  1794.                        });
  1795.                }
  1796.  
  1797.                if ( !queue.length ) {
  1798.                        jQuery.removeData( elem, type + "queue", true );
  1799.                        handleQueueMarkDefer( elem, type, "queue" );
  1800.                }
  1801.        }
  1802.    });
  1803.  
  1804.    jQuery.fn.extend({
  1805.        queue: function( type, data ) {
  1806.                if ( typeof type !== "string" ) {
  1807.                        data = type;
  1808.                        type = "fx";
  1809.                }
  1810.  
  1811.                if ( data === undefined ) {
  1812.                        return jQuery.queue( this[0], type );
  1813.                }
  1814.                return this.each(function() {
  1815.                        var queue = jQuery.queue( this, type, data );
  1816.  
  1817.                        if ( type === "fx" && queue[0] !== "inprogress" ) {
  1818.                                jQuery.dequeue( this, type );
  1819.                        }
  1820.                });
  1821.        },
  1822.        dequeue: function( type ) {
  1823.                return this.each(function() {
  1824.                        jQuery.dequeue( this, type );
  1825.                });
  1826.        },
  1827.        // Based off of the plugin by Clint Helfers, with permission.
  1828.        // http://blindsignals.com/index.php/2009/07/jquery-delay/
  1829.        delay: function( time, type ) {
  1830.                time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
  1831.                type = type || "fx";
  1832.  
  1833.                return this.queue( type, function() {
  1834.                        var elem = this;
  1835.                        setTimeout(function() {
  1836.                                jQuery.dequeue( elem, type );
  1837.                        }, time );
  1838.                });
  1839.        },
  1840.        clearQueue: function( type ) {
  1841.                return this.queue( type || "fx", [] );
  1842.        },
  1843.        // Get a promise resolved when queues of a certain type
  1844.        // are emptied (fx is the type by default)
  1845.        promise: function( type, object ) {
  1846.                if ( typeof type !== "string" ) {
  1847.                        object = type;
  1848.                        type = undefined;
  1849.                }
  1850.                type = type || "fx";
  1851.                var defer = jQuery.Deferred(),
  1852.                        elements = this,
  1853.                        i = elements.length,
  1854.                        count = 1,
  1855.                        deferDataKey = type + "defer",
  1856.                        queueDataKey = type + "queue",
  1857.                        markDataKey = type + "mark",
  1858.                        tmp;
  1859.                function resolve() {
  1860.                        if ( !( --count ) ) {
  1861.                                defer.resolveWith( elements, [ elements ] );
  1862.                        }
  1863.                }
  1864.                while( i-- ) {
  1865.                        if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
  1866.                                        ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
  1867.                                                jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
  1868.                                        jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
  1869.                                count++;
  1870.                                tmp.done( resolve );
  1871.                        }
  1872.                }
  1873.                resolve();
  1874.                return defer.promise();
  1875.        }
  1876.    });
  1877.  
  1878.  
  1879.  
  1880.  
  1881.    var rclass = /[\n\t\r]/g,
  1882.        rspace = /\s+/,
  1883.        rreturn = /\r/g,
  1884.        rtype = /^(?:button|input)$/i,
  1885.        rfocusable = /^(?:button|input|object|select|textarea)$/i,
  1886.        rclickable = /^a(?:rea)?$/i,
  1887.        rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
  1888.        nodeHook, boolHook;
  1889.  
  1890.    jQuery.fn.extend({
  1891.        attr: function( name, value ) {
  1892.                return jQuery.access( this, name, value, true, jQuery.attr );
  1893.        },
  1894.  
  1895.        removeAttr: function( name ) {
  1896.                return this.each(function() {
  1897.                        jQuery.removeAttr( this, name );
  1898.                });
  1899.        },
  1900.        
  1901.        prop: function( name, value ) {
  1902.                return jQuery.access( this, name, value, true, jQuery.prop );
  1903.        },
  1904.        
  1905.        removeProp: function( name ) {
  1906.                name = jQuery.propFix[ name ] || name;
  1907.                return this.each(function() {
  1908.                        // try/catch handles cases where IE balks (such as removing a property on window)
  1909.                        try {
  1910.                                this[ name ] = undefined;
  1911.                                delete this[ name ];
  1912.                        } catch( e ) {}
  1913.                });
  1914.        },
  1915.  
  1916.        addClass: function( value ) {
  1917.                var classNames, i, l, elem,
  1918.                        setClass, c, cl;
  1919.  
  1920.                if ( jQuery.isFunction( value ) ) {
  1921.                        return this.each(function( j ) {
  1922.                                jQuery( this ).addClass( value.call(this, j, this.className) );
  1923.                        });
  1924.                }
  1925.  
  1926.                if ( value && typeof value === "string" ) {
  1927.                        classNames = value.split( rspace );
  1928.  
  1929.                        for ( i = 0, l = this.length; i < l; i++ ) {
  1930.                                elem = this[ i ];
  1931.  
  1932.                                if ( elem.nodeType === 1 ) {
  1933.                                        if ( !elem.className && classNames.length === 1 ) {
  1934.                                                elem.className = value;
  1935.  
  1936.                                        } else {
  1937.                                                setClass = " " + elem.className + " ";
  1938.  
  1939.                                                for ( c = 0, cl = classNames.length; c < cl; c++ ) {
  1940.                                                        if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
  1941.                                                                setClass += classNames[ c ] + " ";
  1942.                                                        }
  1943.                                                }
  1944.                                                elem.className = jQuery.trim( setClass );
  1945.                                        }
  1946.                                }
  1947.                        }
  1948.                }
  1949.  
  1950.                return this;
  1951.        },
  1952.  
  1953.        removeClass: function( value ) {
  1954.                var classNames, i, l, elem, className, c, cl;
  1955.  
  1956.                if ( jQuery.isFunction( value ) ) {
  1957.                        return this.each(function( j ) {
  1958.                                jQuery( this ).removeClass( value.call(this, j, this.className) );
  1959.                        });
  1960.                }
  1961.  
  1962.                if ( (value && typeof value === "string") || value === undefined ) {
  1963.                        classNames = (value || "").split( rspace );
  1964.  
  1965.                        for ( i = 0, l = this.length; i < l; i++ ) {
  1966.                                elem = this[ i ];
  1967.  
  1968.                                if ( elem.nodeType === 1 && elem.className ) {
  1969.                                        if ( value ) {
  1970.                                                className = (" " + elem.className + " ").replace( rclass, " " );
  1971.                                                for ( c = 0, cl = classNames.length; c < cl; c++ ) {
  1972.                                                        className = className.replace(" " + classNames[ c ] + " ", " ");
  1973.                                                }
  1974.                                                elem.className = jQuery.trim( className );
  1975.  
  1976.                                        } else {
  1977.                                                elem.className = "";
  1978.                                        }
  1979.                                }
  1980.                        }
  1981.                }
  1982.  
  1983.                return this;
  1984.        },
  1985.  
  1986.        toggleClass: function( value, stateVal ) {
  1987.                var type = typeof value,
  1988.                        isBool = typeof stateVal === "boolean";
  1989.  
  1990.                if ( jQuery.isFunction( value ) ) {
  1991.                        return this.each(function( i ) {
  1992.                                jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
  1993.                        });
  1994.                }
  1995.  
  1996.                return this.each(function() {
  1997.                        if ( type === "string" ) {
  1998.                                // toggle individual class names
  1999.                                var className,
  2000.                                        i = 0,
  2001.                                        self = jQuery( this ),
  2002.                                        state = stateVal,
  2003.                                        classNames = value.split( rspace );
  2004.  
  2005.                                while ( (className = classNames[ i++ ]) ) {
  2006.                                        // check each className given, space seperated list
  2007.                                        state = isBool ? state : !self.hasClass( className );
  2008.                                        self[ state ? "addClass" : "removeClass" ]( className );
  2009.                                }
  2010.  
  2011.                        } else if ( type === "undefined" || type === "boolean" ) {
  2012.                                if ( this.className ) {
  2013.                                        // store className if set
  2014.                                        jQuery._data( this, "__className__", this.className );
  2015.                                }
  2016.  
  2017.                                // toggle whole className
  2018.                                this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
  2019.                        }
  2020.                });
  2021.        },
  2022.  
  2023.        hasClass: function( selector ) {
  2024.                var className = " " + selector + " ";
  2025.                for ( var i = 0, l = this.length; i < l; i++ ) {
  2026.                        if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
  2027.                                 return true;
  2028.                         }
  2029.                 }
  2030.  
  2031.                 return false;
  2032.         },
  2033.  
  2034.         val: function( value ) {
  2035.                 var hooks, ret,
  2036.                         elem = this[0];
  2037.                
  2038.                 if ( !arguments.length ) {
  2039.                         if ( elem ) {
  2040.                                 hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
  2041.  
  2042.                                 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
  2043.                                        return ret;
  2044.                                 }
  2045.  
  2046.                                 ret = elem.value;
  2047.  
  2048.                                 return typeof ret === "string" ?
  2049.                                         // handle most common string cases
  2050.                                         ret.replace(rreturn, "") :
  2051.                                         // handle cases where value is null/undef or number
  2052.                                         ret == null ? "" : ret;
  2053.                         }
  2054.  
  2055.                         return undefined;
  2056.                 }
  2057.  
  2058.                 var isFunction = jQuery.isFunction( value );
  2059.  
  2060.                 return this.each(function( i ) {
  2061.                         var self = jQuery(this), val;
  2062.  
  2063.                         if ( this.nodeType !== 1 ) {
  2064.                                 return;
  2065.                         }
  2066.  
  2067.                         if ( isFunction ) {
  2068.                                 val = value.call( this, i, self.val() );
  2069.                         } else {
  2070.                                 val = value;
  2071.                         }
  2072.  
  2073.                         // Treat null/undefined as ""; convert numbers to string
  2074.                         if ( val == null ) {
  2075.                                 val = "";
  2076.                         } else if ( typeof val === "number" ) {
  2077.                                 val += "";
  2078.                         } else if ( jQuery.isArray( val ) ) {
  2079.                                 val = jQuery.map(val, function ( value ) {
  2080.                                         return value == null ? "" : value + "";
  2081.                                 });
  2082.                         }
  2083.  
  2084.                         hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
  2085.  
  2086.                         // If set returns undefined, fall back to normal setting
  2087.                         if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
  2088.                                 this.value = val;
  2089.                         }
  2090.                 });
  2091.         }
  2092.     });
  2093.  
  2094.     jQuery.extend({
  2095.         valHooks: {
  2096.                 option: {
  2097.                         get: function( elem ) {
  2098.                                 // attributes.value is undefined in Blackberry 4.7 but
  2099.                                 // uses .value. See #6932
  2100.                                 var val = elem.attributes.value;
  2101.                                 return !val || val.specified ? elem.value : elem.text;
  2102.                         }
  2103.                 },
  2104.                 select: {
  2105.                         get: function( elem ) {
  2106.                                 var value,
  2107.                                         index = elem.selectedIndex,
  2108.                                         values = [],
  2109.                                         options = elem.options,
  2110.                                         one = elem.type === "select-one";
  2111.  
  2112.                                 // Nothing was selected
  2113.                                 if ( index < 0 ) {
  2114.                                        return null;
  2115.                                }
  2116.  
  2117.                                // Loop through all the selected options
  2118.                                for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
  2119.                                        var option = options[ i ];
  2120.  
  2121.                                        // Don't return options that are disabled or in a disabled optgroup
  2122.                                        if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
  2123.                                                        (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
  2124.                                                // Get the specific value for the option
  2125.                                                value = jQuery( option ).val();
  2126.                                                // We don't need an array for one selects
  2127.                                                if ( one ) {
  2128.                                                        return value;
  2129.                                                }
  2130.  
  2131.                                                // Multi-Selects return an array
  2132.                                                values.push( value );
  2133.                                        }
  2134.                                }
  2135.  
  2136.                                // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
  2137.                                if ( one && !values.length && options.length ) {
  2138.                                        return jQuery( options[ index ] ).val();
  2139.                                }
  2140.  
  2141.                                return values;
  2142.                        },
  2143.  
  2144.                        set: function( elem, value ) {
  2145.                                var values = jQuery.makeArray( value );
  2146.  
  2147.                                jQuery(elem).find("option").each(function() {
  2148.                                        this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
  2149.                                 });
  2150.  
  2151.                                 if ( !values.length ) {
  2152.                                         elem.selectedIndex = -1;
  2153.                                 }
  2154.                                 return values;
  2155.                         }
  2156.                 }
  2157.         },
  2158.  
  2159.         attrFn: {
  2160.                 val: true,
  2161.                 css: true,
  2162.                 html: true,
  2163.                 text: true,
  2164.                 data: true,
  2165.                 width: true,
  2166.                 height: true,
  2167.                 offset: true
  2168.         },
  2169.        
  2170.         attrFix: {
  2171.                 // Always normalize to ensure hook usage
  2172.                 tabindex: "tabIndex"
  2173.         },
  2174.        
  2175.         attr: function( elem, name, value, pass ) {
  2176.                 var nType = elem.nodeType;
  2177.                
  2178.                 // don't get/set attributes on text, comment and attribute nodes
  2179.                 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  2180.                         return undefined;
  2181.                 }
  2182.  
  2183.                 if ( pass && name in jQuery.attrFn ) {
  2184.                        return jQuery( elem )[ name ]( value );
  2185.                 }
  2186.  
  2187.                 // Fallback to prop when attributes are not supported
  2188.                 if ( !("getAttribute" in elem) ) {
  2189.                         return jQuery.prop( elem, name, value );
  2190.                 }
  2191.  
  2192.                 var ret, hooks,
  2193.                         notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
  2194.  
  2195.                 // Normalize the name if needed
  2196.                 if ( notxml ) {
  2197.                         name = jQuery.attrFix[ name ] || name;
  2198.  
  2199.                         hooks = jQuery.attrHooks[ name ];
  2200.  
  2201.                         if ( !hooks ) {
  2202.                                 // Use boolHook for boolean attributes
  2203.                                 if ( rboolean.test( name ) ) {
  2204.                                         hooks = boolHook;
  2205.  
  2206.                                 // Use nodeHook if available( IE6/7 )
  2207.                                 } else if ( nodeHook ) {
  2208.                                         hooks = nodeHook;
  2209.                                 }
  2210.                         }
  2211.                 }
  2212.  
  2213.                 if ( value !== undefined ) {
  2214.  
  2215.                         if ( value === null ) {
  2216.                                 jQuery.removeAttr( elem, name );
  2217.                                 return undefined;
  2218.  
  2219.                         } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
  2220.                                return ret;
  2221.  
  2222.                         } else {
  2223.                                 elem.setAttribute( name, "" + value );
  2224.                                 return value;
  2225.                         }
  2226.  
  2227.                 } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
  2228.                        return ret;
  2229.  
  2230.                 } else {
  2231.  
  2232.                         ret = elem.getAttribute( name );
  2233.  
  2234.                         // Non-existent attributes return null, we normalize to undefined
  2235.                         return ret === null ?
  2236.                                 undefined :
  2237.                                 ret;
  2238.                 }
  2239.         },
  2240.  
  2241.         removeAttr: function( elem, name ) {
  2242.                 var propName;
  2243.                 if ( elem.nodeType === 1 ) {
  2244.                         name = jQuery.attrFix[ name ] || name;
  2245.  
  2246.                         jQuery.attr( elem, name, "" );
  2247.                         elem.removeAttribute( name );
  2248.  
  2249.                         // Set corresponding property to false for boolean attributes
  2250.                         if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
  2251.                                elem[ propName ] = false;
  2252.                         }
  2253.                 }
  2254.         },
  2255.  
  2256.         attrHooks: {
  2257.                 type: {
  2258.                         set: function( elem, value ) {
  2259.                                 // We can't allow the type property to be changed (since it causes problems in IE)
  2260.                                 if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
  2261.                                        jQuery.error( "type property can't be changed" );
  2262.                                 } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
  2263.                                        // Setting the type on a radio button after the value resets the value in IE6-9
  2264.                                        // Reset value to it's default in case type is set after value
  2265.                                        // This is for element creation
  2266.                                        var val = elem.value;
  2267.                                         elem.setAttribute( "type", value );
  2268.                                         if ( val ) {
  2269.                                                 elem.value = val;
  2270.                                         }
  2271.                                         return value;
  2272.                                 }
  2273.                         }
  2274.                 },
  2275.                 // Use the value property for back compat
  2276.                 // Use the nodeHook for button elements in IE6/7 (#1954)
  2277.                 value: {
  2278.                         get: function( elem, name ) {
  2279.                                 if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
  2280.                                        return nodeHook.get( elem, name );
  2281.                                 }
  2282.                                 return name in elem ?
  2283.                                         elem.value :
  2284.                                         null;
  2285.                         },
  2286.                         set: function( elem, value, name ) {
  2287.                                 if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
  2288.                                        return nodeHook.set( elem, value, name );
  2289.                                 }
  2290.                                 // Does not return so that setAttribute is also used
  2291.                                 elem.value = value;
  2292.                         }
  2293.                 }
  2294.         },
  2295.  
  2296.         propFix: {
  2297.                 tabindex: "tabIndex",
  2298.                 readonly: "readOnly",
  2299.                 "for": "htmlFor",
  2300.                 "class": "className",
  2301.                 maxlength: "maxLength",
  2302.                 cellspacing: "cellSpacing",
  2303.                 cellpadding: "cellPadding",
  2304.                 rowspan: "rowSpan",
  2305.                 colspan: "colSpan",
  2306.                 usemap: "useMap",
  2307.                 frameborder: "frameBorder",
  2308.                 contenteditable: "contentEditable"
  2309.         },
  2310.        
  2311.         prop: function( elem, name, value ) {
  2312.                 var nType = elem.nodeType;
  2313.  
  2314.                 // don't get/set properties on text, comment and attribute nodes
  2315.                 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  2316.                         return undefined;
  2317.                 }
  2318.  
  2319.                 var ret, hooks,
  2320.                         notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
  2321.  
  2322.                 if ( notxml ) {
  2323.                         // Fix name and attach hooks
  2324.                         name = jQuery.propFix[ name ] || name;
  2325.                         hooks = jQuery.propHooks[ name ];
  2326.                 }
  2327.  
  2328.                 if ( value !== undefined ) {
  2329.                         if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
  2330.                                return ret;
  2331.  
  2332.                         } else {
  2333.                                 return (elem[ name ] = value);
  2334.                         }
  2335.  
  2336.                 } else {
  2337.                         if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
  2338.                                return ret;
  2339.  
  2340.                         } else {
  2341.                                 return elem[ name ];
  2342.                         }
  2343.                 }
  2344.         },
  2345.        
  2346.         propHooks: {
  2347.                 tabIndex: {
  2348.                         get: function( elem ) {
  2349.                                 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
  2350.                                 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  2351.                                 var attributeNode = elem.getAttributeNode("tabindex");
  2352.  
  2353.                                 return attributeNode && attributeNode.specified ?
  2354.                                        parseInt( attributeNode.value, 10 ) :
  2355.                                        rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
  2356.                                                0 :
  2357.                                                undefined;
  2358.                         }
  2359.                 }
  2360.         }
  2361.     });
  2362.  
  2363.     // Add the tabindex propHook to attrHooks for back-compat
  2364.     jQuery.attrHooks.tabIndex = jQuery.propHooks.tabIndex;
  2365.  
  2366.     // Hook for boolean attributes
  2367.     boolHook = {
  2368.         get: function( elem, name ) {
  2369.                 // Align boolean attributes with corresponding properties
  2370.                 // Fall back to attribute presence where some booleans are not supported
  2371.                 var attrNode;
  2372.                 return jQuery.prop( elem, name ) === true || ( attrNode = elem.getAttributeNode( name ) ) && attrNode.nodeValue !== false ?
  2373.                        name.toLowerCase() :
  2374.                        undefined;
  2375.         },
  2376.         set: function( elem, value, name ) {
  2377.                 var propName;
  2378.                 if ( value === false ) {
  2379.                         // Remove boolean attributes when set to false
  2380.                         jQuery.removeAttr( elem, name );
  2381.                 } else {
  2382.                         // value is true since we know at this point it's type boolean and not false
  2383.                         // Set boolean attributes to the same name and set the DOM property
  2384.                         propName = jQuery.propFix[ name ] || name;
  2385.                         if ( propName in elem ) {
  2386.                                 // Only set the IDL specifically if it already exists on the element
  2387.                                 elem[ propName ] = true;
  2388.                         }
  2389.  
  2390.                         elem.setAttribute( name, name.toLowerCase() );
  2391.                 }
  2392.                 return name;
  2393.         }
  2394.     };
  2395.  
  2396.     // IE6/7 do not support getting/setting some attributes with get/setAttribute
  2397.     if ( !jQuery.support.getSetAttribute ) {
  2398.        
  2399.         // Use this for any attribute in IE6/7
  2400.         // This fixes almost every IE6/7 issue
  2401.         nodeHook = jQuery.valHooks.button = {
  2402.                 get: function( elem, name ) {
  2403.                         var ret;
  2404.                         ret = elem.getAttributeNode( name );
  2405.                         // Return undefined if nodeValue is empty string
  2406.                         return ret && ret.nodeValue !== "" ?
  2407.                                ret.nodeValue :
  2408.                                undefined;
  2409.                 },
  2410.                 set: function( elem, value, name ) {
  2411.                         // Set the existing or create a new attribute node
  2412.                         var ret = elem.getAttributeNode( name );
  2413.                         if ( !ret ) {
  2414.                                 ret = document.createAttribute( name );
  2415.                                 elem.setAttributeNode( ret );
  2416.                         }
  2417.                         return (ret.nodeValue = value + "");
  2418.                 }
  2419.         };
  2420.  
  2421.         // Set width and height to auto instead of 0 on empty string( Bug #8150 )
  2422.         // This is for removals
  2423.         jQuery.each([ "width", "height" ], function( i, name ) {
  2424.                 jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
  2425.                         set: function( elem, value ) {
  2426.                                 if ( value === "" ) {
  2427.                                         elem.setAttribute( name, "auto" );
  2428.                                         return value;
  2429.                                 }
  2430.                         }
  2431.                 });
  2432.         });
  2433.     }
  2434.  
  2435.  
  2436.     // Some attributes require a special call on IE
  2437.     if ( !jQuery.support.hrefNormalized ) {
  2438.         jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
  2439.                 jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
  2440.                         get: function( elem ) {
  2441.                                 var ret = elem.getAttribute( name, 2 );
  2442.                                 return ret === null ? undefined : ret;
  2443.                         }
  2444.                 });
  2445.         });
  2446.     }
  2447.  
  2448.     if ( !jQuery.support.style ) {
  2449.         jQuery.attrHooks.style = {
  2450.                 get: function( elem ) {
  2451.                         // Return undefined in the case of empty string
  2452.                         // Normalize to lowercase since IE uppercases css property names
  2453.                         return elem.style.cssText.toLowerCase() || undefined;
  2454.                 },
  2455.                 set: function( elem, value ) {
  2456.                         return (elem.style.cssText = "" + value);
  2457.                 }
  2458.         };
  2459.     }
  2460.  
  2461.     // Safari mis-reports the default selected property of an option
  2462.     // Accessing the parent's selectedIndex property fixes it
  2463.     if ( !jQuery.support.optSelected ) {
  2464.         jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
  2465.                 get: function( elem ) {
  2466.                         var parent = elem.parentNode;
  2467.  
  2468.                         if ( parent ) {
  2469.                                 parent.selectedIndex;
  2470.  
  2471.                                 // Make sure that it also works with optgroups, see #5701
  2472.                                 if ( parent.parentNode ) {
  2473.                                         parent.parentNode.selectedIndex;
  2474.                                 }
  2475.                         }
  2476.                         return null;
  2477.                 }
  2478.         });
  2479.     }
  2480.  
  2481.     // Radios and checkboxes getter/setter
  2482.     if ( !jQuery.support.checkOn ) {
  2483.         jQuery.each([ "radio", "checkbox" ], function() {
  2484.                 jQuery.valHooks[ this ] = {
  2485.                         get: function( elem ) {
  2486.                                 // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
  2487.                                 return elem.getAttribute("value") === null ? "on" : elem.value;
  2488.                         }
  2489.                 };
  2490.         });
  2491.     }
  2492.     jQuery.each([ "radio", "checkbox" ], function() {
  2493.         jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
  2494.                 set: function( elem, value ) {
  2495.                         if ( jQuery.isArray( value ) ) {
  2496.                                 return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0);
  2497.                         }
  2498.                 }
  2499.         });
  2500.     });
  2501.  
  2502.  
  2503.  
  2504.  
  2505.     var rnamespaces = /\.(.*)$/,
  2506.         rformElems = /^(?:textarea|input|select)$/i,
  2507.         rperiod = /\./g,
  2508.         rspaces = / /g,
  2509.         rescape = /[^\w\s.|`]/g,
  2510.         fcleanup = function( nm ) {
  2511.                 return nm.replace(rescape, "\\$&");
  2512.         };
  2513.  
  2514.     /*
  2515.     * A number of helper functions used for managing events.
  2516.     * Many of the ideas behind this code originated from
  2517.     * Dean Edwards' addEvent library.
  2518.     */
  2519.     jQuery.event = {
  2520.  
  2521.         // Bind an event to an element
  2522.         // Original by Dean Edwards
  2523.         add: function( elem, types, handler, data ) {
  2524.                 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  2525.                         return;
  2526.                 }
  2527.  
  2528.                 if ( handler === false ) {
  2529.                         handler = returnFalse;
  2530.                 } else if ( !handler ) {
  2531.                         // Fixes bug #7229. Fix recommended by jdalton
  2532.                         return;
  2533.                 }
  2534.  
  2535.                 var handleObjIn, handleObj;
  2536.  
  2537.                 if ( handler.handler ) {
  2538.                         handleObjIn = handler;
  2539.                         handler = handleObjIn.handler;
  2540.                 }
  2541.  
  2542.                 // Make sure that the function being executed has a unique ID
  2543.                 if ( !handler.guid ) {
  2544.                         handler.guid = jQuery.guid++;
  2545.                 }
  2546.  
  2547.                 // Init the element's event structure
  2548.                 var elemData = jQuery._data( elem );
  2549.  
  2550.                 // If no elemData is found then we must be trying to bind to one of the
  2551.                 // banned noData elements
  2552.                 if ( !elemData ) {
  2553.                         return;
  2554.                 }
  2555.  
  2556.                 var events = elemData.events,
  2557.                         eventHandle = elemData.handle;
  2558.  
  2559.                 if ( !events ) {
  2560.                         elemData.events = events = {};
  2561.                 }
  2562.  
  2563.                 if ( !eventHandle ) {
  2564.                         elemData.handle = eventHandle = function( e ) {
  2565.                                 // Discard the second event of a jQuery.event.trigger() and
  2566.                                 // when an event is called after a page has unloaded
  2567.                                 return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
  2568.                                        jQuery.event.handle.apply( eventHandle.elem, arguments ) :
  2569.                                        undefined;
  2570.                         };
  2571.                 }
  2572.  
  2573.                 // Add elem as a property of the handle function
  2574.                 // This is to prevent a memory leak with non-native events in IE.
  2575.                 eventHandle.elem = elem;
  2576.  
  2577.                 // Handle multiple events separated by a space
  2578.                 // jQuery(...).bind("mouseover mouseout", fn);
  2579.                 types = types.split(" ");
  2580.  
  2581.                 var type, i = 0, namespaces;
  2582.  
  2583.                 while ( (type = types[ i++ ]) ) {
  2584.                         handleObj = handleObjIn ?
  2585.                                 jQuery.extend({}, handleObjIn) :
  2586.                                 { handler: handler, data: data };
  2587.  
  2588.                         // Namespaced event handlers
  2589.                         if ( type.indexOf(".") > -1 ) {
  2590.                                 namespaces = type.split(".");
  2591.                                 type = namespaces.shift();
  2592.                                 handleObj.namespace = namespaces.slice(0).sort().join(".");
  2593.  
  2594.                         } else {
  2595.                                 namespaces = [];
  2596.                                 handleObj.namespace = "";
  2597.                         }
  2598.  
  2599.                         handleObj.type = type;
  2600.                         if ( !handleObj.guid ) {
  2601.                                 handleObj.guid = handler.guid;
  2602.                         }
  2603.  
  2604.                         // Get the current list of functions bound to this event
  2605.                         var handlers = events[ type ],
  2606.                                 special = jQuery.event.special[ type ] || {};
  2607.  
  2608.                         // Init the event handler queue
  2609.                         if ( !handlers ) {
  2610.                                 handlers = events[ type ] = [];
  2611.  
  2612.                                 // Check for a special event handler
  2613.                                 // Only use addEventListener/attachEvent if the special
  2614.                                 // events handler returns false
  2615.                                 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  2616.                                         // Bind the global event handler to the element
  2617.                                         if ( elem.addEventListener ) {
  2618.                                                 elem.addEventListener( type, eventHandle, false );
  2619.  
  2620.                                         } else if ( elem.attachEvent ) {
  2621.                                                 elem.attachEvent( "on" + type, eventHandle );
  2622.                                         }
  2623.                                 }
  2624.                         }
  2625.  
  2626.                         if ( special.add ) {
  2627.                                 special.add.call( elem, handleObj );
  2628.  
  2629.                                 if ( !handleObj.handler.guid ) {
  2630.                                         handleObj.handler.guid = handler.guid;
  2631.                                 }
  2632.                         }
  2633.  
  2634.                         // Add the function to the element's handler list
  2635.                         handlers.push( handleObj );
  2636.  
  2637.                         // Keep track of which events have been used, for event optimization
  2638.                         jQuery.event.global[ type ] = true;
  2639.                 }
  2640.  
  2641.                 // Nullify elem to prevent memory leaks in IE
  2642.                 elem = null;
  2643.         },
  2644.  
  2645.         global: {},
  2646.  
  2647.         // Detach an event or set of events from an element
  2648.         remove: function( elem, types, handler, pos ) {
  2649.                 // don't do events on text and comment nodes
  2650.                 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  2651.                         return;
  2652.                 }
  2653.  
  2654.                 if ( handler === false ) {
  2655.                         handler = returnFalse;
  2656.                 }
  2657.  
  2658.                 var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
  2659.                         elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
  2660.                        events = elemData && elemData.events;
  2661.  
  2662.                 if ( !elemData || !events ) {
  2663.                         return;
  2664.                 }
  2665.  
  2666.                 // types is actually an event object here
  2667.                 if ( types && types.type ) {
  2668.                        handler = types.handler;
  2669.                         types = types.type;
  2670.                 }
  2671.  
  2672.                 // Unbind all events for the element
  2673.                 if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
  2674.                        types = types || "";
  2675.  
  2676.                         for ( type in events ) {
  2677.                                 jQuery.event.remove( elem, type + types );
  2678.                         }
  2679.  
  2680.                         return;
  2681.                 }
  2682.  
  2683.                 // Handle multiple events separated by a space
  2684.                 // jQuery(...).unbind("mouseover mouseout", fn);
  2685.                 types = types.split(" ");
  2686.  
  2687.                 while ( (type = types[ i++ ]) ) {
  2688.                         origType = type;
  2689.                         handleObj = null;
  2690.                         all = type.indexOf(".") < 0;
  2691.                        namespaces = [];
  2692.  
  2693.                        if ( !all ) {
  2694.                                // Namespaced event handlers
  2695.                                namespaces = type.split(".");
  2696.                                type = namespaces.shift();
  2697.  
  2698.                                namespace = new RegExp("(^|\\.)" +
  2699.                                        jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
  2700.                        }
  2701.  
  2702.                        eventType = events[ type ];
  2703.  
  2704.                        if ( !eventType ) {
  2705.                                continue;
  2706.                        }
  2707.  
  2708.                        if ( !handler ) {
  2709.                                for ( j = 0; j < eventType.length; j++ ) {
  2710.                                        handleObj = eventType[ j ];
  2711.  
  2712.                                        if ( all || namespace.test( handleObj.namespace ) ) {
  2713.                                                jQuery.event.remove( elem, origType, handleObj.handler, j );
  2714.                                                eventType.splice( j--, 1 );
  2715.                                        }
  2716.                                }
  2717.  
  2718.                                continue;
  2719.                        }
  2720.  
  2721.                        special = jQuery.event.special[ type ] || {};
  2722.  
  2723.                        for ( j = pos || 0; j < eventType.length; j++ ) {
  2724.                                handleObj = eventType[ j ];
  2725.  
  2726.                                if ( handler.guid === handleObj.guid ) {
  2727.                                        // remove the given handler for the given type
  2728.                                        if ( all || namespace.test( handleObj.namespace ) ) {
  2729.                                                if ( pos == null ) {
  2730.                                                        eventType.splice( j--, 1 );
  2731.                                                }
  2732.  
  2733.                                                if ( special.remove ) {
  2734.                                                        special.remove.call( elem, handleObj );
  2735.                                                }
  2736.                                        }
  2737.  
  2738.                                        if ( pos != null ) {
  2739.                                                break;
  2740.                                        }
  2741.                                }
  2742.                        }
  2743.  
  2744.                        // remove generic event handler if no more handlers exist
  2745.                        if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
  2746.                                if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
  2747.                                        jQuery.removeEvent( elem, type, elemData.handle );
  2748.                                }
  2749.  
  2750.                                ret = null;
  2751.                                delete events[ type ];
  2752.                        }
  2753.                }
  2754.  
  2755.                // Remove the expando if it's no longer used
  2756.                if ( jQuery.isEmptyObject( events ) ) {
  2757.                        var handle = elemData.handle;
  2758.                        if ( handle ) {
  2759.                                handle.elem = null;
  2760.                        }
  2761.                        delete elemData.events;
  2762.                        delete elemData.handle;
  2763.                        if ( jQuery.isEmptyObject( elemData ) ) {
  2764.                                jQuery.removeData( elem, undefined, true );
  2765.                        }
  2766.                }
  2767.        },
  2768.        
  2769.        // Events that are safe to short-circuit if no handlers are attached.
  2770.        // Native DOM events should not be added, they may have inline handlers.
  2771.        customEvent: {
  2772.                "getData": true,
  2773.                "setData": true,
  2774.                "changeData": true
  2775.        },
  2776.        trigger: function( event, data, elem, onlyHandlers ) {
  2777.                // Event object or event type
  2778.                var type = event.type || event,
  2779.                        namespaces = [],
  2780.                        exclusive;
  2781.                if ( type.indexOf("!") >= 0 ) {
  2782.                         // Exclusive events trigger only for the exact event (no namespaces)
  2783.                         type = type.slice(0, -1);
  2784.                         exclusive = true;
  2785.                 }
  2786.  
  2787.                 if ( type.indexOf(".") >= 0 ) {
  2788.                         // Namespaced trigger; create a regexp to match event type in handle()
  2789.                         namespaces = type.split(".");
  2790.                         type = namespaces.shift();
  2791.                         namespaces.sort();
  2792.                 }
  2793.  
  2794.                 if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
  2795.                        // No jQuery handlers for this event type, and it can't have inline handlers
  2796.                        return;
  2797.                 }
  2798.  
  2799.                 // Caller can pass in an Event, Object, or just an event type string
  2800.                 event = typeof event === "object" ?
  2801.                         // jQuery.Event object
  2802.                         event[ jQuery.expando ] ? event :
  2803.                         // Object literal
  2804.                         new jQuery.Event( type, event ) :
  2805.                         // Just the event type (string)
  2806.                         new jQuery.Event( type );
  2807.  
  2808.                 event.type = type;
  2809.                 event.exclusive = exclusive;
  2810.                 event.namespace = namespaces.join(".");
  2811.                 event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
  2812.                
  2813.                 // triggerHandler() and global events don't bubble or run the default action
  2814.                 if ( onlyHandlers || !elem ) {
  2815.                         event.preventDefault();
  2816.                         event.stopPropagation();
  2817.                 }
  2818.  
  2819.                 // Handle a global trigger
  2820.                 if ( !elem ) {
  2821.                         // TODO: Stop taunting the data cache; remove global events and always attach to document
  2822.                         jQuery.each( jQuery.cache, function() {
  2823.                                 // internalKey variable is just used to make it easier to find
  2824.                                 // and potentially change this stuff later; currently it just
  2825.                                 // points to jQuery.expando
  2826.                                 var internalKey = jQuery.expando,
  2827.                                         internalCache = this[ internalKey ];
  2828.                                 if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
  2829.                                        jQuery.event.trigger( event, data, internalCache.handle.elem );
  2830.                                 }
  2831.                         });
  2832.                         return;
  2833.                 }
  2834.  
  2835.                 // Don't do events on text and comment nodes
  2836.                 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  2837.                         return;
  2838.                 }
  2839.  
  2840.                 // Clean up the event in case it is being reused
  2841.                 event.result = undefined;
  2842.                 event.target = elem;
  2843.  
  2844.                 // Clone any incoming data and prepend the event, creating the handler arg list
  2845.                 data = data != null ? jQuery.makeArray( data ) : [];
  2846.                 data.unshift( event );
  2847.  
  2848.                 var cur = elem,
  2849.                         // IE doesn't like method names with a colon (#3533, #8272)
  2850.                         ontype = type.indexOf(":") < 0 ? "on" + type : "";
  2851.  
  2852.                // Fire event on the current element, then bubble up the DOM tree
  2853.                do {
  2854.                        var handle = jQuery._data( cur, "handle" );
  2855.  
  2856.                        event.currentTarget = cur;
  2857.                        if ( handle ) {
  2858.                                handle.apply( cur, data );
  2859.                        }
  2860.  
  2861.                        // Trigger an inline bound script
  2862.                        if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
  2863.                                event.result = false;
  2864.                                event.preventDefault();
  2865.                        }
  2866.  
  2867.                        // Bubble up to document, then to window
  2868.                        cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;
  2869.                } while ( cur && !event.isPropagationStopped() );
  2870.  
  2871.                // If nobody prevented the default action, do it now
  2872.                if ( !event.isDefaultPrevented() ) {
  2873.                        var old,
  2874.                                special = jQuery.event.special[ type ] || {};
  2875.  
  2876.                        if ( (!special._default || special._default.call( elem.ownerDocument, event ) === false) &&
  2877.                                !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
  2878.  
  2879.                                // Call a native DOM method on the target with the same name name as the event.
  2880.                                // Can't use an .isFunction)() check here because IE6/7 fails that test.
  2881.                                // IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
  2882.                                try {
  2883.                                        if ( ontype && elem[ type ] ) {
  2884.                                                // Don't re-trigger an onFOO event when we call its FOO() method
  2885.                                                old = elem[ ontype ];
  2886.  
  2887.                                                if ( old ) {
  2888.                                                        elem[ ontype ] = null;
  2889.                                                }
  2890.  
  2891.                                                jQuery.event.triggered = type;
  2892.                                                elem[ type ]();
  2893.                                        }
  2894.                                } catch ( ieError ) {}
  2895.  
  2896.                                if ( old ) {
  2897.                                        elem[ ontype ] = old;
  2898.                                }
  2899.  
  2900.                                jQuery.event.triggered = undefined;
  2901.                        }
  2902.                }
  2903.                
  2904.                return event.result;
  2905.        },
  2906.  
  2907.        handle: function( event ) {
  2908.                event = jQuery.event.fix( event || window.event );
  2909.                // Snapshot the handlers list since a called handler may add/remove events.
  2910.                var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
  2911.                        run_all = !event.exclusive && !event.namespace,
  2912.                        args = Array.prototype.slice.call( arguments, 0 );
  2913.  
  2914.                // Use the fix-ed Event rather than the (read-only) native event
  2915.                args[0] = event;
  2916.                event.currentTarget = this;
  2917.  
  2918.                for ( var j = 0, l = handlers.length; j < l; j++ ) {
  2919.                        var handleObj = handlers[ j ];
  2920.  
  2921.                        // Triggered event must 1) be non-exclusive and have no namespace, or
  2922.                        // 2) have namespace(s) a subset or equal to those in the bound event.
  2923.                        if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
  2924.                                // Pass in a reference to the handler function itself
  2925.                                // So that we can later remove it
  2926.                                event.handler = handleObj.handler;
  2927.                                event.data = handleObj.data;
  2928.                                event.handleObj = handleObj;
  2929.  
  2930.                                var ret = handleObj.handler.apply( this, args );
  2931.  
  2932.                                if ( ret !== undefined ) {
  2933.                                        event.result = ret;
  2934.                                        if ( ret === false ) {
  2935.                                                event.preventDefault();
  2936.                                                event.stopPropagation();
  2937.                                        }
  2938.                                }
  2939.  
  2940.                                if ( event.isImmediatePropagationStopped() ) {
  2941.                                        break;
  2942.                                }
  2943.                        }
  2944.                }
  2945.                return event.result;
  2946.        },
  2947.  
  2948.        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(" "),
  2949.  
  2950.        fix: function( event ) {
  2951.                if ( event[ jQuery.expando ] ) {
  2952.                        return event;
  2953.                }
  2954.  
  2955.                // store a copy of the original event object
  2956.                // and "clone" to set read-only properties
  2957.                var originalEvent = event;
  2958.                event = jQuery.Event( originalEvent );
  2959.  
  2960.                for ( var i = this.props.length, prop; i; ) {
  2961.                        prop = this.props[ --i ];
  2962.                        event[ prop ] = originalEvent[ prop ];
  2963.                }
  2964.  
  2965.                // Fix target property, if necessary
  2966.                if ( !event.target ) {
  2967.                        // Fixes #1925 where srcElement might not be defined either
  2968.                        event.target = event.srcElement || document;
  2969.                }
  2970.  
  2971.                // check if target is a textnode (safari)
  2972.                if ( event.target.nodeType === 3 ) {
  2973.                        event.target = event.target.parentNode;
  2974.                }
  2975.  
  2976.                // Add relatedTarget, if necessary
  2977.                if ( !event.relatedTarget && event.fromElement ) {
  2978.                        event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
  2979.                }
  2980.  
  2981.                // Calculate pageX/Y if missing and clientX/Y available
  2982.                if ( event.pageX == null && event.clientX != null ) {
  2983.                        var eventDocument = event.target.ownerDocument || document,
  2984.                                doc = eventDocument.documentElement,
  2985.                                body = eventDocument.body;
  2986.  
  2987.                        event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
  2988.                        event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
  2989.                }
  2990.  
  2991.                // Add which for key events
  2992.                if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
  2993.                        event.which = event.charCode != null ? event.charCode : event.keyCode;
  2994.                }
  2995.  
  2996.                // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
  2997.                if ( !event.metaKey && event.ctrlKey ) {
  2998.                        event.metaKey = event.ctrlKey;
  2999.                }
  3000.                // Add which for click: 1 === left; 2 === middle; 3 === right
  3001.                // Note: button is not normalized, so don't use it
  3002.                if ( !event.which && event.button !== undefined ) {
  3003.                        event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
  3004.                }
  3005.  
  3006.                return event;
  3007.        },
  3008.  
  3009.        // Deprecated, use jQuery.guid instead
  3010.        guid: 1E8,
  3011.  
  3012.        // Deprecated, use jQuery.proxy instead
  3013.        proxy: jQuery.proxy,
  3014.  
  3015.        special: {
  3016.                ready: {
  3017.                        // Make sure the ready event is setup
  3018.                        setup: jQuery.bindReady,
  3019.                        teardown: jQuery.noop
  3020.                },
  3021.  
  3022.                live: {
  3023.                        add: function( handleObj ) {
  3024.                                jQuery.event.add( this,
  3025.                                        liveConvert( handleObj.origType, handleObj.selector ),
  3026.                                        jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
  3027.                        },
  3028.  
  3029.                        remove: function( handleObj ) {
  3030.                                jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
  3031.                        }
  3032.                },
  3033.  
  3034.                beforeunload: {
  3035.                        setup: function( data, namespaces, eventHandle ) {
  3036.                                // We only want to do this special case on windows
  3037.                                if ( jQuery.isWindow( this ) ) {
  3038.                                        this.onbeforeunload = eventHandle;
  3039.                                }
  3040.                        },
  3041.  
  3042.                        teardown: function( namespaces, eventHandle ) {
  3043.                                if ( this.onbeforeunload === eventHandle ) {
  3044.                                        this.onbeforeunload = null;
  3045.                                }
  3046.                        }
  3047.                }
  3048.        }
  3049.    };
  3050.  
  3051.    jQuery.removeEvent = document.removeEventListener ?
  3052.        function( elem, type, handle ) {
  3053.                if ( elem.removeEventListener ) {
  3054.                        elem.removeEventListener( type, handle, false );
  3055.                }
  3056.        } :
  3057.        function( elem, type, handle ) {
  3058.                if ( elem.detachEvent ) {
  3059.                        elem.detachEvent( "on" + type, handle );
  3060.                }
  3061.        };
  3062.  
  3063.    jQuery.Event = function( src, props ) {
  3064.        // Allow instantiation without the 'new' keyword
  3065.        if ( !this.preventDefault ) {
  3066.                return new jQuery.Event( src, props );
  3067.        }
  3068.  
  3069.        // Event object
  3070.        if ( src && src.type ) {
  3071.                this.originalEvent = src;
  3072.                this.type = src.type;
  3073.  
  3074.                // Events bubbling up the document may have been marked as prevented
  3075.                // by a handler lower down the tree; reflect the correct value.
  3076.                this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
  3077.                        src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
  3078.  
  3079.        // Event type
  3080.        } else {
  3081.                this.type = src;
  3082.        }
  3083.  
  3084.        // Put explicitly provided properties onto the event object
  3085.        if ( props ) {
  3086.                jQuery.extend( this, props );
  3087.        }
  3088.  
  3089.        // timeStamp is buggy for some events on Firefox(#3843)
  3090.        // So we won't rely on the native value
  3091.        this.timeStamp = jQuery.now();
  3092.        // Mark it as fixed
  3093.        this[ jQuery.expando ] = true;
  3094.    };
  3095.    function returnFalse() {
  3096.        return false;
  3097.    }
  3098.    function returnTrue() {
  3099.        return true;
  3100.    }
  3101.    // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  3102.    // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  3103.    jQuery.Event.prototype = {
  3104.        preventDefault: function() {
  3105.                this.isDefaultPrevented = returnTrue;
  3106.                var e = this.originalEvent;
  3107.                if ( !e ) {
  3108.                        return;
  3109.                }
  3110.                // if preventDefault exists run it on the original event
  3111.                if ( e.preventDefault ) {
  3112.                        e.preventDefault();
  3113.                // otherwise set the returnValue property of the original event to false (IE)
  3114.                } else {
  3115.                        e.returnValue = false;
  3116.                }
  3117.        },
  3118.        stopPropagation: function() {
  3119.                this.isPropagationStopped = returnTrue;
  3120.                var e = this.originalEvent;
  3121.                if ( !e ) {
  3122.                        return;
  3123.                }
  3124.                // if stopPropagation exists run it on the original event
  3125.                if ( e.stopPropagation ) {
  3126.                        e.stopPropagation();
  3127.                }
  3128.                // otherwise set the cancelBubble property of the original event to true (IE)
  3129.                e.cancelBubble = true;
  3130.        },
  3131.        stopImmediatePropagation: function() {
  3132.                this.isImmediatePropagationStopped = returnTrue;
  3133.                this.stopPropagation();
  3134.        },
  3135.        isDefaultPrevented: returnFalse,
  3136.        isPropagationStopped: returnFalse,
  3137.        isImmediatePropagationStopped: returnFalse
  3138.    };
  3139.    // Checks if an event happened on an element within another element
  3140.    // Used in jQuery.event.special.mouseenter and mouseleave handlers
  3141.    var withinElement = function( event ) {
  3142.        // Check if mouse(over|out) are still within the same parent element
  3143.        var related = event.relatedTarget,
  3144.                inside = false,
  3145.                eventType = event.type;
  3146.        event.type = event.data;
  3147.        if ( related !== this ) {
  3148.                if ( related ) {
  3149.                        inside = jQuery.contains( this, related );
  3150.                }
  3151.                if ( !inside ) {
  3152.                        jQuery.event.handle.apply( this, arguments );
  3153.                        event.type = eventType;
  3154.                }
  3155.        }
  3156.    },
  3157.    // In case of event delegation, we only need to rename the event.type,
  3158.    // liveHandler will take care of the rest.
  3159.    delegate = function( event ) {
  3160.        event.type = event.data;
  3161.        jQuery.event.handle.apply( this, arguments );
  3162.    };
  3163.    // Create mouseenter and mouseleave events
  3164.    jQuery.each({
  3165.        mouseenter: "mouseover",
  3166.        mouseleave: "mouseout"
  3167.    }, function( orig, fix ) {
  3168.        jQuery.event.special[ orig ] = {
  3169.                setup: function( data ) {
  3170.                        jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
  3171.                },
  3172.                teardown: function( data ) {
  3173.                        jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
  3174.                }
  3175.        };
  3176.    });
  3177.    // submit delegation
  3178.    if ( !jQuery.support.submitBubbles ) {
  3179.        jQuery.event.special.submit = {
  3180.                setup: function( data, namespaces ) {
  3181.                        if ( !jQuery.nodeName( this, "form" ) ) {
  3182.                                jQuery.event.add(this, "click.specialSubmit", function( e ) {
  3183.                                        // Avoid triggering error on non-existent type attribute in IE VML (#7071)
  3184.                                        var elem = e.target,
  3185.                                                type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.type : "";
  3186.                                        if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
  3187.                                                trigger( "submit", this, arguments );
  3188.                                        }
  3189.                                });
  3190.                                jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
  3191.                                        var elem = e.target,
  3192.                                                type = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.type : "";
  3193.                                        if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
  3194.                                                trigger( "submit", this, arguments );
  3195.                                        }
  3196.                                });
  3197.                        } else {
  3198.                                return false;
  3199.                        }
  3200.                },
  3201.                teardown: function( namespaces ) {
  3202.                        jQuery.event.remove( this, ".specialSubmit" );
  3203.                }
  3204.        };
  3205.    }
  3206.    // change delegation, happens here so we have bind.
  3207.    if ( !jQuery.support.changeBubbles ) {
  3208.        var changeFilters,
  3209.        getVal = function( elem ) {
  3210.                var type = jQuery.nodeName( elem, "input" ) ? elem.type : "",
  3211.                        val = elem.value;
  3212.                if ( type === "radio" || type === "checkbox" ) {
  3213.                        val = elem.checked;
  3214.                } else if ( type === "select-multiple" ) {
  3215.                        val = elem.selectedIndex > -1 ?
  3216.                                 jQuery.map( elem.options, function( elem ) {
  3217.                                         return elem.selected;
  3218.                                 }).join("-") :
  3219.                                 "";
  3220.  
  3221.                 } else if ( jQuery.nodeName( elem, "select" ) ) {
  3222.                         val = elem.selectedIndex;
  3223.                 }
  3224.  
  3225.                 return val;
  3226.         },
  3227.  
  3228.         testChange = function testChange( e ) {
  3229.                 var elem = e.target, data, val;
  3230.  
  3231.                 if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
  3232.                         return;
  3233.                 }
  3234.  
  3235.                 data = jQuery._data( elem, "_change_data" );
  3236.                 val = getVal(elem);
  3237.  
  3238.                 // the current data will be also retrieved by beforeactivate
  3239.                 if ( e.type !== "focusout" || elem.type !== "radio" ) {
  3240.                         jQuery._data( elem, "_change_data", val );
  3241.                 }
  3242.  
  3243.                 if ( data === undefined || val === data ) {
  3244.                         return;
  3245.                 }
  3246.  
  3247.                 if ( data != null || val ) {
  3248.                         e.type = "change";
  3249.                         e.liveFired = undefined;
  3250.                         jQuery.event.trigger( e, arguments[1], elem );
  3251.                 }
  3252.         };
  3253.  
  3254.         jQuery.event.special.change = {
  3255.                 filters: {
  3256.                         focusout: testChange,
  3257.  
  3258.                         beforedeactivate: testChange,
  3259.  
  3260.                         click: function( e ) {
  3261.                                 var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
  3262.  
  3263.                                 if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {
  3264.                                         testChange.call( this, e );
  3265.                                 }
  3266.                         },
  3267.  
  3268.                         // Change has to be called before submit
  3269.                         // Keydown will be called before keypress, which is used in submit-event delegation
  3270.                         keydown: function( e ) {
  3271.                                 var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
  3272.  
  3273.                                 if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||
  3274.                                        (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
  3275.                                        type === "select-multiple" ) {
  3276.                                        testChange.call( this, e );
  3277.                                 }
  3278.                         },
  3279.  
  3280.                         // Beforeactivate happens also before the previous element is blurred
  3281.                         // with this event you can't trigger a change event, but you can store
  3282.                         // information
  3283.                         beforeactivate: function( e ) {
  3284.                                 var elem = e.target;
  3285.                                 jQuery._data( elem, "_change_data", getVal(elem) );
  3286.                         }
  3287.                 },
  3288.  
  3289.                 setup: function( data, namespaces ) {
  3290.                         if ( this.type === "file" ) {
  3291.                                 return false;
  3292.                         }
  3293.  
  3294.                         for ( var type in changeFilters ) {
  3295.                                 jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
  3296.                         }
  3297.  
  3298.                         return rformElems.test( this.nodeName );
  3299.                 },
  3300.  
  3301.                 teardown: function( namespaces ) {
  3302.                         jQuery.event.remove( this, ".specialChange" );
  3303.  
  3304.                         return rformElems.test( this.nodeName );
  3305.                 }
  3306.         };
  3307.  
  3308.         changeFilters = jQuery.event.special.change.filters;
  3309.  
  3310.         // Handle when the input is .focus()'d
  3311.         changeFilters.focus = changeFilters.beforeactivate;
  3312.     }
  3313.  
  3314.     function trigger( type, elem, args ) {
  3315.         // Piggyback on a donor event to simulate a different one.
  3316.         // Fake originalEvent to avoid donor's stopPropagation, but if the
  3317.         // simulated event prevents default then we do the same on the donor.
  3318.         // Don't pass args or remember liveFired; they apply to the donor event.
  3319.         var event = jQuery.extend( {}, args[ 0 ] );
  3320.         event.type = type;
  3321.         event.originalEvent = {};
  3322.         event.liveFired = undefined;
  3323.         jQuery.event.handle.call( elem, event );
  3324.         if ( event.isDefaultPrevented() ) {
  3325.                 args[ 0 ].preventDefault();
  3326.         }
  3327.     }
  3328.  
  3329.     // Create "bubbling" focus and blur events
  3330.     if ( !jQuery.support.focusinBubbles ) {
  3331.         jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  3332.  
  3333.                 // Attach a single capturing handler while someone wants focusin/focusout
  3334.                 var attaches = 0;
  3335.  
  3336.                 jQuery.event.special[ fix ] = {
  3337.                         setup: function() {
  3338.                                 if ( attaches++ === 0 ) {
  3339.                                         document.addEventListener( orig, handler, true );
  3340.                                 }
  3341.                         },
  3342.                         teardown: function() {
  3343.                                 if ( --attaches === 0 ) {
  3344.                                         document.removeEventListener( orig, handler, true );
  3345.                                 }
  3346.                         }
  3347.                 };
  3348.  
  3349.                 function handler( donor ) {
  3350.                         // Donor event is always a native one; fix it and switch its type.
  3351.                         // Let focusin/out handler cancel the donor focus/blur event.
  3352.                         var e = jQuery.event.fix( donor );
  3353.                         e.type = fix;
  3354.                         e.originalEvent = {};
  3355.                         jQuery.event.trigger( e, null, e.target );
  3356.                         if ( e.isDefaultPrevented() ) {
  3357.                                 donor.preventDefault();
  3358.                         }
  3359.                 }
  3360.         });
  3361.     }
  3362.  
  3363.     jQuery.each(["bind", "one"], function( i, name ) {
  3364.         jQuery.fn[ name ] = function( type, data, fn ) {
  3365.                 var handler;
  3366.  
  3367.                 // Handle object literals
  3368.                 if ( typeof type === "object" ) {
  3369.                         for ( var key in type ) {
  3370.                                 this[ name ](key, data, type[key], fn);
  3371.                         }
  3372.                         return this;
  3373.                 }
  3374.  
  3375.                 if ( arguments.length === 2 || data === false ) {
  3376.                         fn = data;
  3377.                         data = undefined;
  3378.                 }
  3379.  
  3380.                 if ( name === "one" ) {
  3381.                         handler = function( event ) {
  3382.                                 jQuery( this ).unbind( event, handler );
  3383.                                 return fn.apply( this, arguments );
  3384.                         };
  3385.                         handler.guid = fn.guid || jQuery.guid++;
  3386.                 } else {
  3387.                         handler = fn;
  3388.                 }
  3389.  
  3390.                 if ( type === "unload" && name !== "one" ) {
  3391.                        this.one( type, data, fn );
  3392.  
  3393.                 } else {
  3394.                         for ( var i = 0, l = this.length; i < l; i++ ) {
  3395.                                jQuery.event.add( this[i], type, handler, data );
  3396.                        }
  3397.                }
  3398.  
  3399.                return this;
  3400.        };
  3401.    });
  3402.  
  3403.    jQuery.fn.extend({
  3404.        unbind: function( type, fn ) {
  3405.                // Handle object literals
  3406.                if ( typeof type === "object" && !type.preventDefault ) {
  3407.                        for ( var key in type ) {
  3408.                                this.unbind(key, type[key]);
  3409.                        }
  3410.  
  3411.                } else {
  3412.                        for ( var i = 0, l = this.length; i < l; i++ ) {
  3413.                                jQuery.event.remove( this[i], type, fn );
  3414.                        }
  3415.                }
  3416.  
  3417.                return this;
  3418.        },
  3419.  
  3420.        delegate: function( selector, types, data, fn ) {
  3421.                return this.live( types, data, fn, selector );
  3422.        },
  3423.  
  3424.        undelegate: function( selector, types, fn ) {
  3425.                if ( arguments.length === 0 ) {
  3426.                        return this.unbind( "live" );
  3427.  
  3428.                } else {
  3429.                        return this.die( types, null, fn, selector );
  3430.                }
  3431.        },
  3432.  
  3433.        trigger: function( type, data ) {
  3434.                return this.each(function() {
  3435.                        jQuery.event.trigger( type, data, this );
  3436.                });
  3437.        },
  3438.  
  3439.        triggerHandler: function( type, data ) {
  3440.                if ( this[0] ) {
  3441.                        return jQuery.event.trigger( type, data, this[0], true );
  3442.                }
  3443.        },
  3444.  
  3445.        toggle: function( fn ) {
  3446.                // Save reference to arguments for access in closure
  3447.                var args = arguments,
  3448.                        guid = fn.guid || jQuery.guid++,
  3449.                        i = 0,
  3450.                        toggler = function( event ) {
  3451.                                // Figure out which function to execute
  3452.                                var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
  3453.                                jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
  3454.  
  3455.                                // Make sure that clicks stop
  3456.                                event.preventDefault();
  3457.  
  3458.                                // and execute the function
  3459.                                return args[ lastToggle ].apply( this, arguments ) || false;
  3460.                        };
  3461.  
  3462.                // link all the functions, so any of them can unbind this click handler
  3463.                toggler.guid = guid;
  3464.                while ( i < args.length ) {
  3465.                        args[ i++ ].guid = guid;
  3466.                }
  3467.  
  3468.                return this.click( toggler );
  3469.        },
  3470.  
  3471.        hover: function( fnOver, fnOut ) {
  3472.                return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  3473.        }
  3474.    });
  3475.  
  3476.    var liveMap = {
  3477.        focus: "focusin",
  3478.        blur: "focusout",
  3479.        mouseenter: "mouseover",
  3480.        mouseleave: "mouseout"
  3481.    };
  3482.  
  3483.    jQuery.each(["live", "die"], function( i, name ) {
  3484.        jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
  3485.                var type, i = 0, match, namespaces, preType,
  3486.                        selector = origSelector || this.selector,
  3487.                        context = origSelector ? this : jQuery( this.context );
  3488.  
  3489.                if ( typeof types === "object" && !types.preventDefault ) {
  3490.                        for ( var key in types ) {
  3491.                                context[ name ]( key, data, types[key], selector );
  3492.                        }
  3493.  
  3494.                        return this;
  3495.                }
  3496.  
  3497.                if ( name === "die" && !types &&
  3498.                                        origSelector && origSelector.charAt(0) === "." ) {
  3499.  
  3500.                        context.unbind( origSelector );
  3501.  
  3502.                        return this;
  3503.                }
  3504.  
  3505.                if ( data === false || jQuery.isFunction( data ) ) {
  3506.                        fn = data || returnFalse;
  3507.                        data = undefined;
  3508.                }
  3509.  
  3510.                types = (types || "").split(" ");
  3511.  
  3512.                while ( (type = types[ i++ ]) != null ) {
  3513.                        match = rnamespaces.exec( type );
  3514.                        namespaces = "";
  3515.  
  3516.                        if ( match )  {
  3517.                                namespaces = match[0];
  3518.                                type = type.replace( rnamespaces, "" );
  3519.                        }
  3520.  
  3521.                        if ( type === "hover" ) {
  3522.                                types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
  3523.                                continue;
  3524.                        }
  3525.  
  3526.                        preType = type;
  3527.  
  3528.                        if ( liveMap[ type ] ) {
  3529.                                types.push( liveMap[ type ] + namespaces );
  3530.                                type = type + namespaces;
  3531.  
  3532.                        } else {
  3533.                                type = (liveMap[ type ] || type) + namespaces;
  3534.                        }
  3535.  
  3536.                        if ( name === "live" ) {
  3537.                                // bind live handler
  3538.                                for ( var j = 0, l = context.length; j < l; j++ ) {
  3539.                                        jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
  3540.                                                { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
  3541.                                }
  3542.  
  3543.                        } else {
  3544.                                // unbind live handler
  3545.                                context.unbind( "live." + liveConvert( type, selector ), fn );
  3546.                        }
  3547.                }
  3548.  
  3549.                return this;
  3550.        };
  3551.    });
  3552.  
  3553.    function liveHandler( event ) {
  3554.        var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
  3555.                elems = [],
  3556.                selectors = [],
  3557.                events = jQuery._data( this, "events" );
  3558.  
  3559.        // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
  3560.        if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
  3561.                return;
  3562.        }
  3563.  
  3564.        if ( event.namespace ) {
  3565.                namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
  3566.        }
  3567.  
  3568.        event.liveFired = this;
  3569.  
  3570.        var live = events.live.slice(0);
  3571.  
  3572.        for ( j = 0; j < live.length; j++ ) {
  3573.                handleObj = live[j];
  3574.  
  3575.                if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
  3576.                        selectors.push( handleObj.selector );
  3577.  
  3578.                } else {
  3579.                        live.splice( j--, 1 );
  3580.                }
  3581.        }
  3582.  
  3583.        match = jQuery( event.target ).closest( selectors, event.currentTarget );
  3584.  
  3585.        for ( i = 0, l = match.length; i < l; i++ ) {
  3586.                close = match[i];
  3587.  
  3588.                for ( j = 0; j < live.length; j++ ) {
  3589.                        handleObj = live[j];
  3590.  
  3591.                        if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
  3592.                                elem = close.elem;
  3593.                                related = null;
  3594.  
  3595.                                // Those two events require additional checking
  3596.                                if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
  3597.                                        event.type = handleObj.preType;
  3598.                                        related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
  3599.  
  3600.                                        // Make sure not to accidentally match a child element with the same selector
  3601.                                        if ( related && jQuery.contains( elem, related ) ) {
  3602.                                                related = elem;
  3603.                                        }
  3604.                                }
  3605.  
  3606.                                if ( !related || related !== elem ) {
  3607.                                        elems.push({ elem: elem, handleObj: handleObj, level: close.level });
  3608.                                }
  3609.                        }
  3610.                }
  3611.        }
  3612.  
  3613.        for ( i = 0, l = elems.length; i < l; i++ ) {
  3614.                match = elems[i];
  3615.  
  3616.                if ( maxLevel && match.level > maxLevel ) {
  3617.                         break;
  3618.                 }
  3619.  
  3620.                 event.currentTarget = match.elem;
  3621.                 event.data = match.handleObj.data;
  3622.                 event.handleObj = match.handleObj;
  3623.  
  3624.                 ret = match.handleObj.origHandler.apply( match.elem, arguments );
  3625.  
  3626.                 if ( ret === false || event.isPropagationStopped() ) {
  3627.                         maxLevel = match.level;
  3628.  
  3629.                         if ( ret === false ) {
  3630.                                 stop = false;
  3631.                         }
  3632.                         if ( event.isImmediatePropagationStopped() ) {
  3633.                                 break;
  3634.                         }
  3635.                 }
  3636.         }
  3637.  
  3638.         return stop;
  3639.     }
  3640.  
  3641.     function liveConvert( type, selector ) {
  3642.         return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");
  3643.     }
  3644.  
  3645.     jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
  3646.         "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  3647.         "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
  3648.  
  3649.         // Handle event binding
  3650.         jQuery.fn[ name ] = function( data, fn ) {
  3651.                 if ( fn == null ) {
  3652.                         fn = data;
  3653.                         data = null;
  3654.                 }
  3655.  
  3656.                 return arguments.length > 0 ?
  3657.                         this.bind( name, data, fn ) :
  3658.                         this.trigger( name );
  3659.         };
  3660.  
  3661.         if ( jQuery.attrFn ) {
  3662.                 jQuery.attrFn[ name ] = true;
  3663.         }
  3664.     });
  3665.  
  3666.  
  3667.  
  3668.     /*!
  3669.     * Sizzle CSS Selector Engine
  3670.     *  Copyright 2011, The Dojo Foundation
  3671.     *  Released under the MIT, BSD, and GPL Licenses.
  3672.     *  More information: http://sizzlejs.com/
  3673.     */
  3674.     (function(){
  3675.  
  3676.     var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
  3677.         done = 0,
  3678.         toString = Object.prototype.toString,
  3679.         hasDuplicate = false,
  3680.         baseHasDuplicate = true,
  3681.         rBackslash = /\\/g,
  3682.         rNonWord = /\W/;
  3683.  
  3684.     // Here we check if the JavaScript engine is using some sort of
  3685.     // optimization where it does not always call our comparision
  3686.     // function. If that is the case, discard the hasDuplicate value.
  3687.     //   Thus far that includes Google Chrome.
  3688.     [0, 0].sort(function() {
  3689.         baseHasDuplicate = false;
  3690.         return 0;
  3691.     });
  3692.  
  3693.     var Sizzle = function( selector, context, results, seed ) {
  3694.         results = results || [];
  3695.         context = context || document;
  3696.  
  3697.         var origContext = context;
  3698.  
  3699.         if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
  3700.                return [];
  3701.         }
  3702.        
  3703.         if ( !selector || typeof selector !== "string" ) {
  3704.                 return results;
  3705.         }
  3706.  
  3707.         var m, set, checkSet, extra, ret, cur, pop, i,
  3708.                 prune = true,
  3709.                 contextXML = Sizzle.isXML( context ),
  3710.                 parts = [],
  3711.                 soFar = selector;
  3712.        
  3713.         // Reset the position of the chunker regexp (start from head)
  3714.         do {
  3715.                 chunker.exec( "" );
  3716.                 m = chunker.exec( soFar );
  3717.  
  3718.                 if ( m ) {
  3719.                         soFar = m[3];
  3720.                
  3721.                         parts.push( m[1] );
  3722.                
  3723.                         if ( m[2] ) {
  3724.                                 extra = m[3];
  3725.                                 break;
  3726.                         }
  3727.                 }
  3728.         } while ( m );
  3729.  
  3730.         if ( parts.length > 1 && origPOS.exec( selector ) ) {
  3731.  
  3732.                if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
  3733.                        set = posProcess( parts[0] + parts[1], context );
  3734.  
  3735.                 } else {
  3736.                         set = Expr.relative[ parts[0] ] ?
  3737.                                 [ context ] :
  3738.                                 Sizzle( parts.shift(), context );
  3739.  
  3740.                         while ( parts.length ) {
  3741.                                 selector = parts.shift();
  3742.  
  3743.                                 if ( Expr.relative[ selector ] ) {
  3744.                                         selector += parts.shift();
  3745.                                 }
  3746.                                
  3747.                                 set = posProcess( selector, set );
  3748.                         }
  3749.                 }
  3750.  
  3751.         } else {
  3752.                 // Take a shortcut and set the context if the root selector is an ID
  3753.                 // (but not if it'll be faster if the inner selector is an ID)
  3754.                 if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
  3755.                                Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
  3756.  
  3757.                        ret = Sizzle.find( parts.shift(), context, contextXML );
  3758.                         context = ret.expr ?
  3759.                                 Sizzle.filter( ret.expr, ret.set )[0] :
  3760.                                 ret.set[0];
  3761.                 }
  3762.  
  3763.                 if ( context ) {
  3764.                         ret = seed ?
  3765.                                 { expr: parts.pop(), set: makeArray(seed) } :
  3766.                                 Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
  3767.  
  3768.                         set = ret.expr ?
  3769.                                 Sizzle.filter( ret.expr, ret.set ) :
  3770.                                 ret.set;
  3771.  
  3772.                         if ( parts.length > 0 ) {
  3773.                                 checkSet = makeArray( set );
  3774.  
  3775.                         } else {
  3776.                                 prune = false;
  3777.                         }
  3778.  
  3779.                         while ( parts.length ) {
  3780.                                 cur = parts.pop();
  3781.                                 pop = cur;
  3782.  
  3783.                                 if ( !Expr.relative[ cur ] ) {
  3784.                                         cur = "";
  3785.                                 } else {
  3786.                                         pop = parts.pop();
  3787.                                 }
  3788.  
  3789.                                 if ( pop == null ) {
  3790.                                         pop = context;
  3791.                                 }
  3792.  
  3793.                                 Expr.relative[ cur ]( checkSet, pop, contextXML );
  3794.                         }
  3795.  
  3796.                 } else {
  3797.                         checkSet = parts = [];
  3798.                 }
  3799.         }
  3800.  
  3801.         if ( !checkSet ) {
  3802.                 checkSet = set;
  3803.         }
  3804.  
  3805.         if ( !checkSet ) {
  3806.                 Sizzle.error( cur || selector );
  3807.         }
  3808.  
  3809.         if ( toString.call(checkSet) === "[object Array]" ) {
  3810.                 if ( !prune ) {
  3811.                         results.push.apply( results, checkSet );
  3812.  
  3813.                 } else if ( context && context.nodeType === 1 ) {
  3814.                        for ( i = 0; checkSet[i] != null; i++ ) {
  3815.                                 if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
  3816.                                        results.push( set[i] );
  3817.                                 }
  3818.                         }
  3819.  
  3820.                 } else {
  3821.                         for ( i = 0; checkSet[i] != null; i++ ) {
  3822.                                 if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
  3823.                                        results.push( set[i] );
  3824.                                 }
  3825.                         }
  3826.                 }
  3827.  
  3828.         } else {
  3829.                 makeArray( checkSet, results );
  3830.         }
  3831.  
  3832.         if ( extra ) {
  3833.                 Sizzle( extra, origContext, results, seed );
  3834.                 Sizzle.uniqueSort( results );
  3835.         }
  3836.  
  3837.         return results;
  3838.     };
  3839.  
  3840.     Sizzle.uniqueSort = function( results ) {
  3841.         if ( sortOrder ) {
  3842.                 hasDuplicate = baseHasDuplicate;
  3843.                 results.sort( sortOrder );
  3844.  
  3845.                 if ( hasDuplicate ) {
  3846.                         for ( var i = 1; i < results.length; i++ ) {
  3847.                                if ( results[i] === results[ i - 1 ] ) {
  3848.                                        results.splice( i--, 1 );
  3849.                                }
  3850.                        }
  3851.                }
  3852.        }
  3853.  
  3854.        return results;
  3855.    };
  3856.  
  3857.    Sizzle.matches = function( expr, set ) {
  3858.        return Sizzle( expr, null, null, set );
  3859.    };
  3860.  
  3861.    Sizzle.matchesSelector = function( node, expr ) {
  3862.        return Sizzle( expr, null, null, [node] ).length > 0;
  3863.     };
  3864.  
  3865.     Sizzle.find = function( expr, context, isXML ) {
  3866.         var set;
  3867.  
  3868.         if ( !expr ) {
  3869.                 return [];
  3870.         }
  3871.  
  3872.         for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
  3873.                var match,
  3874.                        type = Expr.order[i];
  3875.                
  3876.                if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
  3877.                        var left = match[1];
  3878.                        match.splice( 1, 1 );
  3879.  
  3880.                        if ( left.substr( left.length - 1 ) !== "\\" ) {
  3881.                                match[1] = (match[1] || "").replace( rBackslash, "" );
  3882.                                set = Expr.find[ type ]( match, context, isXML );
  3883.  
  3884.                                if ( set != null ) {
  3885.                                        expr = expr.replace( Expr.match[ type ], "" );
  3886.                                        break;
  3887.                                }
  3888.                        }
  3889.                }
  3890.        }
  3891.  
  3892.        if ( !set ) {
  3893.                set = typeof context.getElementsByTagName !== "undefined" ?
  3894.                        context.getElementsByTagName( "*" ) :
  3895.                        [];
  3896.        }
  3897.  
  3898.        return { set: set, expr: expr };
  3899.    };
  3900.  
  3901.    Sizzle.filter = function( expr, set, inplace, not ) {
  3902.        var match, anyFound,
  3903.                old = expr,
  3904.                result = [],
  3905.                curLoop = set,
  3906.                isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
  3907.  
  3908.        while ( expr && set.length ) {
  3909.                for ( var type in Expr.filter ) {
  3910.                        if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
  3911.                                var found, item,
  3912.                                        filter = Expr.filter[ type ],
  3913.                                        left = match[1];
  3914.  
  3915.                                anyFound = false;
  3916.  
  3917.                                match.splice(1,1);
  3918.  
  3919.                                if ( left.substr( left.length - 1 ) === "\\" ) {
  3920.                                        continue;
  3921.                                }
  3922.  
  3923.                                if ( curLoop === result ) {
  3924.                                        result = [];
  3925.                                }
  3926.  
  3927.                                if ( Expr.preFilter[ type ] ) {
  3928.                                        match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
  3929.  
  3930.                                        if ( !match ) {
  3931.                                                anyFound = found = true;
  3932.  
  3933.                                        } else if ( match === true ) {
  3934.                                                continue;
  3935.                                        }
  3936.                                }
  3937.  
  3938.                                if ( match ) {
  3939.                                        for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
  3940.                                                if ( item ) {
  3941.                                                        found = filter( item, match, i, curLoop );
  3942.                                                        var pass = not ^ !!found;
  3943.  
  3944.                                                        if ( inplace && found != null ) {
  3945.                                                                if ( pass ) {
  3946.                                                                        anyFound = true;
  3947.  
  3948.                                                                } else {
  3949.                                                                        curLoop[i] = false;
  3950.                                                                }
  3951.  
  3952.                                                        } else if ( pass ) {
  3953.                                                                result.push( item );
  3954.                                                                anyFound = true;
  3955.                                                        }
  3956.                                                }
  3957.                                        }
  3958.                                }
  3959.  
  3960.                                if ( found !== undefined ) {
  3961.                                        if ( !inplace ) {
  3962.                                                curLoop = result;
  3963.                                        }
  3964.  
  3965.                                        expr = expr.replace( Expr.match[ type ], "" );
  3966.  
  3967.                                        if ( !anyFound ) {
  3968.                                                return [];
  3969.                                        }
  3970.  
  3971.                                        break;
  3972.                                }
  3973.                        }
  3974.                }
  3975.  
  3976.                // Improper expression
  3977.                if ( expr === old ) {
  3978.                        if ( anyFound == null ) {
  3979.                                Sizzle.error( expr );
  3980.  
  3981.                        } else {
  3982.                                break;
  3983.                        }
  3984.                }
  3985.  
  3986.                old = expr;
  3987.        }
  3988.  
  3989.        return curLoop;
  3990.    };
  3991.  
  3992.    Sizzle.error = function( msg ) {
  3993.        throw "Syntax error, unrecognized expression: " + msg;
  3994.    };
  3995.  
  3996.    var Expr = Sizzle.selectors = {
  3997.        order: [ "ID", "NAME", "TAG" ],
  3998.  
  3999.        match: {
  4000.                ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
  4001.                CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
  4002.                NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
  4003.                ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
  4004.                TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
  4005.                CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
  4006.                POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
  4007.                PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
  4008.        },
  4009.        leftMatch: {},
  4010.        attrMap: {
  4011.                "class": "className",
  4012.                "for": "htmlFor"
  4013.        },
  4014.        attrHandle: {
  4015.                href: function( elem ) {
  4016.                        return elem.getAttribute( "href" );
  4017.                },
  4018.                type: function( elem ) {
  4019.                        return elem.getAttribute( "type" );
  4020.                }
  4021.        },
  4022.        relative: {
  4023.                "+": function(checkSet, part){
  4024.                        var isPartStr = typeof part === "string",
  4025.                                isTag = isPartStr && !rNonWord.test( part ),
  4026.                                isPartStrNotTag = isPartStr && !isTag;
  4027.                        if ( isTag ) {
  4028.                                part = part.toLowerCase();
  4029.                        }
  4030.                        for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
  4031.                                if ( (elem = checkSet[i]) ) {
  4032.                                        while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
  4033.                                        checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
  4034.                                                elem || false :
  4035.                                                elem === part;
  4036.                                }
  4037.                        }
  4038.                        if ( isPartStrNotTag ) {
  4039.                                Sizzle.filter( part, checkSet, true );
  4040.                        }
  4041.                },
  4042.                ">": function( checkSet, part ) {
  4043.                         var elem,
  4044.                                 isPartStr = typeof part === "string",
  4045.                                 i = 0,
  4046.                                 l = checkSet.length;
  4047.  
  4048.                         if ( isPartStr && !rNonWord.test( part ) ) {
  4049.                                part = part.toLowerCase();
  4050.  
  4051.                                 for ( ; i < l; i++ ) {
  4052.                                        elem = checkSet[i];
  4053.  
  4054.                                        if ( elem ) {
  4055.                                                var parent = elem.parentNode;
  4056.                                                checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
  4057.                                        }
  4058.                                }
  4059.  
  4060.                        } else {
  4061.                                for ( ; i < l; i++ ) {
  4062.                                        elem = checkSet[i];
  4063.  
  4064.                                        if ( elem ) {
  4065.                                                checkSet[i] = isPartStr ?
  4066.                                                        elem.parentNode :
  4067.                                                        elem.parentNode === part;
  4068.                                        }
  4069.                                }
  4070.  
  4071.                                if ( isPartStr ) {
  4072.                                        Sizzle.filter( part, checkSet, true );
  4073.                                }
  4074.                        }
  4075.                },
  4076.  
  4077.                "": function(checkSet, part, isXML){
  4078.                        var nodeCheck,
  4079.                                doneName = done++,
  4080.                                checkFn = dirCheck;
  4081.  
  4082.                        if ( typeof part === "string" && !rNonWord.test( part ) ) {
  4083.                                part = part.toLowerCase();
  4084.                                nodeCheck = part;
  4085.                                checkFn = dirNodeCheck;
  4086.                        }
  4087.  
  4088.                        checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
  4089.                },
  4090.  
  4091.                "~": function( checkSet, part, isXML ) {
  4092.                        var nodeCheck,
  4093.                                doneName = done++,
  4094.                                checkFn = dirCheck;
  4095.  
  4096.                        if ( typeof part === "string" && !rNonWord.test( part ) ) {
  4097.                                part = part.toLowerCase();
  4098.                                nodeCheck = part;
  4099.                                checkFn = dirNodeCheck;
  4100.                        }
  4101.  
  4102.                        checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
  4103.                }
  4104.        },
  4105.  
  4106.        find: {
  4107.                ID: function( match, context, isXML ) {
  4108.                        if ( typeof context.getElementById !== "undefined" && !isXML ) {
  4109.                                var m = context.getElementById(match[1]);
  4110.                                // Check parentNode to catch when Blackberry 4.6 returns
  4111.                                // nodes that are no longer in the document #6963
  4112.                                return m && m.parentNode ? [m] : [];
  4113.                        }
  4114.                },
  4115.  
  4116.                NAME: function( match, context ) {
  4117.                        if ( typeof context.getElementsByName !== "undefined" ) {
  4118.                                var ret = [],
  4119.                                        results = context.getElementsByName( match[1] );
  4120.  
  4121.                                for ( var i = 0, l = results.length; i < l; i++ ) {
  4122.                                        if ( results[i].getAttribute("name") === match[1] ) {
  4123.                                                ret.push( results[i] );
  4124.                                        }
  4125.                                }
  4126.  
  4127.                                return ret.length === 0 ? null : ret;
  4128.                        }
  4129.                },
  4130.  
  4131.                TAG: function( match, context ) {
  4132.                        if ( typeof context.getElementsByTagName !== "undefined" ) {
  4133.                                return context.getElementsByTagName( match[1] );
  4134.                        }
  4135.                }
  4136.        },
  4137.        preFilter: {
  4138.                CLASS: function( match, curLoop, inplace, result, not, isXML ) {
  4139.                        match = " " + match[1].replace( rBackslash, "" ) + " ";
  4140.  
  4141.                        if ( isXML ) {
  4142.                                return match;
  4143.                        }
  4144.  
  4145.                        for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
  4146.                                if ( elem ) {
  4147.                                        if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
  4148.                                                 if ( !inplace ) {
  4149.                                                         result.push( elem );
  4150.                                                 }
  4151.  
  4152.                                         } else if ( inplace ) {
  4153.                                                 curLoop[i] = false;
  4154.                                         }
  4155.                                 }
  4156.                         }
  4157.  
  4158.                         return false;
  4159.                 },
  4160.  
  4161.                 ID: function( match ) {
  4162.                         return match[1].replace( rBackslash, "" );
  4163.                 },
  4164.  
  4165.                 TAG: function( match, curLoop ) {
  4166.                         return match[1].replace( rBackslash, "" ).toLowerCase();
  4167.                 },
  4168.  
  4169.                 CHILD: function( match ) {
  4170.                         if ( match[1] === "nth" ) {
  4171.                                 if ( !match[2] ) {
  4172.                                         Sizzle.error( match[0] );
  4173.                                 }
  4174.  
  4175.                                 match[2] = match[2].replace(/^\+|\s*/g, '');
  4176.  
  4177.                                 // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
  4178.                                 var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
  4179.                                         match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
  4180.                                        !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
  4181.  
  4182.                                 // calculate the numbers (first)n+(last) including if they are negative
  4183.                                 match[2] = (test[1] + (test[2] || 1)) - 0;
  4184.                                 match[3] = test[3] - 0;
  4185.                         }
  4186.                         else if ( match[2] ) {
  4187.                                 Sizzle.error( match[0] );
  4188.                         }
  4189.  
  4190.                         // TODO: Move to normal caching system
  4191.                         match[0] = done++;
  4192.  
  4193.                         return match;
  4194.                 },
  4195.  
  4196.                 ATTR: function( match, curLoop, inplace, result, not, isXML ) {
  4197.                         var name = match[1] = match[1].replace( rBackslash, "" );
  4198.                        
  4199.                         if ( !isXML && Expr.attrMap[name] ) {
  4200.                                match[1] = Expr.attrMap[name];
  4201.                         }
  4202.  
  4203.                         // Handle if an un-quoted value was used
  4204.                         match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
  4205.  
  4206.                         if ( match[2] === "~=" ) {
  4207.                                 match[4] = " " + match[4] + " ";
  4208.                         }
  4209.  
  4210.                         return match;
  4211.                 },
  4212.  
  4213.                 PSEUDO: function( match, curLoop, inplace, result, not ) {
  4214.                         if ( match[1] === "not" ) {
  4215.                                 // If we're dealing with a complex expression, or a simple one
  4216.                                 if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
  4217.                                         match[3] = Sizzle(match[3], null, null, curLoop);
  4218.  
  4219.                                 } else {
  4220.                                         var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
  4221.  
  4222.                                         if ( !inplace ) {
  4223.                                                 result.push.apply( result, ret );
  4224.                                         }
  4225.  
  4226.                                         return false;
  4227.                                 }
  4228.  
  4229.                         } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
  4230.                                 return true;
  4231.                         }
  4232.                        
  4233.                         return match;
  4234.                 },
  4235.  
  4236.                 POS: function( match ) {
  4237.                         match.unshift( true );
  4238.  
  4239.                         return match;
  4240.                 }
  4241.         },
  4242.        
  4243.         filters: {
  4244.                 enabled: function( elem ) {
  4245.                         return elem.disabled === false && elem.type !== "hidden";
  4246.                 },
  4247.  
  4248.                 disabled: function( elem ) {
  4249.                         return elem.disabled === true;
  4250.                 },
  4251.  
  4252.                 checked: function( elem ) {
  4253.                         return elem.checked === true;
  4254.                 },
  4255.                
  4256.                 selected: function( elem ) {
  4257.                         // Accessing this property makes selected-by-default
  4258.                         // options in Safari work properly
  4259.                         if ( elem.parentNode ) {
  4260.                                 elem.parentNode.selectedIndex;
  4261.                         }
  4262.                        
  4263.                         return elem.selected === true;
  4264.                 },
  4265.  
  4266.                 parent: function( elem ) {
  4267.                         return !!elem.firstChild;
  4268.                 },
  4269.  
  4270.                 empty: function( elem ) {
  4271.                         return !elem.firstChild;
  4272.                 },
  4273.  
  4274.                 has: function( elem, i, match ) {
  4275.                         return !!Sizzle( match[3], elem ).length;
  4276.                 },
  4277.  
  4278.                 header: function( elem ) {
  4279.                         return (/h\d/i).test( elem.nodeName );
  4280.                 },
  4281.  
  4282.                 text: function( elem ) {
  4283.                         var attr = elem.getAttribute( "type" ), type = elem.type;
  4284.                         // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
  4285.                         // use getAttribute instead to test this case
  4286.                         return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
  4287.                 },
  4288.  
  4289.                 radio: function( elem ) {
  4290.                         return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
  4291.                 },
  4292.  
  4293.                 checkbox: function( elem ) {
  4294.                         return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
  4295.                 },
  4296.  
  4297.                 file: function( elem ) {
  4298.                         return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
  4299.                 },
  4300.  
  4301.                 password: function( elem ) {
  4302.                         return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
  4303.                 },
  4304.  
  4305.                 submit: function( elem ) {
  4306.                         var name = elem.nodeName.toLowerCase();
  4307.                         return (name === "input" || name === "button") && "submit" === elem.type;
  4308.                 },
  4309.  
  4310.                 image: function( elem ) {
  4311.                         return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
  4312.                 },
  4313.  
  4314.                 reset: function( elem ) {
  4315.                         var name = elem.nodeName.toLowerCase();
  4316.                         return (name === "input" || name === "button") && "reset" === elem.type;
  4317.                 },
  4318.  
  4319.                 button: function( elem ) {
  4320.                         var name = elem.nodeName.toLowerCase();
  4321.                         return name === "input" && "button" === elem.type || name === "button";
  4322.                 },
  4323.  
  4324.                 input: function( elem ) {
  4325.                         return (/input|select|textarea|button/i).test( elem.nodeName );
  4326.                 },
  4327.  
  4328.                 focus: function( elem ) {
  4329.                         return elem === elem.ownerDocument.activeElement;
  4330.                 }
  4331.         },
  4332.         setFilters: {
  4333.                 first: function( elem, i ) {
  4334.                         return i === 0;
  4335.                 },
  4336.  
  4337.                 last: function( elem, i, match, array ) {
  4338.                         return i === array.length - 1;
  4339.                 },
  4340.  
  4341.                 even: function( elem, i ) {
  4342.                         return i % 2 === 0;
  4343.                 },
  4344.  
  4345.                 odd: function( elem, i ) {
  4346.                         return i % 2 === 1;
  4347.                 },
  4348.  
  4349.                 lt: function( elem, i, match ) {
  4350.                         return i < match[3] - 0;
  4351.                },
  4352.  
  4353.                gt: function( elem, i, match ) {
  4354.                        return i > match[3] - 0;
  4355.                 },
  4356.  
  4357.                 nth: function( elem, i, match ) {
  4358.                         return match[3] - 0 === i;
  4359.                 },
  4360.  
  4361.                 eq: function( elem, i, match ) {
  4362.                         return match[3] - 0 === i;
  4363.                 }
  4364.         },
  4365.         filter: {
  4366.                 PSEUDO: function( elem, match, i, array ) {
  4367.                         var name = match[1],
  4368.                                 filter = Expr.filters[ name ];
  4369.  
  4370.                         if ( filter ) {
  4371.                                 return filter( elem, i, match, array );
  4372.  
  4373.                         } else if ( name === "contains" ) {
  4374.                                 return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
  4375.  
  4376.                         } else if ( name === "not" ) {
  4377.                                 var not = match[3];
  4378.  
  4379.                                 for ( var j = 0, l = not.length; j < l; j++ ) {
  4380.                                        if ( not[j] === elem ) {
  4381.                                                return false;
  4382.                                        }
  4383.                                }
  4384.  
  4385.                                return true;
  4386.  
  4387.                        } else {
  4388.                                Sizzle.error( name );
  4389.                        }
  4390.                },
  4391.  
  4392.                CHILD: function( elem, match ) {
  4393.                        var type = match[1],
  4394.                                node = elem;
  4395.  
  4396.                        switch ( type ) {
  4397.                                case "only":
  4398.                                case "first":
  4399.                                        while ( (node = node.previousSibling) )  {
  4400.                                                if ( node.nodeType === 1 ) {
  4401.                                                        return false;
  4402.                                                }
  4403.                                        }
  4404.  
  4405.                                        if ( type === "first" ) {
  4406.                                                return true;
  4407.                                        }
  4408.  
  4409.                                        node = elem;
  4410.  
  4411.                                case "last":
  4412.                                        while ( (node = node.nextSibling) )      {
  4413.                                                if ( node.nodeType === 1 ) {
  4414.                                                        return false;
  4415.                                                }
  4416.                                        }
  4417.  
  4418.                                        return true;
  4419.  
  4420.                                case "nth":
  4421.                                        var first = match[2],
  4422.                                                last = match[3];
  4423.  
  4424.                                        if ( first === 1 && last === 0 ) {
  4425.                                                return true;
  4426.                                        }
  4427.                                        
  4428.                                        var doneName = match[0],
  4429.                                                parent = elem.parentNode;
  4430.        
  4431.                                        if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
  4432.                                                var count = 0;
  4433.                                                
  4434.                                                for ( node = parent.firstChild; node; node = node.nextSibling ) {
  4435.                                                        if ( node.nodeType === 1 ) {
  4436.                                                                node.nodeIndex = ++count;
  4437.                                                        }
  4438.                                                }
  4439.  
  4440.                                                parent.sizcache = doneName;
  4441.                                        }
  4442.                                        
  4443.                                        var diff = elem.nodeIndex - last;
  4444.  
  4445.                                        if ( first === 0 ) {
  4446.                                                return diff === 0;
  4447.  
  4448.                                        } else {
  4449.                                                return ( diff % first === 0 && diff / first >= 0 );
  4450.                                         }
  4451.                         }
  4452.                 },
  4453.  
  4454.                 ID: function( elem, match ) {
  4455.                         return elem.nodeType === 1 && elem.getAttribute("id") === match;
  4456.                 },
  4457.  
  4458.                 TAG: function( elem, match ) {
  4459.                         return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
  4460.                 },
  4461.                
  4462.                 CLASS: function( elem, match ) {
  4463.                         return (" " + (elem.className || elem.getAttribute("class")) + " ")
  4464.                                 .indexOf( match ) > -1;
  4465.                 },
  4466.  
  4467.                 ATTR: function( elem, match ) {
  4468.                         var name = match[1],
  4469.                                 result = Expr.attrHandle[ name ] ?
  4470.                                         Expr.attrHandle[ name ]( elem ) :
  4471.                                         elem[ name ] != null ?
  4472.                                                 elem[ name ] :
  4473.                                                 elem.getAttribute( name ),
  4474.                                 value = result + "",
  4475.                                 type = match[2],
  4476.                                 check = match[4];
  4477.  
  4478.                         return result == null ?
  4479.                                 type === "!=" :
  4480.                                 type === "=" ?
  4481.                                 value === check :
  4482.                                 type === "*=" ?
  4483.                                 value.indexOf(check) >= 0 :
  4484.                                 type === "~=" ?
  4485.                                 (" " + value + " ").indexOf(check) >= 0 :
  4486.                                 !check ?
  4487.                                 value && result !== false :
  4488.                                type === "!=" ?
  4489.                                value !== check :
  4490.                                type === "^=" ?
  4491.                                value.indexOf(check) === 0 :
  4492.                                type === "$=" ?
  4493.                                value.substr(value.length - check.length) === check :
  4494.                                type === "|=" ?
  4495.                                value === check || value.substr(0, check.length + 1) === check + "-" :
  4496.                                false;
  4497.                 },
  4498.  
  4499.                 POS: function( elem, match, i, array ) {
  4500.                         var name = match[2],
  4501.                                 filter = Expr.setFilters[ name ];
  4502.  
  4503.                         if ( filter ) {
  4504.                                 return filter( elem, i, match, array );
  4505.                         }
  4506.                 }
  4507.         }
  4508.     };
  4509.  
  4510.     var origPOS = Expr.match.POS,
  4511.         fescape = function(all, num){
  4512.                 return "\\" + (num - 0 + 1);
  4513.         };
  4514.  
  4515.     for ( var type in Expr.match ) {
  4516.         Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
  4517.         Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
  4518.     }
  4519.  
  4520.     var makeArray = function( array, results ) {
  4521.         array = Array.prototype.slice.call( array, 0 );
  4522.  
  4523.         if ( results ) {
  4524.                 results.push.apply( results, array );
  4525.                 return results;
  4526.         }
  4527.        
  4528.         return array;
  4529.     };
  4530.  
  4531.     // Perform a simple check to determine if the browser is capable of
  4532.     // converting a NodeList to an array using builtin methods.
  4533.     // Also verifies that the returned array holds DOM nodes
  4534.     // (which is not the case in the Blackberry browser)
  4535.     try {
  4536.         Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
  4537.  
  4538.     // Provide a fallback method if it does not work
  4539.     } catch( e ) {
  4540.         makeArray = function( array, results ) {
  4541.                 var i = 0,
  4542.                         ret = results || [];
  4543.  
  4544.                 if ( toString.call(array) === "[object Array]" ) {
  4545.                         Array.prototype.push.apply( ret, array );
  4546.  
  4547.                 } else {
  4548.                         if ( typeof array.length === "number" ) {
  4549.                                 for ( var l = array.length; i < l; i++ ) {
  4550.                                        ret.push( array[i] );
  4551.                                }
  4552.  
  4553.                        } else {
  4554.                                for ( ; array[i]; i++ ) {
  4555.                                        ret.push( array[i] );
  4556.                                }
  4557.                        }
  4558.                }
  4559.  
  4560.                return ret;
  4561.        };
  4562.    }
  4563.  
  4564.    var sortOrder, siblingCheck;
  4565.  
  4566.    if ( document.documentElement.compareDocumentPosition ) {
  4567.        sortOrder = function( a, b ) {
  4568.                if ( a === b ) {
  4569.                        hasDuplicate = true;
  4570.                        return 0;
  4571.                }
  4572.  
  4573.                if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
  4574.                        return a.compareDocumentPosition ? -1 : 1;
  4575.                }
  4576.  
  4577.                return a.compareDocumentPosition(b) & 4 ? -1 : 1;
  4578.        };
  4579.  
  4580.    } else {
  4581.        sortOrder = function( a, b ) {
  4582.                // The nodes are identical, we can exit early
  4583.                if ( a === b ) {
  4584.                        hasDuplicate = true;
  4585.                        return 0;
  4586.  
  4587.                // Fallback to using sourceIndex (in IE) if it's available on both nodes
  4588.                } else if ( a.sourceIndex && b.sourceIndex ) {
  4589.                        return a.sourceIndex - b.sourceIndex;
  4590.                }
  4591.                var al, bl,
  4592.                        ap = [],
  4593.                        bp = [],
  4594.                        aup = a.parentNode,
  4595.                        bup = b.parentNode,
  4596.                        cur = aup;
  4597.                // If the nodes are siblings (or identical) we can do a quick check
  4598.                if ( aup === bup ) {
  4599.                        return siblingCheck( a, b );
  4600.                // If no parents were found then the nodes are disconnected
  4601.                } else if ( !aup ) {
  4602.                        return -1;
  4603.                } else if ( !bup ) {
  4604.                        return 1;
  4605.                }
  4606.                // Otherwise they're somewhere else in the tree so we need
  4607.                // to build up a full list of the parentNodes for comparison
  4608.                while ( cur ) {
  4609.                        ap.unshift( cur );
  4610.                        cur = cur.parentNode;
  4611.                }
  4612.  
  4613.                cur = bup;
  4614.  
  4615.                while ( cur ) {
  4616.                        bp.unshift( cur );
  4617.                        cur = cur.parentNode;
  4618.                }
  4619.  
  4620.                al = ap.length;
  4621.                bl = bp.length;
  4622.  
  4623.                // Start walking down the tree looking for a discrepancy
  4624.                for ( var i = 0; i < al && i < bl; i++ ) {
  4625.                        if ( ap[i] !== bp[i] ) {
  4626.                                return siblingCheck( ap[i], bp[i] );
  4627.                        }
  4628.                }
  4629.  
  4630.                // We ended someplace up the tree so do a sibling check
  4631.                return i === al ?
  4632.                        siblingCheck( a, bp[i], -1 ) :
  4633.                        siblingCheck( ap[i], b, 1 );
  4634.        };
  4635.  
  4636.        siblingCheck = function( a, b, ret ) {
  4637.                if ( a === b ) {
  4638.                        return ret;
  4639.                }
  4640.  
  4641.                var cur = a.nextSibling;
  4642.  
  4643.                while ( cur ) {
  4644.                        if ( cur === b ) {
  4645.                                return -1;
  4646.                        }
  4647.  
  4648.                        cur = cur.nextSibling;
  4649.                }
  4650.  
  4651.                return 1;
  4652.        };
  4653.    }
  4654.  
  4655.    // Utility function for retreiving the text value of an array of DOM nodes
  4656.    Sizzle.getText = function( elems ) {
  4657.        var ret = "", elem;
  4658.  
  4659.        for ( var i = 0; elems[i]; i++ ) {
  4660.                elem = elems[i];
  4661.  
  4662.                // Get the text from text nodes and CDATA nodes
  4663.                if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
  4664.                        ret += elem.nodeValue;
  4665.  
  4666.                // Traverse everything else, except comment nodes
  4667.                } else if ( elem.nodeType !== 8 ) {
  4668.                        ret += Sizzle.getText( elem.childNodes );
  4669.                }
  4670.        }
  4671.  
  4672.        return ret;
  4673.    };
  4674.  
  4675.    // Check to see if the browser returns elements by name when
  4676.    // querying by getElementById (and provide a workaround)
  4677.    (function(){
  4678.        // We're going to inject a fake input element with a specified name
  4679.        var form = document.createElement("div"),
  4680.                id = "script" + (new Date()).getTime(),
  4681.                root = document.documentElement;
  4682.        form.innerHTML = "<a name='" + id + "'/>";
  4683.  
  4684.         // Inject it into the root element, check its status, and remove it quickly
  4685.         root.insertBefore( form, root.firstChild );
  4686.  
  4687.         // The workaround has to do additional checks after a getElementById
  4688.         // Which slows things down for other browsers (hence the branching)
  4689.         if ( document.getElementById( id ) ) {
  4690.                 Expr.find.ID = function( match, context, isXML ) {
  4691.                         if ( typeof context.getElementById !== "undefined" && !isXML ) {
  4692.                                var m = context.getElementById(match[1]);
  4693.  
  4694.                                 return m ?
  4695.                                         m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
  4696.                                                [m] :
  4697.                                                undefined :
  4698.                                        [];
  4699.                         }
  4700.                 };
  4701.  
  4702.                 Expr.filter.ID = function( elem, match ) {
  4703.                         var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
  4704.  
  4705.                         return elem.nodeType === 1 && node && node.nodeValue === match;
  4706.                 };
  4707.         }
  4708.  
  4709.         root.removeChild( form );
  4710.  
  4711.         // release memory in IE
  4712.         root = form = null;
  4713.     })();
  4714.  
  4715.     (function(){
  4716.         // Check to see if the browser returns only elements
  4717.         // when doing getElementsByTagName("*")
  4718.  
  4719.         // Create a fake element
  4720.         var div = document.createElement("div");
  4721.         div.appendChild( document.createComment("") );
  4722.  
  4723.         // Make sure no comments are found
  4724.         if ( div.getElementsByTagName("*").length > 0 ) {
  4725.                 Expr.find.TAG = function( match, context ) {
  4726.                         var results = context.getElementsByTagName( match[1] );
  4727.  
  4728.                         // Filter out possible comments
  4729.                         if ( match[1] === "*" ) {
  4730.                                 var tmp = [];
  4731.  
  4732.                                 for ( var i = 0; results[i]; i++ ) {
  4733.                                         if ( results[i].nodeType === 1 ) {
  4734.                                                 tmp.push( results[i] );
  4735.                                         }
  4736.                                 }
  4737.  
  4738.                                 results = tmp;
  4739.                         }
  4740.  
  4741.                         return results;
  4742.                 };
  4743.         }
  4744.  
  4745.         // Check to see if an attribute returns normalized href attributes
  4746.         div.innerHTML = "<a href='#'><\/a>";
  4747.  
  4748.         if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
  4749.                        div.firstChild.getAttribute("href") !== "#" ) {
  4750.  
  4751.                Expr.attrHandle.href = function( elem ) {
  4752.                        return elem.getAttribute( "href", 2 );
  4753.                 };
  4754.         }
  4755.  
  4756.         // release memory in IE
  4757.         div = null;
  4758.     })();
  4759.  
  4760.     if ( document.querySelectorAll ) {
  4761.         (function(){
  4762.                 var oldSizzle = Sizzle,
  4763.                         div = document.createElement("div"),
  4764.                         id = "__sizzle__";
  4765.  
  4766.                 div.innerHTML = "<p class='TEST'><\/p>";
  4767.  
  4768.                 // Safari can't handle uppercase or unicode characters when
  4769.                 // in quirks mode.
  4770.                 if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
  4771.                        return;
  4772.                 }
  4773.        
  4774.                 Sizzle = function( query, context, extra, seed ) {
  4775.                         context = context || document;
  4776.  
  4777.                         // Only use querySelectorAll on non-XML documents
  4778.                         // (ID selectors don't work in non-HTML documents)
  4779.                         if ( !seed && !Sizzle.isXML(context) ) {
  4780.                                // See if we find a selector to speed up
  4781.                                var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
  4782.                                
  4783.                                 if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
  4784.                                        // Speed-up: Sizzle("TAG")
  4785.                                        if ( match[1] ) {
  4786.                                                return makeArray( context.getElementsByTagName( query ), extra );
  4787.                                        
  4788.                                         // Speed-up: Sizzle(".CLASS")
  4789.                                         } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
  4790.                                                return makeArray( context.getElementsByClassName( match[2] ), extra );
  4791.                                         }
  4792.                                 }
  4793.                                
  4794.                                 if ( context.nodeType === 9 ) {
  4795.                                         // Speed-up: Sizzle("body")
  4796.                                         // The body element only exists once, optimize finding it
  4797.                                         if ( query === "body" && context.body ) {
  4798.                                                return makeArray( [ context.body ], extra );
  4799.                                                
  4800.                                         // Speed-up: Sizzle("#ID")
  4801.                                         } else if ( match && match[3] ) {
  4802.                                                var elem = context.getElementById( match[3] );
  4803.  
  4804.                                                 // Check parentNode to catch when Blackberry 4.6 returns
  4805.                                                 // nodes that are no longer in the document #6963
  4806.                                                 if ( elem && elem.parentNode ) {
  4807.                                                        // Handle the case where IE and Opera return items
  4808.                                                        // by name instead of ID
  4809.                                                        if ( elem.id === match[3] ) {
  4810.                                                                return makeArray( [ elem ], extra );
  4811.                                                         }
  4812.                                                        
  4813.                                                 } else {
  4814.                                                         return makeArray( [], extra );
  4815.                                                 }
  4816.                                         }
  4817.                                        
  4818.                                         try {
  4819.                                                 return makeArray( context.querySelectorAll(query), extra );
  4820.                                         } catch(qsaError) {}
  4821.  
  4822.                                 // qSA works strangely on Element-rooted queries
  4823.                                 // We can work around this by specifying an extra ID on the root
  4824.                                 // and working up from there (Thanks to Andrew Dupont for the technique)
  4825.                                 // IE 8 doesn't work on object elements
  4826.                                 } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
  4827.                                        var oldContext = context,
  4828.                                                old = context.getAttribute( "id" ),
  4829.                                                nid = old || id,
  4830.                                                hasParent = context.parentNode,
  4831.                                                relativeHierarchySelector = /^\s*[+~]/.test( query );
  4832.  
  4833.                                         if ( !old ) {
  4834.                                                 context.setAttribute( "id", nid );
  4835.                                         } else {
  4836.                                                 nid = nid.replace( /'/g, "\\$&" );
  4837.                                         }
  4838.                                         if ( relativeHierarchySelector && hasParent ) {
  4839.                                                context = context.parentNode;
  4840.                                         }
  4841.  
  4842.                                         try {
  4843.                                                 if ( !relativeHierarchySelector || hasParent ) {
  4844.                                                         return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
  4845.                                                 }
  4846.  
  4847.                                         } catch(pseudoError) {
  4848.                                         } finally {
  4849.                                                 if ( !old ) {
  4850.                                                         oldContext.removeAttribute( "id" );
  4851.                                                 }
  4852.                                         }
  4853.                                 }
  4854.                         }
  4855.                
  4856.                         return oldSizzle(query, context, extra, seed);
  4857.                 };
  4858.  
  4859.                 for ( var prop in oldSizzle ) {
  4860.                         Sizzle[ prop ] = oldSizzle[ prop ];
  4861.                 }
  4862.  
  4863.                 // release memory in IE
  4864.                 div = null;
  4865.         })();
  4866.     }
  4867.  
  4868.     (function(){
  4869.         var html = document.documentElement,
  4870.                 matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
  4871.  
  4872.         if ( matches ) {
  4873.                 // Check to see if it's possible to do matchesSelector
  4874.                 // on a disconnected node (IE 9 fails this)
  4875.                 var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
  4876.                         pseudoWorks = false;
  4877.  
  4878.                 try {
  4879.                         // This should fail with an exception
  4880.                         // Gecko does not error, returns false instead
  4881.                         matches.call( document.documentElement, "[test!='']:sizzle" );
  4882.        
  4883.                 } catch( pseudoError ) {
  4884.                         pseudoWorks = true;
  4885.                 }
  4886.  
  4887.                 Sizzle.matchesSelector = function( node, expr ) {
  4888.                         // Make sure that attribute selectors are quoted
  4889.                         expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
  4890.  
  4891.                         if ( !Sizzle.isXML( node ) ) {
  4892.                                 try {
  4893.                                         if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
  4894.                                                var ret = matches.call( node, expr );
  4895.  
  4896.                                                 // IE 9's matchesSelector returns false on disconnected nodes
  4897.                                                 if ( ret || !disconnectedMatch ||
  4898.                                                                 // As well, disconnected nodes are said to be in a document
  4899.                                                                 // fragment in IE 9, so check for that
  4900.                                                                 node.document && node.document.nodeType !== 11 ) {
  4901.                                                        return ret;
  4902.                                                 }
  4903.                                         }
  4904.                                 } catch(e) {}
  4905.                         }
  4906.  
  4907.                         return Sizzle(expr, null, null, [node]).length > 0;
  4908.                 };
  4909.         }
  4910.     })();
  4911.  
  4912.     (function(){
  4913.         var div = document.createElement("div");
  4914.  
  4915.         div.innerHTML = "<div class='test e'><\/div><div class='test'><\/div>";
  4916.  
  4917.         // Opera can't find a second classname (in 9.6)
  4918.         // Also, make sure that getElementsByClassName actually exists
  4919.         if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
  4920.                 return;
  4921.         }
  4922.  
  4923.         // Safari caches class attributes, doesn't catch changes (in 3.2)
  4924.         div.lastChild.className = "e";
  4925.  
  4926.         if ( div.getElementsByClassName("e").length === 1 ) {
  4927.                 return;
  4928.         }
  4929.        
  4930.         Expr.order.splice(1, 0, "CLASS");
  4931.         Expr.find.CLASS = function( match, context, isXML ) {
  4932.                 if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
  4933.                        return context.getElementsByClassName(match[1]);
  4934.                 }
  4935.         };
  4936.  
  4937.         // release memory in IE
  4938.         div = null;
  4939.     })();
  4940.  
  4941.     function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
  4942.         for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  4943.                var elem = checkSet[i];
  4944.  
  4945.                if ( elem ) {
  4946.                        var match = false;
  4947.  
  4948.                        elem = elem[dir];
  4949.  
  4950.                        while ( elem ) {
  4951.                                if ( elem.sizcache === doneName ) {
  4952.                                        match = checkSet[elem.sizset];
  4953.                                        break;
  4954.                                }
  4955.  
  4956.                                if ( elem.nodeType === 1 && !isXML ){
  4957.                                        elem.sizcache = doneName;
  4958.                                        elem.sizset = i;
  4959.                                }
  4960.  
  4961.                                if ( elem.nodeName.toLowerCase() === cur ) {
  4962.                                        match = elem;
  4963.                                        break;
  4964.                                }
  4965.  
  4966.                                elem = elem[dir];
  4967.                        }
  4968.  
  4969.                        checkSet[i] = match;
  4970.                }
  4971.        }
  4972.    }
  4973.  
  4974.    function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
  4975.        for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  4976.                var elem = checkSet[i];
  4977.  
  4978.                if ( elem ) {
  4979.                        var match = false;
  4980.                        
  4981.                        elem = elem[dir];
  4982.  
  4983.                        while ( elem ) {
  4984.                                if ( elem.sizcache === doneName ) {
  4985.                                        match = checkSet[elem.sizset];
  4986.                                        break;
  4987.                                }
  4988.  
  4989.                                if ( elem.nodeType === 1 ) {
  4990.                                        if ( !isXML ) {
  4991.                                                elem.sizcache = doneName;
  4992.                                                elem.sizset = i;
  4993.                                        }
  4994.  
  4995.                                        if ( typeof cur !== "string" ) {
  4996.                                                if ( elem === cur ) {
  4997.                                                        match = true;
  4998.                                                        break;
  4999.                                                }
  5000.  
  5001.                                        } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
  5002.                                                 match = elem;
  5003.                                                 break;
  5004.                                         }
  5005.                                 }
  5006.  
  5007.                                 elem = elem[dir];
  5008.                         }
  5009.  
  5010.                         checkSet[i] = match;
  5011.                 }
  5012.         }
  5013.     }
  5014.  
  5015.     if ( document.documentElement.contains ) {
  5016.         Sizzle.contains = function( a, b ) {
  5017.                 return a !== b && (a.contains ? a.contains(b) : true);
  5018.         };
  5019.  
  5020.     } else if ( document.documentElement.compareDocumentPosition ) {
  5021.         Sizzle.contains = function( a, b ) {
  5022.                 return !!(a.compareDocumentPosition(b) & 16);
  5023.         };
  5024.  
  5025.     } else {
  5026.         Sizzle.contains = function() {
  5027.                 return false;
  5028.         };
  5029.     }
  5030.  
  5031.     Sizzle.isXML = function( elem ) {
  5032.         // documentElement is verified for cases where it doesn't yet exist
  5033.         // (such as loading iframes in IE - #4833)
  5034.         var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
  5035.  
  5036.         return documentElement ? documentElement.nodeName !== "HTML" : false;
  5037.     };
  5038.  
  5039.     var posProcess = function( selector, context ) {
  5040.         var match,
  5041.                 tmpSet = [],
  5042.                 later = "",
  5043.                 root = context.nodeType ? [context] : context;
  5044.  
  5045.         // Position selectors must be done after the filter
  5046.         // And so must :not(positional) so we move all PSEUDOs to the end
  5047.         while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
  5048.                 later += match[0];
  5049.                 selector = selector.replace( Expr.match.PSEUDO, "" );
  5050.         }
  5051.  
  5052.         selector = Expr.relative[selector] ? selector + "*" : selector;
  5053.  
  5054.         for ( var i = 0, l = root.length; i < l; i++ ) {
  5055.                Sizzle( selector, root[i], tmpSet );
  5056.        }
  5057.  
  5058.        return Sizzle.filter( later, tmpSet );
  5059.    };
  5060.  
  5061.    // EXPOSE
  5062.    jQuery.find = Sizzle;
  5063.    jQuery.expr = Sizzle.selectors;
  5064.    jQuery.expr[":"] = jQuery.expr.filters;
  5065.    jQuery.unique = Sizzle.uniqueSort;
  5066.    jQuery.text = Sizzle.getText;
  5067.    jQuery.isXMLDoc = Sizzle.isXML;
  5068.    jQuery.contains = Sizzle.contains;
  5069.  
  5070.  
  5071.    })();
  5072.  
  5073.  
  5074.    var runtil = /Until$/,
  5075.        rparentsprev = /^(?:parents|prevUntil|prevAll)/,
  5076.        // Note: This RegExp should be improved, or likely pulled from Sizzle
  5077.        rmultiselector = /,/,
  5078.        isSimple = /^.[^:#\[\.,]*$/,
  5079.        slice = Array.prototype.slice,
  5080.        POS = jQuery.expr.match.POS,
  5081.        // methods guaranteed to produce a unique set when starting from a unique set
  5082.        guaranteedUnique = {
  5083.                children: true,
  5084.                contents: true,
  5085.                next: true,
  5086.                prev: true
  5087.        };
  5088.  
  5089.    jQuery.fn.extend({
  5090.        find: function( selector ) {
  5091.                var self = this,
  5092.                        i, l;
  5093.  
  5094.                if ( typeof selector !== "string" ) {
  5095.                        return jQuery( selector ).filter(function() {
  5096.                                for ( i = 0, l = self.length; i < l; i++ ) {
  5097.                                        if ( jQuery.contains( self[ i ], this ) ) {
  5098.                                                return true;
  5099.                                        }
  5100.                                }
  5101.                        });
  5102.                }
  5103.  
  5104.                var ret = this.pushStack( "", "find", selector ),
  5105.                        length, n, r;
  5106.  
  5107.                for ( i = 0, l = this.length; i < l; i++ ) {
  5108.                        length = ret.length;
  5109.                        jQuery.find( selector, this[i], ret );
  5110.  
  5111.                        if ( i > 0 ) {
  5112.                                 // Make sure that the results are unique
  5113.                                 for ( n = length; n < ret.length; n++ ) {
  5114.                                        for ( r = 0; r < length; r++ ) {
  5115.                                                if ( ret[r] === ret[n] ) {
  5116.                                                        ret.splice(n--, 1);
  5117.                                                        break;
  5118.                                                }
  5119.                                        }
  5120.                                }
  5121.                        }
  5122.                }
  5123.  
  5124.                return ret;
  5125.        },
  5126.  
  5127.        has: function( target ) {
  5128.                var targets = jQuery( target );
  5129.                return this.filter(function() {
  5130.                        for ( var i = 0, l = targets.length; i < l; i++ ) {
  5131.                                if ( jQuery.contains( this, targets[i] ) ) {
  5132.                                        return true;
  5133.                                }
  5134.                        }
  5135.                });
  5136.        },
  5137.  
  5138.        not: function( selector ) {
  5139.                return this.pushStack( winnow(this, selector, false), "not", selector);
  5140.        },
  5141.  
  5142.        filter: function( selector ) {
  5143.                return this.pushStack( winnow(this, selector, true), "filter", selector );
  5144.        },
  5145.  
  5146.        is: function( selector ) {
  5147.                return !!selector && ( typeof selector === "string" ?
  5148.                        jQuery.filter( selector, this ).length > 0 :
  5149.                         this.filter( selector ).length > 0 );
  5150.         },
  5151.  
  5152.         closest: function( selectors, context ) {
  5153.                 var ret = [], i, l, cur = this[0];
  5154.                
  5155.                 // Array
  5156.                 if ( jQuery.isArray( selectors ) ) {
  5157.                         var match, selector,
  5158.                                 matches = {},
  5159.                                 level = 1;
  5160.  
  5161.                         if ( cur && selectors.length ) {
  5162.                                for ( i = 0, l = selectors.length; i < l; i++ ) {
  5163.                                        selector = selectors[i];
  5164.  
  5165.                                        if ( !matches[ selector ] ) {
  5166.                                                matches[ selector ] = POS.test( selector ) ?
  5167.                                                        jQuery( selector, context || this.context ) :
  5168.                                                        selector;
  5169.                                        }
  5170.                                }
  5171.  
  5172.                                while ( cur && cur.ownerDocument && cur !== context ) {
  5173.                                        for ( selector in matches ) {
  5174.                                                match = matches[ selector ];
  5175.  
  5176.                                                if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {
  5177.                                                         ret.push({ selector: selector, elem: cur, level: level });
  5178.                                                 }
  5179.                                         }
  5180.  
  5181.                                         cur = cur.parentNode;
  5182.                                         level++;
  5183.                                 }
  5184.                         }
  5185.  
  5186.                         return ret;
  5187.                 }
  5188.  
  5189.                 // String
  5190.                 var pos = POS.test( selectors ) || typeof selectors !== "string" ?
  5191.                                 jQuery( selectors, context || this.context ) :
  5192.                                 0;
  5193.  
  5194.                 for ( i = 0, l = this.length; i < l; i++ ) {
  5195.                        cur = this[i];
  5196.  
  5197.                        while ( cur ) {
  5198.                                if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
  5199.                                         ret.push( cur );
  5200.                                         break;
  5201.  
  5202.                                 } else {
  5203.                                         cur = cur.parentNode;
  5204.                                         if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
  5205.                                                 break;
  5206.                                         }
  5207.                                 }
  5208.                         }
  5209.                 }
  5210.  
  5211.                 ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
  5212.  
  5213.                 return this.pushStack( ret, "closest", selectors );
  5214.         },
  5215.  
  5216.         // Determine the position of an element within
  5217.         // the matched set of elements
  5218.         index: function( elem ) {
  5219.  
  5220.                 // No argument, return index in parent
  5221.                 if ( !elem ) {
  5222.                         return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
  5223.                 }
  5224.  
  5225.                 // index in selector
  5226.                 if ( typeof elem === "string" ) {
  5227.                         return jQuery.inArray( this[0], jQuery( elem ) );
  5228.                 }
  5229.  
  5230.                 // Locate the position of the desired element
  5231.                 return jQuery.inArray(
  5232.                         // If it receives a jQuery object, the first element is used
  5233.                         elem.jquery ? elem[0] : elem, this );
  5234.         },
  5235.  
  5236.         add: function( selector, context ) {
  5237.                 var set = typeof selector === "string" ?
  5238.                                 jQuery( selector, context ) :
  5239.                                 jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
  5240.                        all = jQuery.merge( this.get(), set );
  5241.  
  5242.                 return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
  5243.                         all :
  5244.                         jQuery.unique( all ) );
  5245.         },
  5246.  
  5247.         andSelf: function() {
  5248.                 return this.add( this.prevObject );
  5249.         }
  5250.     });
  5251.  
  5252.     // A painfully simple check to see if an element is disconnected
  5253.     // from a document (should be improved, where feasible).
  5254.     function isDisconnected( node ) {
  5255.         return !node || !node.parentNode || node.parentNode.nodeType === 11;
  5256.     }
  5257.  
  5258.     jQuery.each({
  5259.         parent: function( elem ) {
  5260.                 var parent = elem.parentNode;
  5261.                 return parent && parent.nodeType !== 11 ? parent : null;
  5262.         },
  5263.         parents: function( elem ) {
  5264.                 return jQuery.dir( elem, "parentNode" );
  5265.         },
  5266.         parentsUntil: function( elem, i, until ) {
  5267.                 return jQuery.dir( elem, "parentNode", until );
  5268.         },
  5269.         next: function( elem ) {
  5270.                 return jQuery.nth( elem, 2, "nextSibling" );
  5271.         },
  5272.         prev: function( elem ) {
  5273.                 return jQuery.nth( elem, 2, "previousSibling" );
  5274.         },
  5275.         nextAll: function( elem ) {
  5276.                 return jQuery.dir( elem, "nextSibling" );
  5277.         },
  5278.         prevAll: function( elem ) {
  5279.                 return jQuery.dir( elem, "previousSibling" );
  5280.         },
  5281.         nextUntil: function( elem, i, until ) {
  5282.                 return jQuery.dir( elem, "nextSibling", until );
  5283.         },
  5284.         prevUntil: function( elem, i, until ) {
  5285.                 return jQuery.dir( elem, "previousSibling", until );
  5286.         },
  5287.         siblings: function( elem ) {
  5288.                 return jQuery.sibling( elem.parentNode.firstChild, elem );
  5289.         },
  5290.         children: function( elem ) {
  5291.                 return jQuery.sibling( elem.firstChild );
  5292.         },
  5293.         contents: function( elem ) {
  5294.                 return jQuery.nodeName( elem, "iframe" ) ?
  5295.                         elem.contentDocument || elem.contentWindow.document :
  5296.                         jQuery.makeArray( elem.childNodes );
  5297.         }
  5298.     }, function( name, fn ) {
  5299.         jQuery.fn[ name ] = function( until, selector ) {
  5300.                 var ret = jQuery.map( this, fn, until ),
  5301.                         // The variable 'args' was introduced in
  5302.                         // https://github.com/jquery/jquery/commit/52a0238
  5303.                         // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
  5304.                         // http://code.google.com/p/v8/issues/detail?id=1050
  5305.                         args = slice.call(arguments);
  5306.  
  5307.                 if ( !runtil.test( name ) ) {
  5308.                         selector = until;
  5309.                 }
  5310.  
  5311.                 if ( selector && typeof selector === "string" ) {
  5312.                        ret = jQuery.filter( selector, ret );
  5313.                 }
  5314.  
  5315.                 ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
  5316.  
  5317.                 if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
  5318.                        ret = ret.reverse();
  5319.                 }
  5320.  
  5321.                 return this.pushStack( ret, name, args.join(",") );
  5322.         };
  5323.     });
  5324.  
  5325.     jQuery.extend({
  5326.         filter: function( expr, elems, not ) {
  5327.                 if ( not ) {
  5328.                         expr = ":not(" + expr + ")";
  5329.                 }
  5330.  
  5331.                 return elems.length === 1 ?
  5332.                         jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
  5333.                         jQuery.find.matches(expr, elems);
  5334.         },
  5335.  
  5336.         dir: function( elem, dir, until ) {
  5337.                 var matched = [],
  5338.                         cur = elem[ dir ];
  5339.  
  5340.                 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
  5341.                        if ( cur.nodeType === 1 ) {
  5342.                                matched.push( cur );
  5343.                         }
  5344.                         cur = cur[dir];
  5345.                 }
  5346.                 return matched;
  5347.         },
  5348.  
  5349.         nth: function( cur, result, dir, elem ) {
  5350.                 result = result || 1;
  5351.                 var num = 0;
  5352.  
  5353.                 for ( ; cur; cur = cur[dir] ) {
  5354.                         if ( cur.nodeType === 1 && ++num === result ) {
  5355.                                break;
  5356.                         }
  5357.                 }
  5358.  
  5359.                 return cur;
  5360.         },
  5361.  
  5362.         sibling: function( n, elem ) {
  5363.                 var r = [];
  5364.  
  5365.                 for ( ; n; n = n.nextSibling ) {
  5366.                         if ( n.nodeType === 1 && n !== elem ) {
  5367.                                r.push( n );
  5368.                         }
  5369.                 }
  5370.  
  5371.                 return r;
  5372.         }
  5373.     });
  5374.  
  5375.     // Implement the identical functionality for filter and not
  5376.     function winnow( elements, qualifier, keep ) {
  5377.  
  5378.         // Can't pass null or undefined to indexOf in Firefox 4
  5379.         // Set to 0 to skip string check
  5380.         qualifier = qualifier || 0;
  5381.  
  5382.         if ( jQuery.isFunction( qualifier ) ) {
  5383.                 return jQuery.grep(elements, function( elem, i ) {
  5384.                         var retVal = !!qualifier.call( elem, i, elem );
  5385.                         return retVal === keep;
  5386.                 });
  5387.  
  5388.         } else if ( qualifier.nodeType ) {
  5389.                 return jQuery.grep(elements, function( elem, i ) {
  5390.                         return (elem === qualifier) === keep;
  5391.                 });
  5392.  
  5393.         } else if ( typeof qualifier === "string" ) {
  5394.                 var filtered = jQuery.grep(elements, function( elem ) {
  5395.                         return elem.nodeType === 1;
  5396.                 });
  5397.  
  5398.                 if ( isSimple.test( qualifier ) ) {
  5399.                         return jQuery.filter(qualifier, filtered, !keep);
  5400.                 } else {
  5401.                         qualifier = jQuery.filter( qualifier, filtered );
  5402.                 }
  5403.         }
  5404.  
  5405.         return jQuery.grep(elements, function( elem, i ) {
  5406.                 return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
  5407.         });
  5408.     }
  5409.  
  5410.  
  5411.  
  5412.  
  5413.     var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
  5414.         rleadingWhitespace = /^\s+/,
  5415.         rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
  5416.         rtagName = /<([\w:]+)/,
  5417.        rtbody = /<tbody/i,
  5418.        rhtml = /<|&#?\w+;/,
  5419.        rnocache = /<(?:script|object|embed|option|style)/i,
  5420.        // checked="checked" or checked
  5421.        rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  5422.        rscriptType = /\/(java|ecma)script/i,
  5423.        rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
  5424.        wrapMap = {
  5425.                option: [ 1, "<select multiple='multiple'>", "<\/select>" ],
  5426.                 legend: [ 1, "<fieldset>", "<\/fieldset>" ],
  5427.                 thead: [ 1, "<table>", "<\/table>" ],
  5428.                 tr: [ 2, "<table><tbody>", "<\/tbody><\/table>" ],
  5429.                 td: [ 3, "<table><tbody><tr>", "<\/tr><\/tbody><\/table>" ],
  5430.                 col: [ 2, "<table><tbody><\/tbody><colgroup>", "<\/colgroup><\/table>" ],
  5431.                 area: [ 1, "<map>", "<\/map>" ],
  5432.                 _default: [ 0, "", "" ]
  5433.         };
  5434.  
  5435.     wrapMap.optgroup = wrapMap.option;
  5436.     wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  5437.     wrapMap.th = wrapMap.td;
  5438.  
  5439.     // IE can't serialize <link> and <script> tags normally
  5440.     if ( !jQuery.support.htmlSerialize ) {
  5441.         wrapMap._default = [ 1, "div<div>", "<\/div>" ];
  5442.     }
  5443.  
  5444.     jQuery.fn.extend({
  5445.         text: function( text ) {
  5446.                 if ( jQuery.isFunction(text) ) {
  5447.                         return this.each(function(i) {
  5448.                                 var self = jQuery( this );
  5449.  
  5450.                                 self.text( text.call(this, i, self.text()) );
  5451.                         });
  5452.                 }
  5453.  
  5454.                 if ( typeof text !== "object" && text !== undefined ) {
  5455.                        return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
  5456.                 }
  5457.  
  5458.                 return jQuery.text( this );
  5459.         },
  5460.  
  5461.         wrapAll: function( html ) {
  5462.                 if ( jQuery.isFunction( html ) ) {
  5463.                         return this.each(function(i) {
  5464.                                 jQuery(this).wrapAll( html.call(this, i) );
  5465.                         });
  5466.                 }
  5467.  
  5468.                 if ( this[0] ) {
  5469.                         // The elements to wrap the target around
  5470.                         var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
  5471.  
  5472.                         if ( this[0].parentNode ) {
  5473.                                 wrap.insertBefore( this[0] );
  5474.                         }
  5475.  
  5476.                         wrap.map(function() {
  5477.                                 var elem = this;
  5478.  
  5479.                                 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
  5480.                                        elem = elem.firstChild;
  5481.                                 }
  5482.  
  5483.                                 return elem;
  5484.                         }).append( this );
  5485.                 }
  5486.  
  5487.                 return this;
  5488.         },
  5489.  
  5490.         wrapInner: function( html ) {
  5491.                 if ( jQuery.isFunction( html ) ) {
  5492.                         return this.each(function(i) {
  5493.                                 jQuery(this).wrapInner( html.call(this, i) );
  5494.                         });
  5495.                 }
  5496.  
  5497.                 return this.each(function() {
  5498.                         var self = jQuery( this ),
  5499.                                 contents = self.contents();
  5500.  
  5501.                         if ( contents.length ) {
  5502.                                 contents.wrapAll( html );
  5503.  
  5504.                         } else {
  5505.                                 self.append( html );
  5506.                         }
  5507.                 });
  5508.         },
  5509.  
  5510.         wrap: function( html ) {
  5511.                 return this.each(function() {
  5512.                         jQuery( this ).wrapAll( html );
  5513.                 });
  5514.         },
  5515.  
  5516.         unwrap: function() {
  5517.                 return this.parent().each(function() {
  5518.                         if ( !jQuery.nodeName( this, "body" ) ) {
  5519.                                 jQuery( this ).replaceWith( this.childNodes );
  5520.                         }
  5521.                 }).end();
  5522.         },
  5523.  
  5524.         append: function() {
  5525.                 return this.domManip(arguments, true, function( elem ) {
  5526.                         if ( this.nodeType === 1 ) {
  5527.                                 this.appendChild( elem );
  5528.                         }
  5529.                 });
  5530.         },
  5531.  
  5532.         prepend: function() {
  5533.                 return this.domManip(arguments, true, function( elem ) {
  5534.                         if ( this.nodeType === 1 ) {
  5535.                                 this.insertBefore( elem, this.firstChild );
  5536.                         }
  5537.                 });
  5538.         },
  5539.  
  5540.         before: function() {
  5541.                 if ( this[0] && this[0].parentNode ) {
  5542.                        return this.domManip(arguments, false, function( elem ) {
  5543.                                this.parentNode.insertBefore( elem, this );
  5544.                         });
  5545.                 } else if ( arguments.length ) {
  5546.                         var set = jQuery(arguments[0]);
  5547.                         set.push.apply( set, this.toArray() );
  5548.                         return this.pushStack( set, "before", arguments );
  5549.                 }
  5550.         },
  5551.  
  5552.         after: function() {
  5553.                 if ( this[0] && this[0].parentNode ) {
  5554.                        return this.domManip(arguments, false, function( elem ) {
  5555.                                this.parentNode.insertBefore( elem, this.nextSibling );
  5556.                         });
  5557.                 } else if ( arguments.length ) {
  5558.                         var set = this.pushStack( this, "after", arguments );
  5559.                         set.push.apply( set, jQuery(arguments[0]).toArray() );
  5560.                         return set;
  5561.                 }
  5562.         },
  5563.  
  5564.         // keepData is for internal use only--do not document
  5565.         remove: function( selector, keepData ) {
  5566.                 for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
  5567.                         if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
  5568.                                 if ( !keepData && elem.nodeType === 1 ) {
  5569.                                        jQuery.cleanData( elem.getElementsByTagName("*") );
  5570.                                         jQuery.cleanData( [ elem ] );
  5571.                                 }
  5572.  
  5573.                                 if ( elem.parentNode ) {
  5574.                                         elem.parentNode.removeChild( elem );
  5575.                                 }
  5576.                         }
  5577.                 }
  5578.  
  5579.                 return this;
  5580.         },
  5581.  
  5582.         empty: function() {
  5583.                 for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
  5584.                         // Remove element nodes and prevent memory leaks
  5585.                         if ( elem.nodeType === 1 ) {
  5586.                                 jQuery.cleanData( elem.getElementsByTagName("*") );
  5587.                         }
  5588.  
  5589.                         // Remove any remaining nodes
  5590.                         while ( elem.firstChild ) {
  5591.                                 elem.removeChild( elem.firstChild );
  5592.                         }
  5593.                 }
  5594.  
  5595.                 return this;
  5596.         },
  5597.  
  5598.         clone: function( dataAndEvents, deepDataAndEvents ) {
  5599.                 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  5600.                 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  5601.  
  5602.                 return this.map( function () {
  5603.                         return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  5604.                 });
  5605.         },
  5606.  
  5607.         html: function( value ) {
  5608.                 if ( value === undefined ) {
  5609.                         return this[0] && this[0].nodeType === 1 ?
  5610.                                this[0].innerHTML.replace(rinlinejQuery, "") :
  5611.                                null;
  5612.  
  5613.                 // See if we can take a shortcut and just use innerHTML
  5614.                 } else if ( typeof value === "string" && !rnocache.test( value ) &&
  5615.                        (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
  5616.                        !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
  5617.  
  5618.                        value = value.replace(rxhtmlTag, "<$1></$2>");
  5619.  
  5620.                         try {
  5621.                                 for ( var i = 0, l = this.length; i < l; i++ ) {
  5622.                                        // Remove element nodes and prevent memory leaks
  5623.                                        if ( this[i].nodeType === 1 ) {
  5624.                                                jQuery.cleanData( this[i].getElementsByTagName("*") );
  5625.                                                this[i].innerHTML = value;
  5626.                                        }
  5627.                                }
  5628.  
  5629.                        // If using innerHTML throws an exception, use the fallback method
  5630.                        } catch(e) {
  5631.                                this.empty().append( value );
  5632.                        }
  5633.  
  5634.                } else if ( jQuery.isFunction( value ) ) {
  5635.                        this.each(function(i){
  5636.                                var self = jQuery( this );
  5637.  
  5638.                                self.html( value.call(this, i, self.html()) );
  5639.                        });
  5640.  
  5641.                } else {
  5642.                        this.empty().append( value );
  5643.                }
  5644.  
  5645.                return this;
  5646.        },
  5647.  
  5648.        replaceWith: function( value ) {
  5649.                if ( this[0] && this[0].parentNode ) {
  5650.                        // Make sure that the elements are removed from the DOM before they are inserted
  5651.                        // this can help fix replacing a parent with child elements
  5652.                        if ( jQuery.isFunction( value ) ) {
  5653.                                return this.each(function(i) {
  5654.                                        var self = jQuery(this), old = self.html();
  5655.                                        self.replaceWith( value.call( this, i, old ) );
  5656.                                });
  5657.                        }
  5658.  
  5659.                        if ( typeof value !== "string" ) {
  5660.                                value = jQuery( value ).detach();
  5661.                        }
  5662.  
  5663.                        return this.each(function() {
  5664.                                var next = this.nextSibling,
  5665.                                        parent = this.parentNode;
  5666.  
  5667.                                jQuery( this ).remove();
  5668.  
  5669.                                if ( next ) {
  5670.                                        jQuery(next).before( value );
  5671.                                } else {
  5672.                                        jQuery(parent).append( value );
  5673.                                }
  5674.                        });
  5675.                } else {
  5676.                        return this.length ?
  5677.                                this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
  5678.                                this;
  5679.                }
  5680.        },
  5681.  
  5682.        detach: function( selector ) {
  5683.                return this.remove( selector, true );
  5684.        },
  5685.  
  5686.        domManip: function( args, table, callback ) {
  5687.                var results, first, fragment, parent,
  5688.                        value = args[0],
  5689.                        scripts = [];
  5690.  
  5691.                // We can't cloneNode fragments that contain checked, in WebKit
  5692.                if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
  5693.                        return this.each(function() {
  5694.                                jQuery(this).domManip( args, table, callback, true );
  5695.                        });
  5696.                }
  5697.                if ( jQuery.isFunction(value) ) {
  5698.                        return this.each(function(i) {
  5699.                                var self = jQuery(this);
  5700.                                args[0] = value.call(this, i, table ? self.html() : undefined);
  5701.                                self.domManip( args, table, callback );
  5702.                        });
  5703.                }
  5704.                if ( this[0] ) {
  5705.                        parent = value && value.parentNode;
  5706.                        // If we're in a fragment, just use that instead of building a new one
  5707.                        if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
  5708.                                results = { fragment: parent };
  5709.  
  5710.                        } else {
  5711.                                results = jQuery.buildFragment( args, this, scripts );
  5712.                        }
  5713.  
  5714.                        fragment = results.fragment;
  5715.  
  5716.                        if ( fragment.childNodes.length === 1 ) {
  5717.                                first = fragment = fragment.firstChild;
  5718.                        } else {
  5719.                                first = fragment.firstChild;
  5720.                        }
  5721.  
  5722.                        if ( first ) {
  5723.                                table = table && jQuery.nodeName( first, "tr" );
  5724.  
  5725.                                for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
  5726.                                        callback.call(
  5727.                                                table ?
  5728.                                                        root(this[i], first) :
  5729.                                                        this[i],
  5730.                                                // Make sure that we do not leak memory by inadvertently discarding
  5731.                                                // the original fragment (which might have attached data) instead of
  5732.                                                // using it; in addition, use the original fragment object for the last
  5733.                                                // item instead of first because it can end up being emptied incorrectly
  5734.                                                // in certain situations (Bug #8070).
  5735.                                                // Fragments from the fragment cache must always be cloned and never used
  5736.                                                // in place.
  5737.                                                results.cacheable || (l > 1 && i < lastIndex) ?
  5738.                                                        jQuery.clone( fragment, true, true ) :
  5739.                                                        fragment
  5740.                                        );
  5741.                                 }
  5742.                         }
  5743.  
  5744.                         if ( scripts.length ) {
  5745.                                 jQuery.each( scripts, evalScript );
  5746.                         }
  5747.                 }
  5748.  
  5749.                 return this;
  5750.         }
  5751.     });
  5752.  
  5753.     function root( elem, cur ) {
  5754.         return jQuery.nodeName(elem, "table") ?
  5755.                 (elem.getElementsByTagName("tbody")[0] ||
  5756.                 elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
  5757.                 elem;
  5758.     }
  5759.  
  5760.     function cloneCopyEvent( src, dest ) {
  5761.  
  5762.         if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
  5763.                 return;
  5764.         }
  5765.  
  5766.         var internalKey = jQuery.expando,
  5767.                 oldData = jQuery.data( src ),
  5768.                 curData = jQuery.data( dest, oldData );
  5769.  
  5770.         // Switch to use the internal data object, if it exists, for the next
  5771.         // stage of data copying
  5772.         if ( (oldData = oldData[ internalKey ]) ) {
  5773.                 var events = oldData.events;
  5774.                                 curData = curData[ internalKey ] = jQuery.extend({}, oldData);
  5775.  
  5776.                 if ( events ) {
  5777.                         delete curData.handle;
  5778.                         curData.events = {};
  5779.  
  5780.                         for ( var type in events ) {
  5781.                                 for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
  5782.                                        jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
  5783.                                }
  5784.                        }
  5785.                }
  5786.        }
  5787.    }
  5788.  
  5789.    function cloneFixAttributes( src, dest ) {
  5790.        var nodeName;
  5791.  
  5792.        // We do not need to do anything for non-Elements
  5793.        if ( dest.nodeType !== 1 ) {
  5794.                return;
  5795.        }
  5796.  
  5797.        // clearAttributes removes the attributes, which we don't want,
  5798.        // but also removes the attachEvent events, which we *do* want
  5799.        if ( dest.clearAttributes ) {
  5800.                dest.clearAttributes();
  5801.        }
  5802.        // mergeAttributes, in contrast, only merges back on the
  5803.        // original attributes, not the events
  5804.        if ( dest.mergeAttributes ) {
  5805.                dest.mergeAttributes( src );
  5806.        }
  5807.        nodeName = dest.nodeName.toLowerCase();
  5808.        // IE6-8 fail to clone children inside object elements that use
  5809.        // the proprietary classid attribute value (rather than the type
  5810.        // attribute) to identify the type of content to display
  5811.        if ( nodeName === "object" ) {
  5812.                dest.outerHTML = src.outerHTML;
  5813.        } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
  5814.                // IE6-8 fails to persist the checked state of a cloned checkbox
  5815.                // or radio button. Worse, IE6-7 fail to give the cloned element
  5816.                // a checked appearance if the defaultChecked value isn't also set
  5817.                if ( src.checked ) {
  5818.                        dest.defaultChecked = dest.checked = src.checked;
  5819.                }
  5820.  
  5821.                // IE6-7 get confused and end up setting the value of a cloned
  5822.                // checkbox/radio button to an empty string instead of "on"
  5823.                if ( dest.value !== src.value ) {
  5824.                        dest.value = src.value;
  5825.                }
  5826.  
  5827.        // IE6-8 fails to return the selected option to the default selected
  5828.        // state when cloning options
  5829.        } else if ( nodeName === "option" ) {
  5830.                dest.selected = src.defaultSelected;
  5831.  
  5832.        // IE6-8 fails to set the defaultValue to the correct value when
  5833.        // cloning other types of input fields
  5834.        } else if ( nodeName === "input" || nodeName === "textarea" ) {
  5835.                dest.defaultValue = src.defaultValue;
  5836.        }
  5837.  
  5838.        // Event data gets referenced instead of copied if the expando
  5839.        // gets copied too
  5840.        dest.removeAttribute( jQuery.expando );
  5841.    }
  5842.  
  5843.    jQuery.buildFragment = function( args, nodes, scripts ) {
  5844.        var fragment, cacheable, cacheresults, doc;
  5845.  
  5846.    // nodes may contain either an explicit document object,
  5847.    // a jQuery collection or context object.
  5848.    // If nodes[0] contains a valid object to assign to doc
  5849.    if ( nodes && nodes[0] ) {
  5850.    doc = nodes[0].ownerDocument || nodes[0];
  5851.    }
  5852.  
  5853.    // Ensure that an attr object doesn't incorrectly stand in as a document object
  5854.        // Chrome and Firefox seem to allow this to occur and will throw exception
  5855.        // Fixes #8950
  5856.        if ( !doc.createDocumentFragment ) {
  5857.                doc = document;
  5858.        }
  5859.        // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
  5860.        // Cloning options loses the selected state, so don't cache them
  5861.        // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
  5862.         // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
  5863.         if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
  5864.                args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
  5865.  
  5866.                cacheable = true;
  5867.  
  5868.                 cacheresults = jQuery.fragments[ args[0] ];
  5869.                 if ( cacheresults && cacheresults !== 1 ) {
  5870.                        fragment = cacheresults;
  5871.                 }
  5872.         }
  5873.  
  5874.         if ( !fragment ) {
  5875.                 fragment = doc.createDocumentFragment();
  5876.                 jQuery.clean( args, doc, fragment, scripts );
  5877.         }
  5878.  
  5879.         if ( cacheable ) {
  5880.                 jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
  5881.         }
  5882.  
  5883.         return { fragment: fragment, cacheable: cacheable };
  5884.     };
  5885.  
  5886.     jQuery.fragments = {};
  5887.  
  5888.     jQuery.each({
  5889.         appendTo: "append",
  5890.         prependTo: "prepend",
  5891.         insertBefore: "before",
  5892.         insertAfter: "after",
  5893.         replaceAll: "replaceWith"
  5894.     }, function( name, original ) {
  5895.         jQuery.fn[ name ] = function( selector ) {
  5896.                 var ret = [],
  5897.                         insert = jQuery( selector ),
  5898.                         parent = this.length === 1 && this[0].parentNode;
  5899.  
  5900.                 if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
  5901.                        insert[ original ]( this[0] );
  5902.                         return this;
  5903.  
  5904.                 } else {
  5905.                         for ( var i = 0, l = insert.length; i < l; i++ ) {
  5906.                                var elems = (i > 0 ? this.clone(true) : this).get();
  5907.                                 jQuery( insert[i] )[ original ]( elems );
  5908.                                 ret = ret.concat( elems );
  5909.                         }
  5910.  
  5911.                         return this.pushStack( ret, name, insert.selector );
  5912.                 }
  5913.         };
  5914.     });
  5915.  
  5916.     function getAll( elem ) {
  5917.         if ( "getElementsByTagName" in elem ) {
  5918.                 return elem.getElementsByTagName( "*" );
  5919.  
  5920.         } else if ( "querySelectorAll" in elem ) {
  5921.                 return elem.querySelectorAll( "*" );
  5922.  
  5923.         } else {
  5924.                 return [];
  5925.         }
  5926.     }
  5927.  
  5928.     // Used in clean, fixes the defaultChecked property
  5929.     function fixDefaultChecked( elem ) {
  5930.         if ( elem.type === "checkbox" || elem.type === "radio" ) {
  5931.                 elem.defaultChecked = elem.checked;
  5932.         }
  5933.     }
  5934.     // Finds all inputs and passes them to fixDefaultChecked
  5935.     function findInputs( elem ) {
  5936.         if ( jQuery.nodeName( elem, "input" ) ) {
  5937.                 fixDefaultChecked( elem );
  5938.         } else if ( "getElementsByTagName" in elem ) {
  5939.                 jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
  5940.         }
  5941.     }
  5942.  
  5943.     jQuery.extend({
  5944.         clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  5945.                 var clone = elem.cloneNode(true),
  5946.                                 srcElements,
  5947.                                 destElements,
  5948.                                 i;
  5949.  
  5950.                 if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
  5951.                                (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
  5952.                        // IE copies events bound via attachEvent when using cloneNode.
  5953.                        // Calling detachEvent on the clone will also remove the events
  5954.                        // from the original. In order to get around this, we use some
  5955.                        // proprietary methods to clear the events. Thanks to MooTools
  5956.                        // guys for this hotness.
  5957.  
  5958.                        cloneFixAttributes( elem, clone );
  5959.  
  5960.                         // Using Sizzle here is crazy slow, so we use getElementsByTagName
  5961.                         // instead
  5962.                         srcElements = getAll( elem );
  5963.                         destElements = getAll( clone );
  5964.  
  5965.                         // Weird iteration because IE will replace the length property
  5966.                         // with an element if you are cloning the body and one of the
  5967.                         // elements on the page has a name or id of "length"
  5968.                         for ( i = 0; srcElements[i]; ++i ) {
  5969.                                 // Ensure that the destination node is not null; Fixes #9587
  5970.                                 if ( destElements[i] ) {
  5971.                                         cloneFixAttributes( srcElements[i], destElements[i] );
  5972.                                 }
  5973.                         }
  5974.                 }
  5975.  
  5976.                 // Copy the events from the original to the clone
  5977.                 if ( dataAndEvents ) {
  5978.                         cloneCopyEvent( elem, clone );
  5979.  
  5980.                         if ( deepDataAndEvents ) {
  5981.                                 srcElements = getAll( elem );
  5982.                                 destElements = getAll( clone );
  5983.  
  5984.                                 for ( i = 0; srcElements[i]; ++i ) {
  5985.                                         cloneCopyEvent( srcElements[i], destElements[i] );
  5986.                                 }
  5987.                         }
  5988.                 }
  5989.  
  5990.                 srcElements = destElements = null;
  5991.  
  5992.                 // Return the cloned set
  5993.                 return clone;
  5994.         },
  5995.  
  5996.         clean: function( elems, context, fragment, scripts ) {
  5997.                 var checkScriptType;
  5998.  
  5999.                 context = context || document;
  6000.  
  6001.                 // !context.createElement fails in IE with an error but returns typeof 'object'
  6002.                 if ( typeof context.createElement === "undefined" ) {
  6003.                         context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
  6004.                 }
  6005.  
  6006.                 var ret = [], j;
  6007.  
  6008.                 for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
  6009.                         if ( typeof elem === "number" ) {
  6010.                                 elem += "";
  6011.                         }
  6012.  
  6013.                         if ( !elem ) {
  6014.                                 continue;
  6015.                         }
  6016.  
  6017.                         // Convert html string into DOM nodes
  6018.                         if ( typeof elem === "string" ) {
  6019.                                 if ( !rhtml.test( elem ) ) {
  6020.                                         elem = context.createTextNode( elem );
  6021.                                 } else {
  6022.                                         // Fix "XHTML"-style tags in all browsers
  6023.                                         elem = elem.replace(rxhtmlTag, "<$1></$2>");
  6024.  
  6025.                                         // Trim whitespace, otherwise indexOf won't work as expected
  6026.                                         var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
  6027.                                                 wrap = wrapMap[ tag ] || wrapMap._default,
  6028.                                                 depth = wrap[0],
  6029.                                                 div = context.createElement("div");
  6030.  
  6031.                                         // Go to html and back, then peel off extra wrappers
  6032.                                         div.innerHTML = wrap[1] + elem + wrap[2];
  6033.  
  6034.                                         // Move to the right depth
  6035.                                         while ( depth-- ) {
  6036.                                                 div = div.lastChild;
  6037.                                         }
  6038.  
  6039.                                         // Remove IE's autoinserted <tbody> from table fragments
  6040.                                         if ( !jQuery.support.tbody ) {
  6041.  
  6042.                                                 // String was a <table>, *may* have spurious <tbody>
  6043.                                                 var hasBody = rtbody.test(elem),
  6044.                                                         tbody = tag === "table" && !hasBody ?
  6045.                                                                div.firstChild && div.firstChild.childNodes :
  6046.  
  6047.                                                                // String was a bare <thead> or <tfoot>
  6048.                                                                wrap[1] === "<table>" && !hasBody ?
  6049.                                                                        div.childNodes :
  6050.                                                                        [];
  6051.  
  6052.                                                 for ( j = tbody.length - 1; j >= 0 ; --j ) {
  6053.                                                         if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
  6054.                                                                tbody[ j ].parentNode.removeChild( tbody[ j ] );
  6055.                                                         }
  6056.                                                 }
  6057.                                         }
  6058.  
  6059.                                         // IE completely kills leading whitespace when innerHTML is used
  6060.                                         if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
  6061.                                                div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
  6062.                                         }
  6063.  
  6064.                                         elem = div.childNodes;
  6065.                                 }
  6066.                         }
  6067.  
  6068.                         // Resets defaultChecked for any radios and checkboxes
  6069.                         // about to be appended to the DOM in IE 6/7 (#8060)
  6070.                         var len;
  6071.                         if ( !jQuery.support.appendChecked ) {
  6072.                                 if ( elem[0] && typeof (len = elem.length) === "number" ) {
  6073.                                        for ( j = 0; j < len; j++ ) {
  6074.                                                findInputs( elem[j] );
  6075.                                        }
  6076.                                } else {
  6077.                                        findInputs( elem );
  6078.                                }
  6079.                        }
  6080.  
  6081.                        if ( elem.nodeType ) {
  6082.                                ret.push( elem );
  6083.                        } else {
  6084.                                ret = jQuery.merge( ret, elem );
  6085.                        }
  6086.                }
  6087.  
  6088.                if ( fragment ) {
  6089.                        checkScriptType = function( elem ) {
  6090.                                return !elem.type || rscriptType.test( elem.type );
  6091.                        };
  6092.                        for ( i = 0; ret[i]; i++ ) {
  6093.                                if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
  6094.                                        scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
  6095.  
  6096.                                } else {
  6097.                                        if ( ret[i].nodeType === 1 ) {
  6098.                                                var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
  6099.  
  6100.                                                ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
  6101.                                        }
  6102.                                        fragment.appendChild( ret[i] );
  6103.                                }
  6104.                        }
  6105.                }
  6106.  
  6107.                return ret;
  6108.        },
  6109.  
  6110.        cleanData: function( elems ) {
  6111.                var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
  6112.                        deleteExpando = jQuery.support.deleteExpando;
  6113.  
  6114.                for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
  6115.                        if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
  6116.                                continue;
  6117.                        }
  6118.  
  6119.                        id = elem[ jQuery.expando ];
  6120.  
  6121.                        if ( id ) {
  6122.                                data = cache[ id ] && cache[ id ][ internalKey ];
  6123.  
  6124.                                if ( data && data.events ) {
  6125.                                        for ( var type in data.events ) {
  6126.                                                if ( special[ type ] ) {
  6127.                                                        jQuery.event.remove( elem, type );
  6128.  
  6129.                                                // This is a shortcut to avoid jQuery.event.remove's overhead
  6130.                                                } else {
  6131.                                                        jQuery.removeEvent( elem, type, data.handle );
  6132.                                                }
  6133.                                        }
  6134.                                        // Null the DOM reference to avoid IE6/7/8 leak (#7054)
  6135.                                        if ( data.handle ) {
  6136.                                                data.handle.elem = null;
  6137.                                        }
  6138.                                }
  6139.                                if ( deleteExpando ) {
  6140.                                        delete elem[ jQuery.expando ];
  6141.                                } else if ( elem.removeAttribute ) {
  6142.                                        elem.removeAttribute( jQuery.expando );
  6143.                                }
  6144.                                delete cache[ id ];
  6145.                        }
  6146.                }
  6147.        }
  6148.    });
  6149.    function evalScript( i, elem ) {
  6150.        if ( elem.src ) {
  6151.                jQuery.ajax({
  6152.                        url: elem.src,
  6153.                        async: false,
  6154.                        dataType: "script"
  6155.                });
  6156.        } else {
  6157.                jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
  6158.        }
  6159.        if ( elem.parentNode ) {
  6160.                elem.parentNode.removeChild( elem );
  6161.        }
  6162.    }
  6163.    var ralpha = /alpha\([^)]*\)/i,
  6164.        ropacity = /opacity=([^)]*)/,
  6165.        // fixed for IE9, see #8346
  6166.        rupper = /([A-Z]|^ms)/g,
  6167.        rnumpx = /^-?\d+(?:px)?$/i,
  6168.        rnum = /^-?\d/,
  6169.        rrelNum = /^([\-+])=([\-+.\de]+)/,
  6170.        cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  6171.        cssWidth = [ "Left", "Right" ],
  6172.        cssHeight = [ "Top", "Bottom" ],
  6173.        curCSS,
  6174.        getComputedStyle,
  6175.        currentStyle;
  6176.    jQuery.fn.css = function( name, value ) {
  6177.        // Setting 'undefined' is a no-op
  6178.        if ( arguments.length === 2 && value === undefined ) {
  6179.                return this;
  6180.        }
  6181.        return jQuery.access( this, name, value, true, function( elem, name, value ) {
  6182.                return value !== undefined ?
  6183.                        jQuery.style( elem, name, value ) :
  6184.                        jQuery.css( elem, name );
  6185.        });
  6186.    };
  6187.    jQuery.extend({
  6188.        // Add in style property hooks for overriding the default
  6189.        // behavior of getting and setting a style property
  6190.        cssHooks: {
  6191.                opacity: {
  6192.                        get: function( elem, computed ) {
  6193.                                if ( computed ) {
  6194.                                        // We should always get a number back from opacity
  6195.                                        var ret = curCSS( elem, "opacity", "opacity" );
  6196.                                        return ret === "" ? "1" : ret;
  6197.                                } else {
  6198.                                        return elem.style.opacity;
  6199.                                }
  6200.                        }
  6201.                }
  6202.        },
  6203.        // Exclude the following css properties to add px
  6204.        cssNumber: {
  6205.                "fillOpacity": true,
  6206.                "fontWeight": true,
  6207.                "lineHeight": true,
  6208.                "opacity": true,
  6209.                "orphans": true,
  6210.                "widows": true,
  6211.                "zIndex": true,
  6212.                "zoom": true
  6213.        },
  6214.        // Add in properties whose names you wish to fix before
  6215.        // setting or getting the value
  6216.        cssProps: {
  6217.                // normalize float css property
  6218.                "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
  6219.        },
  6220.        // Get and set the style property on a DOM Node
  6221.        style: function( elem, name, value, extra ) {
  6222.                // Don't set styles on text and comment nodes
  6223.                if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  6224.                        return;
  6225.                }
  6226.  
  6227.                // Make sure that we're working with the right name
  6228.                var ret, type, origName = jQuery.camelCase( name ),
  6229.                        style = elem.style, hooks = jQuery.cssHooks[ origName ];
  6230.                name = jQuery.cssProps[ origName ] || origName;
  6231.                // Check if we're setting a value
  6232.                if ( value !== undefined ) {
  6233.                        type = typeof value;
  6234.  
  6235.                        // convert relative number strings (+= or -=) to relative numbers. #7345
  6236.                        if ( type === "string" && (ret = rrelNum.exec( value )) ) {
  6237.                                value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
  6238.                                // Fixes bug #9237
  6239.                                type = "number";
  6240.                        }
  6241.  
  6242.                        // Make sure that NaN and null values aren't set. See: #7116
  6243.                        if ( value == null || type === "number" && isNaN( value ) ) {
  6244.                                return;
  6245.                        }
  6246.                        // If a number was passed in, add 'px' to the (except for certain CSS properties)
  6247.                        if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
  6248.                                value += "px";
  6249.                        }
  6250.                        // If a hook was provided, use that value, otherwise just set the specified value
  6251.                        if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
  6252.                                // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
  6253.                                // Fixes bug #5509
  6254.                                try {
  6255.                                        style[ name ] = value;
  6256.                                } catch(e) {}
  6257.                        }
  6258.                } else {
  6259.                        // If a hook was provided get the non-computed value from there
  6260.                        if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
  6261.                                return ret;
  6262.                        }
  6263.                        // Otherwise just get the value from the style object
  6264.                        return style[ name ];
  6265.                }
  6266.        },
  6267.        css: function( elem, name, extra ) {
  6268.                var ret, hooks;
  6269.                // Make sure that we're working with the right name
  6270.                name = jQuery.camelCase( name );
  6271.                hooks = jQuery.cssHooks[ name ];
  6272.                name = jQuery.cssProps[ name ] || name;
  6273.  
  6274.                // cssFloat needs a special treatment
  6275.                if ( name === "cssFloat" ) {
  6276.                        name = "float";
  6277.                }
  6278.  
  6279.                // If a hook was provided get the computed value from there
  6280.                if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
  6281.                        return ret;
  6282.  
  6283.                // Otherwise, if a way to get the computed value exists, use that
  6284.                } else if ( curCSS ) {
  6285.                        return curCSS( elem, name );
  6286.                }
  6287.        },
  6288.  
  6289.        // A method for quickly swapping in/out CSS properties to get correct calculations
  6290.        swap: function( elem, options, callback ) {
  6291.                var old = {};
  6292.  
  6293.                // Remember the old values, and insert the new ones
  6294.                for ( var name in options ) {
  6295.                        old[ name ] = elem.style[ name ];
  6296.                        elem.style[ name ] = options[ name ];
  6297.                }
  6298.  
  6299.                callback.call( elem );
  6300.  
  6301.                // Revert the old values
  6302.                for ( name in options ) {
  6303.                        elem.style[ name ] = old[ name ];
  6304.                }
  6305.        }
  6306.    });
  6307.  
  6308.    // DEPRECATED, Use jQuery.css() instead
  6309.    jQuery.curCSS = jQuery.css;
  6310.  
  6311.    jQuery.each(["height", "width"], function( i, name ) {
  6312.        jQuery.cssHooks[ name ] = {
  6313.                get: function( elem, computed, extra ) {
  6314.                        var val;
  6315.  
  6316.                        if ( computed ) {
  6317.                                if ( elem.offsetWidth !== 0 ) {
  6318.                                        return getWH( elem, name, extra );
  6319.                                } else {
  6320.                                        jQuery.swap( elem, cssShow, function() {
  6321.                                                val = getWH( elem, name, extra );
  6322.                                        });
  6323.                                }
  6324.  
  6325.                                return val;
  6326.                        }
  6327.                },
  6328.  
  6329.                set: function( elem, value ) {
  6330.                        if ( rnumpx.test( value ) ) {
  6331.                                // ignore negative width and height values #1599
  6332.                                value = parseFloat( value );
  6333.  
  6334.                                if ( value >= 0 ) {
  6335.                                         return value + "px";
  6336.                                 }
  6337.  
  6338.                         } else {
  6339.                                 return value;
  6340.                         }
  6341.                 }
  6342.         };
  6343.     });
  6344.  
  6345.     if ( !jQuery.support.opacity ) {
  6346.         jQuery.cssHooks.opacity = {
  6347.                 get: function( elem, computed ) {
  6348.                         // IE uses filters for opacity
  6349.                         return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
  6350.                                ( parseFloat( RegExp.$1 ) / 100 ) + "" :
  6351.                                computed ? "1" : "";
  6352.                 },
  6353.  
  6354.                 set: function( elem, value ) {
  6355.                         var style = elem.style,
  6356.                                 currentStyle = elem.currentStyle,
  6357.                                 opacity = jQuery.isNaN( value ) ? "" : "alpha(opacity=" + value * 100 + ")",
  6358.                                 filter = currentStyle && currentStyle.filter || style.filter || "";
  6359.  
  6360.                         // IE has trouble with opacity if it does not have layout
  6361.                         // Force it by setting the zoom level
  6362.                         style.zoom = 1;
  6363.  
  6364.                         // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
  6365.                         if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
  6366.  
  6367.                                // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
  6368.                                // if "filter:" is present at all, clearType is disabled, we want to avoid this
  6369.                                // style.removeAttribute is IE Only, but so apparently is this code path...
  6370.                                style.removeAttribute( "filter" );
  6371.  
  6372.                                 // if there there is no filter style applied in a css rule, we are done
  6373.                                 if ( currentStyle && !currentStyle.filter ) {
  6374.                                        return;
  6375.                                 }
  6376.                         }
  6377.  
  6378.                         // otherwise, set new filter values
  6379.                         style.filter = ralpha.test( filter ) ?
  6380.                                 filter.replace( ralpha, opacity ) :
  6381.                                 filter + " " + opacity;
  6382.                 }
  6383.         };
  6384.     }
  6385.  
  6386.     jQuery(function() {
  6387.         // This hook cannot be added until DOM ready because the support test
  6388.         // for it is not run until after DOM ready
  6389.         if ( !jQuery.support.reliableMarginRight ) {
  6390.                 jQuery.cssHooks.marginRight = {
  6391.                         get: function( elem, computed ) {
  6392.                                 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  6393.                                 // Work around by temporarily setting element display to inline-block
  6394.                                 var ret;
  6395.                                 jQuery.swap( elem, { "display": "inline-block" }, function() {
  6396.                                         if ( computed ) {
  6397.                                                 ret = curCSS( elem, "margin-right", "marginRight" );
  6398.                                         } else {
  6399.                                                 ret = elem.style.marginRight;
  6400.                                         }
  6401.                                 });
  6402.                                 return ret;
  6403.                         }
  6404.                 };
  6405.         }
  6406.     });
  6407.  
  6408.     if ( document.defaultView && document.defaultView.getComputedStyle ) {
  6409.        getComputedStyle = function( elem, name ) {
  6410.                var ret, defaultView, computedStyle;
  6411.  
  6412.                 name = name.replace( rupper, "-$1" ).toLowerCase();
  6413.  
  6414.                 if ( !(defaultView = elem.ownerDocument.defaultView) ) {
  6415.                         return undefined;
  6416.                 }
  6417.  
  6418.                 if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
  6419.                         ret = computedStyle.getPropertyValue( name );
  6420.                         if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
  6421.                                ret = jQuery.style( elem, name );
  6422.                         }
  6423.                 }
  6424.  
  6425.                 return ret;
  6426.         };
  6427.     }
  6428.  
  6429.     if ( document.documentElement.currentStyle ) {
  6430.         currentStyle = function( elem, name ) {
  6431.                 var left,
  6432.                         ret = elem.currentStyle && elem.currentStyle[ name ],
  6433.                        rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
  6434.                        style = elem.style;
  6435.  
  6436.                 // From the awesome hack by Dean Edwards
  6437.                 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
  6438.  
  6439.                 // If we're not dealing with a regular pixel number
  6440.                 // but a number that has a weird ending, we need to convert it to pixels
  6441.                 if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
  6442.                        // Remember the original values
  6443.                        left = style.left;
  6444.  
  6445.                         // Put in the new values to get a computed value out
  6446.                         if ( rsLeft ) {
  6447.                                 elem.runtimeStyle.left = elem.currentStyle.left;
  6448.                         }
  6449.                         style.left = name === "fontSize" ? "1em" : (ret || 0);
  6450.                         ret = style.pixelLeft + "px";
  6451.  
  6452.                         // Revert the changed values
  6453.                         style.left = left;
  6454.                         if ( rsLeft ) {
  6455.                                 elem.runtimeStyle.left = rsLeft;
  6456.                         }
  6457.                 }
  6458.  
  6459.                 return ret === "" ? "auto" : ret;
  6460.         };
  6461.     }
  6462.  
  6463.     curCSS = getComputedStyle || currentStyle;
  6464.  
  6465.     function getWH( elem, name, extra ) {
  6466.  
  6467.         // Start with offset property
  6468.         var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
  6469.                 which = name === "width" ? cssWidth : cssHeight;
  6470.  
  6471.         if ( val > 0 ) {
  6472.                 if ( extra !== "border" ) {
  6473.                         jQuery.each( which, function() {
  6474.                                 if ( !extra ) {
  6475.                                         val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
  6476.                                 }
  6477.                                 if ( extra === "margin" ) {
  6478.                                         val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
  6479.                                 } else {
  6480.                                         val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
  6481.                                 }
  6482.                         });
  6483.                 }
  6484.  
  6485.                 return val + "px";
  6486.         }
  6487.  
  6488.         // Fall back to computed then uncomputed css if necessary
  6489.         val = curCSS( elem, name, name );
  6490.         if ( val < 0 || val == null ) {
  6491.                val = elem.style[ name ] || 0;
  6492.        }
  6493.        // Normalize "", auto, and prepare for extra
  6494.        val = parseFloat( val ) || 0;
  6495.  
  6496.        // Add padding, border, margin
  6497.        if ( extra ) {
  6498.                jQuery.each( which, function() {
  6499.                        val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
  6500.                        if ( extra !== "padding" ) {
  6501.                                val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
  6502.                        }
  6503.                        if ( extra === "margin" ) {
  6504.                                val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
  6505.                        }
  6506.                });
  6507.        }
  6508.  
  6509.        return val + "px";
  6510.    }
  6511.  
  6512.    if ( jQuery.expr && jQuery.expr.filters ) {
  6513.        jQuery.expr.filters.hidden = function( elem ) {
  6514.                var width = elem.offsetWidth,
  6515.                        height = elem.offsetHeight;
  6516.  
  6517.                return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
  6518.        };
  6519.  
  6520.        jQuery.expr.filters.visible = function( elem ) {
  6521.                return !jQuery.expr.filters.hidden( elem );
  6522.        };
  6523.    }
  6524.  
  6525.  
  6526.  
  6527.  
  6528.    var r20 = /%20/g,
  6529.        rbracket = /\[\]$/,
  6530.        rCRLF = /\r?\n/g,
  6531.        rhash = /#.*$/,
  6532.        rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
  6533.        rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
  6534.        // #7653, #8125, #8152: local protocol detection
  6535.        rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
  6536.        rnoContent = /^(?:GET|HEAD)$/,
  6537.        rprotocol = /^\/\//,
  6538.        rquery = /\?/,
  6539.        rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
  6540.         rselectTextarea = /^(?:select|textarea)/i,
  6541.         rspacesAjax = /\s+/,
  6542.         rts = /([?&])_=[^&]*/,
  6543.        rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
  6544.  
  6545.        // Keep a copy of the old load method
  6546.        _load = jQuery.fn.load,
  6547.  
  6548.        /* Prefilters
  6549.         * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  6550.         * 2) These are called:
  6551.         *    - BEFORE asking for a transport
  6552.         *    - AFTER param serialization (s.data is a string if s.processData is true)
  6553.         * 3) key is the dataType
  6554.         * 4) the catchall symbol "*" can be used
  6555.         * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  6556.         */
  6557.        prefilters = {},
  6558.  
  6559.        /* Transports bindings
  6560.         * 1) key is the dataType
  6561.         * 2) the catchall symbol "*" can be used
  6562.         * 3) selection will start with transport dataType and THEN go to "*" if needed
  6563.         */
  6564.        transports = {},
  6565.  
  6566.        // Document location
  6567.        ajaxLocation,
  6568.  
  6569.        // Document location segments
  6570.        ajaxLocParts,
  6571.        
  6572.        // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  6573.         allTypes = ["*/"] + ["*"];
  6574.  
  6575.     // #8138, IE may throw an exception when accessing
  6576.     // a field from window.location if document.domain has been set
  6577.     try {
  6578.         ajaxLocation = location.href;
  6579.     } catch( e ) {
  6580.         // Use the href attribute of an A element
  6581.         // since IE will modify it given document.location
  6582.         ajaxLocation = document.createElement( "a" );
  6583.         ajaxLocation.href = "";
  6584.         ajaxLocation = ajaxLocation.href;
  6585.     }
  6586.  
  6587.     // Segment location into parts
  6588.     ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
  6589.  
  6590.     // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  6591.     function addToPrefiltersOrTransports( structure ) {
  6592.  
  6593.         // dataTypeExpression is optional and defaults to "*"
  6594.         return function( dataTypeExpression, func ) {
  6595.  
  6596.                 if ( typeof dataTypeExpression !== "string" ) {
  6597.                         func = dataTypeExpression;
  6598.                         dataTypeExpression = "*";
  6599.                 }
  6600.  
  6601.                 if ( jQuery.isFunction( func ) ) {
  6602.                         var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
  6603.                                 i = 0,
  6604.                                 length = dataTypes.length,
  6605.                                 dataType,
  6606.                                 list,
  6607.                                 placeBefore;
  6608.  
  6609.                         // For each dataType in the dataTypeExpression
  6610.                         for(; i < length; i++ ) {
  6611.                                dataType = dataTypes[ i ];
  6612.                                // We control if we're asked to add before
  6613.                                // any existing element
  6614.                                placeBefore = /^\+/.test( dataType );
  6615.                                if ( placeBefore ) {
  6616.                                        dataType = dataType.substr( 1 ) || "*";
  6617.                                }
  6618.                                list = structure[ dataType ] = structure[ dataType ] || [];
  6619.                                // then we add to the structure accordingly
  6620.                                list[ placeBefore ? "unshift" : "push" ]( func );
  6621.                        }
  6622.                }
  6623.        };
  6624.    }
  6625.    // Base inspection function for prefilters and transports
  6626.    function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
  6627.                dataType /* internal */, inspected /* internal */ ) {
  6628.        dataType = dataType || options.dataTypes[ 0 ];
  6629.        inspected = inspected || {};
  6630.        inspected[ dataType ] = true;
  6631.        var list = structure[ dataType ],
  6632.                i = 0,
  6633.                length = list ? list.length : 0,
  6634.                executeOnly = ( structure === prefilters ),
  6635.                selection;
  6636.        for(; i < length && ( executeOnly || !selection ); i++ ) {
  6637.                selection = list[ i ]( options, originalOptions, jqXHR );
  6638.                // If we got redirected to another dataType
  6639.                // we try there if executing only and not done already
  6640.                if ( typeof selection === "string" ) {
  6641.                        if ( !executeOnly || inspected[ selection ] ) {
  6642.                                selection = undefined;
  6643.                        } else {
  6644.                                options.dataTypes.unshift( selection );
  6645.                                selection = inspectPrefiltersOrTransports(
  6646.                                                structure, options, originalOptions, jqXHR, selection, inspected );
  6647.                        }
  6648.                }
  6649.        }
  6650.        // If we're only executing or nothing was selected
  6651.        // we try the catchall dataType if not done already
  6652.        if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
  6653.                selection = inspectPrefiltersOrTransports(
  6654.                                structure, options, originalOptions, jqXHR, "*", inspected );
  6655.        }
  6656.        // unnecessary when only executing (prefilters)
  6657.        // but it'll be ignored by the caller in that case
  6658.        return selection;
  6659.    }
  6660.    // A special extend for ajax options
  6661.    // that takes "flat" options (not to be deep extended)
  6662.    // Fixes #9887
  6663.    function ajaxExtend( target, src ) {
  6664.        var key, deep,
  6665.                flatOptions = jQuery.ajaxSettings.flatOptions || {};
  6666.        for( key in src ) {
  6667.                if ( src[ key ] !== undefined ) {
  6668.                        ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  6669.                }
  6670.        }
  6671.        if ( deep ) {
  6672.                jQuery.extend( true, target, deep );
  6673.        }
  6674.    }
  6675.    jQuery.fn.extend({
  6676.        load: function( url, params, callback ) {
  6677.                if ( typeof url !== "string" && _load ) {
  6678.                        return _load.apply( this, arguments );
  6679.                // Don't do a request if no elements are being requested
  6680.                } else if ( !this.length ) {
  6681.                        return this;
  6682.                }
  6683.  
  6684.                var off = url.indexOf( " " );
  6685.                if ( off >= 0 ) {
  6686.                         var selector = url.slice( off, url.length );
  6687.                         url = url.slice( 0, off );
  6688.                 }
  6689.  
  6690.                 // Default to a GET request
  6691.                 var type = "GET";
  6692.  
  6693.                 // If the second parameter was provided
  6694.                 if ( params ) {
  6695.                         // If it's a function
  6696.                         if ( jQuery.isFunction( params ) ) {
  6697.                                 // We assume that it's the callback
  6698.                                 callback = params;
  6699.                                 params = undefined;
  6700.  
  6701.                         // Otherwise, build a param string
  6702.                         } else if ( typeof params === "object" ) {
  6703.                                 params = jQuery.param( params, jQuery.ajaxSettings.traditional );
  6704.                                 type = "POST";
  6705.                         }
  6706.                 }
  6707.  
  6708.                 var self = this;
  6709.  
  6710.                 // Request the remote document
  6711.                 jQuery.ajax({
  6712.                         url: url,
  6713.                         type: type,
  6714.                         dataType: "html",
  6715.                         data: params,
  6716.                         // Complete callback (responseText is used internally)
  6717.                         complete: function( jqXHR, status, responseText ) {
  6718.                                 // Store the response as specified by the jqXHR object
  6719.                                 responseText = jqXHR.responseText;
  6720.                                 // If successful, inject the HTML into all the matched elements
  6721.                                 if ( jqXHR.isResolved() ) {
  6722.                                         // #4825: Get the actual response in case
  6723.                                         // a dataFilter is present in ajaxSettings
  6724.                                         jqXHR.done(function( r ) {
  6725.                                                 responseText = r;
  6726.                                         });
  6727.                                         // See if a selector was specified
  6728.                                         self.html( selector ?
  6729.                                                 // Create a dummy div to hold the results
  6730.                                                 jQuery("<div>")
  6731.                                                         // inject the contents of the document in, removing the scripts
  6732.                                                         // to avoid any 'Permission Denied' errors in IE
  6733.                                                         .append(responseText.replace(rscript, ""))
  6734.  
  6735.                                                         // Locate the specified elements
  6736.                                                         .find(selector) :
  6737.  
  6738.                                                 // If not, just inject the full result
  6739.                                                 responseText );
  6740.                                 }
  6741.  
  6742.                                 if ( callback ) {
  6743.                                         self.each( callback, [ responseText, status, jqXHR ] );
  6744.                                 }
  6745.                         }
  6746.                 });
  6747.  
  6748.                 return this;
  6749.         },
  6750.  
  6751.         serialize: function() {
  6752.                 return jQuery.param( this.serializeArray() );
  6753.         },
  6754.  
  6755.         serializeArray: function() {
  6756.                 return this.map(function(){
  6757.                         return this.elements ? jQuery.makeArray( this.elements ) : this;
  6758.                 })
  6759.                 .filter(function(){
  6760.                         return this.name && !this.disabled &&
  6761.                                ( this.checked || rselectTextarea.test( this.nodeName ) ||
  6762.                                        rinput.test( this.type ) );
  6763.                 })
  6764.                 .map(function( i, elem ){
  6765.                         var val = jQuery( this ).val();
  6766.  
  6767.                         return val == null ?
  6768.                                 null :
  6769.                                 jQuery.isArray( val ) ?
  6770.                                         jQuery.map( val, function( val, i ){
  6771.                                                 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  6772.                                         }) :
  6773.                                         { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  6774.                 }).get();
  6775.         }
  6776.     });
  6777.  
  6778.     // Attach a bunch of functions for handling common AJAX events
  6779.     jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
  6780.         jQuery.fn[ o ] = function( f ){
  6781.                 return this.bind( o, f );
  6782.         };
  6783.     });
  6784.  
  6785.     jQuery.each( [ "get", "post" ], function( i, method ) {
  6786.         jQuery[ method ] = function( url, data, callback, type ) {
  6787.                 // shift arguments if data argument was omitted
  6788.                 if ( jQuery.isFunction( data ) ) {
  6789.                         type = type || callback;
  6790.                         callback = data;
  6791.                         data = undefined;
  6792.                 }
  6793.  
  6794.                 return jQuery.ajax({
  6795.                         type: method,
  6796.                         url: url,
  6797.                         data: data,
  6798.                         success: callback,
  6799.                         dataType: type
  6800.                 });
  6801.         };
  6802.     });
  6803.  
  6804.     jQuery.extend({
  6805.  
  6806.         getScript: function( url, callback ) {
  6807.                 return jQuery.get( url, undefined, callback, "script" );
  6808.         },
  6809.  
  6810.         getJSON: function( url, data, callback ) {
  6811.                 return jQuery.get( url, data, callback, "json" );
  6812.         },
  6813.  
  6814.         // Creates a full fledged settings object into target
  6815.         // with both ajaxSettings and settings fields.
  6816.         // If target is omitted, writes into ajaxSettings.
  6817.         ajaxSetup: function( target, settings ) {
  6818.                 if ( settings ) {
  6819.                         // Building a settings object
  6820.                         ajaxExtend( target, jQuery.ajaxSettings );
  6821.                 } else {
  6822.                         // Extending ajaxSettings
  6823.                         settings = target;
  6824.                         target = jQuery.ajaxSettings;
  6825.                 }
  6826.                 ajaxExtend( target, settings );
  6827.                 return target;
  6828.         },
  6829.  
  6830.         ajaxSettings: {
  6831.                 url: ajaxLocation,
  6832.                 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
  6833.                 global: true,
  6834.                 type: "GET",
  6835.                 contentType: "application/x-www-form-urlencoded",
  6836.                 processData: true,
  6837.                 async: true,
  6838.                 /*
  6839.                 timeout: 0,
  6840.                 data: null,
  6841.                 dataType: null,
  6842.                 username: null,
  6843.                 password: null,
  6844.                 cache: null,
  6845.                 traditional: false,
  6846.                 headers: {},
  6847.                 */
  6848.  
  6849.                 accepts: {
  6850.                         xml: "application/xml, text/xml",
  6851.                         html: "text/html",
  6852.                         text: "text/plain",
  6853.                         json: "application/json, text/javascript",
  6854.                         "*": allTypes
  6855.                 },
  6856.  
  6857.                 contents: {
  6858.                         xml: /xml/,
  6859.                         html: /html/,
  6860.                         json: /json/
  6861.                 },
  6862.  
  6863.                 responseFields: {
  6864.                         xml: "responseXML",
  6865.                         text: "responseText"
  6866.                 },
  6867.  
  6868.                 // List of data converters
  6869.                 // 1) key format is "source_type destination_type" (a single space in-between)
  6870.                 // 2) the catchall symbol "*" can be used for source_type
  6871.                 converters: {
  6872.  
  6873.                         // Convert anything to text
  6874.                         "* text": window.String,
  6875.  
  6876.                         // Text to html (true = no transformation)
  6877.                         "text html": true,
  6878.  
  6879.                         // Evaluate text as a json expression
  6880.                         "text json": jQuery.parseJSON,
  6881.  
  6882.                         // Parse text as xml
  6883.                         "text xml": jQuery.parseXML
  6884.                 },
  6885.  
  6886.                 // For options that shouldn't be deep extended:
  6887.                 // you can add your own custom options here if
  6888.                 // and when you create one that shouldn't be
  6889.                 // deep extended (see ajaxExtend)
  6890.                 flatOptions: {
  6891.                         context: true,
  6892.                         url: true
  6893.                 }
  6894.         },
  6895.  
  6896.         ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  6897.         ajaxTransport: addToPrefiltersOrTransports( transports ),
  6898.  
  6899.         // Main method
  6900.         ajax: function( url, options ) {
  6901.  
  6902.                 // If url is an object, simulate pre-1.5 signature
  6903.                 if ( typeof url === "object" ) {
  6904.                         options = url;
  6905.                         url = undefined;
  6906.                 }
  6907.  
  6908.                 // Force options to be an object
  6909.                 options = options || {};
  6910.  
  6911.                 var // Create the final options object
  6912.                         s = jQuery.ajaxSetup( {}, options ),
  6913.                         // Callbacks context
  6914.                         callbackContext = s.context || s,
  6915.                         // Context for global events
  6916.                         // It's the callbackContext if one was provided in the options
  6917.                         // and if it's a DOM node or a jQuery collection
  6918.                         globalEventContext = callbackContext !== s &&
  6919.                                ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
  6920.                                                jQuery( callbackContext ) : jQuery.event,
  6921.                        // Deferreds
  6922.                        deferred = jQuery.Deferred(),
  6923.                        completeDeferred = jQuery._Deferred(),
  6924.                        // Status-dependent callbacks
  6925.                        statusCode = s.statusCode || {},
  6926.                        // ifModified key
  6927.                        ifModifiedKey,
  6928.                        // Headers (they are sent all at once)
  6929.                        requestHeaders = {},
  6930.                        requestHeadersNames = {},
  6931.                        // Response headers
  6932.                        responseHeadersString,
  6933.                        responseHeaders,
  6934.                        // transport
  6935.                        transport,
  6936.                        // timeout handle
  6937.                        timeoutTimer,
  6938.                        // Cross-domain detection vars
  6939.                        parts,
  6940.                        // The jqXHR state
  6941.                        state = 0,
  6942.                        // To know if global events are to be dispatched
  6943.                        fireGlobals,
  6944.                        // Loop variable
  6945.                        i,
  6946.                        // Fake xhr
  6947.                        jqXHR = {
  6948.  
  6949.                                readyState: 0,
  6950.  
  6951.                                // Caches the header
  6952.                                setRequestHeader: function( name, value ) {
  6953.                                        if ( !state ) {
  6954.                                                var lname = name.toLowerCase();
  6955.                                                 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
  6956.                                                 requestHeaders[ name ] = value;
  6957.                                         }
  6958.                                         return this;
  6959.                                 },
  6960.  
  6961.                                 // Raw string
  6962.                                 getAllResponseHeaders: function() {
  6963.                                         return state === 2 ? responseHeadersString : null;
  6964.                                 },
  6965.  
  6966.                                 // Builds headers hashtable if needed
  6967.                                 getResponseHeader: function( key ) {
  6968.                                         var match;
  6969.                                         if ( state === 2 ) {
  6970.                                                 if ( !responseHeaders ) {
  6971.                                                         responseHeaders = {};
  6972.                                                         while( ( match = rheaders.exec( responseHeadersString ) ) ) {
  6973.                                                                 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
  6974.                                                         }
  6975.                                                 }
  6976.                                                 match = responseHeaders[ key.toLowerCase() ];
  6977.                                         }
  6978.                                         return match === undefined ? null : match;
  6979.                                 },
  6980.  
  6981.                                 // Overrides response content-type header
  6982.                                 overrideMimeType: function( type ) {
  6983.                                         if ( !state ) {
  6984.                                                 s.mimeType = type;
  6985.                                         }
  6986.                                         return this;
  6987.                                 },
  6988.  
  6989.                                 // Cancel the request
  6990.                                 abort: function( statusText ) {
  6991.                                         statusText = statusText || "abort";
  6992.                                         if ( transport ) {
  6993.                                                 transport.abort( statusText );
  6994.                                         }
  6995.                                         done( 0, statusText );
  6996.                                         return this;
  6997.                                 }
  6998.                         };
  6999.  
  7000.                 // Callback for when everything is done
  7001.                 // It is defined here because jslint complains if it is declared
  7002.                 // at the end of the function (which would be more logical and readable)
  7003.                 function done( status, nativeStatusText, responses, headers ) {
  7004.  
  7005.                         // Called once
  7006.                         if ( state === 2 ) {
  7007.                                 return;
  7008.                         }
  7009.  
  7010.                         // State is "done" now
  7011.                         state = 2;
  7012.  
  7013.                         // Clear timeout if it exists
  7014.                         if ( timeoutTimer ) {
  7015.                                 clearTimeout( timeoutTimer );
  7016.                         }
  7017.  
  7018.                         // Dereference transport for early garbage collection
  7019.                         // (no matter how long the jqXHR object will be used)
  7020.                         transport = undefined;
  7021.  
  7022.                         // Cache response headers
  7023.                         responseHeadersString = headers || "";
  7024.  
  7025.                         // Set readyState
  7026.                         jqXHR.readyState = status > 0 ? 4 : 0;
  7027.  
  7028.                         var isSuccess,
  7029.                                 success,
  7030.                                 error,
  7031.                                 statusText = nativeStatusText,
  7032.                                 response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
  7033.                                 lastModified,
  7034.                                 etag;
  7035.  
  7036.                         // If successful, handle type chaining
  7037.                         if ( status >= 200 && status < 300 || status === 304 ) {
  7038.  
  7039.                                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7040.                                if ( s.ifModified ) {
  7041.  
  7042.                                        if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
  7043.                                                jQuery.lastModified[ ifModifiedKey ] = lastModified;
  7044.                                         }
  7045.                                         if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
  7046.                                                 jQuery.etag[ ifModifiedKey ] = etag;
  7047.                                         }
  7048.                                 }
  7049.  
  7050.                                 // If not modified
  7051.                                 if ( status === 304 ) {
  7052.  
  7053.                                         statusText = "notmodified";
  7054.                                         isSuccess = true;
  7055.  
  7056.                                 // If we have data
  7057.                                 } else {
  7058.  
  7059.                                         try {
  7060.                                                 success = ajaxConvert( s, response );
  7061.                                                 statusText = "success";
  7062.                                                 isSuccess = true;
  7063.                                         } catch(e) {
  7064.                                                 // We have a parsererror
  7065.                                                 statusText = "parsererror";
  7066.                                                 error = e;
  7067.                                         }
  7068.                                 }
  7069.                         } else {
  7070.                                 // We extract error from statusText
  7071.                                 // then normalize statusText and status for non-aborts
  7072.                                 error = statusText;
  7073.                                 if( !statusText || status ) {
  7074.                                         statusText = "error";
  7075.                                         if ( status < 0 ) {
  7076.                                                status = 0;
  7077.                                        }
  7078.                                }
  7079.                        }
  7080.  
  7081.                        // Set data for the fake xhr object
  7082.                        jqXHR.status = status;
  7083.                        jqXHR.statusText = "" + ( nativeStatusText || statusText );
  7084.  
  7085.                        // Success/Error
  7086.                        if ( isSuccess ) {
  7087.                                deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  7088.                        } else {
  7089.                                deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  7090.                        }
  7091.  
  7092.                        // Status-dependent callbacks
  7093.                        jqXHR.statusCode( statusCode );
  7094.                        statusCode = undefined;
  7095.  
  7096.                        if ( fireGlobals ) {
  7097.                                globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
  7098.                                                [ jqXHR, s, isSuccess ? success : error ] );
  7099.                        }
  7100.  
  7101.                        // Complete
  7102.                        completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText ] );
  7103.  
  7104.                        if ( fireGlobals ) {
  7105.                                globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  7106.                                // Handle the global AJAX counter
  7107.                                if ( !( --jQuery.active ) ) {
  7108.                                        jQuery.event.trigger( "ajaxStop" );
  7109.                                }
  7110.                        }
  7111.                }
  7112.  
  7113.                // Attach deferreds
  7114.                deferred.promise( jqXHR );
  7115.                jqXHR.success = jqXHR.done;
  7116.                jqXHR.error = jqXHR.fail;
  7117.                jqXHR.complete = completeDeferred.done;
  7118.  
  7119.                // Status-dependent callbacks
  7120.                jqXHR.statusCode = function( map ) {
  7121.                        if ( map ) {
  7122.                                var tmp;
  7123.                                if ( state < 2 ) {
  7124.                                        for( tmp in map ) {
  7125.                                                statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
  7126.                                        }
  7127.                                } else {
  7128.                                        tmp = map[ jqXHR.status ];
  7129.                                        jqXHR.then( tmp, tmp );
  7130.                                }
  7131.                        }
  7132.                        return this;
  7133.                };
  7134.  
  7135.                // Remove hash character (#7531: and string promotion)
  7136.                // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
  7137.                // We also use the url parameter if available
  7138.                s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
  7139.  
  7140.                // Extract dataTypes list
  7141.                s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
  7142.  
  7143.                // Determine if a cross-domain request is in order
  7144.                if ( s.crossDomain == null ) {
  7145.                        parts = rurl.exec( s.url.toLowerCase() );
  7146.                        s.crossDomain = !!( parts &&
  7147.                                ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
  7148.                                        ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
  7149.                                                ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
  7150.                        );
  7151.                }
  7152.  
  7153.                // Convert data if not already a string
  7154.                if ( s.data && s.processData && typeof s.data !== "string" ) {
  7155.                        s.data = jQuery.param( s.data, s.traditional );
  7156.                }
  7157.  
  7158.                // Apply prefilters
  7159.                inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  7160.  
  7161.                // If request was aborted inside a prefiler, stop there
  7162.                if ( state === 2 ) {
  7163.                        return false;
  7164.                }
  7165.  
  7166.                // We can fire global events as of now if asked to
  7167.                fireGlobals = s.global;
  7168.  
  7169.                // Uppercase the type
  7170.                s.type = s.type.toUpperCase();
  7171.  
  7172.                // Determine if request has content
  7173.                s.hasContent = !rnoContent.test( s.type );
  7174.  
  7175.                // Watch for a new set of requests
  7176.                if ( fireGlobals && jQuery.active++ === 0 ) {
  7177.                        jQuery.event.trigger( "ajaxStart" );
  7178.                }
  7179.  
  7180.                // More options handling for requests with no content
  7181.                if ( !s.hasContent ) {
  7182.  
  7183.                        // If data is available, append data to url
  7184.                        if ( s.data ) {
  7185.                                s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
  7186.                                // #9682: remove data so that it's not used in an eventual retry
  7187.                                delete s.data;
  7188.                        }
  7189.                        // Get ifModifiedKey before adding the anti-cache parameter
  7190.                        ifModifiedKey = s.url;
  7191.                        // Add anti-cache in url if needed
  7192.                        if ( s.cache === false ) {
  7193.                                var ts = jQuery.now(),
  7194.                                        // try replacing _= if it is there
  7195.                                        ret = s.url.replace( rts, "$1_=" + ts );
  7196.                                // if nothing was replaced, add timestamp to the end
  7197.                                s.url = ret + ( (ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
  7198.                        }
  7199.                }
  7200.                // Set the correct header, if data is being sent
  7201.                if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  7202.                        jqXHR.setRequestHeader( "Content-Type", s.contentType );
  7203.                }
  7204.                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7205.                if ( s.ifModified ) {
  7206.                        ifModifiedKey = ifModifiedKey || s.url;
  7207.                        if ( jQuery.lastModified[ ifModifiedKey ] ) {
  7208.                                jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
  7209.                        }
  7210.                        if ( jQuery.etag[ ifModifiedKey ] ) {
  7211.                                jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
  7212.                        }
  7213.                }
  7214.                // Set the Accepts header for the server, depending on the dataType
  7215.                jqXHR.setRequestHeader(
  7216.                        "Accept",
  7217.                        s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
  7218.                                s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  7219.                                s.accepts[ "*" ]
  7220.                );
  7221.                // Check for headers option
  7222.                for ( i in s.headers ) {
  7223.                        jqXHR.setRequestHeader( i, s.headers[ i ] );
  7224.                }
  7225.                // Allow custom headers/mimetypes and early abort
  7226.                if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
  7227.                                // Abort if not done already
  7228.                                jqXHR.abort();
  7229.                                return false;
  7230.                }
  7231.                // Install callbacks on deferreds
  7232.                for ( i in { success: 1, error: 1, complete: 1 } ) {
  7233.                        jqXHR[ i ]( s[ i ] );
  7234.                }
  7235.                // Get transport
  7236.                transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  7237.                // If no transport, we auto-abort
  7238.                if ( !transport ) {
  7239.                        done( -1, "No Transport" );
  7240.                } else {
  7241.                        jqXHR.readyState = 1;
  7242.                        // Send global event
  7243.                        if ( fireGlobals ) {
  7244.                                globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  7245.                        }
  7246.                        // Timeout
  7247.                        if ( s.async && s.timeout > 0 ) {
  7248.                                 timeoutTimer = setTimeout( function(){
  7249.                                         jqXHR.abort( "timeout" );
  7250.                                 }, s.timeout );
  7251.                         }
  7252.  
  7253.                         try {
  7254.                                 state = 1;
  7255.                                 transport.send( requestHeaders, done );
  7256.                         } catch (e) {
  7257.                                 // Propagate exception as error if not done
  7258.                                 if ( state < 2 ) {
  7259.                                        done( -1, e );
  7260.                                // Simply rethrow otherwise
  7261.                                } else {
  7262.                                        jQuery.error( e );
  7263.                                }
  7264.                        }
  7265.                }
  7266.  
  7267.                return jqXHR;
  7268.        },
  7269.  
  7270.        // Serialize an array of form elements or a set of
  7271.        // key/values into a query string
  7272.        param: function( a, traditional ) {
  7273.                var s = [],
  7274.                        add = function( key, value ) {
  7275.                                // If value is a function, invoke it and return its value
  7276.                                value = jQuery.isFunction( value ) ? value() : value;
  7277.                                s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
  7278.                        };
  7279.  
  7280.                // Set traditional to true for jQuery <= 1.3.2 behavior.
  7281.                if ( traditional === undefined ) {
  7282.                        traditional = jQuery.ajaxSettings.traditional;
  7283.                }
  7284.  
  7285.                // If an array was passed in, assume that it is an array of form elements.
  7286.                if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  7287.                        // Serialize the form elements
  7288.                        jQuery.each( a, function() {
  7289.                                add( this.name, this.value );
  7290.                        });
  7291.  
  7292.                } else {
  7293.                        // If traditional, encode the "old" way (the way 1.3.2 or older
  7294.                        // did it), otherwise encode params recursively.
  7295.                        for ( var prefix in a ) {
  7296.                                buildParams( prefix, a[ prefix ], traditional, add );
  7297.                        }
  7298.                }
  7299.  
  7300.                // Return the resulting serialization
  7301.                return s.join( "&" ).replace( r20, "+" );
  7302.        }
  7303.    });
  7304.  
  7305.    function buildParams( prefix, obj, traditional, add ) {
  7306.        if ( jQuery.isArray( obj ) ) {
  7307.                // Serialize array item.
  7308.                jQuery.each( obj, function( i, v ) {
  7309.                        if ( traditional || rbracket.test( prefix ) ) {
  7310.                                // Treat each array item as a scalar.
  7311.                                add( prefix, v );
  7312.  
  7313.                        } else {
  7314.                                // If array item is non-scalar (array or object), encode its
  7315.                                // numeric index to resolve deserialization ambiguity issues.
  7316.                                // Note that rack (as of 1.0.0) can't currently deserialize
  7317.                                // nested arrays properly, and attempting to do so may cause
  7318.                                // a server error. Possible fixes are to modify rack's
  7319.                                // deserialization algorithm or to provide an option or flag
  7320.                                // to force array serialization to be shallow.
  7321.                                buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
  7322.                        }
  7323.                });
  7324.  
  7325.        } else if ( !traditional && obj != null && typeof obj === "object" ) {
  7326.                // Serialize object item.
  7327.                for ( var name in obj ) {
  7328.                        buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  7329.                }
  7330.  
  7331.        } else {
  7332.                // Serialize scalar item.
  7333.                add( prefix, obj );
  7334.        }
  7335.    }
  7336.  
  7337.    // This is still on the jQuery object... for now
  7338.    // Want to move this to jQuery.ajax some day
  7339.    jQuery.extend({
  7340.  
  7341.        // Counter for holding the number of active queries
  7342.        active: 0,
  7343.  
  7344.        // Last-Modified header cache for next request
  7345.        lastModified: {},
  7346.        etag: {}
  7347.  
  7348.    });
  7349.  
  7350.    /* Handles responses to an ajax request:
  7351.    * - sets all responseXXX fields accordingly
  7352.    * - finds the right dataType (mediates between content-type and expected dataType)
  7353.    * - returns the corresponding response
  7354.    */
  7355.    function ajaxHandleResponses( s, jqXHR, responses ) {
  7356.  
  7357.        var contents = s.contents,
  7358.                dataTypes = s.dataTypes,
  7359.                responseFields = s.responseFields,
  7360.                ct,
  7361.                type,
  7362.                finalDataType,
  7363.                firstDataType;
  7364.  
  7365.        // Fill responseXXX fields
  7366.        for( type in responseFields ) {
  7367.                if ( type in responses ) {
  7368.                        jqXHR[ responseFields[type] ] = responses[ type ];
  7369.                }
  7370.        }
  7371.  
  7372.        // Remove auto dataType and get content-type in the process
  7373.        while( dataTypes[ 0 ] === "*" ) {
  7374.                dataTypes.shift();
  7375.                if ( ct === undefined ) {
  7376.                        ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
  7377.                }
  7378.        }
  7379.  
  7380.        // Check if we're dealing with a known content-type
  7381.        if ( ct ) {
  7382.                for ( type in contents ) {
  7383.                        if ( contents[ type ] && contents[ type ].test( ct ) ) {
  7384.                                dataTypes.unshift( type );
  7385.                                break;
  7386.                        }
  7387.                }
  7388.        }
  7389.        // Check to see if we have a response for the expected dataType
  7390.        if ( dataTypes[ 0 ] in responses ) {
  7391.                finalDataType = dataTypes[ 0 ];
  7392.        } else {
  7393.                // Try convertible dataTypes
  7394.                for ( type in responses ) {
  7395.                        if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
  7396.                                finalDataType = type;
  7397.                                break;
  7398.                        }
  7399.                        if ( !firstDataType ) {
  7400.                                firstDataType = type;
  7401.                        }
  7402.                }
  7403.                // Or just use first one
  7404.                finalDataType = finalDataType || firstDataType;
  7405.        }
  7406.        // If we found a dataType
  7407.        // We add the dataType to the list if needed
  7408.        // and return the corresponding response
  7409.        if ( finalDataType ) {
  7410.                if ( finalDataType !== dataTypes[ 0 ] ) {
  7411.                        dataTypes.unshift( finalDataType );
  7412.                }
  7413.                return responses[ finalDataType ];
  7414.        }
  7415.    }
  7416.    // Chain conversions given the request and the original response
  7417.    function ajaxConvert( s, response ) {
  7418.        // Apply the dataFilter if provided
  7419.        if ( s.dataFilter ) {
  7420.                response = s.dataFilter( response, s.dataType );
  7421.        }
  7422.        var dataTypes = s.dataTypes,
  7423.                converters = {},
  7424.                i,
  7425.                key,
  7426.                length = dataTypes.length,
  7427.                tmp,
  7428.                // Current and previous dataTypes
  7429.                current = dataTypes[ 0 ],
  7430.                prev,
  7431.                // Conversion expression
  7432.                conversion,
  7433.                // Conversion function
  7434.                conv,
  7435.                // Conversion functions (transitive conversion)
  7436.                conv1,
  7437.                conv2;
  7438.        // For each dataType in the chain
  7439.        for( i = 1; i < length; i++ ) {
  7440.                // Create converters map
  7441.                // with lowercased keys
  7442.                if ( i === 1 ) {
  7443.                        for( key in s.converters ) {
  7444.                                if( typeof key === "string" ) {
  7445.                                        converters[ key.toLowerCase() ] = s.converters[ key ];
  7446.                                }
  7447.                        }
  7448.                }
  7449.                // Get the dataTypes
  7450.                prev = current;
  7451.                current = dataTypes[ i ];
  7452.                // If current is auto dataType, update it to prev
  7453.                if( current === "*" ) {
  7454.                        current = prev;
  7455.                // If no auto and dataTypes are actually different
  7456.                } else if ( prev !== "*" && prev !== current ) {
  7457.                        // Get the converter
  7458.                        conversion = prev + " " + current;
  7459.                        conv = converters[ conversion ] || converters[ "* " + current ];
  7460.                        // If there is no direct converter, search transitively
  7461.                        if ( !conv ) {
  7462.                                conv2 = undefined;
  7463.                                for( conv1 in converters ) {
  7464.                                        tmp = conv1.split( " " );
  7465.                                        if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
  7466.                                                conv2 = converters[ tmp[1] + " " + current ];
  7467.                                                if ( conv2 ) {
  7468.                                                        conv1 = converters[ conv1 ];
  7469.                                                        if ( conv1 === true ) {
  7470.                                                                conv = conv2;
  7471.                                                        } else if ( conv2 === true ) {
  7472.                                                                conv = conv1;
  7473.                                                        }
  7474.                                                        break;
  7475.                                                }
  7476.                                        }
  7477.                                }
  7478.                        }
  7479.                        // If we found no converter, dispatch an error
  7480.                        if ( !( conv || conv2 ) ) {
  7481.                                jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
  7482.                        }
  7483.                        // If found converter is not an equivalence
  7484.                        if ( conv !== true ) {
  7485.                                // Convert with 1 or 2 converters accordingly
  7486.                                response = conv ? conv( response ) : conv2( conv1(response) );
  7487.                        }
  7488.                }
  7489.        }
  7490.        return response;
  7491.    }
  7492.    var jsc = jQuery.now(),
  7493.        jsre = /(\=)\?(&|$)|\?\?/i;
  7494.    // Default jsonp settings
  7495.    jQuery.ajaxSetup({
  7496.        jsonp: "callback",
  7497.        jsonpCallback: function() {
  7498.                return jQuery.expando + "_" + ( jsc++ );
  7499.        }
  7500.    });
  7501.    // Detect, normalize options and install callbacks for jsonp requests
  7502.    jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  7503.        var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
  7504.                ( typeof s.data === "string" );
  7505.        if ( s.dataTypes[ 0 ] === "jsonp" ||
  7506.                s.jsonp !== false && ( jsre.test( s.url ) ||
  7507.                                inspectData && jsre.test( s.data ) ) ) {
  7508.                var responseContainer,
  7509.                        jsonpCallback = s.jsonpCallback =
  7510.                                jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
  7511.                        previous = window[ jsonpCallback ],
  7512.                        url = s.url,
  7513.                        data = s.data,
  7514.                        replace = "$1" + jsonpCallback + "$2";
  7515.                if ( s.jsonp !== false ) {
  7516.                        url = url.replace( jsre, replace );
  7517.                        if ( s.url === url ) {
  7518.                                if ( inspectData ) {
  7519.                                        data = data.replace( jsre, replace );
  7520.                                }
  7521.                                if ( s.data === data ) {
  7522.                                        // Add callback manually
  7523.                                        url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
  7524.                                }
  7525.                        }
  7526.                }
  7527.                s.url = url;
  7528.                s.data = data;
  7529.                // Install callback
  7530.                window[ jsonpCallback ] = function( response ) {
  7531.                        responseContainer = [ response ];
  7532.                };
  7533.                // Clean-up function
  7534.                jqXHR.always(function() {
  7535.                        // Set callback back to previous value
  7536.                        window[ jsonpCallback ] = previous;
  7537.                        // Call if it was a function and we have a response
  7538.                        if ( responseContainer && jQuery.isFunction( previous ) ) {
  7539.                                window[ jsonpCallback ]( responseContainer[ 0 ] );
  7540.                        }
  7541.                });
  7542.                // Use data converter to retrieve json after script execution
  7543.                s.converters["script json"] = function() {
  7544.                        if ( !responseContainer ) {
  7545.                                jQuery.error( jsonpCallback + " was not called" );
  7546.                        }
  7547.                        return responseContainer[ 0 ];
  7548.                };
  7549.                // force json dataType
  7550.                s.dataTypes[ 0 ] = "json";
  7551.                // Delegate to script
  7552.                return "script";
  7553.        }
  7554.    });
  7555.    // Install script dataType
  7556.    jQuery.ajaxSetup({
  7557.        accepts: {
  7558.                script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  7559.        },
  7560.        contents: {
  7561.                script: /javascript|ecmascript/
  7562.        },
  7563.        converters: {
  7564.                "text script": function( text ) {
  7565.                        jQuery.globalEval( text );
  7566.                        return text;
  7567.                }
  7568.        }
  7569.    });
  7570.    // Handle cache's special case and global
  7571.    jQuery.ajaxPrefilter( "script", function( s ) {
  7572.        if ( s.cache === undefined ) {
  7573.                s.cache = false;
  7574.        }
  7575.        if ( s.crossDomain ) {
  7576.                s.type = "GET";
  7577.                s.global = false;
  7578.        }
  7579.    });
  7580.  
  7581.    // Bind script tag hack transport
  7582.    jQuery.ajaxTransport( "script", function(s) {
  7583.  
  7584.        // This transport only deals with cross domain requests
  7585.        if ( s.crossDomain ) {
  7586.  
  7587.                var script,
  7588.                        head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
  7589.  
  7590.                return {
  7591.  
  7592.                        send: function( _, callback ) {
  7593.  
  7594.                                script = document.createElement( "script" );
  7595.  
  7596.                                script.async = "async";
  7597.  
  7598.                                if ( s.scriptCharset ) {
  7599.                                        script.charset = s.scriptCharset;
  7600.                                }
  7601.  
  7602.                                script.src = s.url;
  7603.  
  7604.                                // Attach handlers for all browsers
  7605.                                script.onload = script.onreadystatechange = function( _, isAbort ) {
  7606.  
  7607.                                        if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
  7608.  
  7609.                                                // Handle memory leak in IE
  7610.                                                script.onload = script.onreadystatechange = null;
  7611.  
  7612.                                                // Remove the script
  7613.                                                if ( head && script.parentNode ) {
  7614.                                                        head.removeChild( script );
  7615.                                                }
  7616.  
  7617.                                                // Dereference the script
  7618.                                                script = undefined;
  7619.  
  7620.                                                // Callback if not abort
  7621.                                                if ( !isAbort ) {
  7622.                                                        callback( 200, "success" );
  7623.                                                }
  7624.                                        }
  7625.                                };
  7626.                                // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
  7627.                                // This arises when a base node is used (#2709 and #4378).
  7628.                                head.insertBefore( script, head.firstChild );
  7629.                        },
  7630.  
  7631.                        abort: function() {
  7632.                                if ( script ) {
  7633.                                        script.onload( 0, 1 );
  7634.                                }
  7635.                        }
  7636.                };
  7637.        }
  7638.    });
  7639.  
  7640.  
  7641.  
  7642.  
  7643.    var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
  7644.        xhrOnUnloadAbort = window.ActiveXObject ? function() {
  7645.                // Abort all pending requests
  7646.                for ( var key in xhrCallbacks ) {
  7647.                        xhrCallbacks[ key ]( 0, 1 );
  7648.                }
  7649.        } : false,
  7650.        xhrId = 0,
  7651.        xhrCallbacks;
  7652.    // Functions to create xhrs
  7653.    function createStandardXHR() {
  7654.        try {
  7655.                return new window.XMLHttpRequest();
  7656.        } catch( e ) {}
  7657.    }
  7658.    function createActiveXHR() {
  7659.        try {
  7660.                return new window.ActiveXObject( "Microsoft.XMLHTTP" );
  7661.        } catch( e ) {}
  7662.    }
  7663.    // Create the request object
  7664.    // (This is still attached to ajaxSettings for backward compatibility)
  7665.    jQuery.ajaxSettings.xhr = window.ActiveXObject ?
  7666.        /* Microsoft failed to properly
  7667.         * implement the XMLHttpRequest in IE7 (can't request local files),
  7668.         * so we use the ActiveXObject when it is available
  7669.         * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
  7670.         * we need a fallback.
  7671.         */
  7672.        function() {
  7673.                return !this.isLocal && createStandardXHR() || createActiveXHR();
  7674.        } :
  7675.        // For all other browsers, use the standard XMLHttpRequest object
  7676.        createStandardXHR;
  7677.  
  7678.    // Determine support properties
  7679.    (function( xhr ) {
  7680.        jQuery.extend( jQuery.support, {
  7681.                ajax: !!xhr,
  7682.                cors: !!xhr && ( "withCredentials" in xhr )
  7683.        });
  7684.    })( jQuery.ajaxSettings.xhr() );
  7685.  
  7686.    // Create transport if the browser can provide an xhr
  7687.    if ( jQuery.support.ajax ) {
  7688.  
  7689.        jQuery.ajaxTransport(function( s ) {
  7690.                // Cross domain only allowed if supported through XMLHttpRequest
  7691.                if ( !s.crossDomain || jQuery.support.cors ) {
  7692.  
  7693.                        var callback;
  7694.  
  7695.                        return {
  7696.                                send: function( headers, complete ) {
  7697.  
  7698.                                        // Get a new xhr
  7699.                                        var xhr = s.xhr(),
  7700.                                                handle,
  7701.                                                i;
  7702.  
  7703.                                        // Open the socket
  7704.                                        // Passing null username, generates a login popup on Opera (#2865)
  7705.                                        if ( s.username ) {
  7706.                                                xhr.open( s.type, s.url, s.async, s.username, s.password );
  7707.                                        } else {
  7708.                                                xhr.open( s.type, s.url, s.async );
  7709.                                        }
  7710.  
  7711.                                        // Apply custom fields if provided
  7712.                                        if ( s.xhrFields ) {
  7713.                                                for ( i in s.xhrFields ) {
  7714.                                                        xhr[ i ] = s.xhrFields[ i ];
  7715.                                                }
  7716.                                        }
  7717.  
  7718.                                        // Override mime type if needed
  7719.                                        if ( s.mimeType && xhr.overrideMimeType ) {
  7720.                                                xhr.overrideMimeType( s.mimeType );
  7721.                                        }
  7722.  
  7723.                                        // X-Requested-With header
  7724.                                        // For cross-domain requests, seeing as conditions for a preflight are
  7725.                                        // akin to a jigsaw puzzle, we simply never set it to be sure.
  7726.                                        // (it can always be set on a per-request basis or even using ajaxSetup)
  7727.                                        // For same-domain requests, won't change header if already provided.
  7728.                                        if ( !s.crossDomain && !headers["X-Requested-With"] ) {
  7729.                                                headers[ "X-Requested-With" ] = "XMLHttpRequest";
  7730.                                        }
  7731.                                        // Need an extra try/catch for cross domain requests in Firefox 3
  7732.                                        try {
  7733.                                                for ( i in headers ) {
  7734.                                                        xhr.setRequestHeader( i, headers[ i ] );
  7735.                                                }
  7736.                                        } catch( _ ) {}
  7737.                                        // Do send the request
  7738.                                        // This may raise an exception which is actually
  7739.                                        // handled in jQuery.ajax (so no try/catch here)
  7740.                                        xhr.send( ( s.hasContent && s.data ) || null );
  7741.                                        // Listener
  7742.                                        callback = function( _, isAbort ) {
  7743.                                                var status,
  7744.                                                        statusText,
  7745.                                                        responseHeaders,
  7746.                                                        responses,
  7747.                                                        xml;
  7748.                                                // Firefox throws exceptions when accessing properties
  7749.                                                // of an xhr when a network error occured
  7750.                                                // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
  7751.                                                try {
  7752.                                                        // Was never called and is aborted or complete
  7753.                                                        if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
  7754.                                                                // Only called once
  7755.                                                                callback = undefined;
  7756.                                                                // Do not keep as active anymore
  7757.                                                                if ( handle ) {
  7758.                                                                        xhr.onreadystatechange = jQuery.noop;
  7759.                                                                        if ( xhrOnUnloadAbort ) {
  7760.                                                                                delete xhrCallbacks[ handle ];
  7761.                                                                        }
  7762.                                                                }
  7763.                                                                // If it's an abort
  7764.                                                                if ( isAbort ) {
  7765.                                                                        // Abort it manually if needed
  7766.                                                                        if ( xhr.readyState !== 4 ) {
  7767.                                                                                xhr.abort();
  7768.                                                                        }
  7769.                                                                } else {
  7770.                                                                        status = xhr.status;
  7771.                                                                        responseHeaders = xhr.getAllResponseHeaders();
  7772.                                                                        responses = {};
  7773.                                                                        xml = xhr.responseXML;
  7774.  
  7775.                                                                        // Construct response list
  7776.                                                                        if ( xml && xml.documentElement /* #4958 */ ) {
  7777.                                                                                responses.xml = xml;
  7778.                                                                        }
  7779.                                                                        responses.text = xhr.responseText;
  7780.  
  7781.                                                                        // Firefox throws an exception when accessing
  7782.                                                                        // statusText for faulty cross-domain requests
  7783.                                                                        try {
  7784.                                                                                statusText = xhr.statusText;
  7785.                                                                        } catch( e ) {
  7786.                                                                                // We normalize with Webkit giving an empty statusText
  7787.                                                                                statusText = "";
  7788.                                                                        }
  7789.  
  7790.                                                                        // Filter status for non standard behaviors
  7791.  
  7792.                                                                        // If the request is local and we have data: assume a success
  7793.                                                                        // (success with no data won't get notified, that's the best we
  7794.                                                                        // can do given current implementations)
  7795.                                                                        if ( !status && s.isLocal && !s.crossDomain ) {
  7796.                                                                                status = responses.text ? 200 : 404;
  7797.                                                                        // IE - #1450: sometimes returns 1223 when it should be 204
  7798.                                                                        } else if ( status === 1223 ) {
  7799.                                                                                status = 204;
  7800.                                                                        }
  7801.                                                                }
  7802.                                                        }
  7803.                                                } catch( firefoxAccessException ) {
  7804.                                                        if ( !isAbort ) {
  7805.                                                                complete( -1, firefoxAccessException );
  7806.                                                        }
  7807.                                                }
  7808.  
  7809.                                                // Call complete if needed
  7810.                                                if ( responses ) {
  7811.                                                        complete( status, statusText, responses, responseHeaders );
  7812.                                                }
  7813.                                        };
  7814.  
  7815.                                        // if we're in sync mode or it's in cache
  7816.                                        // and has been retrieved directly (IE6 & IE7)
  7817.                                        // we need to manually fire the callback
  7818.                                        if ( !s.async || xhr.readyState === 4 ) {
  7819.                                                callback();
  7820.                                        } else {
  7821.                                                handle = ++xhrId;
  7822.                                                if ( xhrOnUnloadAbort ) {
  7823.                                                        // Create the active xhrs callbacks list if needed
  7824.                                                        // and attach the unload handler
  7825.                                                        if ( !xhrCallbacks ) {
  7826.                                                                xhrCallbacks = {};
  7827.                                                                jQuery( window ).unload( xhrOnUnloadAbort );
  7828.                                                        }
  7829.                                                        // Add to list of active xhrs callbacks
  7830.                                                        xhrCallbacks[ handle ] = callback;
  7831.                                                }
  7832.                                                xhr.onreadystatechange = callback;
  7833.                                        }
  7834.                                },
  7835.  
  7836.                                abort: function() {
  7837.                                        if ( callback ) {
  7838.                                                callback(0,1);
  7839.                                        }
  7840.                                }
  7841.                        };
  7842.                }
  7843.        });
  7844.    }
  7845.  
  7846.  
  7847.  
  7848.  
  7849.    var elemdisplay = {},
  7850.        iframe, iframeDoc,
  7851.        rfxtypes = /^(?:toggle|show|hide)$/,
  7852.        rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
  7853.        timerId,
  7854.        fxAttrs = [
  7855.                // height animations
  7856.                [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
  7857.                // width animations
  7858.                [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
  7859.                // opacity animations
  7860.                [ "opacity" ]
  7861.        ],
  7862.        fxNow;
  7863.  
  7864.    jQuery.fn.extend({
  7865.        show: function( speed, easing, callback ) {
  7866.                var elem, display;
  7867.  
  7868.                if ( speed || speed === 0 ) {
  7869.                        return this.animate( genFx("show", 3), speed, easing, callback);
  7870.  
  7871.                } else {
  7872.                        for ( var i = 0, j = this.length; i < j; i++ ) {
  7873.                                elem = this[i];
  7874.  
  7875.                                if ( elem.style ) {
  7876.                                        display = elem.style.display;
  7877.  
  7878.                                        // Reset the inline display of this element to learn if it is
  7879.                                        // being hidden by cascaded rules or not
  7880.                                        if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
  7881.                                                display = elem.style.display = "";
  7882.                                        }
  7883.  
  7884.                                        // Set elements which have been overridden with display: none
  7885.                                        // in a stylesheet to whatever the default browser style is
  7886.                                        // for such an element
  7887.                                        if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
  7888.                                                jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
  7889.                                        }
  7890.                                }
  7891.                        }
  7892.  
  7893.                        // Set the display of most of the elements in a second loop
  7894.                        // to avoid the constant reflow
  7895.                        for ( i = 0; i < j; i++ ) {
  7896.                                elem = this[i];
  7897.  
  7898.                                if ( elem.style ) {
  7899.                                        display = elem.style.display;
  7900.  
  7901.                                        if ( display === "" || display === "none" ) {
  7902.                                                elem.style.display = jQuery._data(elem, "olddisplay") || "";
  7903.                                        }
  7904.                                }
  7905.                        }
  7906.  
  7907.                        return this;
  7908.                }
  7909.        },
  7910.  
  7911.        hide: function( speed, easing, callback ) {
  7912.                if ( speed || speed === 0 ) {
  7913.                        return this.animate( genFx("hide", 3), speed, easing, callback);
  7914.  
  7915.                } else {
  7916.                        for ( var i = 0, j = this.length; i < j; i++ ) {
  7917.                                if ( this[i].style ) {
  7918.                                        var display = jQuery.css( this[i], "display" );
  7919.  
  7920.                                        if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
  7921.                                                jQuery._data( this[i], "olddisplay", display );
  7922.                                        }
  7923.                                }
  7924.                        }
  7925.  
  7926.                        // Set the display of the elements in a second loop
  7927.                        // to avoid the constant reflow
  7928.                        for ( i = 0; i < j; i++ ) {
  7929.                                if ( this[i].style ) {
  7930.                                        this[i].style.display = "none";
  7931.                                }
  7932.                        }
  7933.  
  7934.                        return this;
  7935.                }
  7936.        },
  7937.  
  7938.        // Save the old toggle function
  7939.        _toggle: jQuery.fn.toggle,
  7940.  
  7941.        toggle: function( fn, fn2, callback ) {
  7942.                var bool = typeof fn === "boolean";
  7943.  
  7944.                if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
  7945.                        this._toggle.apply( this, arguments );
  7946.  
  7947.                } else if ( fn == null || bool ) {
  7948.                        this.each(function() {
  7949.                                var state = bool ? fn : jQuery(this).is(":hidden");
  7950.                                jQuery(this)[ state ? "show" : "hide" ]();
  7951.                        });
  7952.  
  7953.                } else {
  7954.                        this.animate(genFx("toggle", 3), fn, fn2, callback);
  7955.                }
  7956.  
  7957.                return this;
  7958.        },
  7959.  
  7960.        fadeTo: function( speed, to, easing, callback ) {
  7961.                return this.filter(":hidden").css("opacity", 0).show().end()
  7962.                                        .animate({opacity: to}, speed, easing, callback);
  7963.        },
  7964.  
  7965.        animate: function( prop, speed, easing, callback ) {
  7966.                var optall = jQuery.speed(speed, easing, callback);
  7967.  
  7968.                if ( jQuery.isEmptyObject( prop ) ) {
  7969.                        return this.each( optall.complete, [ false ] );
  7970.                }
  7971.  
  7972.                // Do not change referenced properties as per-property easing will be lost
  7973.                prop = jQuery.extend( {}, prop );
  7974.  
  7975.                return this[ optall.queue === false ? "each" : "queue" ](function() {
  7976.                        // XXX 'this' does not always have a nodeName when running the
  7977.                        // test suite
  7978.  
  7979.                        if ( optall.queue === false ) {
  7980.                                jQuery._mark( this );
  7981.                        }
  7982.  
  7983.                        var opt = jQuery.extend( {}, optall ),
  7984.                                isElement = this.nodeType === 1,
  7985.                                hidden = isElement && jQuery(this).is(":hidden"),
  7986.                                name, val, p,
  7987.                                display, e,
  7988.                                parts, start, end, unit;
  7989.  
  7990.                        // will store per property easing and be used to determine when an animation is complete
  7991.                        opt.animatedProperties = {};
  7992.  
  7993.                        for ( p in prop ) {
  7994.  
  7995.                                // property name normalization
  7996.                                name = jQuery.camelCase( p );
  7997.                                if ( p !== name ) {
  7998.                                        prop[ name ] = prop[ p ];
  7999.                                        delete prop[ p ];
  8000.                                }
  8001.  
  8002.                                val = prop[ name ];
  8003.  
  8004.                                // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
  8005.                                 if ( jQuery.isArray( val ) ) {
  8006.                                         opt.animatedProperties[ name ] = val[ 1 ];
  8007.                                         val = prop[ name ] = val[ 0 ];
  8008.                                 } else {
  8009.                                         opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
  8010.                                 }
  8011.  
  8012.                                 if ( val === "hide" && hidden || val === "show" && !hidden ) {
  8013.                                        return opt.complete.call( this );
  8014.                                 }
  8015.  
  8016.                                 if ( isElement && ( name === "height" || name === "width" ) ) {
  8017.                                        // Make sure that nothing sneaks out
  8018.                                        // Record all 3 overflow attributes because IE does not
  8019.                                        // change the overflow attribute when overflowX and
  8020.                                        // overflowY are set to the same value
  8021.                                        opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
  8022.  
  8023.                                         // Set display property to inline-block for height/width
  8024.                                         // animations on inline elements that are having width/height
  8025.                                         // animated
  8026.                                         if ( jQuery.css( this, "display" ) === "inline" &&
  8027.                                                        jQuery.css( this, "float" ) === "none" ) {
  8028.                                                if ( !jQuery.support.inlineBlockNeedsLayout ) {
  8029.                                                        this.style.display = "inline-block";
  8030.  
  8031.                                                 } else {
  8032.                                                         display = defaultDisplay( this.nodeName );
  8033.  
  8034.                                                         // inline-level elements accept inline-block;
  8035.                                                         // block-level elements need to be inline with layout
  8036.                                                         if ( display === "inline" ) {
  8037.                                                                 this.style.display = "inline-block";
  8038.  
  8039.                                                         } else {
  8040.                                                                 this.style.display = "inline";
  8041.                                                                 this.style.zoom = 1;
  8042.                                                         }
  8043.                                                 }
  8044.                                         }
  8045.                                 }
  8046.                         }
  8047.  
  8048.                         if ( opt.overflow != null ) {
  8049.                                 this.style.overflow = "hidden";
  8050.                         }
  8051.  
  8052.                         for ( p in prop ) {
  8053.                                 e = new jQuery.fx( this, opt, p );
  8054.                                 val = prop[ p ];
  8055.  
  8056.                                 if ( rfxtypes.test(val) ) {
  8057.                                         e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();
  8058.  
  8059.                                 } else {
  8060.                                         parts = rfxnum.exec( val );
  8061.                                         start = e.cur();
  8062.  
  8063.                                         if ( parts ) {
  8064.                                                 end = parseFloat( parts[2] );
  8065.                                                 unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
  8066.  
  8067.                                                 // We need to compute starting value
  8068.                                                 if ( unit !== "px" ) {
  8069.                                                         jQuery.style( this, p, (end || 1) + unit);
  8070.                                                         start = ((end || 1) / e.cur()) * start;
  8071.                                                         jQuery.style( this, p, start + unit);
  8072.                                                 }
  8073.  
  8074.                                                 // If a +=/-= token was provided, we're doing a relative animation
  8075.                                                 if ( parts[1] ) {
  8076.                                                         end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
  8077.                                                 }
  8078.  
  8079.                                                 e.custom( start, end, unit );
  8080.  
  8081.                                         } else {
  8082.                                                 e.custom( start, val, "" );
  8083.                                         }
  8084.                                 }
  8085.                         }
  8086.  
  8087.                         // For JS strict compliance
  8088.                         return true;
  8089.                 });
  8090.         },
  8091.  
  8092.         stop: function( clearQueue, gotoEnd ) {
  8093.                 if ( clearQueue ) {
  8094.                         this.queue([]);
  8095.                 }
  8096.  
  8097.                 this.each(function() {
  8098.                         var timers = jQuery.timers,
  8099.                                 i = timers.length;
  8100.                         // clear marker counters if we know they won't be
  8101.                         if ( !gotoEnd ) {
  8102.                                 jQuery._unmark( true, this );
  8103.                         }
  8104.                         while ( i-- ) {
  8105.                                 if ( timers[i].elem === this ) {
  8106.                                         if (gotoEnd) {
  8107.                                                 // force the next step to be the last
  8108.                                                 timers[i](true);
  8109.                                         }
  8110.  
  8111.                                         timers.splice(i, 1);
  8112.                                 }
  8113.                         }
  8114.                 });
  8115.  
  8116.                 // start the next in the queue if the last step wasn't forced
  8117.                 if ( !gotoEnd ) {
  8118.                         this.dequeue();
  8119.                 }
  8120.  
  8121.                 return this;
  8122.         }
  8123.  
  8124.     });
  8125.  
  8126.     // Animations created synchronously will run synchronously
  8127.     function createFxNow() {
  8128.         setTimeout( clearFxNow, 0 );
  8129.         return ( fxNow = jQuery.now() );
  8130.     }
  8131.  
  8132.     function clearFxNow() {
  8133.         fxNow = undefined;
  8134.     }
  8135.  
  8136.     // Generate parameters to create a standard animation
  8137.     function genFx( type, num ) {
  8138.         var obj = {};
  8139.  
  8140.         jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
  8141.                 obj[ this ] = type;
  8142.         });
  8143.  
  8144.         return obj;
  8145.     }
  8146.  
  8147.     // Generate shortcuts for custom animations
  8148.     jQuery.each({
  8149.         slideDown: genFx("show", 1),
  8150.         slideUp: genFx("hide", 1),
  8151.         slideToggle: genFx("toggle", 1),
  8152.         fadeIn: { opacity: "show" },
  8153.         fadeOut: { opacity: "hide" },
  8154.         fadeToggle: { opacity: "toggle" }
  8155.     }, function( name, props ) {
  8156.         jQuery.fn[ name ] = function( speed, easing, callback ) {
  8157.                 return this.animate( props, speed, easing, callback );
  8158.         };
  8159.     });
  8160.  
  8161.     jQuery.extend({
  8162.         speed: function( speed, easing, fn ) {
  8163.                 var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
  8164.                        complete: fn || !fn && easing ||
  8165.                                jQuery.isFunction( speed ) && speed,
  8166.                        duration: speed,
  8167.                        easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
  8168.                };
  8169.  
  8170.                 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
  8171.                         opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
  8172.  
  8173.                 // Queueing
  8174.                 opt.old = opt.complete;
  8175.                 opt.complete = function( noUnmark ) {
  8176.                         if ( jQuery.isFunction( opt.old ) ) {
  8177.                                 opt.old.call( this );
  8178.                         }
  8179.  
  8180.                         if ( opt.queue !== false ) {
  8181.                                 jQuery.dequeue( this );
  8182.                         } else if ( noUnmark !== false ) {
  8183.                                 jQuery._unmark( this );
  8184.                         }
  8185.                 };
  8186.  
  8187.                 return opt;
  8188.         },
  8189.  
  8190.         easing: {
  8191.                 linear: function( p, n, firstNum, diff ) {
  8192.                         return firstNum + diff * p;
  8193.                 },
  8194.                 swing: function( p, n, firstNum, diff ) {
  8195.                         return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
  8196.                 }
  8197.         },
  8198.  
  8199.         timers: [],
  8200.  
  8201.         fx: function( elem, options, prop ) {
  8202.                 this.options = options;
  8203.                 this.elem = elem;
  8204.                 this.prop = prop;
  8205.  
  8206.                 options.orig = options.orig || {};
  8207.         }
  8208.  
  8209.     });
  8210.  
  8211.     jQuery.fx.prototype = {
  8212.         // Simple function for setting a style value
  8213.         update: function() {
  8214.                 if ( this.options.step ) {
  8215.                         this.options.step.call( this.elem, this.now, this );
  8216.                 }
  8217.  
  8218.                 (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
  8219.         },
  8220.  
  8221.         // Get the current size
  8222.         cur: function() {
  8223.                 if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
  8224.                        return this.elem[ this.prop ];
  8225.                 }
  8226.  
  8227.                 var parsed,
  8228.                         r = jQuery.css( this.elem, this.prop );
  8229.                 // Empty strings, null, undefined and "auto" are converted to 0,
  8230.                 // complex values such as "rotate(1rad)" are returned as is,
  8231.                 // simple values such as "10px" are parsed to Float.
  8232.                 return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
  8233.         },
  8234.  
  8235.         // Start an animation from one number to another
  8236.         custom: function( from, to, unit ) {
  8237.                 var self = this,
  8238.                         fx = jQuery.fx;
  8239.  
  8240.                 this.startTime = fxNow || createFxNow();
  8241.                 this.start = from;
  8242.                 this.end = to;
  8243.                 this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
  8244.                 this.now = this.start;
  8245.                 this.pos = this.state = 0;
  8246.  
  8247.                 function t( gotoEnd ) {
  8248.                         return self.step(gotoEnd);
  8249.                 }
  8250.  
  8251.                 t.elem = this.elem;
  8252.  
  8253.                 if ( t() && jQuery.timers.push(t) && !timerId ) {
  8254.                        timerId = setInterval( fx.tick, fx.interval );
  8255.                 }
  8256.         },
  8257.  
  8258.         // Simple 'show' function
  8259.         show: function() {
  8260.                 // Remember where we started, so that we can go back to it later
  8261.                 this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
  8262.                 this.options.show = true;
  8263.  
  8264.                 // Begin the animation
  8265.                 // Make sure that we start at a small width/height to avoid any
  8266.                 // flash of content
  8267.                 this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
  8268.  
  8269.                 // Start by showing the element
  8270.                 jQuery( this.elem ).show();
  8271.         },
  8272.  
  8273.         // Simple 'hide' function
  8274.         hide: function() {
  8275.                 // Remember where we started, so that we can go back to it later
  8276.                 this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
  8277.                 this.options.hide = true;
  8278.  
  8279.                 // Begin the animation
  8280.                 this.custom(this.cur(), 0);
  8281.         },
  8282.  
  8283.         // Each step of an animation
  8284.         step: function( gotoEnd ) {
  8285.                 var t = fxNow || createFxNow(),
  8286.                         done = true,
  8287.                         elem = this.elem,
  8288.                         options = this.options,
  8289.                         i, n;
  8290.  
  8291.                 if ( gotoEnd || t >= options.duration + this.startTime ) {
  8292.                         this.now = this.end;
  8293.                         this.pos = this.state = 1;
  8294.                         this.update();
  8295.  
  8296.                         options.animatedProperties[ this.prop ] = true;
  8297.  
  8298.                         for ( i in options.animatedProperties ) {
  8299.                                 if ( options.animatedProperties[i] !== true ) {
  8300.                                         done = false;
  8301.                                 }
  8302.                         }
  8303.  
  8304.                         if ( done ) {
  8305.                                 // Reset the overflow
  8306.                                 if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
  8307.  
  8308.                                        jQuery.each( [ "", "X", "Y" ], function (index, value) {
  8309.                                                elem.style[ "overflow" + value ] = options.overflow[index];
  8310.                                         });
  8311.                                 }
  8312.  
  8313.                                 // Hide the element if the "hide" operation was done
  8314.                                 if ( options.hide ) {
  8315.                                         jQuery(elem).hide();
  8316.                                 }
  8317.  
  8318.                                 // Reset the properties, if the item has been hidden or shown
  8319.                                 if ( options.hide || options.show ) {
  8320.                                         for ( var p in options.animatedProperties ) {
  8321.                                                 jQuery.style( elem, p, options.orig[p] );
  8322.                                         }
  8323.                                 }
  8324.  
  8325.                                 // Execute the complete function
  8326.                                 options.complete.call( elem );
  8327.                         }
  8328.  
  8329.                         return false;
  8330.  
  8331.                 } else {
  8332.                         // classical easing cannot be used with an Infinity duration
  8333.                         if ( options.duration == Infinity ) {
  8334.                                 this.now = t;
  8335.                         } else {
  8336.                                 n = t - this.startTime;
  8337.                                 this.state = n / options.duration;
  8338.  
  8339.                                 // Perform the easing function, defaults to swing
  8340.                                 this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration );
  8341.                                 this.now = this.start + ((this.end - this.start) * this.pos);
  8342.                         }
  8343.                         // Perform the next step of the animation
  8344.                         this.update();
  8345.                 }
  8346.  
  8347.                 return true;
  8348.         }
  8349.     };
  8350.  
  8351.     jQuery.extend( jQuery.fx, {
  8352.         tick: function() {
  8353.                 for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
  8354.                        if ( !timers[i]() ) {
  8355.                                timers.splice(i--, 1);
  8356.                        }
  8357.                }
  8358.  
  8359.                if ( !timers.length ) {
  8360.                        jQuery.fx.stop();
  8361.                }
  8362.        },
  8363.  
  8364.        interval: 13,
  8365.  
  8366.        stop: function() {
  8367.                clearInterval( timerId );
  8368.                timerId = null;
  8369.        },
  8370.  
  8371.        speeds: {
  8372.                slow: 600,
  8373.                fast: 200,
  8374.                // Default speed
  8375.                _default: 400
  8376.        },
  8377.  
  8378.        step: {
  8379.                opacity: function( fx ) {
  8380.                        jQuery.style( fx.elem, "opacity", fx.now );
  8381.                },
  8382.  
  8383.                _default: function( fx ) {
  8384.                        if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
  8385.                                fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
  8386.                        } else {
  8387.                                fx.elem[ fx.prop ] = fx.now;
  8388.                        }
  8389.                }
  8390.        }
  8391.    });
  8392.  
  8393.    if ( jQuery.expr && jQuery.expr.filters ) {
  8394.        jQuery.expr.filters.animated = function( elem ) {
  8395.                return jQuery.grep(jQuery.timers, function( fn ) {
  8396.                        return elem === fn.elem;
  8397.                }).length;
  8398.        };
  8399.    }
  8400.  
  8401.    // Try to restore the default display value of an element
  8402.    function defaultDisplay( nodeName ) {
  8403.  
  8404.        if ( !elemdisplay[ nodeName ] ) {
  8405.  
  8406.                var body = document.body,
  8407.                        elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
  8408.                         display = elem.css( "display" );
  8409.  
  8410.                 elem.remove();
  8411.  
  8412.                 // If the simple way fails,
  8413.                 // get element's real default display by attaching it to a temp iframe
  8414.                 if ( display === "none" || display === "" ) {
  8415.                         // No iframe to use yet, so create it
  8416.                         if ( !iframe ) {
  8417.                                 iframe = document.createElement( "iframe" );
  8418.                                 iframe.frameBorder = iframe.width = iframe.height = 0;
  8419.                         }
  8420.  
  8421.                         body.appendChild( iframe );
  8422.  
  8423.                         // Create a cacheable copy of the iframe document on first call.
  8424.                         // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
  8425.                         // document to it; WebKit & Firefox won't allow reusing the iframe document.
  8426.                        if ( !iframeDoc || !iframe.createElement ) {
  8427.                                iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
  8428.                                 iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
  8429.                                 iframeDoc.close();
  8430.                         }
  8431.  
  8432.                         elem = iframeDoc.createElement( nodeName );
  8433.  
  8434.                         iframeDoc.body.appendChild( elem );
  8435.  
  8436.                         display = jQuery.css( elem, "display" );
  8437.  
  8438.                         body.removeChild( iframe );
  8439.                 }
  8440.  
  8441.                 // Store the correct default display
  8442.                 elemdisplay[ nodeName ] = display;
  8443.         }
  8444.  
  8445.         return elemdisplay[ nodeName ];
  8446.     }
  8447.  
  8448.  
  8449.  
  8450.  
  8451.     var rtable = /^t(?:able|d|h)$/i,
  8452.         rroot = /^(?:body|html)$/i;
  8453.  
  8454.     if ( "getBoundingClientRect" in document.documentElement ) {
  8455.         jQuery.fn.offset = function( options ) {
  8456.                 var elem = this[0], box;
  8457.  
  8458.                 if ( options ) {
  8459.                         return this.each(function( i ) {
  8460.                                 jQuery.offset.setOffset( this, options, i );
  8461.                         });
  8462.                 }
  8463.  
  8464.                 if ( !elem || !elem.ownerDocument ) {
  8465.                         return null;
  8466.                 }
  8467.  
  8468.                 if ( elem === elem.ownerDocument.body ) {
  8469.                         return jQuery.offset.bodyOffset( elem );
  8470.                 }
  8471.  
  8472.                 try {
  8473.                         box = elem.getBoundingClientRect();
  8474.                 } catch(e) {}
  8475.  
  8476.                 var doc = elem.ownerDocument,
  8477.                         docElem = doc.documentElement;
  8478.  
  8479.                 // Make sure we're not dealing with a disconnected DOM node
  8480.                 if ( !box || !jQuery.contains( docElem, elem ) ) {
  8481.                         return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
  8482.                 }
  8483.  
  8484.                 var body = doc.body,
  8485.                         win = getWindow(doc),
  8486.                         clientTop  = docElem.clientTop  || body.clientTop  || 0,
  8487.                         clientLeft = docElem.clientLeft || body.clientLeft || 0,
  8488.                         scrollTop  = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop,
  8489.                        scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
  8490.                        top  = box.top  + scrollTop  - clientTop,
  8491.                        left = box.left + scrollLeft - clientLeft;
  8492.  
  8493.                 return { top: top, left: left };
  8494.         };
  8495.  
  8496.     } else {
  8497.         jQuery.fn.offset = function( options ) {
  8498.                 var elem = this[0];
  8499.  
  8500.                 if ( options ) {
  8501.                         return this.each(function( i ) {
  8502.                                 jQuery.offset.setOffset( this, options, i );
  8503.                         });
  8504.                 }
  8505.  
  8506.                 if ( !elem || !elem.ownerDocument ) {
  8507.                         return null;
  8508.                 }
  8509.  
  8510.                 if ( elem === elem.ownerDocument.body ) {
  8511.                         return jQuery.offset.bodyOffset( elem );
  8512.                 }
  8513.  
  8514.                 jQuery.offset.initialize();
  8515.  
  8516.                 var computedStyle,
  8517.                         offsetParent = elem.offsetParent,
  8518.                         prevOffsetParent = elem,
  8519.                         doc = elem.ownerDocument,
  8520.                         docElem = doc.documentElement,
  8521.                         body = doc.body,
  8522.                         defaultView = doc.defaultView,
  8523.                         prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
  8524.                         top = elem.offsetTop,
  8525.                         left = elem.offsetLeft;
  8526.  
  8527.                 while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
  8528.                        if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
  8529.                                break;
  8530.                         }
  8531.  
  8532.                         computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
  8533.                         top  -= elem.scrollTop;
  8534.                         left -= elem.scrollLeft;
  8535.  
  8536.                         if ( elem === offsetParent ) {
  8537.                                 top  += elem.offsetTop;
  8538.                                 left += elem.offsetLeft;
  8539.  
  8540.                                 if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
  8541.                                        top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
  8542.                                         left += parseFloat( computedStyle.borderLeftWidth ) || 0;
  8543.                                 }
  8544.  
  8545.                                 prevOffsetParent = offsetParent;
  8546.                                 offsetParent = elem.offsetParent;
  8547.                         }
  8548.  
  8549.                         if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
  8550.                                top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
  8551.                                 left += parseFloat( computedStyle.borderLeftWidth ) || 0;
  8552.                         }
  8553.  
  8554.                         prevComputedStyle = computedStyle;
  8555.                 }
  8556.  
  8557.                 if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
  8558.                         top  += body.offsetTop;
  8559.                         left += body.offsetLeft;
  8560.                 }
  8561.  
  8562.                 if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
  8563.                        top  += Math.max( docElem.scrollTop, body.scrollTop );
  8564.                         left += Math.max( docElem.scrollLeft, body.scrollLeft );
  8565.                 }
  8566.  
  8567.                 return { top: top, left: left };
  8568.         };
  8569.     }
  8570.  
  8571.     jQuery.offset = {
  8572.         initialize: function() {
  8573.                 var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
  8574.                         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>";
  8575.  
  8576.                 jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
  8577.  
  8578.                 container.innerHTML = html;
  8579.                 body.insertBefore( container, body.firstChild );
  8580.                 innerDiv = container.firstChild;
  8581.                 checkDiv = innerDiv.firstChild;
  8582.                 td = innerDiv.nextSibling.firstChild.firstChild;
  8583.  
  8584.                 this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
  8585.                 this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
  8586.  
  8587.                 checkDiv.style.position = "fixed";
  8588.                 checkDiv.style.top = "20px";
  8589.  
  8590.                 // safari subtracts parent border width here which is 5px
  8591.                 this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
  8592.                 checkDiv.style.position = checkDiv.style.top = "";
  8593.  
  8594.                 innerDiv.style.overflow = "hidden";
  8595.                 innerDiv.style.position = "relative";
  8596.  
  8597.                 this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
  8598.  
  8599.                 this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
  8600.  
  8601.                 body.removeChild( container );
  8602.                 jQuery.offset.initialize = jQuery.noop;
  8603.         },
  8604.  
  8605.         bodyOffset: function( body ) {
  8606.                 var top = body.offsetTop,
  8607.                         left = body.offsetLeft;
  8608.  
  8609.                 jQuery.offset.initialize();
  8610.  
  8611.                 if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
  8612.                         top  += parseFloat( jQuery.css(body, "marginTop") ) || 0;
  8613.                         left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
  8614.                 }
  8615.  
  8616.                 return { top: top, left: left };
  8617.         },
  8618.  
  8619.         setOffset: function( elem, options, i ) {
  8620.                 var position = jQuery.css( elem, "position" );
  8621.  
  8622.                 // set position first, in-case top/left are set even on static elem
  8623.                 if ( position === "static" ) {
  8624.                         elem.style.position = "relative";
  8625.                 }
  8626.  
  8627.                 var curElem = jQuery( elem ),
  8628.                         curOffset = curElem.offset(),
  8629.                         curCSSTop = jQuery.css( elem, "top" ),
  8630.                         curCSSLeft = jQuery.css( elem, "left" ),
  8631.                         calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
  8632.                        props = {}, curPosition = {}, curTop, curLeft;
  8633.  
  8634.                 // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
  8635.                 if ( calculatePosition ) {
  8636.                         curPosition = curElem.position();
  8637.                         curTop = curPosition.top;
  8638.                         curLeft = curPosition.left;
  8639.                 } else {
  8640.                         curTop = parseFloat( curCSSTop ) || 0;
  8641.                         curLeft = parseFloat( curCSSLeft ) || 0;
  8642.                 }
  8643.  
  8644.                 if ( jQuery.isFunction( options ) ) {
  8645.                         options = options.call( elem, i, curOffset );
  8646.                 }
  8647.  
  8648.                 if (options.top != null) {
  8649.                         props.top = (options.top - curOffset.top) + curTop;
  8650.                 }
  8651.                 if (options.left != null) {
  8652.                         props.left = (options.left - curOffset.left) + curLeft;
  8653.                 }
  8654.  
  8655.                 if ( "using" in options ) {
  8656.                         options.using.call( elem, props );
  8657.                 } else {
  8658.                         curElem.css( props );
  8659.                 }
  8660.         }
  8661.     };
  8662.  
  8663.  
  8664.     jQuery.fn.extend({
  8665.         position: function() {
  8666.                 if ( !this[0] ) {
  8667.                         return null;
  8668.                 }
  8669.  
  8670.                 var elem = this[0],
  8671.  
  8672.                 // Get *real* offsetParent
  8673.                 offsetParent = this.offsetParent(),
  8674.  
  8675.                 // Get correct offsets
  8676.                 offset       = this.offset(),
  8677.                 parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
  8678.  
  8679.                 // Subtract element margins
  8680.                 // note: when an element has margin: auto the offsetLeft and marginLeft
  8681.                 // are the same in Safari causing offset.left to incorrectly be 0
  8682.                 offset.top  -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
  8683.                 offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
  8684.  
  8685.                 // Add offsetParent borders
  8686.                 parentOffset.top  += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
  8687.                 parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
  8688.  
  8689.                 // Subtract the two offsets
  8690.                 return {
  8691.                         top:  offset.top  - parentOffset.top,
  8692.                         left: offset.left - parentOffset.left
  8693.                 };
  8694.         },
  8695.  
  8696.         offsetParent: function() {
  8697.                 return this.map(function() {
  8698.                         var offsetParent = this.offsetParent || document.body;
  8699.                         while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
  8700.                                offsetParent = offsetParent.offsetParent;
  8701.                         }
  8702.                         return offsetParent;
  8703.                 });
  8704.         }
  8705.     });
  8706.  
  8707.  
  8708.     // Create scrollLeft and scrollTop methods
  8709.     jQuery.each( ["Left", "Top"], function( i, name ) {
  8710.         var method = "scroll" + name;
  8711.  
  8712.         jQuery.fn[ method ] = function( val ) {
  8713.                 var elem, win;
  8714.  
  8715.                 if ( val === undefined ) {
  8716.                         elem = this[ 0 ];
  8717.  
  8718.                         if ( !elem ) {
  8719.                                 return null;
  8720.                         }
  8721.  
  8722.                         win = getWindow( elem );
  8723.  
  8724.                         // Return the scroll offset
  8725.                         return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
  8726.                                 jQuery.support.boxModel && win.document.documentElement[ method ] ||
  8727.                                        win.document.body[ method ] :
  8728.                                elem[ method ];
  8729.                 }
  8730.  
  8731.                 // Set the scroll offset
  8732.                 return this.each(function() {
  8733.                         win = getWindow( this );
  8734.  
  8735.                         if ( win ) {
  8736.                                 win.scrollTo(
  8737.                                         !i ? val : jQuery( win ).scrollLeft(),
  8738.                                          i ? val : jQuery( win ).scrollTop()
  8739.                                 );
  8740.  
  8741.                         } else {
  8742.                                 this[ method ] = val;
  8743.                         }
  8744.                 });
  8745.         };
  8746.     });
  8747.  
  8748.     function getWindow( elem ) {
  8749.         return jQuery.isWindow( elem ) ?
  8750.                 elem :
  8751.                 elem.nodeType === 9 ?
  8752.                         elem.defaultView || elem.parentWindow :
  8753.                         false;
  8754.     }
  8755.  
  8756.  
  8757.  
  8758.  
  8759.     // Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
  8760.     jQuery.each([ "Height", "Width" ], function( i, name ) {
  8761.  
  8762.         var type = name.toLowerCase();
  8763.  
  8764.         // innerHeight and innerWidth
  8765.         jQuery.fn[ "inner" + name ] = function() {
  8766.                 var elem = this[0];
  8767.                 return elem && elem.style ?
  8768.                        parseFloat( jQuery.css( elem, type, "padding" ) ) :
  8769.                        null;
  8770.         };
  8771.  
  8772.         // outerHeight and outerWidth
  8773.         jQuery.fn[ "outer" + name ] = function( margin ) {
  8774.                 var elem = this[0];
  8775.                 return elem && elem.style ?
  8776.                        parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
  8777.                        null;
  8778.         };
  8779.  
  8780.         jQuery.fn[ type ] = function( size ) {
  8781.                 // Get window width or height
  8782.                 var elem = this[0];
  8783.                 if ( !elem ) {
  8784.                         return size == null ? null : this;
  8785.                 }
  8786.  
  8787.                 if ( jQuery.isFunction( size ) ) {
  8788.                         return this.each(function( i ) {
  8789.                                 var self = jQuery( this );
  8790.                                 self[ type ]( size.call( this, i, self[ type ]() ) );
  8791.                         });
  8792.                 }
  8793.  
  8794.                 if ( jQuery.isWindow( elem ) ) {
  8795.                         // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
  8796.                         // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
  8797.                         var docElemProp = elem.document.documentElement[ "client" + name ],
  8798.                                 body = elem.document.body;
  8799.                         return elem.document.compatMode === "CSS1Compat" && docElemProp ||
  8800.                                body && body[ "client" + name ] || docElemProp;
  8801.  
  8802.                 // Get document width or height
  8803.                 } else if ( elem.nodeType === 9 ) {
  8804.                         // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
  8805.                         return Math.max(
  8806.                                 elem.documentElement["client" + name],
  8807.                                 elem.body["scroll" + name], elem.documentElement["scroll" + name],
  8808.                                 elem.body["offset" + name], elem.documentElement["offset" + name]
  8809.                         );
  8810.  
  8811.                 // Get or set width or height on the element
  8812.                 } else if ( size === undefined ) {
  8813.                         var orig = jQuery.css( elem, type ),
  8814.                                 ret = parseFloat( orig );
  8815.  
  8816.                         return jQuery.isNaN( ret ) ? orig : ret;
  8817.  
  8818.                 // Set the width or height on the element (default to pixels if value is unitless)
  8819.                 } else {
  8820.                         return this.css( type, typeof size === "string" ? size : size + "px" );
  8821.                 }
  8822.         };
  8823.  
  8824.     });
  8825.  
  8826.  
  8827.     // Expose jQuery to the global object
  8828.     window.jQuery = window.$ = jQuery;
  8829.     })(window);
  8830.     </script>
  8831.     <script type='text/javascript'>
  8832.    
  8833.    
  8834.     function nestDiv( parent, total ){
  8835.                
  8836.         var element = $("<div/>").appendTo( parent );
  8837.        
  8838.         var repeat = total - 1;
  8839.         if( repeat > 0 ){
  8840.         var i = 0;
  8841.         //nest 10 divs
  8842.         for( i = 0; i < 10; i++ ){
  8843.             nestDiv( element, repeat );
  8844.         }
  8845.         }
  8846.     }
  8847.    
  8848.    jQuery(document).ready( function(){
  8849.     nestDiv( $('body'), 5 );
  8850.     jQuery('div').eq(500).addClass('test');
  8851.    
  8852.        
  8853.         jQuery('.test').bind('without_cache', function(){  
  8854.         var i = 0;
  8855.         for( i = 0; i < 1000; i++ ){
  8856.             jQuery(this).data('test', i );
  8857.         }
  8858.         });
  8859.        
  8860.         jQuery('.test').bind('with_cache', function(){
  8861.         var self = jQuery(this);
  8862.         var i = 0;
  8863.         for( i = 0; i < 1000; i++ ){
  8864.             self.data('test', i );
  8865.         }
  8866.         });
  8867.     });
  8868.    
  8869.    </script>
  8870.     <title></title>
  8871.   </head>
  8872.   <body>
  8873.   </body>
  8874. </html>
  8875.  
  8876.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement