jQuery JavaScript Library v1.4.2

the Jquery library version 1.4.2

目前为 2015-08-31 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.cn-greasyfork.org/scripts/12092/71381/jQuery%20JavaScript%20Library%20v142.js

  1. // ==UserScript==
  2. // @name jQuery JavaScript Library v1.4.2
  3. // @namespace nikkoum
  4. // @version 1.4.2
  5. // ==/UserScript==
  6. /*!
  7. * jQuery JavaScript Library v1.4.2
  8. * http://jquery.com/
  9. *
  10. * Copyright 2010, 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 2010, The Dojo Foundation
  17. * Released under the MIT, BSD, and GPL Licenses.
  18. *
  19. * Date: Sat Feb 13 22:33:48 2010 -0500
  20. */
  21. (function( window, undefined ) {
  22.  
  23. // Define a local copy of jQuery
  24. var jQuery = function( selector, context ) {
  25. // The jQuery object is actually just the init constructor 'enhanced'
  26. return new jQuery.fn.init( selector, context );
  27. },
  28.  
  29. // Map over jQuery in case of overwrite
  30. _jQuery = window.jQuery,
  31.  
  32. // Map over the $ in case of overwrite
  33. _$ = window.$,
  34.  
  35. // Use the correct document accordingly with window argument (sandbox)
  36. document = window.document,
  37.  
  38. // A central reference to the root jQuery(document)
  39. rootjQuery,
  40.  
  41. // A simple way to check for HTML strings or ID strings
  42. // (both of which we optimize for)
  43. quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
  44.  
  45. // Is it a simple selector
  46. isSimple = /^.[^:#\[\.,]*$/,
  47.  
  48. // Check if a string has a non-whitespace character in it
  49. rnotwhite = /\S/,
  50.  
  51. // Used for trimming whitespace
  52. rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
  53.  
  54. // Match a standalone tag
  55. rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
  56.  
  57. // Keep a UserAgent string for use with jQuery.browser
  58. userAgent = navigator.userAgent,
  59.  
  60. // For matching the engine and version of the browser
  61. browserMatch,
  62. // Has the ready events already been bound?
  63. readyBound = false,
  64. // The functions to execute on DOM ready
  65. readyList = [],
  66.  
  67. // The ready event handler
  68. DOMContentLoaded,
  69.  
  70. // Save a reference to some core methods
  71. toString = Object.prototype.toString,
  72. hasOwnProperty = Object.prototype.hasOwnProperty,
  73. push = Array.prototype.push,
  74. slice = Array.prototype.slice,
  75. indexOf = Array.prototype.indexOf;
  76.  
  77. jQuery.fn = jQuery.prototype = {
  78. init: function( selector, context ) {
  79. var match, elem, ret, doc;
  80.  
  81. // Handle $(""), $(null), or $(undefined)
  82. if ( !selector ) {
  83. return this;
  84. }
  85.  
  86. // Handle $(DOMElement)
  87. if ( selector.nodeType ) {
  88. this.context = this[0] = selector;
  89. this.length = 1;
  90. return this;
  91. }
  92. // The body element only exists once, optimize finding it
  93. if ( selector === "body" && !context ) {
  94. this.context = document;
  95. this[0] = document.body;
  96. this.selector = "body";
  97. this.length = 1;
  98. return this;
  99. }
  100.  
  101. // Handle HTML strings
  102. if ( typeof selector === "string" ) {
  103. // Are we dealing with HTML string or an ID?
  104. match = quickExpr.exec( selector );
  105.  
  106. // Verify a match, and that no context was specified for #id
  107. if ( match && (match[1] || !context) ) {
  108.  
  109. // HANDLE: $(html) -> $(array)
  110. if ( match[1] ) {
  111. doc = (context ? context.ownerDocument || context : document);
  112.  
  113. // If a single string is passed in and it's a single tag
  114. // just do a createElement and skip the rest
  115. ret = rsingleTag.exec( selector );
  116.  
  117. if ( ret ) {
  118. if ( jQuery.isPlainObject( context ) ) {
  119. selector = [ document.createElement( ret[1] ) ];
  120. jQuery.fn.attr.call( selector, context, true );
  121.  
  122. } else {
  123. selector = [ doc.createElement( ret[1] ) ];
  124. }
  125.  
  126. } else {
  127. ret = buildFragment( [ match[1] ], [ doc ] );
  128. selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
  129. }
  130. return jQuery.merge( this, selector );
  131. // HANDLE: $("#id")
  132. } else {
  133. elem = document.getElementById( match[2] );
  134.  
  135. if ( elem ) {
  136. // Handle the case where IE and Opera return items
  137. // by name instead of ID
  138. if ( elem.id !== match[2] ) {
  139. return rootjQuery.find( selector );
  140. }
  141.  
  142. // Otherwise, we inject the element directly into the jQuery object
  143. this.length = 1;
  144. this[0] = elem;
  145. }
  146.  
  147. this.context = document;
  148. this.selector = selector;
  149. return this;
  150. }
  151.  
  152. // HANDLE: $("TAG")
  153. } else if ( !context && /^\w+$/.test( selector ) ) {
  154. this.selector = selector;
  155. this.context = document;
  156. selector = document.getElementsByTagName( selector );
  157. return jQuery.merge( this, selector );
  158.  
  159. // HANDLE: $(expr, $(...))
  160. } else if ( !context || context.jquery ) {
  161. return (context || rootjQuery).find( selector );
  162.  
  163. // HANDLE: $(expr, context)
  164. // (which is just equivalent to: $(context).find(expr)
  165. } else {
  166. return jQuery( context ).find( selector );
  167. }
  168.  
  169. // HANDLE: $(function)
  170. // Shortcut for document ready
  171. } else if ( jQuery.isFunction( selector ) ) {
  172. return rootjQuery.ready( selector );
  173. }
  174.  
  175. if (selector.selector !== undefined) {
  176. this.selector = selector.selector;
  177. this.context = selector.context;
  178. }
  179.  
  180. return jQuery.makeArray( selector, this );
  181. },
  182.  
  183. // Start with an empty selector
  184. selector: "",
  185.  
  186. // The current version of jQuery being used
  187. jquery: "1.4.2",
  188.  
  189. // The default length of a jQuery object is 0
  190. length: 0,
  191.  
  192. // The number of elements contained in the matched element set
  193. size: function() {
  194. return this.length;
  195. },
  196.  
  197. toArray: function() {
  198. return slice.call( this, 0 );
  199. },
  200.  
  201. // Get the Nth element in the matched element set OR
  202. // Get the whole matched element set as a clean array
  203. get: function( num ) {
  204. return num == null ?
  205.  
  206. // Return a 'clean' array
  207. this.toArray() :
  208.  
  209. // Return just the object
  210. ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
  211. },
  212.  
  213. // Take an array of elements and push it onto the stack
  214. // (returning the new matched element set)
  215. pushStack: function( elems, name, selector ) {
  216. // Build a new jQuery matched element set
  217. var ret = jQuery();
  218.  
  219. if ( jQuery.isArray( elems ) ) {
  220. push.apply( ret, elems );
  221. } else {
  222. jQuery.merge( ret, elems );
  223. }
  224.  
  225. // Add the old object onto the stack (as a reference)
  226. ret.prevObject = this;
  227.  
  228. ret.context = this.context;
  229.  
  230. if ( name === "find" ) {
  231. ret.selector = this.selector + (this.selector ? " " : "") + selector;
  232. } else if ( name ) {
  233. ret.selector = this.selector + "." + name + "(" + selector + ")";
  234. }
  235.  
  236. // Return the newly-formed element set
  237. return ret;
  238. },
  239.  
  240. // Execute a callback for every element in the matched set.
  241. // (You can seed the arguments with an array of args, but this is
  242. // only used internally.)
  243. each: function( callback, args ) {
  244. return jQuery.each( this, callback, args );
  245. },
  246. ready: function( fn ) {
  247. // Attach the listeners
  248. jQuery.bindReady();
  249.  
  250. // If the DOM is already ready
  251. if ( jQuery.isReady ) {
  252. // Execute the function immediately
  253. fn.call( document, jQuery );
  254.  
  255. // Otherwise, remember the function for later
  256. } else if ( readyList ) {
  257. // Add the function to the wait list
  258. readyList.push( fn );
  259. }
  260.  
  261. return this;
  262. },
  263. eq: function( i ) {
  264. return i === -1 ?
  265. this.slice( i ) :
  266. this.slice( i, +i + 1 );
  267. },
  268.  
  269. first: function() {
  270. return this.eq( 0 );
  271. },
  272.  
  273. last: function() {
  274. return this.eq( -1 );
  275. },
  276.  
  277. slice: function() {
  278. return this.pushStack( slice.apply( this, arguments ),
  279. "slice", slice.call(arguments).join(",") );
  280. },
  281.  
  282. map: function( callback ) {
  283. return this.pushStack( jQuery.map(this, function( elem, i ) {
  284. return callback.call( elem, i, elem );
  285. }));
  286. },
  287. end: function() {
  288. return this.prevObject || jQuery(null);
  289. },
  290.  
  291. // For internal use only.
  292. // Behaves like an Array's method, not like a jQuery method.
  293. push: push,
  294. sort: [].sort,
  295. splice: [].splice
  296. };
  297.  
  298. // Give the init function the jQuery prototype for later instantiation
  299. jQuery.fn.init.prototype = jQuery.fn;
  300.  
  301. jQuery.extend = jQuery.fn.extend = function() {
  302. // copy reference to target object
  303. var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
  304.  
  305. // Handle a deep copy situation
  306. if ( typeof target === "boolean" ) {
  307. deep = target;
  308. target = arguments[1] || {};
  309. // skip the boolean and the target
  310. i = 2;
  311. }
  312.  
  313. // Handle case when target is a string or something (possible in deep copy)
  314. if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
  315. target = {};
  316. }
  317.  
  318. // extend jQuery itself if only one argument is passed
  319. if ( length === i ) {
  320. target = this;
  321. --i;
  322. }
  323.  
  324. for ( ; i < length; i++ ) {
  325. // Only deal with non-null/undefined values
  326. if ( (options = arguments[ i ]) != null ) {
  327. // Extend the base object
  328. for ( name in options ) {
  329. src = target[ name ];
  330. copy = options[ name ];
  331.  
  332. // Prevent never-ending loop
  333. if ( target === copy ) {
  334. continue;
  335. }
  336.  
  337. // Recurse if we're merging object literal values or arrays
  338. if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
  339. var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
  340. : jQuery.isArray(copy) ? [] : {};
  341.  
  342. // Never move original objects, clone them
  343. target[ name ] = jQuery.extend( deep, clone, copy );
  344.  
  345. // Don't bring in undefined values
  346. } else if ( copy !== undefined ) {
  347. target[ name ] = copy;
  348. }
  349. }
  350. }
  351. }
  352.  
  353. // Return the modified object
  354. return target;
  355. };
  356.  
  357. jQuery.extend({
  358. noConflict: function( deep ) {
  359. window.$ = _$;
  360.  
  361. if ( deep ) {
  362. window.jQuery = _jQuery;
  363. }
  364.  
  365. return jQuery;
  366. },
  367. // Is the DOM ready to be used? Set to true once it occurs.
  368. isReady: false,
  369. // Handle when the DOM is ready
  370. ready: function() {
  371. // Make sure that the DOM is not already loaded
  372. if ( !jQuery.isReady ) {
  373. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  374. if ( !document.body ) {
  375. return setTimeout( jQuery.ready, 13 );
  376. }
  377.  
  378. // Remember that the DOM is ready
  379. jQuery.isReady = true;
  380.  
  381. // If there are functions bound, to execute
  382. if ( readyList ) {
  383. // Execute all of them
  384. var fn, i = 0;
  385. while ( (fn = readyList[ i++ ]) ) {
  386. fn.call( document, jQuery );
  387. }
  388.  
  389. // Reset the list of functions
  390. readyList = null;
  391. }
  392.  
  393. // Trigger any bound ready events
  394. if ( jQuery.fn.triggerHandler ) {
  395. jQuery( document ).triggerHandler( "ready" );
  396. }
  397. }
  398. },
  399. bindReady: function() {
  400. if ( readyBound ) {
  401. return;
  402. }
  403.  
  404. readyBound = true;
  405.  
  406. // Catch cases where $(document).ready() is called after the
  407. // browser event has already occurred.
  408. if ( document.readyState === "complete" ) {
  409. return jQuery.ready();
  410. }
  411.  
  412. // Mozilla, Opera and webkit nightlies currently support this event
  413. if ( document.addEventListener ) {
  414. // Use the handy event callback
  415. document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  416. // A fallback to window.onload, that will always work
  417. window.addEventListener( "load", jQuery.ready, false );
  418.  
  419. // If IE event model is used
  420. } else if ( document.attachEvent ) {
  421. // ensure firing before onload,
  422. // maybe late but safe also for iframes
  423. document.attachEvent("onreadystatechange", DOMContentLoaded);
  424. // A fallback to window.onload, that will always work
  425. window.attachEvent( "onload", jQuery.ready );
  426.  
  427. // If IE and not a frame
  428. // continually check to see if the document is ready
  429. var toplevel = false;
  430.  
  431. try {
  432. toplevel = window.frameElement == null;
  433. } catch(e) {}
  434.  
  435. if ( document.documentElement.doScroll && toplevel ) {
  436. doScrollCheck();
  437. }
  438. }
  439. },
  440.  
  441. // See test/unit/core.js for details concerning isFunction.
  442. // Since version 1.3, DOM methods and functions like alert
  443. // aren't supported. They return false on IE (#2968).
  444. isFunction: function( obj ) {
  445. return toString.call(obj) === "[object Function]";
  446. },
  447.  
  448. isArray: function( obj ) {
  449. return toString.call(obj) === "[object Array]";
  450. },
  451.  
  452. isPlainObject: function( obj ) {
  453. // Must be an Object.
  454. // Because of IE, we also have to check the presence of the constructor property.
  455. // Make sure that DOM nodes and window objects don't pass through, as well
  456. if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
  457. return false;
  458. }
  459. // Not own constructor property must be Object
  460. if ( obj.constructor
  461. && !hasOwnProperty.call(obj, "constructor")
  462. && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
  463. return false;
  464. }
  465. // Own properties are enumerated firstly, so to speed up,
  466. // if last one is own, then all properties are own.
  467. var key;
  468. for ( key in obj ) {}
  469. return key === undefined || hasOwnProperty.call( obj, key );
  470. },
  471.  
  472. isEmptyObject: function( obj ) {
  473. for ( var name in obj ) {
  474. return false;
  475. }
  476. return true;
  477. },
  478. error: function( msg ) {
  479. throw msg;
  480. },
  481. parseJSON: function( data ) {
  482. if ( typeof data !== "string" || !data ) {
  483. return null;
  484. }
  485.  
  486. // Make sure leading/trailing whitespace is removed (IE can't handle it)
  487. data = jQuery.trim( data );
  488. // Make sure the incoming data is actual JSON
  489. // Logic borrowed from http://json.org/json2.js
  490. if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
  491. .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
  492. .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) {
  493.  
  494. // Try to use the native JSON parser first
  495. return window.JSON && window.JSON.parse ?
  496. window.JSON.parse( data ) :
  497. (new Function("return " + data))();
  498.  
  499. } else {
  500. jQuery.error( "Invalid JSON: " + data );
  501. }
  502. },
  503.  
  504. noop: function() {},
  505.  
  506. // Evalulates a script in a global context
  507. globalEval: function( data ) {
  508. if ( data && rnotwhite.test(data) ) {
  509. // Inspired by code by Andrea Giammarchi
  510. // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
  511. var head = document.getElementsByTagName("head")[0] || document.documentElement,
  512. script = document.createElement("script");
  513.  
  514. script.type = "text/javascript";
  515.  
  516. if ( jQuery.support.scriptEval ) {
  517. script.appendChild( document.createTextNode( data ) );
  518. } else {
  519. script.text = data;
  520. }
  521.  
  522. // Use insertBefore instead of appendChild to circumvent an IE6 bug.
  523. // This arises when a base node is used (#2709).
  524. head.insertBefore( script, head.firstChild );
  525. head.removeChild( script );
  526. }
  527. },
  528.  
  529. nodeName: function( elem, name ) {
  530. return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
  531. },
  532.  
  533. // args is for internal usage only
  534. each: function( object, callback, args ) {
  535. var name, i = 0,
  536. length = object.length,
  537. isObj = length === undefined || jQuery.isFunction(object);
  538.  
  539. if ( args ) {
  540. if ( isObj ) {
  541. for ( name in object ) {
  542. if ( callback.apply( object[ name ], args ) === false ) {
  543. break;
  544. }
  545. }
  546. } else {
  547. for ( ; i < length; ) {
  548. if ( callback.apply( object[ i++ ], args ) === false ) {
  549. break;
  550. }
  551. }
  552. }
  553.  
  554. // A special, fast, case for the most common use of each
  555. } else {
  556. if ( isObj ) {
  557. for ( name in object ) {
  558. if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
  559. break;
  560. }
  561. }
  562. } else {
  563. for ( var value = object[0];
  564. i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
  565. }
  566. }
  567.  
  568. return object;
  569. },
  570.  
  571. trim: function( text ) {
  572. return (text || "").replace( rtrim, "" );
  573. },
  574.  
  575. // results is for internal usage only
  576. makeArray: function( array, results ) {
  577. var ret = results || [];
  578.  
  579. if ( array != null ) {
  580. // The window, strings (and functions) also have 'length'
  581. // The extra typeof function check is to prevent crashes
  582. // in Safari 2 (See: #3039)
  583. if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
  584. push.call( ret, array );
  585. } else {
  586. jQuery.merge( ret, array );
  587. }
  588. }
  589.  
  590. return ret;
  591. },
  592.  
  593. inArray: function( elem, array ) {
  594. if ( array.indexOf ) {
  595. return array.indexOf( elem );
  596. }
  597.  
  598. for ( var i = 0, length = array.length; i < length; i++ ) {
  599. if ( array[ i ] === elem ) {
  600. return i;
  601. }
  602. }
  603.  
  604. return -1;
  605. },
  606.  
  607. merge: function( first, second ) {
  608. var i = first.length, j = 0;
  609.  
  610. if ( typeof second.length === "number" ) {
  611. for ( var l = second.length; j < l; j++ ) {
  612. first[ i++ ] = second[ j ];
  613. }
  614. } else {
  615. while ( second[j] !== undefined ) {
  616. first[ i++ ] = second[ j++ ];
  617. }
  618. }
  619.  
  620. first.length = i;
  621.  
  622. return first;
  623. },
  624.  
  625. grep: function( elems, callback, inv ) {
  626. var ret = [];
  627.  
  628. // Go through the array, only saving the items
  629. // that pass the validator function
  630. for ( var i = 0, length = elems.length; i < length; i++ ) {
  631. if ( !inv !== !callback( elems[ i ], i ) ) {
  632. ret.push( elems[ i ] );
  633. }
  634. }
  635.  
  636. return ret;
  637. },
  638.  
  639. // arg is for internal usage only
  640. map: function( elems, callback, arg ) {
  641. var ret = [], value;
  642.  
  643. // Go through the array, translating each of the items to their
  644. // new value (or values).
  645. for ( var i = 0, length = elems.length; i < length; i++ ) {
  646. value = callback( elems[ i ], i, arg );
  647.  
  648. if ( value != null ) {
  649. ret[ ret.length ] = value;
  650. }
  651. }
  652.  
  653. return ret.concat.apply( [], ret );
  654. },
  655.  
  656. // A global GUID counter for objects
  657. guid: 1,
  658.  
  659. proxy: function( fn, proxy, thisObject ) {
  660. if ( arguments.length === 2 ) {
  661. if ( typeof proxy === "string" ) {
  662. thisObject = fn;
  663. fn = thisObject[ proxy ];
  664. proxy = undefined;
  665.  
  666. } else if ( proxy && !jQuery.isFunction( proxy ) ) {
  667. thisObject = proxy;
  668. proxy = undefined;
  669. }
  670. }
  671.  
  672. if ( !proxy && fn ) {
  673. proxy = function() {
  674. return fn.apply( thisObject || this, arguments );
  675. };
  676. }
  677.  
  678. // Set the guid of unique handler to the same of original handler, so it can be removed
  679. if ( fn ) {
  680. proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
  681. }
  682.  
  683. // So proxy can be declared as an argument
  684. return proxy;
  685. },
  686.  
  687. // Use of jQuery.browser is frowned upon.
  688. // More details: http://docs.jquery.com/Utilities/jQuery.browser
  689. uaMatch: function( ua ) {
  690. ua = ua.toLowerCase();
  691.  
  692. var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
  693. /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
  694. /(msie) ([\w.]+)/.exec( ua ) ||
  695. !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
  696. [];
  697.  
  698. return { browser: match[1] || "", version: match[2] || "0" };
  699. },
  700.  
  701. browser: {}
  702. });
  703.  
  704. browserMatch = jQuery.uaMatch( userAgent );
  705. if ( browserMatch.browser ) {
  706. jQuery.browser[ browserMatch.browser ] = true;
  707. jQuery.browser.version = browserMatch.version;
  708. }
  709.  
  710. // Deprecated, use jQuery.browser.webkit instead
  711. if ( jQuery.browser.webkit ) {
  712. jQuery.browser.safari = true;
  713. }
  714.  
  715. if ( indexOf ) {
  716. jQuery.inArray = function( elem, array ) {
  717. return indexOf.call( array, elem );
  718. };
  719. }
  720.  
  721. // All jQuery objects should point back to these
  722. rootjQuery = jQuery(document);
  723.  
  724. // Cleanup functions for the document ready method
  725. if ( document.addEventListener ) {
  726. DOMContentLoaded = function() {
  727. document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  728. jQuery.ready();
  729. };
  730.  
  731. } else if ( document.attachEvent ) {
  732. DOMContentLoaded = function() {
  733. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  734. if ( document.readyState === "complete" ) {
  735. document.detachEvent( "onreadystatechange", DOMContentLoaded );
  736. jQuery.ready();
  737. }
  738. };
  739. }
  740.  
  741. // The DOM ready check for Internet Explorer
  742. function doScrollCheck() {
  743. if ( jQuery.isReady ) {
  744. return;
  745. }
  746.  
  747. try {
  748. // If IE is used, use the trick by Diego Perini
  749. // http://javascript.nwbox.com/IEContentLoaded/
  750. document.documentElement.doScroll("left");
  751. } catch( error ) {
  752. setTimeout( doScrollCheck, 1 );
  753. return;
  754. }
  755.  
  756. // and execute any waiting functions
  757. jQuery.ready();
  758. }
  759.  
  760. function evalScript( i, elem ) {
  761. if ( elem.src ) {
  762. jQuery.ajax({
  763. url: elem.src,
  764. async: false,
  765. dataType: "script"
  766. });
  767. } else {
  768. jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
  769. }
  770.  
  771. if ( elem.parentNode ) {
  772. elem.parentNode.removeChild( elem );
  773. }
  774. }
  775.  
  776. // Mutifunctional method to get and set values to a collection
  777. // The value/s can be optionally by executed if its a function
  778. function access( elems, key, value, exec, fn, pass ) {
  779. var length = elems.length;
  780. // Setting many attributes
  781. if ( typeof key === "object" ) {
  782. for ( var k in key ) {
  783. access( elems, k, key[k], exec, fn, value );
  784. }
  785. return elems;
  786. }
  787. // Setting one attribute
  788. if ( value !== undefined ) {
  789. // Optionally, function values get executed if exec is true
  790. exec = !pass && exec && jQuery.isFunction(value);
  791. for ( var i = 0; i < length; i++ ) {
  792. fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
  793. }
  794. return elems;
  795. }
  796. // Getting an attribute
  797. return length ? fn( elems[0], key ) : undefined;
  798. }
  799.  
  800. function now() {
  801. return (new Date).getTime();
  802. }
  803. (function() {
  804.  
  805. jQuery.support = {};
  806.  
  807. var root = document.documentElement,
  808. script = document.createElement("script"),
  809. div = document.createElement("div"),
  810. id = "script" + now();
  811.  
  812. div.style.display = "none";
  813. div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
  814.  
  815. var all = div.getElementsByTagName("*"),
  816. a = div.getElementsByTagName("a")[0];
  817.  
  818. // Can't get basic test support
  819. if ( !all || !all.length || !a ) {
  820. return;
  821. }
  822.  
  823. jQuery.support = {
  824. // IE strips leading whitespace when .innerHTML is used
  825. leadingWhitespace: div.firstChild.nodeType === 3,
  826.  
  827. // Make sure that tbody elements aren't automatically inserted
  828. // IE will insert them into empty tables
  829. tbody: !div.getElementsByTagName("tbody").length,
  830.  
  831. // Make sure that link elements get serialized correctly by innerHTML
  832. // This requires a wrapper element in IE
  833. htmlSerialize: !!div.getElementsByTagName("link").length,
  834.  
  835. // Get the style information from getAttribute
  836. // (IE uses .cssText insted)
  837. style: /red/.test( a.getAttribute("style") ),
  838.  
  839. // Make sure that URLs aren't manipulated
  840. // (IE normalizes it by default)
  841. hrefNormalized: a.getAttribute("href") === "/a",
  842.  
  843. // Make sure that element opacity exists
  844. // (IE uses filter instead)
  845. // Use a regex to work around a WebKit issue. See #5145
  846. opacity: /^0.55$/.test( a.style.opacity ),
  847.  
  848. // Verify style float existence
  849. // (IE uses styleFloat instead of cssFloat)
  850. cssFloat: !!a.style.cssFloat,
  851.  
  852. // Make sure that if no value is specified for a checkbox
  853. // that it defaults to "on".
  854. // (WebKit defaults to "" instead)
  855. checkOn: div.getElementsByTagName("input")[0].value === "on",
  856.  
  857. // Make sure that a selected-by-default option has a working selected property.
  858. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
  859. optSelected: document.createElement("select").appendChild( document.createElement("option") ).selected,
  860.  
  861. parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null,
  862.  
  863. // Will be defined later
  864. deleteExpando: true,
  865. checkClone: false,
  866. scriptEval: false,
  867. noCloneEvent: true,
  868. boxModel: null
  869. };
  870.  
  871. script.type = "text/javascript";
  872. try {
  873. script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
  874. } catch(e) {}
  875.  
  876. root.insertBefore( script, root.firstChild );
  877.  
  878. // Make sure that the execution of code works by injecting a script
  879. // tag with appendChild/createTextNode
  880. // (IE doesn't support this, fails, and uses .text instead)
  881. if ( window[ id ] ) {
  882. jQuery.support.scriptEval = true;
  883. delete window[ id ];
  884. }
  885.  
  886. // Test to see if it's possible to delete an expando from an element
  887. // Fails in Internet Explorer
  888. try {
  889. delete script.test;
  890. } catch(e) {
  891. jQuery.support.deleteExpando = false;
  892. }
  893.  
  894. root.removeChild( script );
  895.  
  896. if ( div.attachEvent && div.fireEvent ) {
  897. div.attachEvent("onclick", function click() {
  898. // Cloning a node shouldn't copy over any
  899. // bound event handlers (IE does this)
  900. jQuery.support.noCloneEvent = false;
  901. div.detachEvent("onclick", click);
  902. });
  903. div.cloneNode(true).fireEvent("onclick");
  904. }
  905.  
  906. div = document.createElement("div");
  907. div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
  908.  
  909. var fragment = document.createDocumentFragment();
  910. fragment.appendChild( div.firstChild );
  911.  
  912. // WebKit doesn't clone checked state correctly in fragments
  913. jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
  914.  
  915. // Figure out if the W3C box model works as expected
  916. // document.body must exist before we can do this
  917. jQuery(function() {
  918. var div = document.createElement("div");
  919. div.style.width = div.style.paddingLeft = "1px";
  920.  
  921. document.body.appendChild( div );
  922. jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
  923. document.body.removeChild( div ).style.display = 'none';
  924.  
  925. div = null;
  926. });
  927.  
  928. // Technique from Juriy Zaytsev
  929. // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
  930. var eventSupported = function( eventName ) {
  931. var el = document.createElement("div");
  932. eventName = "on" + eventName;
  933.  
  934. var isSupported = (eventName in el);
  935. if ( !isSupported ) {
  936. el.setAttribute(eventName, "return;");
  937. isSupported = typeof el[eventName] === "function";
  938. }
  939. el = null;
  940.  
  941. return isSupported;
  942. };
  943. jQuery.support.submitBubbles = eventSupported("submit");
  944. jQuery.support.changeBubbles = eventSupported("change");
  945.  
  946. // release memory in IE
  947. root = script = div = all = a = null;
  948. })();
  949.  
  950. jQuery.props = {
  951. "for": "htmlFor",
  952. "class": "className",
  953. readonly: "readOnly",
  954. maxlength: "maxLength",
  955. cellspacing: "cellSpacing",
  956. rowspan: "rowSpan",
  957. colspan: "colSpan",
  958. tabindex: "tabIndex",
  959. usemap: "useMap",
  960. frameborder: "frameBorder"
  961. };
  962. var expando = "jQuery" + now(), uuid = 0, windowData = {};
  963.  
  964. jQuery.extend({
  965. cache: {},
  966. expando:expando,
  967.  
  968. // The following elements throw uncatchable exceptions if you
  969. // attempt to add expando properties to them.
  970. noData: {
  971. "embed": true,
  972. "object": true,
  973. "applet": true
  974. },
  975.  
  976. data: function( elem, name, data ) {
  977. if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
  978. return;
  979. }
  980.  
  981. elem = elem == window ?
  982. windowData :
  983. elem;
  984.  
  985. var id = elem[ expando ], cache = jQuery.cache, thisCache;
  986.  
  987. if ( !id && typeof name === "string" && data === undefined ) {
  988. return null;
  989. }
  990.  
  991. // Compute a unique ID for the element
  992. if ( !id ) {
  993. id = ++uuid;
  994. }
  995.  
  996. // Avoid generating a new cache unless none exists and we
  997. // want to manipulate it.
  998. if ( typeof name === "object" ) {
  999. elem[ expando ] = id;
  1000. thisCache = cache[ id ] = jQuery.extend(true, {}, name);
  1001.  
  1002. } else if ( !cache[ id ] ) {
  1003. elem[ expando ] = id;
  1004. cache[ id ] = {};
  1005. }
  1006.  
  1007. thisCache = cache[ id ];
  1008.  
  1009. // Prevent overriding the named cache with undefined values
  1010. if ( data !== undefined ) {
  1011. thisCache[ name ] = data;
  1012. }
  1013.  
  1014. return typeof name === "string" ? thisCache[ name ] : thisCache;
  1015. },
  1016.  
  1017. removeData: function( elem, name ) {
  1018. if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
  1019. return;
  1020. }
  1021.  
  1022. elem = elem == window ?
  1023. windowData :
  1024. elem;
  1025.  
  1026. var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
  1027.  
  1028. // If we want to remove a specific section of the element's data
  1029. if ( name ) {
  1030. if ( thisCache ) {
  1031. // Remove the section of cache data
  1032. delete thisCache[ name ];
  1033.  
  1034. // If we've removed all the data, remove the element's cache
  1035. if ( jQuery.isEmptyObject(thisCache) ) {
  1036. jQuery.removeData( elem );
  1037. }
  1038. }
  1039.  
  1040. // Otherwise, we want to remove all of the element's data
  1041. } else {
  1042. if ( jQuery.support.deleteExpando ) {
  1043. delete elem[ jQuery.expando ];
  1044.  
  1045. } else if ( elem.removeAttribute ) {
  1046. elem.removeAttribute( jQuery.expando );
  1047. }
  1048.  
  1049. // Completely remove the data cache
  1050. delete cache[ id ];
  1051. }
  1052. }
  1053. });
  1054.  
  1055. jQuery.fn.extend({
  1056. data: function( key, value ) {
  1057. if ( typeof key === "undefined" && this.length ) {
  1058. return jQuery.data( this[0] );
  1059.  
  1060. } else if ( typeof key === "object" ) {
  1061. return this.each(function() {
  1062. jQuery.data( this, key );
  1063. });
  1064. }
  1065.  
  1066. var parts = key.split(".");
  1067. parts[1] = parts[1] ? "." + parts[1] : "";
  1068.  
  1069. if ( value === undefined ) {
  1070. var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
  1071.  
  1072. if ( data === undefined && this.length ) {
  1073. data = jQuery.data( this[0], key );
  1074. }
  1075. return data === undefined && parts[1] ?
  1076. this.data( parts[0] ) :
  1077. data;
  1078. } else {
  1079. return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
  1080. jQuery.data( this, key, value );
  1081. });
  1082. }
  1083. },
  1084.  
  1085. removeData: function( key ) {
  1086. return this.each(function() {
  1087. jQuery.removeData( this, key );
  1088. });
  1089. }
  1090. });
  1091. jQuery.extend({
  1092. queue: function( elem, type, data ) {
  1093. if ( !elem ) {
  1094. return;
  1095. }
  1096.  
  1097. type = (type || "fx") + "queue";
  1098. var q = jQuery.data( elem, type );
  1099.  
  1100. // Speed up dequeue by getting out quickly if this is just a lookup
  1101. if ( !data ) {
  1102. return q || [];
  1103. }
  1104.  
  1105. if ( !q || jQuery.isArray(data) ) {
  1106. q = jQuery.data( elem, type, jQuery.makeArray(data) );
  1107.  
  1108. } else {
  1109. q.push( data );
  1110. }
  1111.  
  1112. return q;
  1113. },
  1114.  
  1115. dequeue: function( elem, type ) {
  1116. type = type || "fx";
  1117.  
  1118. var queue = jQuery.queue( elem, type ), fn = queue.shift();
  1119.  
  1120. // If the fx queue is dequeued, always remove the progress sentinel
  1121. if ( fn === "inprogress" ) {
  1122. fn = queue.shift();
  1123. }
  1124.  
  1125. if ( fn ) {
  1126. // Add a progress sentinel to prevent the fx queue from being
  1127. // automatically dequeued
  1128. if ( type === "fx" ) {
  1129. queue.unshift("inprogress");
  1130. }
  1131.  
  1132. fn.call(elem, function() {
  1133. jQuery.dequeue(elem, type);
  1134. });
  1135. }
  1136. }
  1137. });
  1138.  
  1139. jQuery.fn.extend({
  1140. queue: function( type, data ) {
  1141. if ( typeof type !== "string" ) {
  1142. data = type;
  1143. type = "fx";
  1144. }
  1145.  
  1146. if ( data === undefined ) {
  1147. return jQuery.queue( this[0], type );
  1148. }
  1149. return this.each(function( i, elem ) {
  1150. var queue = jQuery.queue( this, type, data );
  1151.  
  1152. if ( type === "fx" && queue[0] !== "inprogress" ) {
  1153. jQuery.dequeue( this, type );
  1154. }
  1155. });
  1156. },
  1157. dequeue: function( type ) {
  1158. return this.each(function() {
  1159. jQuery.dequeue( this, type );
  1160. });
  1161. },
  1162.  
  1163. // Based off of the plugin by Clint Helfers, with permission.
  1164. // http://blindsignals.com/index.php/2009/07/jquery-delay/
  1165. delay: function( time, type ) {
  1166. time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
  1167. type = type || "fx";
  1168.  
  1169. return this.queue( type, function() {
  1170. var elem = this;
  1171. setTimeout(function() {
  1172. jQuery.dequeue( elem, type );
  1173. }, time );
  1174. });
  1175. },
  1176.  
  1177. clearQueue: function( type ) {
  1178. return this.queue( type || "fx", [] );
  1179. }
  1180. });
  1181. var rclass = /[\n\t]/g,
  1182. rspace = /\s+/,
  1183. rreturn = /\r/g,
  1184. rspecialurl = /href|src|style/,
  1185. rtype = /(button|input)/i,
  1186. rfocusable = /(button|input|object|select|textarea)/i,
  1187. rclickable = /^(a|area)$/i,
  1188. rradiocheck = /radio|checkbox/;
  1189.  
  1190. jQuery.fn.extend({
  1191. attr: function( name, value ) {
  1192. return access( this, name, value, true, jQuery.attr );
  1193. },
  1194.  
  1195. removeAttr: function( name, fn ) {
  1196. return this.each(function(){
  1197. jQuery.attr( this, name, "" );
  1198. if ( this.nodeType === 1 ) {
  1199. this.removeAttribute( name );
  1200. }
  1201. });
  1202. },
  1203.  
  1204. addClass: function( value ) {
  1205. if ( jQuery.isFunction(value) ) {
  1206. return this.each(function(i) {
  1207. var self = jQuery(this);
  1208. self.addClass( value.call(this, i, self.attr("class")) );
  1209. });
  1210. }
  1211.  
  1212. if ( value && typeof value === "string" ) {
  1213. var classNames = (value || "").split( rspace );
  1214.  
  1215. for ( var i = 0, l = this.length; i < l; i++ ) {
  1216. var elem = this[i];
  1217.  
  1218. if ( elem.nodeType === 1 ) {
  1219. if ( !elem.className ) {
  1220. elem.className = value;
  1221.  
  1222. } else {
  1223. var className = " " + elem.className + " ", setClass = elem.className;
  1224. for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
  1225. if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
  1226. setClass += " " + classNames[c];
  1227. }
  1228. }
  1229. elem.className = jQuery.trim( setClass );
  1230. }
  1231. }
  1232. }
  1233. }
  1234.  
  1235. return this;
  1236. },
  1237.  
  1238. removeClass: function( value ) {
  1239. if ( jQuery.isFunction(value) ) {
  1240. return this.each(function(i) {
  1241. var self = jQuery(this);
  1242. self.removeClass( value.call(this, i, self.attr("class")) );
  1243. });
  1244. }
  1245.  
  1246. if ( (value && typeof value === "string") || value === undefined ) {
  1247. var classNames = (value || "").split(rspace);
  1248.  
  1249. for ( var i = 0, l = this.length; i < l; i++ ) {
  1250. var elem = this[i];
  1251.  
  1252. if ( elem.nodeType === 1 && elem.className ) {
  1253. if ( value ) {
  1254. var className = (" " + elem.className + " ").replace(rclass, " ");
  1255. for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
  1256. className = className.replace(" " + classNames[c] + " ", " ");
  1257. }
  1258. elem.className = jQuery.trim( className );
  1259.  
  1260. } else {
  1261. elem.className = "";
  1262. }
  1263. }
  1264. }
  1265. }
  1266.  
  1267. return this;
  1268. },
  1269.  
  1270. toggleClass: function( value, stateVal ) {
  1271. var type = typeof value, isBool = typeof stateVal === "boolean";
  1272.  
  1273. if ( jQuery.isFunction( value ) ) {
  1274. return this.each(function(i) {
  1275. var self = jQuery(this);
  1276. self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
  1277. });
  1278. }
  1279.  
  1280. return this.each(function() {
  1281. if ( type === "string" ) {
  1282. // toggle individual class names
  1283. var className, i = 0, self = jQuery(this),
  1284. state = stateVal,
  1285. classNames = value.split( rspace );
  1286.  
  1287. while ( (className = classNames[ i++ ]) ) {
  1288. // check each className given, space seperated list
  1289. state = isBool ? state : !self.hasClass( className );
  1290. self[ state ? "addClass" : "removeClass" ]( className );
  1291. }
  1292.  
  1293. } else if ( type === "undefined" || type === "boolean" ) {
  1294. if ( this.className ) {
  1295. // store className if set
  1296. jQuery.data( this, "__className__", this.className );
  1297. }
  1298.  
  1299. // toggle whole className
  1300. this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
  1301. }
  1302. });
  1303. },
  1304.  
  1305. hasClass: function( selector ) {
  1306. var className = " " + selector + " ";
  1307. for ( var i = 0, l = this.length; i < l; i++ ) {
  1308. if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
  1309. return true;
  1310. }
  1311. }
  1312.  
  1313. return false;
  1314. },
  1315.  
  1316. val: function( value ) {
  1317. if ( value === undefined ) {
  1318. var elem = this[0];
  1319.  
  1320. if ( elem ) {
  1321. if ( jQuery.nodeName( elem, "option" ) ) {
  1322. return (elem.attributes.value || {}).specified ? elem.value : elem.text;
  1323. }
  1324.  
  1325. // We need to handle select boxes special
  1326. if ( jQuery.nodeName( elem, "select" ) ) {
  1327. var index = elem.selectedIndex,
  1328. values = [],
  1329. options = elem.options,
  1330. one = elem.type === "select-one";
  1331.  
  1332. // Nothing was selected
  1333. if ( index < 0 ) {
  1334. return null;
  1335. }
  1336.  
  1337. // Loop through all the selected options
  1338. for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
  1339. var option = options[ i ];
  1340.  
  1341. if ( option.selected ) {
  1342. // Get the specifc value for the option
  1343. value = jQuery(option).val();
  1344.  
  1345. // We don't need an array for one selects
  1346. if ( one ) {
  1347. return value;
  1348. }
  1349.  
  1350. // Multi-Selects return an array
  1351. values.push( value );
  1352. }
  1353. }
  1354.  
  1355. return values;
  1356. }
  1357.  
  1358. // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
  1359. if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
  1360. return elem.getAttribute("value") === null ? "on" : elem.value;
  1361. }
  1362.  
  1363. // Everything else, we just grab the value
  1364. return (elem.value || "").replace(rreturn, "");
  1365.  
  1366. }
  1367.  
  1368. return undefined;
  1369. }
  1370.  
  1371. var isFunction = jQuery.isFunction(value);
  1372.  
  1373. return this.each(function(i) {
  1374. var self = jQuery(this), val = value;
  1375.  
  1376. if ( this.nodeType !== 1 ) {
  1377. return;
  1378. }
  1379.  
  1380. if ( isFunction ) {
  1381. val = value.call(this, i, self.val());
  1382. }
  1383.  
  1384. // Typecast each time if the value is a Function and the appended
  1385. // value is therefore different each time.
  1386. if ( typeof val === "number" ) {
  1387. val += "";
  1388. }
  1389.  
  1390. if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
  1391. this.checked = jQuery.inArray( self.val(), val ) >= 0;
  1392.  
  1393. } else if ( jQuery.nodeName( this, "select" ) ) {
  1394. var values = jQuery.makeArray(val);
  1395.  
  1396. jQuery( "option", this ).each(function() {
  1397. this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
  1398. });
  1399.  
  1400. if ( !values.length ) {
  1401. this.selectedIndex = -1;
  1402. }
  1403.  
  1404. } else {
  1405. this.value = val;
  1406. }
  1407. });
  1408. }
  1409. });
  1410.  
  1411. jQuery.extend({
  1412. attrFn: {
  1413. val: true,
  1414. css: true,
  1415. html: true,
  1416. text: true,
  1417. data: true,
  1418. width: true,
  1419. height: true,
  1420. offset: true
  1421. },
  1422. attr: function( elem, name, value, pass ) {
  1423. // don't set attributes on text and comment nodes
  1424. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
  1425. return undefined;
  1426. }
  1427.  
  1428. if ( pass && name in jQuery.attrFn ) {
  1429. return jQuery(elem)[name](value);
  1430. }
  1431.  
  1432. var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
  1433. // Whether we are setting (or getting)
  1434. set = value !== undefined;
  1435.  
  1436. // Try to normalize/fix the name
  1437. name = notxml && jQuery.props[ name ] || name;
  1438.  
  1439. // Only do all the following if this is a node (faster for style)
  1440. if ( elem.nodeType === 1 ) {
  1441. // These attributes require special treatment
  1442. var special = rspecialurl.test( name );
  1443.  
  1444. // Safari mis-reports the default selected property of an option
  1445. // Accessing the parent's selectedIndex property fixes it
  1446. if ( name === "selected" && !jQuery.support.optSelected ) {
  1447. var parent = elem.parentNode;
  1448. if ( parent ) {
  1449. parent.selectedIndex;
  1450. // Make sure that it also works with optgroups, see #5701
  1451. if ( parent.parentNode ) {
  1452. parent.parentNode.selectedIndex;
  1453. }
  1454. }
  1455. }
  1456.  
  1457. // If applicable, access the attribute via the DOM 0 way
  1458. if ( name in elem && notxml && !special ) {
  1459. if ( set ) {
  1460. // We can't allow the type property to be changed (since it causes problems in IE)
  1461. if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
  1462. jQuery.error( "type property can't be changed" );
  1463. }
  1464.  
  1465. elem[ name ] = value;
  1466. }
  1467.  
  1468. // browsers index elements by id/name on forms, give priority to attributes.
  1469. if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
  1470. return elem.getAttributeNode( name ).nodeValue;
  1471. }
  1472.  
  1473. // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
  1474. // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  1475. if ( name === "tabIndex" ) {
  1476. var attributeNode = elem.getAttributeNode( "tabIndex" );
  1477.  
  1478. return attributeNode && attributeNode.specified ?
  1479. attributeNode.value :
  1480. rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
  1481. 0 :
  1482. undefined;
  1483. }
  1484.  
  1485. return elem[ name ];
  1486. }
  1487.  
  1488. if ( !jQuery.support.style && notxml && name === "style" ) {
  1489. if ( set ) {
  1490. elem.style.cssText = "" + value;
  1491. }
  1492.  
  1493. return elem.style.cssText;
  1494. }
  1495.  
  1496. if ( set ) {
  1497. // convert the value to a string (all browsers do this but IE) see #1070
  1498. elem.setAttribute( name, "" + value );
  1499. }
  1500.  
  1501. var attr = !jQuery.support.hrefNormalized && notxml && special ?
  1502. // Some attributes require a special call on IE
  1503. elem.getAttribute( name, 2 ) :
  1504. elem.getAttribute( name );
  1505.  
  1506. // Non-existent attributes return null, we normalize to undefined
  1507. return attr === null ? undefined : attr;
  1508. }
  1509.  
  1510. // elem is actually elem.style ... set the style
  1511. // Using attr for specific style information is now deprecated. Use style instead.
  1512. return jQuery.style( elem, name, value );
  1513. }
  1514. });
  1515. var rnamespaces = /\.(.*)$/,
  1516. fcleanup = function( nm ) {
  1517. return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
  1518. return "\\" + ch;
  1519. });
  1520. };
  1521.  
  1522. /*
  1523. * A number of helper functions used for managing events.
  1524. * Many of the ideas behind this code originated from
  1525. * Dean Edwards' addEvent library.
  1526. */
  1527. jQuery.event = {
  1528.  
  1529. // Bind an event to an element
  1530. // Original by Dean Edwards
  1531. add: function( elem, types, handler, data ) {
  1532. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  1533. return;
  1534. }
  1535.  
  1536. // For whatever reason, IE has trouble passing the window object
  1537. // around, causing it to be cloned in the process
  1538. if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
  1539. elem = window;
  1540. }
  1541.  
  1542. var handleObjIn, handleObj;
  1543.  
  1544. if ( handler.handler ) {
  1545. handleObjIn = handler;
  1546. handler = handleObjIn.handler;
  1547. }
  1548.  
  1549. // Make sure that the function being executed has a unique ID
  1550. if ( !handler.guid ) {
  1551. handler.guid = jQuery.guid++;
  1552. }
  1553.  
  1554. // Init the element's event structure
  1555. var elemData = jQuery.data( elem );
  1556.  
  1557. // If no elemData is found then we must be trying to bind to one of the
  1558. // banned noData elements
  1559. if ( !elemData ) {
  1560. return;
  1561. }
  1562.  
  1563. var events = elemData.events = elemData.events || {},
  1564. eventHandle = elemData.handle, eventHandle;
  1565.  
  1566. if ( !eventHandle ) {
  1567. elemData.handle = eventHandle = function() {
  1568. // Handle the second event of a trigger and when
  1569. // an event is called after a page has unloaded
  1570. return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
  1571. jQuery.event.handle.apply( eventHandle.elem, arguments ) :
  1572. undefined;
  1573. };
  1574. }
  1575.  
  1576. // Add elem as a property of the handle function
  1577. // This is to prevent a memory leak with non-native events in IE.
  1578. eventHandle.elem = elem;
  1579.  
  1580. // Handle multiple events separated by a space
  1581. // jQuery(...).bind("mouseover mouseout", fn);
  1582. types = types.split(" ");
  1583.  
  1584. var type, i = 0, namespaces;
  1585.  
  1586. while ( (type = types[ i++ ]) ) {
  1587. handleObj = handleObjIn ?
  1588. jQuery.extend({}, handleObjIn) :
  1589. { handler: handler, data: data };
  1590.  
  1591. // Namespaced event handlers
  1592. if ( type.indexOf(".") > -1 ) {
  1593. namespaces = type.split(".");
  1594. type = namespaces.shift();
  1595. handleObj.namespace = namespaces.slice(0).sort().join(".");
  1596.  
  1597. } else {
  1598. namespaces = [];
  1599. handleObj.namespace = "";
  1600. }
  1601.  
  1602. handleObj.type = type;
  1603. handleObj.guid = handler.guid;
  1604.  
  1605. // Get the current list of functions bound to this event
  1606. var handlers = events[ type ],
  1607. special = jQuery.event.special[ type ] || {};
  1608.  
  1609. // Init the event handler queue
  1610. if ( !handlers ) {
  1611. handlers = events[ type ] = [];
  1612.  
  1613. // Check for a special event handler
  1614. // Only use addEventListener/attachEvent if the special
  1615. // events handler returns false
  1616. if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  1617. // Bind the global event handler to the element
  1618. if ( elem.addEventListener ) {
  1619. elem.addEventListener( type, eventHandle, false );
  1620.  
  1621. } else if ( elem.attachEvent ) {
  1622. elem.attachEvent( "on" + type, eventHandle );
  1623. }
  1624. }
  1625. }
  1626. if ( special.add ) {
  1627. special.add.call( elem, handleObj );
  1628.  
  1629. if ( !handleObj.handler.guid ) {
  1630. handleObj.handler.guid = handler.guid;
  1631. }
  1632. }
  1633.  
  1634. // Add the function to the element's handler list
  1635. handlers.push( handleObj );
  1636.  
  1637. // Keep track of which events have been used, for global triggering
  1638. jQuery.event.global[ type ] = true;
  1639. }
  1640.  
  1641. // Nullify elem to prevent memory leaks in IE
  1642. elem = null;
  1643. },
  1644.  
  1645. global: {},
  1646.  
  1647. // Detach an event or set of events from an element
  1648. remove: function( elem, types, handler, pos ) {
  1649. // don't do events on text and comment nodes
  1650. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  1651. return;
  1652. }
  1653.  
  1654. var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
  1655. elemData = jQuery.data( elem ),
  1656. events = elemData && elemData.events;
  1657.  
  1658. if ( !elemData || !events ) {
  1659. return;
  1660. }
  1661.  
  1662. // types is actually an event object here
  1663. if ( types && types.type ) {
  1664. handler = types.handler;
  1665. types = types.type;
  1666. }
  1667.  
  1668. // Unbind all events for the element
  1669. if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
  1670. types = types || "";
  1671.  
  1672. for ( type in events ) {
  1673. jQuery.event.remove( elem, type + types );
  1674. }
  1675.  
  1676. return;
  1677. }
  1678.  
  1679. // Handle multiple events separated by a space
  1680. // jQuery(...).unbind("mouseover mouseout", fn);
  1681. types = types.split(" ");
  1682.  
  1683. while ( (type = types[ i++ ]) ) {
  1684. origType = type;
  1685. handleObj = null;
  1686. all = type.indexOf(".") < 0;
  1687. namespaces = [];
  1688.  
  1689. if ( !all ) {
  1690. // Namespaced event handlers
  1691. namespaces = type.split(".");
  1692. type = namespaces.shift();
  1693.  
  1694. namespace = new RegExp("(^|\\.)" +
  1695. jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)")
  1696. }
  1697.  
  1698. eventType = events[ type ];
  1699.  
  1700. if ( !eventType ) {
  1701. continue;
  1702. }
  1703.  
  1704. if ( !handler ) {
  1705. for ( var j = 0; j < eventType.length; j++ ) {
  1706. handleObj = eventType[ j ];
  1707.  
  1708. if ( all || namespace.test( handleObj.namespace ) ) {
  1709. jQuery.event.remove( elem, origType, handleObj.handler, j );
  1710. eventType.splice( j--, 1 );
  1711. }
  1712. }
  1713.  
  1714. continue;
  1715. }
  1716.  
  1717. special = jQuery.event.special[ type ] || {};
  1718.  
  1719. for ( var j = pos || 0; j < eventType.length; j++ ) {
  1720. handleObj = eventType[ j ];
  1721.  
  1722. if ( handler.guid === handleObj.guid ) {
  1723. // remove the given handler for the given type
  1724. if ( all || namespace.test( handleObj.namespace ) ) {
  1725. if ( pos == null ) {
  1726. eventType.splice( j--, 1 );
  1727. }
  1728.  
  1729. if ( special.remove ) {
  1730. special.remove.call( elem, handleObj );
  1731. }
  1732. }
  1733.  
  1734. if ( pos != null ) {
  1735. break;
  1736. }
  1737. }
  1738. }
  1739.  
  1740. // remove generic event handler if no more handlers exist
  1741. if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
  1742. if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
  1743. removeEvent( elem, type, elemData.handle );
  1744. }
  1745.  
  1746. ret = null;
  1747. delete events[ type ];
  1748. }
  1749. }
  1750.  
  1751. // Remove the expando if it's no longer used
  1752. if ( jQuery.isEmptyObject( events ) ) {
  1753. var handle = elemData.handle;
  1754. if ( handle ) {
  1755. handle.elem = null;
  1756. }
  1757.  
  1758. delete elemData.events;
  1759. delete elemData.handle;
  1760.  
  1761. if ( jQuery.isEmptyObject( elemData ) ) {
  1762. jQuery.removeData( elem );
  1763. }
  1764. }
  1765. },
  1766.  
  1767. // bubbling is internal
  1768. trigger: function( event, data, elem /*, bubbling */ ) {
  1769. // Event object or event type
  1770. var type = event.type || event,
  1771. bubbling = arguments[3];
  1772.  
  1773. if ( !bubbling ) {
  1774. event = typeof event === "object" ?
  1775. // jQuery.Event object
  1776. event[expando] ? event :
  1777. // Object literal
  1778. jQuery.extend( jQuery.Event(type), event ) :
  1779. // Just the event type (string)
  1780. jQuery.Event(type);
  1781.  
  1782. if ( type.indexOf("!") >= 0 ) {
  1783. event.type = type = type.slice(0, -1);
  1784. event.exclusive = true;
  1785. }
  1786.  
  1787. // Handle a global trigger
  1788. if ( !elem ) {
  1789. // Don't bubble custom events when global (to avoid too much overhead)
  1790. event.stopPropagation();
  1791.  
  1792. // Only trigger if we've ever bound an event for it
  1793. if ( jQuery.event.global[ type ] ) {
  1794. jQuery.each( jQuery.cache, function() {
  1795. if ( this.events && this.events[type] ) {
  1796. jQuery.event.trigger( event, data, this.handle.elem );
  1797. }
  1798. });
  1799. }
  1800. }
  1801.  
  1802. // Handle triggering a single element
  1803.  
  1804. // don't do events on text and comment nodes
  1805. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
  1806. return undefined;
  1807. }
  1808.  
  1809. // Clean up in case it is reused
  1810. event.result = undefined;
  1811. event.target = elem;
  1812.  
  1813. // Clone the incoming data, if any
  1814. data = jQuery.makeArray( data );
  1815. data.unshift( event );
  1816. }
  1817.  
  1818. event.currentTarget = elem;
  1819.  
  1820. // Trigger the event, it is assumed that "handle" is a function
  1821. var handle = jQuery.data( elem, "handle" );
  1822. if ( handle ) {
  1823. handle.apply( elem, data );
  1824. }
  1825.  
  1826. var parent = elem.parentNode || elem.ownerDocument;
  1827.  
  1828. // Trigger an inline bound script
  1829. try {
  1830. if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
  1831. if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
  1832. event.result = false;
  1833. }
  1834. }
  1835.  
  1836. // prevent IE from throwing an error for some elements with some event types, see #3533
  1837. } catch (e) {}
  1838.  
  1839. if ( !event.isPropagationStopped() && parent ) {
  1840. jQuery.event.trigger( event, data, parent, true );
  1841.  
  1842. } else if ( !event.isDefaultPrevented() ) {
  1843. var target = event.target, old,
  1844. isClick = jQuery.nodeName(target, "a") && type === "click",
  1845. special = jQuery.event.special[ type ] || {};
  1846.  
  1847. if ( (!special._default || special._default.call( elem, event ) === false) &&
  1848. !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
  1849.  
  1850. try {
  1851. if ( target[ type ] ) {
  1852. // Make sure that we don't accidentally re-trigger the onFOO events
  1853. old = target[ "on" + type ];
  1854.  
  1855. if ( old ) {
  1856. target[ "on" + type ] = null;
  1857. }
  1858.  
  1859. jQuery.event.triggered = true;
  1860. target[ type ]();
  1861. }
  1862.  
  1863. // prevent IE from throwing an error for some elements with some event types, see #3533
  1864. } catch (e) {}
  1865.  
  1866. if ( old ) {
  1867. target[ "on" + type ] = old;
  1868. }
  1869.  
  1870. jQuery.event.triggered = false;
  1871. }
  1872. }
  1873. },
  1874.  
  1875. handle: function( event ) {
  1876. var all, handlers, namespaces, namespace, events;
  1877.  
  1878. event = arguments[0] = jQuery.event.fix( event || window.event );
  1879. event.currentTarget = this;
  1880.  
  1881. // Namespaced event handlers
  1882. all = event.type.indexOf(".") < 0 && !event.exclusive;
  1883.  
  1884. if ( !all ) {
  1885. namespaces = event.type.split(".");
  1886. event.type = namespaces.shift();
  1887. namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
  1888. }
  1889.  
  1890. var events = jQuery.data(this, "events"), handlers = events[ event.type ];
  1891.  
  1892. if ( events && handlers ) {
  1893. // Clone the handlers to prevent manipulation
  1894. handlers = handlers.slice(0);
  1895.  
  1896. for ( var j = 0, l = handlers.length; j < l; j++ ) {
  1897. var handleObj = handlers[ j ];
  1898.  
  1899. // Filter the functions by class
  1900. if ( all || namespace.test( handleObj.namespace ) ) {
  1901. // Pass in a reference to the handler function itself
  1902. // So that we can later remove it
  1903. event.handler = handleObj.handler;
  1904. event.data = handleObj.data;
  1905. event.handleObj = handleObj;
  1906. var ret = handleObj.handler.apply( this, arguments );
  1907.  
  1908. if ( ret !== undefined ) {
  1909. event.result = ret;
  1910. if ( ret === false ) {
  1911. event.preventDefault();
  1912. event.stopPropagation();
  1913. }
  1914. }
  1915.  
  1916. if ( event.isImmediatePropagationStopped() ) {
  1917. break;
  1918. }
  1919. }
  1920. }
  1921. }
  1922.  
  1923. return event.result;
  1924. },
  1925.  
  1926. props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
  1927.  
  1928. fix: function( event ) {
  1929. if ( event[ expando ] ) {
  1930. return event;
  1931. }
  1932.  
  1933. // store a copy of the original event object
  1934. // and "clone" to set read-only properties
  1935. var originalEvent = event;
  1936. event = jQuery.Event( originalEvent );
  1937.  
  1938. for ( var i = this.props.length, prop; i; ) {
  1939. prop = this.props[ --i ];
  1940. event[ prop ] = originalEvent[ prop ];
  1941. }
  1942.  
  1943. // Fix target property, if necessary
  1944. if ( !event.target ) {
  1945. event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
  1946. }
  1947.  
  1948. // check if target is a textnode (safari)
  1949. if ( event.target.nodeType === 3 ) {
  1950. event.target = event.target.parentNode;
  1951. }
  1952.  
  1953. // Add relatedTarget, if necessary
  1954. if ( !event.relatedTarget && event.fromElement ) {
  1955. event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
  1956. }
  1957.  
  1958. // Calculate pageX/Y if missing and clientX/Y available
  1959. if ( event.pageX == null && event.clientX != null ) {
  1960. var doc = document.documentElement, body = document.body;
  1961. event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
  1962. event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
  1963. }
  1964.  
  1965. // Add which for key events
  1966. if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
  1967. event.which = event.charCode || event.keyCode;
  1968. }
  1969.  
  1970. // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
  1971. if ( !event.metaKey && event.ctrlKey ) {
  1972. event.metaKey = event.ctrlKey;
  1973. }
  1974.  
  1975. // Add which for click: 1 === left; 2 === middle; 3 === right
  1976. // Note: button is not normalized, so don't use it
  1977. if ( !event.which && event.button !== undefined ) {
  1978. event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
  1979. }
  1980.  
  1981. return event;
  1982. },
  1983.  
  1984. // Deprecated, use jQuery.guid instead
  1985. guid: 1E8,
  1986.  
  1987. // Deprecated, use jQuery.proxy instead
  1988. proxy: jQuery.proxy,
  1989.  
  1990. special: {
  1991. ready: {
  1992. // Make sure the ready event is setup
  1993. setup: jQuery.bindReady,
  1994. teardown: jQuery.noop
  1995. },
  1996.  
  1997. live: {
  1998. add: function( handleObj ) {
  1999. jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) );
  2000. },
  2001.  
  2002. remove: function( handleObj ) {
  2003. var remove = true,
  2004. type = handleObj.origType.replace(rnamespaces, "");
  2005. jQuery.each( jQuery.data(this, "events").live || [], function() {
  2006. if ( type === this.origType.replace(rnamespaces, "") ) {
  2007. remove = false;
  2008. return false;
  2009. }
  2010. });
  2011.  
  2012. if ( remove ) {
  2013. jQuery.event.remove( this, handleObj.origType, liveHandler );
  2014. }
  2015. }
  2016.  
  2017. },
  2018.  
  2019. beforeunload: {
  2020. setup: function( data, namespaces, eventHandle ) {
  2021. // We only want to do this special case on windows
  2022. if ( this.setInterval ) {
  2023. this.onbeforeunload = eventHandle;
  2024. }
  2025.  
  2026. return false;
  2027. },
  2028. teardown: function( namespaces, eventHandle ) {
  2029. if ( this.onbeforeunload === eventHandle ) {
  2030. this.onbeforeunload = null;
  2031. }
  2032. }
  2033. }
  2034. }
  2035. };
  2036.  
  2037. var removeEvent = document.removeEventListener ?
  2038. function( elem, type, handle ) {
  2039. elem.removeEventListener( type, handle, false );
  2040. } :
  2041. function( elem, type, handle ) {
  2042. elem.detachEvent( "on" + type, handle );
  2043. };
  2044.  
  2045. jQuery.Event = function( src ) {
  2046. // Allow instantiation without the 'new' keyword
  2047. if ( !this.preventDefault ) {
  2048. return new jQuery.Event( src );
  2049. }
  2050.  
  2051. // Event object
  2052. if ( src && src.type ) {
  2053. this.originalEvent = src;
  2054. this.type = src.type;
  2055. // Event type
  2056. } else {
  2057. this.type = src;
  2058. }
  2059.  
  2060. // timeStamp is buggy for some events on Firefox(#3843)
  2061. // So we won't rely on the native value
  2062. this.timeStamp = now();
  2063.  
  2064. // Mark it as fixed
  2065. this[ expando ] = true;
  2066. };
  2067.  
  2068. function returnFalse() {
  2069. return false;
  2070. }
  2071. function returnTrue() {
  2072. return true;
  2073. }
  2074.  
  2075. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  2076. // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  2077. jQuery.Event.prototype = {
  2078. preventDefault: function() {
  2079. this.isDefaultPrevented = returnTrue;
  2080.  
  2081. var e = this.originalEvent;
  2082. if ( !e ) {
  2083. return;
  2084. }
  2085. // if preventDefault exists run it on the original event
  2086. if ( e.preventDefault ) {
  2087. e.preventDefault();
  2088. }
  2089. // otherwise set the returnValue property of the original event to false (IE)
  2090. e.returnValue = false;
  2091. },
  2092. stopPropagation: function() {
  2093. this.isPropagationStopped = returnTrue;
  2094.  
  2095. var e = this.originalEvent;
  2096. if ( !e ) {
  2097. return;
  2098. }
  2099. // if stopPropagation exists run it on the original event
  2100. if ( e.stopPropagation ) {
  2101. e.stopPropagation();
  2102. }
  2103. // otherwise set the cancelBubble property of the original event to true (IE)
  2104. e.cancelBubble = true;
  2105. },
  2106. stopImmediatePropagation: function() {
  2107. this.isImmediatePropagationStopped = returnTrue;
  2108. this.stopPropagation();
  2109. },
  2110. isDefaultPrevented: returnFalse,
  2111. isPropagationStopped: returnFalse,
  2112. isImmediatePropagationStopped: returnFalse
  2113. };
  2114.  
  2115. // Checks if an event happened on an element within another element
  2116. // Used in jQuery.event.special.mouseenter and mouseleave handlers
  2117. var withinElement = function( event ) {
  2118. // Check if mouse(over|out) are still within the same parent element
  2119. var parent = event.relatedTarget;
  2120.  
  2121. // Firefox sometimes assigns relatedTarget a XUL element
  2122. // which we cannot access the parentNode property of
  2123. try {
  2124. // Traverse up the tree
  2125. while ( parent && parent !== this ) {
  2126. parent = parent.parentNode;
  2127. }
  2128.  
  2129. if ( parent !== this ) {
  2130. // set the correct event type
  2131. event.type = event.data;
  2132.  
  2133. // handle event if we actually just moused on to a non sub-element
  2134. jQuery.event.handle.apply( this, arguments );
  2135. }
  2136.  
  2137. // assuming we've left the element since we most likely mousedover a xul element
  2138. } catch(e) { }
  2139. },
  2140.  
  2141. // In case of event delegation, we only need to rename the event.type,
  2142. // liveHandler will take care of the rest.
  2143. delegate = function( event ) {
  2144. event.type = event.data;
  2145. jQuery.event.handle.apply( this, arguments );
  2146. };
  2147.  
  2148. // Create mouseenter and mouseleave events
  2149. jQuery.each({
  2150. mouseenter: "mouseover",
  2151. mouseleave: "mouseout"
  2152. }, function( orig, fix ) {
  2153. jQuery.event.special[ orig ] = {
  2154. setup: function( data ) {
  2155. jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
  2156. },
  2157. teardown: function( data ) {
  2158. jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
  2159. }
  2160. };
  2161. });
  2162.  
  2163. // submit delegation
  2164. if ( !jQuery.support.submitBubbles ) {
  2165.  
  2166. jQuery.event.special.submit = {
  2167. setup: function( data, namespaces ) {
  2168. if ( this.nodeName.toLowerCase() !== "form" ) {
  2169. jQuery.event.add(this, "click.specialSubmit", function( e ) {
  2170. var elem = e.target, type = elem.type;
  2171.  
  2172. if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
  2173. return trigger( "submit", this, arguments );
  2174. }
  2175. });
  2176. jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
  2177. var elem = e.target, type = elem.type;
  2178.  
  2179. if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
  2180. return trigger( "submit", this, arguments );
  2181. }
  2182. });
  2183.  
  2184. } else {
  2185. return false;
  2186. }
  2187. },
  2188.  
  2189. teardown: function( namespaces ) {
  2190. jQuery.event.remove( this, ".specialSubmit" );
  2191. }
  2192. };
  2193.  
  2194. }
  2195.  
  2196. // change delegation, happens here so we have bind.
  2197. if ( !jQuery.support.changeBubbles ) {
  2198.  
  2199. var formElems = /textarea|input|select/i,
  2200.  
  2201. changeFilters,
  2202.  
  2203. getVal = function( elem ) {
  2204. var type = elem.type, val = elem.value;
  2205.  
  2206. if ( type === "radio" || type === "checkbox" ) {
  2207. val = elem.checked;
  2208.  
  2209. } else if ( type === "select-multiple" ) {
  2210. val = elem.selectedIndex > -1 ?
  2211. jQuery.map( elem.options, function( elem ) {
  2212. return elem.selected;
  2213. }).join("-") :
  2214. "";
  2215.  
  2216. } else if ( elem.nodeName.toLowerCase() === "select" ) {
  2217. val = elem.selectedIndex;
  2218. }
  2219.  
  2220. return val;
  2221. },
  2222.  
  2223. testChange = function testChange( e ) {
  2224. var elem = e.target, data, val;
  2225.  
  2226. if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
  2227. return;
  2228. }
  2229.  
  2230. data = jQuery.data( elem, "_change_data" );
  2231. val = getVal(elem);
  2232.  
  2233. // the current data will be also retrieved by beforeactivate
  2234. if ( e.type !== "focusout" || elem.type !== "radio" ) {
  2235. jQuery.data( elem, "_change_data", val );
  2236. }
  2237. if ( data === undefined || val === data ) {
  2238. return;
  2239. }
  2240.  
  2241. if ( data != null || val ) {
  2242. e.type = "change";
  2243. return jQuery.event.trigger( e, arguments[1], elem );
  2244. }
  2245. };
  2246.  
  2247. jQuery.event.special.change = {
  2248. filters: {
  2249. focusout: testChange,
  2250.  
  2251. click: function( e ) {
  2252. var elem = e.target, type = elem.type;
  2253.  
  2254. if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
  2255. return testChange.call( this, e );
  2256. }
  2257. },
  2258.  
  2259. // Change has to be called before submit
  2260. // Keydown will be called before keypress, which is used in submit-event delegation
  2261. keydown: function( e ) {
  2262. var elem = e.target, type = elem.type;
  2263.  
  2264. if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
  2265. (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
  2266. type === "select-multiple" ) {
  2267. return testChange.call( this, e );
  2268. }
  2269. },
  2270.  
  2271. // Beforeactivate happens also before the previous element is blurred
  2272. // with this event you can't trigger a change event, but you can store
  2273. // information/focus[in] is not needed anymore
  2274. beforeactivate: function( e ) {
  2275. var elem = e.target;
  2276. jQuery.data( elem, "_change_data", getVal(elem) );
  2277. }
  2278. },
  2279.  
  2280. setup: function( data, namespaces ) {
  2281. if ( this.type === "file" ) {
  2282. return false;
  2283. }
  2284.  
  2285. for ( var type in changeFilters ) {
  2286. jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
  2287. }
  2288.  
  2289. return formElems.test( this.nodeName );
  2290. },
  2291.  
  2292. teardown: function( namespaces ) {
  2293. jQuery.event.remove( this, ".specialChange" );
  2294.  
  2295. return formElems.test( this.nodeName );
  2296. }
  2297. };
  2298.  
  2299. changeFilters = jQuery.event.special.change.filters;
  2300. }
  2301.  
  2302. function trigger( type, elem, args ) {
  2303. args[0].type = type;
  2304. return jQuery.event.handle.apply( elem, args );
  2305. }
  2306.  
  2307. // Create "bubbling" focus and blur events
  2308. if ( document.addEventListener ) {
  2309. jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  2310. jQuery.event.special[ fix ] = {
  2311. setup: function() {
  2312. this.addEventListener( orig, handler, true );
  2313. },
  2314. teardown: function() {
  2315. this.removeEventListener( orig, handler, true );
  2316. }
  2317. };
  2318.  
  2319. function handler( e ) {
  2320. e = jQuery.event.fix( e );
  2321. e.type = fix;
  2322. return jQuery.event.handle.call( this, e );
  2323. }
  2324. });
  2325. }
  2326.  
  2327. jQuery.each(["bind", "one"], function( i, name ) {
  2328. jQuery.fn[ name ] = function( type, data, fn ) {
  2329. // Handle object literals
  2330. if ( typeof type === "object" ) {
  2331. for ( var key in type ) {
  2332. this[ name ](key, data, type[key], fn);
  2333. }
  2334. return this;
  2335. }
  2336. if ( jQuery.isFunction( data ) ) {
  2337. fn = data;
  2338. data = undefined;
  2339. }
  2340.  
  2341. var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
  2342. jQuery( this ).unbind( event, handler );
  2343. return fn.apply( this, arguments );
  2344. }) : fn;
  2345.  
  2346. if ( type === "unload" && name !== "one" ) {
  2347. this.one( type, data, fn );
  2348.  
  2349. } else {
  2350. for ( var i = 0, l = this.length; i < l; i++ ) {
  2351. jQuery.event.add( this[i], type, handler, data );
  2352. }
  2353. }
  2354.  
  2355. return this;
  2356. };
  2357. });
  2358.  
  2359. jQuery.fn.extend({
  2360. unbind: function( type, fn ) {
  2361. // Handle object literals
  2362. if ( typeof type === "object" && !type.preventDefault ) {
  2363. for ( var key in type ) {
  2364. this.unbind(key, type[key]);
  2365. }
  2366.  
  2367. } else {
  2368. for ( var i = 0, l = this.length; i < l; i++ ) {
  2369. jQuery.event.remove( this[i], type, fn );
  2370. }
  2371. }
  2372.  
  2373. return this;
  2374. },
  2375. delegate: function( selector, types, data, fn ) {
  2376. return this.live( types, data, fn, selector );
  2377. },
  2378. undelegate: function( selector, types, fn ) {
  2379. if ( arguments.length === 0 ) {
  2380. return this.unbind( "live" );
  2381. } else {
  2382. return this.die( types, null, fn, selector );
  2383. }
  2384. },
  2385. trigger: function( type, data ) {
  2386. return this.each(function() {
  2387. jQuery.event.trigger( type, data, this );
  2388. });
  2389. },
  2390.  
  2391. triggerHandler: function( type, data ) {
  2392. if ( this[0] ) {
  2393. var event = jQuery.Event( type );
  2394. event.preventDefault();
  2395. event.stopPropagation();
  2396. jQuery.event.trigger( event, data, this[0] );
  2397. return event.result;
  2398. }
  2399. },
  2400.  
  2401. toggle: function( fn ) {
  2402. // Save reference to arguments for access in closure
  2403. var args = arguments, i = 1;
  2404.  
  2405. // link all the functions, so any of them can unbind this click handler
  2406. while ( i < args.length ) {
  2407. jQuery.proxy( fn, args[ i++ ] );
  2408. }
  2409.  
  2410. return this.click( jQuery.proxy( fn, function( event ) {
  2411. // Figure out which function to execute
  2412. var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
  2413. jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
  2414.  
  2415. // Make sure that clicks stop
  2416. event.preventDefault();
  2417.  
  2418. // and execute the function
  2419. return args[ lastToggle ].apply( this, arguments ) || false;
  2420. }));
  2421. },
  2422.  
  2423. hover: function( fnOver, fnOut ) {
  2424. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  2425. }
  2426. });
  2427.  
  2428. var liveMap = {
  2429. focus: "focusin",
  2430. blur: "focusout",
  2431. mouseenter: "mouseover",
  2432. mouseleave: "mouseout"
  2433. };
  2434.  
  2435. jQuery.each(["live", "die"], function( i, name ) {
  2436. jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
  2437. var type, i = 0, match, namespaces, preType,
  2438. selector = origSelector || this.selector,
  2439. context = origSelector ? this : jQuery( this.context );
  2440.  
  2441. if ( jQuery.isFunction( data ) ) {
  2442. fn = data;
  2443. data = undefined;
  2444. }
  2445.  
  2446. types = (types || "").split(" ");
  2447.  
  2448. while ( (type = types[ i++ ]) != null ) {
  2449. match = rnamespaces.exec( type );
  2450. namespaces = "";
  2451.  
  2452. if ( match ) {
  2453. namespaces = match[0];
  2454. type = type.replace( rnamespaces, "" );
  2455. }
  2456.  
  2457. if ( type === "hover" ) {
  2458. types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
  2459. continue;
  2460. }
  2461.  
  2462. preType = type;
  2463.  
  2464. if ( type === "focus" || type === "blur" ) {
  2465. types.push( liveMap[ type ] + namespaces );
  2466. type = type + namespaces;
  2467.  
  2468. } else {
  2469. type = (liveMap[ type ] || type) + namespaces;
  2470. }
  2471.  
  2472. if ( name === "live" ) {
  2473. // bind live handler
  2474. context.each(function(){
  2475. jQuery.event.add( this, liveConvert( type, selector ),
  2476. { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
  2477. });
  2478.  
  2479. } else {
  2480. // unbind live handler
  2481. context.unbind( liveConvert( type, selector ), fn );
  2482. }
  2483. }
  2484. return this;
  2485. }
  2486. });
  2487.  
  2488. function liveHandler( event ) {
  2489. var stop, elems = [], selectors = [], args = arguments,
  2490. related, match, handleObj, elem, j, i, l, data,
  2491. events = jQuery.data( this, "events" );
  2492.  
  2493. // Make sure we avoid non-left-click bubbling in Firefox (#3861)
  2494. if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
  2495. return;
  2496. }
  2497.  
  2498. event.liveFired = this;
  2499.  
  2500. var live = events.live.slice(0);
  2501.  
  2502. for ( j = 0; j < live.length; j++ ) {
  2503. handleObj = live[j];
  2504.  
  2505. if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
  2506. selectors.push( handleObj.selector );
  2507.  
  2508. } else {
  2509. live.splice( j--, 1 );
  2510. }
  2511. }
  2512.  
  2513. match = jQuery( event.target ).closest( selectors, event.currentTarget );
  2514.  
  2515. for ( i = 0, l = match.length; i < l; i++ ) {
  2516. for ( j = 0; j < live.length; j++ ) {
  2517. handleObj = live[j];
  2518.  
  2519. if ( match[i].selector === handleObj.selector ) {
  2520. elem = match[i].elem;
  2521. related = null;
  2522.  
  2523. // Those two events require additional checking
  2524. if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
  2525. related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
  2526. }
  2527.  
  2528. if ( !related || related !== elem ) {
  2529. elems.push({ elem: elem, handleObj: handleObj });
  2530. }
  2531. }
  2532. }
  2533. }
  2534.  
  2535. for ( i = 0, l = elems.length; i < l; i++ ) {
  2536. match = elems[i];
  2537. event.currentTarget = match.elem;
  2538. event.data = match.handleObj.data;
  2539. event.handleObj = match.handleObj;
  2540.  
  2541. if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) {
  2542. stop = false;
  2543. break;
  2544. }
  2545. }
  2546.  
  2547. return stop;
  2548. }
  2549.  
  2550. function liveConvert( type, selector ) {
  2551. return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&");
  2552. }
  2553.  
  2554. jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
  2555. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  2556. "change select submit keydown keypress keyup error").split(" "), function( i, name ) {
  2557.  
  2558. // Handle event binding
  2559. jQuery.fn[ name ] = function( fn ) {
  2560. return fn ? this.bind( name, fn ) : this.trigger( name );
  2561. };
  2562.  
  2563. if ( jQuery.attrFn ) {
  2564. jQuery.attrFn[ name ] = true;
  2565. }
  2566. });
  2567.  
  2568. // Prevent memory leaks in IE
  2569. // Window isn't included so as not to unbind existing unload events
  2570. // More info:
  2571. // - http://isaacschlueter.com/2006/10/msie-memory-leaks/
  2572. if ( window.attachEvent && !window.addEventListener ) {
  2573. window.attachEvent("onunload", function() {
  2574. for ( var id in jQuery.cache ) {
  2575. if ( jQuery.cache[ id ].handle ) {
  2576. // Try/Catch is to handle iframes being unloaded, see #4280
  2577. try {
  2578. jQuery.event.remove( jQuery.cache[ id ].handle.elem );
  2579. } catch(e) {}
  2580. }
  2581. }
  2582. });
  2583. }
  2584. /*!
  2585. * Sizzle CSS Selector Engine - v1.0
  2586. * Copyright 2009, The Dojo Foundation
  2587. * Released under the MIT, BSD, and GPL Licenses.
  2588. * More information: http://sizzlejs.com/
  2589. */
  2590. (function(){
  2591.  
  2592. var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
  2593. done = 0,
  2594. toString = Object.prototype.toString,
  2595. hasDuplicate = false,
  2596. baseHasDuplicate = true;
  2597.  
  2598. // Here we check if the JavaScript engine is using some sort of
  2599. // optimization where it does not always call our comparision
  2600. // function. If that is the case, discard the hasDuplicate value.
  2601. // Thus far that includes Google Chrome.
  2602. [0, 0].sort(function(){
  2603. baseHasDuplicate = false;
  2604. return 0;
  2605. });
  2606.  
  2607. var Sizzle = function(selector, context, results, seed) {
  2608. results = results || [];
  2609. var origContext = context = context || document;
  2610.  
  2611. if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
  2612. return [];
  2613. }
  2614. if ( !selector || typeof selector !== "string" ) {
  2615. return results;
  2616. }
  2617.  
  2618. var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
  2619. soFar = selector;
  2620. // Reset the position of the chunker regexp (start from head)
  2621. while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
  2622. soFar = m[3];
  2623. parts.push( m[1] );
  2624. if ( m[2] ) {
  2625. extra = m[3];
  2626. break;
  2627. }
  2628. }
  2629.  
  2630. if ( parts.length > 1 && origPOS.exec( selector ) ) {
  2631. if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
  2632. set = posProcess( parts[0] + parts[1], context );
  2633. } else {
  2634. set = Expr.relative[ parts[0] ] ?
  2635. [ context ] :
  2636. Sizzle( parts.shift(), context );
  2637.  
  2638. while ( parts.length ) {
  2639. selector = parts.shift();
  2640.  
  2641. if ( Expr.relative[ selector ] ) {
  2642. selector += parts.shift();
  2643. }
  2644. set = posProcess( selector, set );
  2645. }
  2646. }
  2647. } else {
  2648. // Take a shortcut and set the context if the root selector is an ID
  2649. // (but not if it'll be faster if the inner selector is an ID)
  2650. if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
  2651. Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
  2652. var ret = Sizzle.find( parts.shift(), context, contextXML );
  2653. context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
  2654. }
  2655.  
  2656. if ( context ) {
  2657. var ret = seed ?
  2658. { expr: parts.pop(), set: makeArray(seed) } :
  2659. Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
  2660. set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
  2661.  
  2662. if ( parts.length > 0 ) {
  2663. checkSet = makeArray(set);
  2664. } else {
  2665. prune = false;
  2666. }
  2667.  
  2668. while ( parts.length ) {
  2669. var cur = parts.pop(), pop = cur;
  2670.  
  2671. if ( !Expr.relative[ cur ] ) {
  2672. cur = "";
  2673. } else {
  2674. pop = parts.pop();
  2675. }
  2676.  
  2677. if ( pop == null ) {
  2678. pop = context;
  2679. }
  2680.  
  2681. Expr.relative[ cur ]( checkSet, pop, contextXML );
  2682. }
  2683. } else {
  2684. checkSet = parts = [];
  2685. }
  2686. }
  2687.  
  2688. if ( !checkSet ) {
  2689. checkSet = set;
  2690. }
  2691.  
  2692. if ( !checkSet ) {
  2693. Sizzle.error( cur || selector );
  2694. }
  2695.  
  2696. if ( toString.call(checkSet) === "[object Array]" ) {
  2697. if ( !prune ) {
  2698. results.push.apply( results, checkSet );
  2699. } else if ( context && context.nodeType === 1 ) {
  2700. for ( var i = 0; checkSet[i] != null; i++ ) {
  2701. if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
  2702. results.push( set[i] );
  2703. }
  2704. }
  2705. } else {
  2706. for ( var i = 0; checkSet[i] != null; i++ ) {
  2707. if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
  2708. results.push( set[i] );
  2709. }
  2710. }
  2711. }
  2712. } else {
  2713. makeArray( checkSet, results );
  2714. }
  2715.  
  2716. if ( extra ) {
  2717. Sizzle( extra, origContext, results, seed );
  2718. Sizzle.uniqueSort( results );
  2719. }
  2720.  
  2721. return results;
  2722. };
  2723.  
  2724. Sizzle.uniqueSort = function(results){
  2725. if ( sortOrder ) {
  2726. hasDuplicate = baseHasDuplicate;
  2727. results.sort(sortOrder);
  2728.  
  2729. if ( hasDuplicate ) {
  2730. for ( var i = 1; i < results.length; i++ ) {
  2731. if ( results[i] === results[i-1] ) {
  2732. results.splice(i--, 1);
  2733. }
  2734. }
  2735. }
  2736. }
  2737.  
  2738. return results;
  2739. };
  2740.  
  2741. Sizzle.matches = function(expr, set){
  2742. return Sizzle(expr, null, null, set);
  2743. };
  2744.  
  2745. Sizzle.find = function(expr, context, isXML){
  2746. var set, match;
  2747.  
  2748. if ( !expr ) {
  2749. return [];
  2750. }
  2751.  
  2752. for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
  2753. var type = Expr.order[i], match;
  2754. if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
  2755. var left = match[1];
  2756. match.splice(1,1);
  2757.  
  2758. if ( left.substr( left.length - 1 ) !== "\\" ) {
  2759. match[1] = (match[1] || "").replace(/\\/g, "");
  2760. set = Expr.find[ type ]( match, context, isXML );
  2761. if ( set != null ) {
  2762. expr = expr.replace( Expr.match[ type ], "" );
  2763. break;
  2764. }
  2765. }
  2766. }
  2767. }
  2768.  
  2769. if ( !set ) {
  2770. set = context.getElementsByTagName("*");
  2771. }
  2772.  
  2773. return {set: set, expr: expr};
  2774. };
  2775.  
  2776. Sizzle.filter = function(expr, set, inplace, not){
  2777. var old = expr, result = [], curLoop = set, match, anyFound,
  2778. isXMLFilter = set && set[0] && isXML(set[0]);
  2779.  
  2780. while ( expr && set.length ) {
  2781. for ( var type in Expr.filter ) {
  2782. if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
  2783. var filter = Expr.filter[ type ], found, item, left = match[1];
  2784. anyFound = false;
  2785.  
  2786. match.splice(1,1);
  2787.  
  2788. if ( left.substr( left.length - 1 ) === "\\" ) {
  2789. continue;
  2790. }
  2791.  
  2792. if ( curLoop === result ) {
  2793. result = [];
  2794. }
  2795.  
  2796. if ( Expr.preFilter[ type ] ) {
  2797. match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
  2798.  
  2799. if ( !match ) {
  2800. anyFound = found = true;
  2801. } else if ( match === true ) {
  2802. continue;
  2803. }
  2804. }
  2805.  
  2806. if ( match ) {
  2807. for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
  2808. if ( item ) {
  2809. found = filter( item, match, i, curLoop );
  2810. var pass = not ^ !!found;
  2811.  
  2812. if ( inplace && found != null ) {
  2813. if ( pass ) {
  2814. anyFound = true;
  2815. } else {
  2816. curLoop[i] = false;
  2817. }
  2818. } else if ( pass ) {
  2819. result.push( item );
  2820. anyFound = true;
  2821. }
  2822. }
  2823. }
  2824. }
  2825.  
  2826. if ( found !== undefined ) {
  2827. if ( !inplace ) {
  2828. curLoop = result;
  2829. }
  2830.  
  2831. expr = expr.replace( Expr.match[ type ], "" );
  2832.  
  2833. if ( !anyFound ) {
  2834. return [];
  2835. }
  2836.  
  2837. break;
  2838. }
  2839. }
  2840. }
  2841.  
  2842. // Improper expression
  2843. if ( expr === old ) {
  2844. if ( anyFound == null ) {
  2845. Sizzle.error( expr );
  2846. } else {
  2847. break;
  2848. }
  2849. }
  2850.  
  2851. old = expr;
  2852. }
  2853.  
  2854. return curLoop;
  2855. };
  2856.  
  2857. Sizzle.error = function( msg ) {
  2858. throw "Syntax error, unrecognized expression: " + msg;
  2859. };
  2860.  
  2861. var Expr = Sizzle.selectors = {
  2862. order: [ "ID", "NAME", "TAG" ],
  2863. match: {
  2864. ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
  2865. CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
  2866. NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
  2867. ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
  2868. TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
  2869. CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
  2870. POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
  2871. PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
  2872. },
  2873. leftMatch: {},
  2874. attrMap: {
  2875. "class": "className",
  2876. "for": "htmlFor"
  2877. },
  2878. attrHandle: {
  2879. href: function(elem){
  2880. return elem.getAttribute("href");
  2881. }
  2882. },
  2883. relative: {
  2884. "+": function(checkSet, part){
  2885. var isPartStr = typeof part === "string",
  2886. isTag = isPartStr && !/\W/.test(part),
  2887. isPartStrNotTag = isPartStr && !isTag;
  2888.  
  2889. if ( isTag ) {
  2890. part = part.toLowerCase();
  2891. }
  2892.  
  2893. for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
  2894. if ( (elem = checkSet[i]) ) {
  2895. while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
  2896.  
  2897. checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
  2898. elem || false :
  2899. elem === part;
  2900. }
  2901. }
  2902.  
  2903. if ( isPartStrNotTag ) {
  2904. Sizzle.filter( part, checkSet, true );
  2905. }
  2906. },
  2907. ">": function(checkSet, part){
  2908. var isPartStr = typeof part === "string";
  2909.  
  2910. if ( isPartStr && !/\W/.test(part) ) {
  2911. part = part.toLowerCase();
  2912.  
  2913. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  2914. var elem = checkSet[i];
  2915. if ( elem ) {
  2916. var parent = elem.parentNode;
  2917. checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
  2918. }
  2919. }
  2920. } else {
  2921. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  2922. var elem = checkSet[i];
  2923. if ( elem ) {
  2924. checkSet[i] = isPartStr ?
  2925. elem.parentNode :
  2926. elem.parentNode === part;
  2927. }
  2928. }
  2929.  
  2930. if ( isPartStr ) {
  2931. Sizzle.filter( part, checkSet, true );
  2932. }
  2933. }
  2934. },
  2935. "": function(checkSet, part, isXML){
  2936. var doneName = done++, checkFn = dirCheck;
  2937.  
  2938. if ( typeof part === "string" && !/\W/.test(part) ) {
  2939. var nodeCheck = part = part.toLowerCase();
  2940. checkFn = dirNodeCheck;
  2941. }
  2942.  
  2943. checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
  2944. },
  2945. "~": function(checkSet, part, isXML){
  2946. var doneName = done++, checkFn = dirCheck;
  2947.  
  2948. if ( typeof part === "string" && !/\W/.test(part) ) {
  2949. var nodeCheck = part = part.toLowerCase();
  2950. checkFn = dirNodeCheck;
  2951. }
  2952.  
  2953. checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
  2954. }
  2955. },
  2956. find: {
  2957. ID: function(match, context, isXML){
  2958. if ( typeof context.getElementById !== "undefined" && !isXML ) {
  2959. var m = context.getElementById(match[1]);
  2960. return m ? [m] : [];
  2961. }
  2962. },
  2963. NAME: function(match, context){
  2964. if ( typeof context.getElementsByName !== "undefined" ) {
  2965. var ret = [], results = context.getElementsByName(match[1]);
  2966.  
  2967. for ( var i = 0, l = results.length; i < l; i++ ) {
  2968. if ( results[i].getAttribute("name") === match[1] ) {
  2969. ret.push( results[i] );
  2970. }
  2971. }
  2972.  
  2973. return ret.length === 0 ? null : ret;
  2974. }
  2975. },
  2976. TAG: function(match, context){
  2977. return context.getElementsByTagName(match[1]);
  2978. }
  2979. },
  2980. preFilter: {
  2981. CLASS: function(match, curLoop, inplace, result, not, isXML){
  2982. match = " " + match[1].replace(/\\/g, "") + " ";
  2983.  
  2984. if ( isXML ) {
  2985. return match;
  2986. }
  2987.  
  2988. for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
  2989. if ( elem ) {
  2990. if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
  2991. if ( !inplace ) {
  2992. result.push( elem );
  2993. }
  2994. } else if ( inplace ) {
  2995. curLoop[i] = false;
  2996. }
  2997. }
  2998. }
  2999.  
  3000. return false;
  3001. },
  3002. ID: function(match){
  3003. return match[1].replace(/\\/g, "");
  3004. },
  3005. TAG: function(match, curLoop){
  3006. return match[1].toLowerCase();
  3007. },
  3008. CHILD: function(match){
  3009. if ( match[1] === "nth" ) {
  3010. // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
  3011. var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
  3012. match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
  3013. !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
  3014.  
  3015. // calculate the numbers (first)n+(last) including if they are negative
  3016. match[2] = (test[1] + (test[2] || 1)) - 0;
  3017. match[3] = test[3] - 0;
  3018. }
  3019.  
  3020. // TODO: Move to normal caching system
  3021. match[0] = done++;
  3022.  
  3023. return match;
  3024. },
  3025. ATTR: function(match, curLoop, inplace, result, not, isXML){
  3026. var name = match[1].replace(/\\/g, "");
  3027. if ( !isXML && Expr.attrMap[name] ) {
  3028. match[1] = Expr.attrMap[name];
  3029. }
  3030.  
  3031. if ( match[2] === "~=" ) {
  3032. match[4] = " " + match[4] + " ";
  3033. }
  3034.  
  3035. return match;
  3036. },
  3037. PSEUDO: function(match, curLoop, inplace, result, not){
  3038. if ( match[1] === "not" ) {
  3039. // If we're dealing with a complex expression, or a simple one
  3040. if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
  3041. match[3] = Sizzle(match[3], null, null, curLoop);
  3042. } else {
  3043. var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
  3044. if ( !inplace ) {
  3045. result.push.apply( result, ret );
  3046. }
  3047. return false;
  3048. }
  3049. } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
  3050. return true;
  3051. }
  3052. return match;
  3053. },
  3054. POS: function(match){
  3055. match.unshift( true );
  3056. return match;
  3057. }
  3058. },
  3059. filters: {
  3060. enabled: function(elem){
  3061. return elem.disabled === false && elem.type !== "hidden";
  3062. },
  3063. disabled: function(elem){
  3064. return elem.disabled === true;
  3065. },
  3066. checked: function(elem){
  3067. return elem.checked === true;
  3068. },
  3069. selected: function(elem){
  3070. // Accessing this property makes selected-by-default
  3071. // options in Safari work properly
  3072. elem.parentNode.selectedIndex;
  3073. return elem.selected === true;
  3074. },
  3075. parent: function(elem){
  3076. return !!elem.firstChild;
  3077. },
  3078. empty: function(elem){
  3079. return !elem.firstChild;
  3080. },
  3081. has: function(elem, i, match){
  3082. return !!Sizzle( match[3], elem ).length;
  3083. },
  3084. header: function(elem){
  3085. return /h\d/i.test( elem.nodeName );
  3086. },
  3087. text: function(elem){
  3088. return "text" === elem.type;
  3089. },
  3090. radio: function(elem){
  3091. return "radio" === elem.type;
  3092. },
  3093. checkbox: function(elem){
  3094. return "checkbox" === elem.type;
  3095. },
  3096. file: function(elem){
  3097. return "file" === elem.type;
  3098. },
  3099. password: function(elem){
  3100. return "password" === elem.type;
  3101. },
  3102. submit: function(elem){
  3103. return "submit" === elem.type;
  3104. },
  3105. image: function(elem){
  3106. return "image" === elem.type;
  3107. },
  3108. reset: function(elem){
  3109. return "reset" === elem.type;
  3110. },
  3111. button: function(elem){
  3112. return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
  3113. },
  3114. input: function(elem){
  3115. return /input|select|textarea|button/i.test(elem.nodeName);
  3116. }
  3117. },
  3118. setFilters: {
  3119. first: function(elem, i){
  3120. return i === 0;
  3121. },
  3122. last: function(elem, i, match, array){
  3123. return i === array.length - 1;
  3124. },
  3125. even: function(elem, i){
  3126. return i % 2 === 0;
  3127. },
  3128. odd: function(elem, i){
  3129. return i % 2 === 1;
  3130. },
  3131. lt: function(elem, i, match){
  3132. return i < match[3] - 0;
  3133. },
  3134. gt: function(elem, i, match){
  3135. return i > match[3] - 0;
  3136. },
  3137. nth: function(elem, i, match){
  3138. return match[3] - 0 === i;
  3139. },
  3140. eq: function(elem, i, match){
  3141. return match[3] - 0 === i;
  3142. }
  3143. },
  3144. filter: {
  3145. PSEUDO: function(elem, match, i, array){
  3146. var name = match[1], filter = Expr.filters[ name ];
  3147.  
  3148. if ( filter ) {
  3149. return filter( elem, i, match, array );
  3150. } else if ( name === "contains" ) {
  3151. return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
  3152. } else if ( name === "not" ) {
  3153. var not = match[3];
  3154.  
  3155. for ( var i = 0, l = not.length; i < l; i++ ) {
  3156. if ( not[i] === elem ) {
  3157. return false;
  3158. }
  3159. }
  3160.  
  3161. return true;
  3162. } else {
  3163. Sizzle.error( "Syntax error, unrecognized expression: " + name );
  3164. }
  3165. },
  3166. CHILD: function(elem, match){
  3167. var type = match[1], node = elem;
  3168. switch (type) {
  3169. case 'only':
  3170. case 'first':
  3171. while ( (node = node.previousSibling) ) {
  3172. if ( node.nodeType === 1 ) {
  3173. return false;
  3174. }
  3175. }
  3176. if ( type === "first" ) {
  3177. return true;
  3178. }
  3179. node = elem;
  3180. case 'last':
  3181. while ( (node = node.nextSibling) ) {
  3182. if ( node.nodeType === 1 ) {
  3183. return false;
  3184. }
  3185. }
  3186. return true;
  3187. case 'nth':
  3188. var first = match[2], last = match[3];
  3189.  
  3190. if ( first === 1 && last === 0 ) {
  3191. return true;
  3192. }
  3193. var doneName = match[0],
  3194. parent = elem.parentNode;
  3195. if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
  3196. var count = 0;
  3197. for ( node = parent.firstChild; node; node = node.nextSibling ) {
  3198. if ( node.nodeType === 1 ) {
  3199. node.nodeIndex = ++count;
  3200. }
  3201. }
  3202. parent.sizcache = doneName;
  3203. }
  3204. var diff = elem.nodeIndex - last;
  3205. if ( first === 0 ) {
  3206. return diff === 0;
  3207. } else {
  3208. return ( diff % first === 0 && diff / first >= 0 );
  3209. }
  3210. }
  3211. },
  3212. ID: function(elem, match){
  3213. return elem.nodeType === 1 && elem.getAttribute("id") === match;
  3214. },
  3215. TAG: function(elem, match){
  3216. return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
  3217. },
  3218. CLASS: function(elem, match){
  3219. return (" " + (elem.className || elem.getAttribute("class")) + " ")
  3220. .indexOf( match ) > -1;
  3221. },
  3222. ATTR: function(elem, match){
  3223. var name = match[1],
  3224. result = Expr.attrHandle[ name ] ?
  3225. Expr.attrHandle[ name ]( elem ) :
  3226. elem[ name ] != null ?
  3227. elem[ name ] :
  3228. elem.getAttribute( name ),
  3229. value = result + "",
  3230. type = match[2],
  3231. check = match[4];
  3232.  
  3233. return result == null ?
  3234. type === "!=" :
  3235. type === "=" ?
  3236. value === check :
  3237. type === "*=" ?
  3238. value.indexOf(check) >= 0 :
  3239. type === "~=" ?
  3240. (" " + value + " ").indexOf(check) >= 0 :
  3241. !check ?
  3242. value && result !== false :
  3243. type === "!=" ?
  3244. value !== check :
  3245. type === "^=" ?
  3246. value.indexOf(check) === 0 :
  3247. type === "$=" ?
  3248. value.substr(value.length - check.length) === check :
  3249. type === "|=" ?
  3250. value === check || value.substr(0, check.length + 1) === check + "-" :
  3251. false;
  3252. },
  3253. POS: function(elem, match, i, array){
  3254. var name = match[2], filter = Expr.setFilters[ name ];
  3255.  
  3256. if ( filter ) {
  3257. return filter( elem, i, match, array );
  3258. }
  3259. }
  3260. }
  3261. };
  3262.  
  3263. var origPOS = Expr.match.POS;
  3264.  
  3265. for ( var type in Expr.match ) {
  3266. Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
  3267. Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
  3268. return "\\" + (num - 0 + 1);
  3269. }));
  3270. }
  3271.  
  3272. var makeArray = function(array, results) {
  3273. array = Array.prototype.slice.call( array, 0 );
  3274.  
  3275. if ( results ) {
  3276. results.push.apply( results, array );
  3277. return results;
  3278. }
  3279. return array;
  3280. };
  3281.  
  3282. // Perform a simple check to determine if the browser is capable of
  3283. // converting a NodeList to an array using builtin methods.
  3284. // Also verifies that the returned array holds DOM nodes
  3285. // (which is not the case in the Blackberry browser)
  3286. try {
  3287. Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
  3288.  
  3289. // Provide a fallback method if it does not work
  3290. } catch(e){
  3291. makeArray = function(array, results) {
  3292. var ret = results || [];
  3293.  
  3294. if ( toString.call(array) === "[object Array]" ) {
  3295. Array.prototype.push.apply( ret, array );
  3296. } else {
  3297. if ( typeof array.length === "number" ) {
  3298. for ( var i = 0, l = array.length; i < l; i++ ) {
  3299. ret.push( array[i] );
  3300. }
  3301. } else {
  3302. for ( var i = 0; array[i]; i++ ) {
  3303. ret.push( array[i] );
  3304. }
  3305. }
  3306. }
  3307.  
  3308. return ret;
  3309. };
  3310. }
  3311.  
  3312. var sortOrder;
  3313.  
  3314. if ( document.documentElement.compareDocumentPosition ) {
  3315. sortOrder = function( a, b ) {
  3316. if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
  3317. if ( a == b ) {
  3318. hasDuplicate = true;
  3319. }
  3320. return a.compareDocumentPosition ? -1 : 1;
  3321. }
  3322.  
  3323. var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
  3324. if ( ret === 0 ) {
  3325. hasDuplicate = true;
  3326. }
  3327. return ret;
  3328. };
  3329. } else if ( "sourceIndex" in document.documentElement ) {
  3330. sortOrder = function( a, b ) {
  3331. if ( !a.sourceIndex || !b.sourceIndex ) {
  3332. if ( a == b ) {
  3333. hasDuplicate = true;
  3334. }
  3335. return a.sourceIndex ? -1 : 1;
  3336. }
  3337.  
  3338. var ret = a.sourceIndex - b.sourceIndex;
  3339. if ( ret === 0 ) {
  3340. hasDuplicate = true;
  3341. }
  3342. return ret;
  3343. };
  3344. } else if ( document.createRange ) {
  3345. sortOrder = function( a, b ) {
  3346. if ( !a.ownerDocument || !b.ownerDocument ) {
  3347. if ( a == b ) {
  3348. hasDuplicate = true;
  3349. }
  3350. return a.ownerDocument ? -1 : 1;
  3351. }
  3352.  
  3353. var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
  3354. aRange.setStart(a, 0);
  3355. aRange.setEnd(a, 0);
  3356. bRange.setStart(b, 0);
  3357. bRange.setEnd(b, 0);
  3358. var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
  3359. if ( ret === 0 ) {
  3360. hasDuplicate = true;
  3361. }
  3362. return ret;
  3363. };
  3364. }
  3365.  
  3366. // Utility function for retreiving the text value of an array of DOM nodes
  3367. function getText( elems ) {
  3368. var ret = "", elem;
  3369.  
  3370. for ( var i = 0; elems[i]; i++ ) {
  3371. elem = elems[i];
  3372.  
  3373. // Get the text from text nodes and CDATA nodes
  3374. if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
  3375. ret += elem.nodeValue;
  3376.  
  3377. // Traverse everything else, except comment nodes
  3378. } else if ( elem.nodeType !== 8 ) {
  3379. ret += getText( elem.childNodes );
  3380. }
  3381. }
  3382.  
  3383. return ret;
  3384. }
  3385.  
  3386. // Check to see if the browser returns elements by name when
  3387. // querying by getElementById (and provide a workaround)
  3388. (function(){
  3389. // We're going to inject a fake input element with a specified name
  3390. var form = document.createElement("div"),
  3391. id = "script" + (new Date).getTime();
  3392. form.innerHTML = "<a name='" + id + "'/>";
  3393.  
  3394. // Inject it into the root element, check its status, and remove it quickly
  3395. var root = document.documentElement;
  3396. root.insertBefore( form, root.firstChild );
  3397.  
  3398. // The workaround has to do additional checks after a getElementById
  3399. // Which slows things down for other browsers (hence the branching)
  3400. if ( document.getElementById( id ) ) {
  3401. Expr.find.ID = function(match, context, isXML){
  3402. if ( typeof context.getElementById !== "undefined" && !isXML ) {
  3403. var m = context.getElementById(match[1]);
  3404. return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
  3405. }
  3406. };
  3407.  
  3408. Expr.filter.ID = function(elem, match){
  3409. var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
  3410. return elem.nodeType === 1 && node && node.nodeValue === match;
  3411. };
  3412. }
  3413.  
  3414. root.removeChild( form );
  3415. root = form = null; // release memory in IE
  3416. })();
  3417.  
  3418. (function(){
  3419. // Check to see if the browser returns only elements
  3420. // when doing getElementsByTagName("*")
  3421.  
  3422. // Create a fake element
  3423. var div = document.createElement("div");
  3424. div.appendChild( document.createComment("") );
  3425.  
  3426. // Make sure no comments are found
  3427. if ( div.getElementsByTagName("*").length > 0 ) {
  3428. Expr.find.TAG = function(match, context){
  3429. var results = context.getElementsByTagName(match[1]);
  3430.  
  3431. // Filter out possible comments
  3432. if ( match[1] === "*" ) {
  3433. var tmp = [];
  3434.  
  3435. for ( var i = 0; results[i]; i++ ) {
  3436. if ( results[i].nodeType === 1 ) {
  3437. tmp.push( results[i] );
  3438. }
  3439. }
  3440.  
  3441. results = tmp;
  3442. }
  3443.  
  3444. return results;
  3445. };
  3446. }
  3447.  
  3448. // Check to see if an attribute returns normalized href attributes
  3449. div.innerHTML = "<a href='#'></a>";
  3450. if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
  3451. div.firstChild.getAttribute("href") !== "#" ) {
  3452. Expr.attrHandle.href = function(elem){
  3453. return elem.getAttribute("href", 2);
  3454. };
  3455. }
  3456.  
  3457. div = null; // release memory in IE
  3458. })();
  3459.  
  3460. if ( document.querySelectorAll ) {
  3461. (function(){
  3462. var oldSizzle = Sizzle, div = document.createElement("div");
  3463. div.innerHTML = "<p class='TEST'></p>";
  3464.  
  3465. // Safari can't handle uppercase or unicode characters when
  3466. // in quirks mode.
  3467. if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
  3468. return;
  3469. }
  3470. Sizzle = function(query, context, extra, seed){
  3471. context = context || document;
  3472.  
  3473. // Only use querySelectorAll on non-XML documents
  3474. // (ID selectors don't work in non-HTML documents)
  3475. if ( !seed && context.nodeType === 9 && !isXML(context) ) {
  3476. try {
  3477. return makeArray( context.querySelectorAll(query), extra );
  3478. } catch(e){}
  3479. }
  3480. return oldSizzle(query, context, extra, seed);
  3481. };
  3482.  
  3483. for ( var prop in oldSizzle ) {
  3484. Sizzle[ prop ] = oldSizzle[ prop ];
  3485. }
  3486.  
  3487. div = null; // release memory in IE
  3488. })();
  3489. }
  3490.  
  3491. (function(){
  3492. var div = document.createElement("div");
  3493.  
  3494. div.innerHTML = "<div class='test e'></div><div class='test'></div>";
  3495.  
  3496. // Opera can't find a second classname (in 9.6)
  3497. // Also, make sure that getElementsByClassName actually exists
  3498. if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
  3499. return;
  3500. }
  3501.  
  3502. // Safari caches class attributes, doesn't catch changes (in 3.2)
  3503. div.lastChild.className = "e";
  3504.  
  3505. if ( div.getElementsByClassName("e").length === 1 ) {
  3506. return;
  3507. }
  3508. Expr.order.splice(1, 0, "CLASS");
  3509. Expr.find.CLASS = function(match, context, isXML) {
  3510. if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
  3511. return context.getElementsByClassName(match[1]);
  3512. }
  3513. };
  3514.  
  3515. div = null; // release memory in IE
  3516. })();
  3517.  
  3518. function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
  3519. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  3520. var elem = checkSet[i];
  3521. if ( elem ) {
  3522. elem = elem[dir];
  3523. var match = false;
  3524.  
  3525. while ( elem ) {
  3526. if ( elem.sizcache === doneName ) {
  3527. match = checkSet[elem.sizset];
  3528. break;
  3529. }
  3530.  
  3531. if ( elem.nodeType === 1 && !isXML ){
  3532. elem.sizcache = doneName;
  3533. elem.sizset = i;
  3534. }
  3535.  
  3536. if ( elem.nodeName.toLowerCase() === cur ) {
  3537. match = elem;
  3538. break;
  3539. }
  3540.  
  3541. elem = elem[dir];
  3542. }
  3543.  
  3544. checkSet[i] = match;
  3545. }
  3546. }
  3547. }
  3548.  
  3549. function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
  3550. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  3551. var elem = checkSet[i];
  3552. if ( elem ) {
  3553. elem = elem[dir];
  3554. var match = false;
  3555.  
  3556. while ( elem ) {
  3557. if ( elem.sizcache === doneName ) {
  3558. match = checkSet[elem.sizset];
  3559. break;
  3560. }
  3561.  
  3562. if ( elem.nodeType === 1 ) {
  3563. if ( !isXML ) {
  3564. elem.sizcache = doneName;
  3565. elem.sizset = i;
  3566. }
  3567. if ( typeof cur !== "string" ) {
  3568. if ( elem === cur ) {
  3569. match = true;
  3570. break;
  3571. }
  3572.  
  3573. } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
  3574. match = elem;
  3575. break;
  3576. }
  3577. }
  3578.  
  3579. elem = elem[dir];
  3580. }
  3581.  
  3582. checkSet[i] = match;
  3583. }
  3584. }
  3585. }
  3586.  
  3587. var contains = document.compareDocumentPosition ? function(a, b){
  3588. return !!(a.compareDocumentPosition(b) & 16);
  3589. } : function(a, b){
  3590. return a !== b && (a.contains ? a.contains(b) : true);
  3591. };
  3592.  
  3593. var isXML = function(elem){
  3594. // documentElement is verified for cases where it doesn't yet exist
  3595. // (such as loading iframes in IE - #4833)
  3596. var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
  3597. return documentElement ? documentElement.nodeName !== "HTML" : false;
  3598. };
  3599.  
  3600. var posProcess = function(selector, context){
  3601. var tmpSet = [], later = "", match,
  3602. root = context.nodeType ? [context] : context;
  3603.  
  3604. // Position selectors must be done after the filter
  3605. // And so must :not(positional) so we move all PSEUDOs to the end
  3606. while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
  3607. later += match[0];
  3608. selector = selector.replace( Expr.match.PSEUDO, "" );
  3609. }
  3610.  
  3611. selector = Expr.relative[selector] ? selector + "*" : selector;
  3612.  
  3613. for ( var i = 0, l = root.length; i < l; i++ ) {
  3614. Sizzle( selector, root[i], tmpSet );
  3615. }
  3616.  
  3617. return Sizzle.filter( later, tmpSet );
  3618. };
  3619.  
  3620. // EXPOSE
  3621. jQuery.find = Sizzle;
  3622. jQuery.expr = Sizzle.selectors;
  3623. jQuery.expr[":"] = jQuery.expr.filters;
  3624. jQuery.unique = Sizzle.uniqueSort;
  3625. jQuery.text = getText;
  3626. jQuery.isXMLDoc = isXML;
  3627. jQuery.contains = contains;
  3628.  
  3629. return;
  3630.  
  3631. window.Sizzle = Sizzle;
  3632.  
  3633. })();
  3634. var runtil = /Until$/,
  3635. rparentsprev = /^(?:parents|prevUntil|prevAll)/,
  3636. // Note: This RegExp should be improved, or likely pulled from Sizzle
  3637. rmultiselector = /,/,
  3638. slice = Array.prototype.slice;
  3639.  
  3640. // Implement the identical functionality for filter and not
  3641. var winnow = function( elements, qualifier, keep ) {
  3642. if ( jQuery.isFunction( qualifier ) ) {
  3643. return jQuery.grep(elements, function( elem, i ) {
  3644. return !!qualifier.call( elem, i, elem ) === keep;
  3645. });
  3646.  
  3647. } else if ( qualifier.nodeType ) {
  3648. return jQuery.grep(elements, function( elem, i ) {
  3649. return (elem === qualifier) === keep;
  3650. });
  3651.  
  3652. } else if ( typeof qualifier === "string" ) {
  3653. var filtered = jQuery.grep(elements, function( elem ) {
  3654. return elem.nodeType === 1;
  3655. });
  3656.  
  3657. if ( isSimple.test( qualifier ) ) {
  3658. return jQuery.filter(qualifier, filtered, !keep);
  3659. } else {
  3660. qualifier = jQuery.filter( qualifier, filtered );
  3661. }
  3662. }
  3663.  
  3664. return jQuery.grep(elements, function( elem, i ) {
  3665. return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
  3666. });
  3667. };
  3668.  
  3669. jQuery.fn.extend({
  3670. find: function( selector ) {
  3671. var ret = this.pushStack( "", "find", selector ), length = 0;
  3672.  
  3673. for ( var i = 0, l = this.length; i < l; i++ ) {
  3674. length = ret.length;
  3675. jQuery.find( selector, this[i], ret );
  3676.  
  3677. if ( i > 0 ) {
  3678. // Make sure that the results are unique
  3679. for ( var n = length; n < ret.length; n++ ) {
  3680. for ( var r = 0; r < length; r++ ) {
  3681. if ( ret[r] === ret[n] ) {
  3682. ret.splice(n--, 1);
  3683. break;
  3684. }
  3685. }
  3686. }
  3687. }
  3688. }
  3689.  
  3690. return ret;
  3691. },
  3692.  
  3693. has: function( target ) {
  3694. var targets = jQuery( target );
  3695. return this.filter(function() {
  3696. for ( var i = 0, l = targets.length; i < l; i++ ) {
  3697. if ( jQuery.contains( this, targets[i] ) ) {
  3698. return true;
  3699. }
  3700. }
  3701. });
  3702. },
  3703.  
  3704. not: function( selector ) {
  3705. return this.pushStack( winnow(this, selector, false), "not", selector);
  3706. },
  3707.  
  3708. filter: function( selector ) {
  3709. return this.pushStack( winnow(this, selector, true), "filter", selector );
  3710. },
  3711. is: function( selector ) {
  3712. return !!selector && jQuery.filter( selector, this ).length > 0;
  3713. },
  3714.  
  3715. closest: function( selectors, context ) {
  3716. if ( jQuery.isArray( selectors ) ) {
  3717. var ret = [], cur = this[0], match, matches = {}, selector;
  3718.  
  3719. if ( cur && selectors.length ) {
  3720. for ( var i = 0, l = selectors.length; i < l; i++ ) {
  3721. selector = selectors[i];
  3722.  
  3723. if ( !matches[selector] ) {
  3724. matches[selector] = jQuery.expr.match.POS.test( selector ) ?
  3725. jQuery( selector, context || this.context ) :
  3726. selector;
  3727. }
  3728. }
  3729.  
  3730. while ( cur && cur.ownerDocument && cur !== context ) {
  3731. for ( selector in matches ) {
  3732. match = matches[selector];
  3733.  
  3734. if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
  3735. ret.push({ selector: selector, elem: cur });
  3736. delete matches[selector];
  3737. }
  3738. }
  3739. cur = cur.parentNode;
  3740. }
  3741. }
  3742.  
  3743. return ret;
  3744. }
  3745.  
  3746. var pos = jQuery.expr.match.POS.test( selectors ) ?
  3747. jQuery( selectors, context || this.context ) : null;
  3748.  
  3749. return this.map(function( i, cur ) {
  3750. while ( cur && cur.ownerDocument && cur !== context ) {
  3751. if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
  3752. return cur;
  3753. }
  3754. cur = cur.parentNode;
  3755. }
  3756. return null;
  3757. });
  3758. },
  3759. // Determine the position of an element within
  3760. // the matched set of elements
  3761. index: function( elem ) {
  3762. if ( !elem || typeof elem === "string" ) {
  3763. return jQuery.inArray( this[0],
  3764. // If it receives a string, the selector is used
  3765. // If it receives nothing, the siblings are used
  3766. elem ? jQuery( elem ) : this.parent().children() );
  3767. }
  3768. // Locate the position of the desired element
  3769. return jQuery.inArray(
  3770. // If it receives a jQuery object, the first element is used
  3771. elem.jquery ? elem[0] : elem, this );
  3772. },
  3773.  
  3774. add: function( selector, context ) {
  3775. var set = typeof selector === "string" ?
  3776. jQuery( selector, context || this.context ) :
  3777. jQuery.makeArray( selector ),
  3778. all = jQuery.merge( this.get(), set );
  3779.  
  3780. return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
  3781. all :
  3782. jQuery.unique( all ) );
  3783. },
  3784.  
  3785. andSelf: function() {
  3786. return this.add( this.prevObject );
  3787. }
  3788. });
  3789.  
  3790. // A painfully simple check to see if an element is disconnected
  3791. // from a document (should be improved, where feasible).
  3792. function isDisconnected( node ) {
  3793. return !node || !node.parentNode || node.parentNode.nodeType === 11;
  3794. }
  3795.  
  3796. jQuery.each({
  3797. parent: function( elem ) {
  3798. var parent = elem.parentNode;
  3799. return parent && parent.nodeType !== 11 ? parent : null;
  3800. },
  3801. parents: function( elem ) {
  3802. return jQuery.dir( elem, "parentNode" );
  3803. },
  3804. parentsUntil: function( elem, i, until ) {
  3805. return jQuery.dir( elem, "parentNode", until );
  3806. },
  3807. next: function( elem ) {
  3808. return jQuery.nth( elem, 2, "nextSibling" );
  3809. },
  3810. prev: function( elem ) {
  3811. return jQuery.nth( elem, 2, "previousSibling" );
  3812. },
  3813. nextAll: function( elem ) {
  3814. return jQuery.dir( elem, "nextSibling" );
  3815. },
  3816. prevAll: function( elem ) {
  3817. return jQuery.dir( elem, "previousSibling" );
  3818. },
  3819. nextUntil: function( elem, i, until ) {
  3820. return jQuery.dir( elem, "nextSibling", until );
  3821. },
  3822. prevUntil: function( elem, i, until ) {
  3823. return jQuery.dir( elem, "previousSibling", until );
  3824. },
  3825. siblings: function( elem ) {
  3826. return jQuery.sibling( elem.parentNode.firstChild, elem );
  3827. },
  3828. children: function( elem ) {
  3829. return jQuery.sibling( elem.firstChild );
  3830. },
  3831. contents: function( elem ) {
  3832. return jQuery.nodeName( elem, "iframe" ) ?
  3833. elem.contentDocument || elem.contentWindow.document :
  3834. jQuery.makeArray( elem.childNodes );
  3835. }
  3836. }, function( name, fn ) {
  3837. jQuery.fn[ name ] = function( until, selector ) {
  3838. var ret = jQuery.map( this, fn, until );
  3839. if ( !runtil.test( name ) ) {
  3840. selector = until;
  3841. }
  3842.  
  3843. if ( selector && typeof selector === "string" ) {
  3844. ret = jQuery.filter( selector, ret );
  3845. }
  3846.  
  3847. ret = this.length > 1 ? jQuery.unique( ret ) : ret;
  3848.  
  3849. if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
  3850. ret = ret.reverse();
  3851. }
  3852.  
  3853. return this.pushStack( ret, name, slice.call(arguments).join(",") );
  3854. };
  3855. });
  3856.  
  3857. jQuery.extend({
  3858. filter: function( expr, elems, not ) {
  3859. if ( not ) {
  3860. expr = ":not(" + expr + ")";
  3861. }
  3862.  
  3863. return jQuery.find.matches(expr, elems);
  3864. },
  3865. dir: function( elem, dir, until ) {
  3866. var matched = [], cur = elem[dir];
  3867. while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
  3868. if ( cur.nodeType === 1 ) {
  3869. matched.push( cur );
  3870. }
  3871. cur = cur[dir];
  3872. }
  3873. return matched;
  3874. },
  3875.  
  3876. nth: function( cur, result, dir, elem ) {
  3877. result = result || 1;
  3878. var num = 0;
  3879.  
  3880. for ( ; cur; cur = cur[dir] ) {
  3881. if ( cur.nodeType === 1 && ++num === result ) {
  3882. break;
  3883. }
  3884. }
  3885.  
  3886. return cur;
  3887. },
  3888.  
  3889. sibling: function( n, elem ) {
  3890. var r = [];
  3891.  
  3892. for ( ; n; n = n.nextSibling ) {
  3893. if ( n.nodeType === 1 && n !== elem ) {
  3894. r.push( n );
  3895. }
  3896. }
  3897.  
  3898. return r;
  3899. }
  3900. });
  3901. var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
  3902. rleadingWhitespace = /^\s+/,
  3903. rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
  3904. rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
  3905. rtagName = /<([\w:]+)/,
  3906. rtbody = /<tbody/i,
  3907. rhtml = /<|&#?\w+;/,
  3908. rnocache = /<script|<object|<embed|<option|<style/i,
  3909. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, // checked="checked" or checked (html5)
  3910. fcloseTag = function( all, front, tag ) {
  3911. return rselfClosing.test( tag ) ?
  3912. all :
  3913. front + "></" + tag + ">";
  3914. },
  3915. wrapMap = {
  3916. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  3917. legend: [ 1, "<fieldset>", "</fieldset>" ],
  3918. thead: [ 1, "<table>", "</table>" ],
  3919. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  3920. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  3921. col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
  3922. area: [ 1, "<map>", "</map>" ],
  3923. _default: [ 0, "", "" ]
  3924. };
  3925.  
  3926. wrapMap.optgroup = wrapMap.option;
  3927. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  3928. wrapMap.th = wrapMap.td;
  3929.  
  3930. // IE can't serialize <link> and <script> tags normally
  3931. if ( !jQuery.support.htmlSerialize ) {
  3932. wrapMap._default = [ 1, "div<div>", "</div>" ];
  3933. }
  3934.  
  3935. jQuery.fn.extend({
  3936. text: function( text ) {
  3937. if ( jQuery.isFunction(text) ) {
  3938. return this.each(function(i) {
  3939. var self = jQuery(this);
  3940. self.text( text.call(this, i, self.text()) );
  3941. });
  3942. }
  3943.  
  3944. if ( typeof text !== "object" && text !== undefined ) {
  3945. return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
  3946. }
  3947.  
  3948. return jQuery.text( this );
  3949. },
  3950.  
  3951. wrapAll: function( html ) {
  3952. if ( jQuery.isFunction( html ) ) {
  3953. return this.each(function(i) {
  3954. jQuery(this).wrapAll( html.call(this, i) );
  3955. });
  3956. }
  3957.  
  3958. if ( this[0] ) {
  3959. // The elements to wrap the target around
  3960. var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
  3961.  
  3962. if ( this[0].parentNode ) {
  3963. wrap.insertBefore( this[0] );
  3964. }
  3965.  
  3966. wrap.map(function() {
  3967. var elem = this;
  3968.  
  3969. while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
  3970. elem = elem.firstChild;
  3971. }
  3972.  
  3973. return elem;
  3974. }).append(this);
  3975. }
  3976.  
  3977. return this;
  3978. },
  3979.  
  3980. wrapInner: function( html ) {
  3981. if ( jQuery.isFunction( html ) ) {
  3982. return this.each(function(i) {
  3983. jQuery(this).wrapInner( html.call(this, i) );
  3984. });
  3985. }
  3986.  
  3987. return this.each(function() {
  3988. var self = jQuery( this ), contents = self.contents();
  3989.  
  3990. if ( contents.length ) {
  3991. contents.wrapAll( html );
  3992.  
  3993. } else {
  3994. self.append( html );
  3995. }
  3996. });
  3997. },
  3998.  
  3999. wrap: function( html ) {
  4000. return this.each(function() {
  4001. jQuery( this ).wrapAll( html );
  4002. });
  4003. },
  4004.  
  4005. unwrap: function() {
  4006. return this.parent().each(function() {
  4007. if ( !jQuery.nodeName( this, "body" ) ) {
  4008. jQuery( this ).replaceWith( this.childNodes );
  4009. }
  4010. }).end();
  4011. },
  4012.  
  4013. append: function() {
  4014. return this.domManip(arguments, true, function( elem ) {
  4015. if ( this.nodeType === 1 ) {
  4016. this.appendChild( elem );
  4017. }
  4018. });
  4019. },
  4020.  
  4021. prepend: function() {
  4022. return this.domManip(arguments, true, function( elem ) {
  4023. if ( this.nodeType === 1 ) {
  4024. this.insertBefore( elem, this.firstChild );
  4025. }
  4026. });
  4027. },
  4028.  
  4029. before: function() {
  4030. if ( this[0] && this[0].parentNode ) {
  4031. return this.domManip(arguments, false, function( elem ) {
  4032. this.parentNode.insertBefore( elem, this );
  4033. });
  4034. } else if ( arguments.length ) {
  4035. var set = jQuery(arguments[0]);
  4036. set.push.apply( set, this.toArray() );
  4037. return this.pushStack( set, "before", arguments );
  4038. }
  4039. },
  4040.  
  4041. after: function() {
  4042. if ( this[0] && this[0].parentNode ) {
  4043. return this.domManip(arguments, false, function( elem ) {
  4044. this.parentNode.insertBefore( elem, this.nextSibling );
  4045. });
  4046. } else if ( arguments.length ) {
  4047. var set = this.pushStack( this, "after", arguments );
  4048. set.push.apply( set, jQuery(arguments[0]).toArray() );
  4049. return set;
  4050. }
  4051. },
  4052. // keepData is for internal use only--do not document
  4053. remove: function( selector, keepData ) {
  4054. for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
  4055. if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
  4056. if ( !keepData && elem.nodeType === 1 ) {
  4057. jQuery.cleanData( elem.getElementsByTagName("*") );
  4058. jQuery.cleanData( [ elem ] );
  4059. }
  4060.  
  4061. if ( elem.parentNode ) {
  4062. elem.parentNode.removeChild( elem );
  4063. }
  4064. }
  4065. }
  4066. return this;
  4067. },
  4068.  
  4069. empty: function() {
  4070. for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
  4071. // Remove element nodes and prevent memory leaks
  4072. if ( elem.nodeType === 1 ) {
  4073. jQuery.cleanData( elem.getElementsByTagName("*") );
  4074. }
  4075.  
  4076. // Remove any remaining nodes
  4077. while ( elem.firstChild ) {
  4078. elem.removeChild( elem.firstChild );
  4079. }
  4080. }
  4081. return this;
  4082. },
  4083.  
  4084. clone: function( events ) {
  4085. // Do the clone
  4086. var ret = this.map(function() {
  4087. if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
  4088. // IE copies events bound via attachEvent when
  4089. // using cloneNode. Calling detachEvent on the
  4090. // clone will also remove the events from the orignal
  4091. // In order to get around this, we use innerHTML.
  4092. // Unfortunately, this means some modifications to
  4093. // attributes in IE that are actually only stored
  4094. // as properties will not be copied (such as the
  4095. // the name attribute on an input).
  4096. var html = this.outerHTML, ownerDocument = this.ownerDocument;
  4097. if ( !html ) {
  4098. var div = ownerDocument.createElement("div");
  4099. div.appendChild( this.cloneNode(true) );
  4100. html = div.innerHTML;
  4101. }
  4102.  
  4103. return jQuery.clean([html.replace(rinlinejQuery, "")
  4104. // Handle the case in IE 8 where action=/test/> self-closes a tag
  4105. .replace(/=([^="'>\s]+\/)>/g, '="$1">')
  4106. .replace(rleadingWhitespace, "")], ownerDocument)[0];
  4107. } else {
  4108. return this.cloneNode(true);
  4109. }
  4110. });
  4111.  
  4112. // Copy the events from the original to the clone
  4113. if ( events === true ) {
  4114. cloneCopyEvent( this, ret );
  4115. cloneCopyEvent( this.find("*"), ret.find("*") );
  4116. }
  4117.  
  4118. // Return the cloned set
  4119. return ret;
  4120. },
  4121.  
  4122. html: function( value ) {
  4123. if ( value === undefined ) {
  4124. return this[0] && this[0].nodeType === 1 ?
  4125. this[0].innerHTML.replace(rinlinejQuery, "") :
  4126. null;
  4127.  
  4128. // See if we can take a shortcut and just use innerHTML
  4129. } else if ( typeof value === "string" && !rnocache.test( value ) &&
  4130. (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
  4131. !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
  4132.  
  4133. value = value.replace(rxhtmlTag, fcloseTag);
  4134.  
  4135. try {
  4136. for ( var i = 0, l = this.length; i < l; i++ ) {
  4137. // Remove element nodes and prevent memory leaks
  4138. if ( this[i].nodeType === 1 ) {
  4139. jQuery.cleanData( this[i].getElementsByTagName("*") );
  4140. this[i].innerHTML = value;
  4141. }
  4142. }
  4143.  
  4144. // If using innerHTML throws an exception, use the fallback method
  4145. } catch(e) {
  4146. this.empty().append( value );
  4147. }
  4148.  
  4149. } else if ( jQuery.isFunction( value ) ) {
  4150. this.each(function(i){
  4151. var self = jQuery(this), old = self.html();
  4152. self.empty().append(function(){
  4153. return value.call( this, i, old );
  4154. });
  4155. });
  4156.  
  4157. } else {
  4158. this.empty().append( value );
  4159. }
  4160.  
  4161. return this;
  4162. },
  4163.  
  4164. replaceWith: function( value ) {
  4165. if ( this[0] && this[0].parentNode ) {
  4166. // Make sure that the elements are removed from the DOM before they are inserted
  4167. // this can help fix replacing a parent with child elements
  4168. if ( jQuery.isFunction( value ) ) {
  4169. return this.each(function(i) {
  4170. var self = jQuery(this), old = self.html();
  4171. self.replaceWith( value.call( this, i, old ) );
  4172. });
  4173. }
  4174.  
  4175. if ( typeof value !== "string" ) {
  4176. value = jQuery(value).detach();
  4177. }
  4178.  
  4179. return this.each(function() {
  4180. var next = this.nextSibling, parent = this.parentNode;
  4181.  
  4182. jQuery(this).remove();
  4183.  
  4184. if ( next ) {
  4185. jQuery(next).before( value );
  4186. } else {
  4187. jQuery(parent).append( value );
  4188. }
  4189. });
  4190. } else {
  4191. return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
  4192. }
  4193. },
  4194.  
  4195. detach: function( selector ) {
  4196. return this.remove( selector, true );
  4197. },
  4198.  
  4199. domManip: function( args, table, callback ) {
  4200. var results, first, value = args[0], scripts = [], fragment, parent;
  4201.  
  4202. // We can't cloneNode fragments that contain checked, in WebKit
  4203. if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
  4204. return this.each(function() {
  4205. jQuery(this).domManip( args, table, callback, true );
  4206. });
  4207. }
  4208.  
  4209. if ( jQuery.isFunction(value) ) {
  4210. return this.each(function(i) {
  4211. var self = jQuery(this);
  4212. args[0] = value.call(this, i, table ? self.html() : undefined);
  4213. self.domManip( args, table, callback );
  4214. });
  4215. }
  4216.  
  4217. if ( this[0] ) {
  4218. parent = value && value.parentNode;
  4219.  
  4220. // If we're in a fragment, just use that instead of building a new one
  4221. if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
  4222. results = { fragment: parent };
  4223.  
  4224. } else {
  4225. results = buildFragment( args, this, scripts );
  4226. }
  4227. fragment = results.fragment;
  4228. if ( fragment.childNodes.length === 1 ) {
  4229. first = fragment = fragment.firstChild;
  4230. } else {
  4231. first = fragment.firstChild;
  4232. }
  4233.  
  4234. if ( first ) {
  4235. table = table && jQuery.nodeName( first, "tr" );
  4236.  
  4237. for ( var i = 0, l = this.length; i < l; i++ ) {
  4238. callback.call(
  4239. table ?
  4240. root(this[i], first) :
  4241. this[i],
  4242. i > 0 || results.cacheable || this.length > 1 ?
  4243. fragment.cloneNode(true) :
  4244. fragment
  4245. );
  4246. }
  4247. }
  4248.  
  4249. if ( scripts.length ) {
  4250. jQuery.each( scripts, evalScript );
  4251. }
  4252. }
  4253.  
  4254. return this;
  4255.  
  4256. function root( elem, cur ) {
  4257. return jQuery.nodeName(elem, "table") ?
  4258. (elem.getElementsByTagName("tbody")[0] ||
  4259. elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
  4260. elem;
  4261. }
  4262. }
  4263. });
  4264.  
  4265. function cloneCopyEvent(orig, ret) {
  4266. var i = 0;
  4267.  
  4268. ret.each(function() {
  4269. if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
  4270. return;
  4271. }
  4272.  
  4273. var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
  4274.  
  4275. if ( events ) {
  4276. delete curData.handle;
  4277. curData.events = {};
  4278.  
  4279. for ( var type in events ) {
  4280. for ( var handler in events[ type ] ) {
  4281. jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
  4282. }
  4283. }
  4284. }
  4285. });
  4286. }
  4287.  
  4288. function buildFragment( args, nodes, scripts ) {
  4289. var fragment, cacheable, cacheresults,
  4290. doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
  4291.  
  4292. // Only cache "small" (1/2 KB) strings that are associated with the main document
  4293. // Cloning options loses the selected state, so don't cache them
  4294. // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
  4295. // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
  4296. if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
  4297. !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
  4298.  
  4299. cacheable = true;
  4300. cacheresults = jQuery.fragments[ args[0] ];
  4301. if ( cacheresults ) {
  4302. if ( cacheresults !== 1 ) {
  4303. fragment = cacheresults;
  4304. }
  4305. }
  4306. }
  4307.  
  4308. if ( !fragment ) {
  4309. fragment = doc.createDocumentFragment();
  4310. jQuery.clean( args, doc, fragment, scripts );
  4311. }
  4312.  
  4313. if ( cacheable ) {
  4314. jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
  4315. }
  4316.  
  4317. return { fragment: fragment, cacheable: cacheable };
  4318. }
  4319.  
  4320. jQuery.fragments = {};
  4321.  
  4322. jQuery.each({
  4323. appendTo: "append",
  4324. prependTo: "prepend",
  4325. insertBefore: "before",
  4326. insertAfter: "after",
  4327. replaceAll: "replaceWith"
  4328. }, function( name, original ) {
  4329. jQuery.fn[ name ] = function( selector ) {
  4330. var ret = [], insert = jQuery( selector ),
  4331. parent = this.length === 1 && this[0].parentNode;
  4332. if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
  4333. insert[ original ]( this[0] );
  4334. return this;
  4335. } else {
  4336. for ( var i = 0, l = insert.length; i < l; i++ ) {
  4337. var elems = (i > 0 ? this.clone(true) : this).get();
  4338. jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
  4339. ret = ret.concat( elems );
  4340. }
  4341. return this.pushStack( ret, name, insert.selector );
  4342. }
  4343. };
  4344. });
  4345.  
  4346. jQuery.extend({
  4347. clean: function( elems, context, fragment, scripts ) {
  4348. context = context || document;
  4349.  
  4350. // !context.createElement fails in IE with an error but returns typeof 'object'
  4351. if ( typeof context.createElement === "undefined" ) {
  4352. context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
  4353. }
  4354.  
  4355. var ret = [];
  4356.  
  4357. for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
  4358. if ( typeof elem === "number" ) {
  4359. elem += "";
  4360. }
  4361.  
  4362. if ( !elem ) {
  4363. continue;
  4364. }
  4365.  
  4366. // Convert html string into DOM nodes
  4367. if ( typeof elem === "string" && !rhtml.test( elem ) ) {
  4368. elem = context.createTextNode( elem );
  4369.  
  4370. } else if ( typeof elem === "string" ) {
  4371. // Fix "XHTML"-style tags in all browsers
  4372. elem = elem.replace(rxhtmlTag, fcloseTag);
  4373.  
  4374. // Trim whitespace, otherwise indexOf won't work as expected
  4375. var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
  4376. wrap = wrapMap[ tag ] || wrapMap._default,
  4377. depth = wrap[0],
  4378. div = context.createElement("div");
  4379.  
  4380. // Go to html and back, then peel off extra wrappers
  4381. div.innerHTML = wrap[1] + elem + wrap[2];
  4382.  
  4383. // Move to the right depth
  4384. while ( depth-- ) {
  4385. div = div.lastChild;
  4386. }
  4387.  
  4388. // Remove IE's autoinserted <tbody> from table fragments
  4389. if ( !jQuery.support.tbody ) {
  4390.  
  4391. // String was a <table>, *may* have spurious <tbody>
  4392. var hasBody = rtbody.test(elem),
  4393. tbody = tag === "table" && !hasBody ?
  4394. div.firstChild && div.firstChild.childNodes :
  4395.  
  4396. // String was a bare <thead> or <tfoot>
  4397. wrap[1] === "<table>" && !hasBody ?
  4398. div.childNodes :
  4399. [];
  4400.  
  4401. for ( var j = tbody.length - 1; j >= 0 ; --j ) {
  4402. if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
  4403. tbody[ j ].parentNode.removeChild( tbody[ j ] );
  4404. }
  4405. }
  4406.  
  4407. }
  4408.  
  4409. // IE completely kills leading whitespace when innerHTML is used
  4410. if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
  4411. div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
  4412. }
  4413.  
  4414. elem = div.childNodes;
  4415. }
  4416.  
  4417. if ( elem.nodeType ) {
  4418. ret.push( elem );
  4419. } else {
  4420. ret = jQuery.merge( ret, elem );
  4421. }
  4422. }
  4423.  
  4424. if ( fragment ) {
  4425. for ( var i = 0; ret[i]; i++ ) {
  4426. if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
  4427. scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
  4428. } else {
  4429. if ( ret[i].nodeType === 1 ) {
  4430. ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
  4431. }
  4432. fragment.appendChild( ret[i] );
  4433. }
  4434. }
  4435. }
  4436.  
  4437. return ret;
  4438. },
  4439. cleanData: function( elems ) {
  4440. var data, id, cache = jQuery.cache,
  4441. special = jQuery.event.special,
  4442. deleteExpando = jQuery.support.deleteExpando;
  4443. for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
  4444. id = elem[ jQuery.expando ];
  4445. if ( id ) {
  4446. data = cache[ id ];
  4447. if ( data.events ) {
  4448. for ( var type in data.events ) {
  4449. if ( special[ type ] ) {
  4450. jQuery.event.remove( elem, type );
  4451.  
  4452. } else {
  4453. removeEvent( elem, type, data.handle );
  4454. }
  4455. }
  4456. }
  4457. if ( deleteExpando ) {
  4458. delete elem[ jQuery.expando ];
  4459.  
  4460. } else if ( elem.removeAttribute ) {
  4461. elem.removeAttribute( jQuery.expando );
  4462. }
  4463. delete cache[ id ];
  4464. }
  4465. }
  4466. }
  4467. });
  4468. // exclude the following css properties to add px
  4469. var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
  4470. ralpha = /alpha\([^)]*\)/,
  4471. ropacity = /opacity=([^)]*)/,
  4472. rfloat = /float/i,
  4473. rdashAlpha = /-([a-z])/ig,
  4474. rupper = /([A-Z])/g,
  4475. rnumpx = /^-?\d+(?:px)?$/i,
  4476. rnum = /^-?\d/,
  4477.  
  4478. cssShow = { position: "absolute", visibility: "hidden", display:"block" },
  4479. cssWidth = [ "Left", "Right" ],
  4480. cssHeight = [ "Top", "Bottom" ],
  4481.  
  4482. // cache check for defaultView.getComputedStyle
  4483. getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
  4484. // normalize float css property
  4485. styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
  4486. fcamelCase = function( all, letter ) {
  4487. return letter.toUpperCase();
  4488. };
  4489.  
  4490. jQuery.fn.css = function( name, value ) {
  4491. return access( this, name, value, true, function( elem, name, value ) {
  4492. if ( value === undefined ) {
  4493. return jQuery.curCSS( elem, name );
  4494. }
  4495. if ( typeof value === "number" && !rexclude.test(name) ) {
  4496. value += "px";
  4497. }
  4498.  
  4499. jQuery.style( elem, name, value );
  4500. });
  4501. };
  4502.  
  4503. jQuery.extend({
  4504. style: function( elem, name, value ) {
  4505. // don't set styles on text and comment nodes
  4506. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
  4507. return undefined;
  4508. }
  4509.  
  4510. // ignore negative width and height values #1599
  4511. if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
  4512. value = undefined;
  4513. }
  4514.  
  4515. var style = elem.style || elem, set = value !== undefined;
  4516.  
  4517. // IE uses filters for opacity
  4518. if ( !jQuery.support.opacity && name === "opacity" ) {
  4519. if ( set ) {
  4520. // IE has trouble with opacity if it does not have layout
  4521. // Force it by setting the zoom level
  4522. style.zoom = 1;
  4523.  
  4524. // Set the alpha filter to set the opacity
  4525. var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
  4526. var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
  4527. style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
  4528. }
  4529.  
  4530. return style.filter && style.filter.indexOf("opacity=") >= 0 ?
  4531. (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
  4532. "";
  4533. }
  4534.  
  4535. // Make sure we're using the right name for getting the float value
  4536. if ( rfloat.test( name ) ) {
  4537. name = styleFloat;
  4538. }
  4539.  
  4540. name = name.replace(rdashAlpha, fcamelCase);
  4541.  
  4542. if ( set ) {
  4543. style[ name ] = value;
  4544. }
  4545.  
  4546. return style[ name ];
  4547. },
  4548.  
  4549. css: function( elem, name, force, extra ) {
  4550. if ( name === "width" || name === "height" ) {
  4551. var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
  4552.  
  4553. function getWH() {
  4554. val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
  4555.  
  4556. if ( extra === "border" ) {
  4557. return;
  4558. }
  4559.  
  4560. jQuery.each( which, function() {
  4561. if ( !extra ) {
  4562. val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
  4563. }
  4564.  
  4565. if ( extra === "margin" ) {
  4566. val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
  4567. } else {
  4568. val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
  4569. }
  4570. });
  4571. }
  4572.  
  4573. if ( elem.offsetWidth !== 0 ) {
  4574. getWH();
  4575. } else {
  4576. jQuery.swap( elem, props, getWH );
  4577. }
  4578.  
  4579. return Math.max(0, Math.round(val));
  4580. }
  4581.  
  4582. return jQuery.curCSS( elem, name, force );
  4583. },
  4584.  
  4585. curCSS: function( elem, name, force ) {
  4586. var ret, style = elem.style, filter;
  4587.  
  4588. // IE uses filters for opacity
  4589. if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
  4590. ret = ropacity.test(elem.currentStyle.filter || "") ?
  4591. (parseFloat(RegExp.$1) / 100) + "" :
  4592. "";
  4593.  
  4594. return ret === "" ?
  4595. "1" :
  4596. ret;
  4597. }
  4598.  
  4599. // Make sure we're using the right name for getting the float value
  4600. if ( rfloat.test( name ) ) {
  4601. name = styleFloat;
  4602. }
  4603.  
  4604. if ( !force && style && style[ name ] ) {
  4605. ret = style[ name ];
  4606.  
  4607. } else if ( getComputedStyle ) {
  4608.  
  4609. // Only "float" is needed here
  4610. if ( rfloat.test( name ) ) {
  4611. name = "float";
  4612. }
  4613.  
  4614. name = name.replace( rupper, "-$1" ).toLowerCase();
  4615.  
  4616. var defaultView = elem.ownerDocument.defaultView;
  4617.  
  4618. if ( !defaultView ) {
  4619. return null;
  4620. }
  4621.  
  4622. var computedStyle = defaultView.getComputedStyle( elem, null );
  4623.  
  4624. if ( computedStyle ) {
  4625. ret = computedStyle.getPropertyValue( name );
  4626. }
  4627.  
  4628. // We should always get a number back from opacity
  4629. if ( name === "opacity" && ret === "" ) {
  4630. ret = "1";
  4631. }
  4632.  
  4633. } else if ( elem.currentStyle ) {
  4634. var camelCase = name.replace(rdashAlpha, fcamelCase);
  4635.  
  4636. ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
  4637.  
  4638. // From the awesome hack by Dean Edwards
  4639. // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
  4640.  
  4641. // If we're not dealing with a regular pixel number
  4642. // but a number that has a weird ending, we need to convert it to pixels
  4643. if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
  4644. // Remember the original values
  4645. var left = style.left, rsLeft = elem.runtimeStyle.left;
  4646.  
  4647. // Put in the new values to get a computed value out
  4648. elem.runtimeStyle.left = elem.currentStyle.left;
  4649. style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
  4650. ret = style.pixelLeft + "px";
  4651.  
  4652. // Revert the changed values
  4653. style.left = left;
  4654. elem.runtimeStyle.left = rsLeft;
  4655. }
  4656. }
  4657.  
  4658. return ret;
  4659. },
  4660.  
  4661. // A method for quickly swapping in/out CSS properties to get correct calculations
  4662. swap: function( elem, options, callback ) {
  4663. var old = {};
  4664.  
  4665. // Remember the old values, and insert the new ones
  4666. for ( var name in options ) {
  4667. old[ name ] = elem.style[ name ];
  4668. elem.style[ name ] = options[ name ];
  4669. }
  4670.  
  4671. callback.call( elem );
  4672.  
  4673. // Revert the old values
  4674. for ( var name in options ) {
  4675. elem.style[ name ] = old[ name ];
  4676. }
  4677. }
  4678. });
  4679.  
  4680. if ( jQuery.expr && jQuery.expr.filters ) {
  4681. jQuery.expr.filters.hidden = function( elem ) {
  4682. var width = elem.offsetWidth, height = elem.offsetHeight,
  4683. skip = elem.nodeName.toLowerCase() === "tr";
  4684.  
  4685. return width === 0 && height === 0 && !skip ?
  4686. true :
  4687. width > 0 && height > 0 && !skip ?
  4688. false :
  4689. jQuery.curCSS(elem, "display") === "none";
  4690. };
  4691.  
  4692. jQuery.expr.filters.visible = function( elem ) {
  4693. return !jQuery.expr.filters.hidden( elem );
  4694. };
  4695. }
  4696. var jsc = now(),
  4697. rscript = /<script(.|\s)*?\/script>/gi,
  4698. rselectTextarea = /select|textarea/i,
  4699. rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
  4700. jsre = /=\?(&|$)/,
  4701. rquery = /\?/,
  4702. rts = /(\?|&)_=.*?(&|$)/,
  4703. rurl = /^(\w+:)?\/\/([^\/?#]+)/,
  4704. r20 = /%20/g,
  4705.  
  4706. // Keep a copy of the old load method
  4707. _load = jQuery.fn.load;
  4708.  
  4709. jQuery.fn.extend({
  4710. load: function( url, params, callback ) {
  4711. if ( typeof url !== "string" ) {
  4712. return _load.call( this, url );
  4713.  
  4714. // Don't do a request if no elements are being requested
  4715. } else if ( !this.length ) {
  4716. return this;
  4717. }
  4718.  
  4719. var off = url.indexOf(" ");
  4720. if ( off >= 0 ) {
  4721. var selector = url.slice(off, url.length);
  4722. url = url.slice(0, off);
  4723. }
  4724.  
  4725. // Default to a GET request
  4726. var type = "GET";
  4727.  
  4728. // If the second parameter was provided
  4729. if ( params ) {
  4730. // If it's a function
  4731. if ( jQuery.isFunction( params ) ) {
  4732. // We assume that it's the callback
  4733. callback = params;
  4734. params = null;
  4735.  
  4736. // Otherwise, build a param string
  4737. } else if ( typeof params === "object" ) {
  4738. params = jQuery.param( params, jQuery.ajaxSettings.traditional );
  4739. type = "POST";
  4740. }
  4741. }
  4742.  
  4743. var self = this;
  4744.  
  4745. // Request the remote document
  4746. jQuery.ajax({
  4747. url: url,
  4748. type: type,
  4749. dataType: "html",
  4750. data: params,
  4751. complete: function( res, status ) {
  4752. // If successful, inject the HTML into all the matched elements
  4753. if ( status === "success" || status === "notmodified" ) {
  4754. // See if a selector was specified
  4755. self.html( selector ?
  4756. // Create a dummy div to hold the results
  4757. jQuery("<div />")
  4758. // inject the contents of the document in, removing the scripts
  4759. // to avoid any 'Permission Denied' errors in IE
  4760. .append(res.responseText.replace(rscript, ""))
  4761.  
  4762. // Locate the specified elements
  4763. .find(selector) :
  4764.  
  4765. // If not, just inject the full result
  4766. res.responseText );
  4767. }
  4768.  
  4769. if ( callback ) {
  4770. self.each( callback, [res.responseText, status, res] );
  4771. }
  4772. }
  4773. });
  4774.  
  4775. return this;
  4776. },
  4777.  
  4778. serialize: function() {
  4779. return jQuery.param(this.serializeArray());
  4780. },
  4781. serializeArray: function() {
  4782. return this.map(function() {
  4783. return this.elements ? jQuery.makeArray(this.elements) : this;
  4784. })
  4785. .filter(function() {
  4786. return this.name && !this.disabled &&
  4787. (this.checked || rselectTextarea.test(this.nodeName) ||
  4788. rinput.test(this.type));
  4789. })
  4790. .map(function( i, elem ) {
  4791. var val = jQuery(this).val();
  4792.  
  4793. return val == null ?
  4794. null :
  4795. jQuery.isArray(val) ?
  4796. jQuery.map( val, function( val, i ) {
  4797. return { name: elem.name, value: val };
  4798. }) :
  4799. { name: elem.name, value: val };
  4800. }).get();
  4801. }
  4802. });
  4803.  
  4804. // Attach a bunch of functions for handling common AJAX events
  4805. jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
  4806. jQuery.fn[o] = function( f ) {
  4807. return this.bind(o, f);
  4808. };
  4809. });
  4810.  
  4811. jQuery.extend({
  4812.  
  4813. get: function( url, data, callback, type ) {
  4814. // shift arguments if data argument was omited
  4815. if ( jQuery.isFunction( data ) ) {
  4816. type = type || callback;
  4817. callback = data;
  4818. data = null;
  4819. }
  4820.  
  4821. return jQuery.ajax({
  4822. type: "GET",
  4823. url: url,
  4824. data: data,
  4825. success: callback,
  4826. dataType: type
  4827. });
  4828. },
  4829.  
  4830. getScript: function( url, callback ) {
  4831. return jQuery.get(url, null, callback, "script");
  4832. },
  4833.  
  4834. getJSON: function( url, data, callback ) {
  4835. return jQuery.get(url, data, callback, "json");
  4836. },
  4837.  
  4838. post: function( url, data, callback, type ) {
  4839. // shift arguments if data argument was omited
  4840. if ( jQuery.isFunction( data ) ) {
  4841. type = type || callback;
  4842. callback = data;
  4843. data = {};
  4844. }
  4845.  
  4846. return jQuery.ajax({
  4847. type: "POST",
  4848. url: url,
  4849. data: data,
  4850. success: callback,
  4851. dataType: type
  4852. });
  4853. },
  4854.  
  4855. ajaxSetup: function( settings ) {
  4856. jQuery.extend( jQuery.ajaxSettings, settings );
  4857. },
  4858.  
  4859. ajaxSettings: {
  4860. url: location.href,
  4861. global: true,
  4862. type: "GET",
  4863. contentType: "application/x-www-form-urlencoded",
  4864. processData: true,
  4865. async: true,
  4866. /*
  4867. timeout: 0,
  4868. data: null,
  4869. username: null,
  4870. password: null,
  4871. traditional: false,
  4872. */
  4873. // Create the request object; Microsoft failed to properly
  4874. // implement the XMLHttpRequest in IE7 (can't request local files),
  4875. // so we use the ActiveXObject when it is available
  4876. // This function can be overriden by calling jQuery.ajaxSetup
  4877. xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
  4878. function() {
  4879. return new window.XMLHttpRequest();
  4880. } :
  4881. function() {
  4882. try {
  4883. return new window.ActiveXObject("Microsoft.XMLHTTP");
  4884. } catch(e) {}
  4885. },
  4886. accepts: {
  4887. xml: "application/xml, text/xml",
  4888. html: "text/html",
  4889. script: "text/javascript, application/javascript",
  4890. json: "application/json, text/javascript",
  4891. text: "text/plain",
  4892. _default: "*/*"
  4893. }
  4894. },
  4895.  
  4896. // Last-Modified header cache for next request
  4897. lastModified: {},
  4898. etag: {},
  4899.  
  4900. ajax: function( origSettings ) {
  4901. var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
  4902. var jsonp, status, data,
  4903. callbackContext = origSettings && origSettings.context || s,
  4904. type = s.type.toUpperCase();
  4905.  
  4906. // convert data if not already a string
  4907. if ( s.data && s.processData && typeof s.data !== "string" ) {
  4908. s.data = jQuery.param( s.data, s.traditional );
  4909. }
  4910.  
  4911. // Handle JSONP Parameter Callbacks
  4912. if ( s.dataType === "jsonp" ) {
  4913. if ( type === "GET" ) {
  4914. if ( !jsre.test( s.url ) ) {
  4915. s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
  4916. }
  4917. } else if ( !s.data || !jsre.test(s.data) ) {
  4918. s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
  4919. }
  4920. s.dataType = "json";
  4921. }
  4922.  
  4923. // Build temporary JSONP function
  4924. if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
  4925. jsonp = s.jsonpCallback || ("jsonp" + jsc++);
  4926.  
  4927. // Replace the =? sequence both in the query string and the data
  4928. if ( s.data ) {
  4929. s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
  4930. }
  4931.  
  4932. s.url = s.url.replace(jsre, "=" + jsonp + "$1");
  4933.  
  4934. // We need to make sure
  4935. // that a JSONP style response is executed properly
  4936. s.dataType = "script";
  4937.  
  4938. // Handle JSONP-style loading
  4939. window[ jsonp ] = window[ jsonp ] || function( tmp ) {
  4940. data = tmp;
  4941. success();
  4942. complete();
  4943. // Garbage collect
  4944. window[ jsonp ] = undefined;
  4945.  
  4946. try {
  4947. delete window[ jsonp ];
  4948. } catch(e) {}
  4949.  
  4950. if ( head ) {
  4951. head.removeChild( script );
  4952. }
  4953. };
  4954. }
  4955.  
  4956. if ( s.dataType === "script" && s.cache === null ) {
  4957. s.cache = false;
  4958. }
  4959.  
  4960. if ( s.cache === false && type === "GET" ) {
  4961. var ts = now();
  4962.  
  4963. // try replacing _= if it is there
  4964. var ret = s.url.replace(rts, "$1_=" + ts + "$2");
  4965.  
  4966. // if nothing was replaced, add timestamp to the end
  4967. s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
  4968. }
  4969.  
  4970. // If data is available, append data to url for get requests
  4971. if ( s.data && type === "GET" ) {
  4972. s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
  4973. }
  4974.  
  4975. // Watch for a new set of requests
  4976. if ( s.global && ! jQuery.active++ ) {
  4977. jQuery.event.trigger( "ajaxStart" );
  4978. }
  4979.  
  4980. // Matches an absolute URL, and saves the domain
  4981. var parts = rurl.exec( s.url ),
  4982. remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
  4983.  
  4984. // If we're requesting a remote document
  4985. // and trying to load JSON or Script with a GET
  4986. if ( s.dataType === "script" && type === "GET" && remote ) {
  4987. var head = document.getElementsByTagName("head")[0] || document.documentElement;
  4988. var script = document.createElement("script");
  4989. script.src = s.url;
  4990. if ( s.scriptCharset ) {
  4991. script.charset = s.scriptCharset;
  4992. }
  4993.  
  4994. // Handle Script loading
  4995. if ( !jsonp ) {
  4996. var done = false;
  4997.  
  4998. // Attach handlers for all browsers
  4999. script.onload = script.onreadystatechange = function() {
  5000. if ( !done && (!this.readyState ||
  5001. this.readyState === "loaded" || this.readyState === "complete") ) {
  5002. done = true;
  5003. success();
  5004. complete();
  5005.  
  5006. // Handle memory leak in IE
  5007. script.onload = script.onreadystatechange = null;
  5008. if ( head && script.parentNode ) {
  5009. head.removeChild( script );
  5010. }
  5011. }
  5012. };
  5013. }
  5014.  
  5015. // Use insertBefore instead of appendChild to circumvent an IE6 bug.
  5016. // This arises when a base node is used (#2709 and #4378).
  5017. head.insertBefore( script, head.firstChild );
  5018.  
  5019. // We handle everything using the script element injection
  5020. return undefined;
  5021. }
  5022.  
  5023. var requestDone = false;
  5024.  
  5025. // Create the request object
  5026. var xhr = s.xhr();
  5027.  
  5028. if ( !xhr ) {
  5029. return;
  5030. }
  5031.  
  5032. // Open the socket
  5033. // Passing null username, generates a login popup on Opera (#2865)
  5034. if ( s.username ) {
  5035. xhr.open(type, s.url, s.async, s.username, s.password);
  5036. } else {
  5037. xhr.open(type, s.url, s.async);
  5038. }
  5039.  
  5040. // Need an extra try/catch for cross domain requests in Firefox 3
  5041. try {
  5042. // Set the correct header, if data is being sent
  5043. if ( s.data || origSettings && origSettings.contentType ) {
  5044. xhr.setRequestHeader("Content-Type", s.contentType);
  5045. }
  5046.  
  5047. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  5048. if ( s.ifModified ) {
  5049. if ( jQuery.lastModified[s.url] ) {
  5050. xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
  5051. }
  5052.  
  5053. if ( jQuery.etag[s.url] ) {
  5054. xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
  5055. }
  5056. }
  5057.  
  5058. // Set header so the called script knows that it's an XMLHttpRequest
  5059. // Only send the header if it's not a remote XHR
  5060. if ( !remote ) {
  5061. xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
  5062. }
  5063.  
  5064. // Set the Accepts header for the server, depending on the dataType
  5065. xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
  5066. s.accepts[ s.dataType ] + ", */*" :
  5067. s.accepts._default );
  5068. } catch(e) {}
  5069.  
  5070. // Allow custom headers/mimetypes and early abort
  5071. if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
  5072. // Handle the global AJAX counter
  5073. if ( s.global && ! --jQuery.active ) {
  5074. jQuery.event.trigger( "ajaxStop" );
  5075. }
  5076.  
  5077. // close opended socket
  5078. xhr.abort();
  5079. return false;
  5080. }
  5081.  
  5082. if ( s.global ) {
  5083. trigger("ajaxSend", [xhr, s]);
  5084. }
  5085.  
  5086. // Wait for a response to come back
  5087. var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
  5088. // The request was aborted
  5089. if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
  5090. // Opera doesn't call onreadystatechange before this point
  5091. // so we simulate the call
  5092. if ( !requestDone ) {
  5093. complete();
  5094. }
  5095.  
  5096. requestDone = true;
  5097. if ( xhr ) {
  5098. xhr.onreadystatechange = jQuery.noop;
  5099. }
  5100.  
  5101. // The transfer is complete and the data is available, or the request timed out
  5102. } else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
  5103. requestDone = true;
  5104. xhr.onreadystatechange = jQuery.noop;
  5105.  
  5106. status = isTimeout === "timeout" ?
  5107. "timeout" :
  5108. !jQuery.httpSuccess( xhr ) ?
  5109. "error" :
  5110. s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
  5111. "notmodified" :
  5112. "success";
  5113.  
  5114. var errMsg;
  5115.  
  5116. if ( status === "success" ) {
  5117. // Watch for, and catch, XML document parse errors
  5118. try {
  5119. // process the data (runs the xml through httpData regardless of callback)
  5120. data = jQuery.httpData( xhr, s.dataType, s );
  5121. } catch(err) {
  5122. status = "parsererror";
  5123. errMsg = err;
  5124. }
  5125. }
  5126.  
  5127. // Make sure that the request was successful or notmodified
  5128. if ( status === "success" || status === "notmodified" ) {
  5129. // JSONP handles its own success callback
  5130. if ( !jsonp ) {
  5131. success();
  5132. }
  5133. } else {
  5134. jQuery.handleError(s, xhr, status, errMsg);
  5135. }
  5136.  
  5137. // Fire the complete handlers
  5138. complete();
  5139.  
  5140. if ( isTimeout === "timeout" ) {
  5141. xhr.abort();
  5142. }
  5143.  
  5144. // Stop memory leaks
  5145. if ( s.async ) {
  5146. xhr = null;
  5147. }
  5148. }
  5149. };
  5150.  
  5151. // Override the abort handler, if we can (IE doesn't allow it, but that's OK)
  5152. // Opera doesn't fire onreadystatechange at all on abort
  5153. try {
  5154. var oldAbort = xhr.abort;
  5155. xhr.abort = function() {
  5156. if ( xhr ) {
  5157. oldAbort.call( xhr );
  5158. }
  5159.  
  5160. onreadystatechange( "abort" );
  5161. };
  5162. } catch(e) { }
  5163.  
  5164. // Timeout checker
  5165. if ( s.async && s.timeout > 0 ) {
  5166. setTimeout(function() {
  5167. // Check to see if the request is still happening
  5168. if ( xhr && !requestDone ) {
  5169. onreadystatechange( "timeout" );
  5170. }
  5171. }, s.timeout);
  5172. }
  5173.  
  5174. // Send the data
  5175. try {
  5176. xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
  5177. } catch(e) {
  5178. jQuery.handleError(s, xhr, null, e);
  5179. // Fire the complete handlers
  5180. complete();
  5181. }
  5182.  
  5183. // firefox 1.5 doesn't fire statechange for sync requests
  5184. if ( !s.async ) {
  5185. onreadystatechange();
  5186. }
  5187.  
  5188. function success() {
  5189. // If a local callback was specified, fire it and pass it the data
  5190. if ( s.success ) {
  5191. s.success.call( callbackContext, data, status, xhr );
  5192. }
  5193.  
  5194. // Fire the global callback
  5195. if ( s.global ) {
  5196. trigger( "ajaxSuccess", [xhr, s] );
  5197. }
  5198. }
  5199.  
  5200. function complete() {
  5201. // Process result
  5202. if ( s.complete ) {
  5203. s.complete.call( callbackContext, xhr, status);
  5204. }
  5205.  
  5206. // The request was completed
  5207. if ( s.global ) {
  5208. trigger( "ajaxComplete", [xhr, s] );
  5209. }
  5210.  
  5211. // Handle the global AJAX counter
  5212. if ( s.global && ! --jQuery.active ) {
  5213. jQuery.event.trigger( "ajaxStop" );
  5214. }
  5215. }
  5216. function trigger(type, args) {
  5217. (s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
  5218. }
  5219.  
  5220. // return XMLHttpRequest to allow aborting the request etc.
  5221. return xhr;
  5222. },
  5223.  
  5224. handleError: function( s, xhr, status, e ) {
  5225. // If a local callback was specified, fire it
  5226. if ( s.error ) {
  5227. s.error.call( s.context || s, xhr, status, e );
  5228. }
  5229.  
  5230. // Fire the global callback
  5231. if ( s.global ) {
  5232. (s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
  5233. }
  5234. },
  5235.  
  5236. // Counter for holding the number of active queries
  5237. active: 0,
  5238.  
  5239. // Determines if an XMLHttpRequest was successful or not
  5240. httpSuccess: function( xhr ) {
  5241. try {
  5242. // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
  5243. return !xhr.status && location.protocol === "file:" ||
  5244. // Opera returns 0 when status is 304
  5245. ( xhr.status >= 200 && xhr.status < 300 ) ||
  5246. xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
  5247. } catch(e) {}
  5248.  
  5249. return false;
  5250. },
  5251.  
  5252. // Determines if an XMLHttpRequest returns NotModified
  5253. httpNotModified: function( xhr, url ) {
  5254. var lastModified = xhr.getResponseHeader("Last-Modified"),
  5255. etag = xhr.getResponseHeader("Etag");
  5256.  
  5257. if ( lastModified ) {
  5258. jQuery.lastModified[url] = lastModified;
  5259. }
  5260.  
  5261. if ( etag ) {
  5262. jQuery.etag[url] = etag;
  5263. }
  5264.  
  5265. // Opera returns 0 when status is 304
  5266. return xhr.status === 304 || xhr.status === 0;
  5267. },
  5268.  
  5269. httpData: function( xhr, type, s ) {
  5270. var ct = xhr.getResponseHeader("content-type") || "",
  5271. xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
  5272. data = xml ? xhr.responseXML : xhr.responseText;
  5273.  
  5274. if ( xml && data.documentElement.nodeName === "parsererror" ) {
  5275. jQuery.error( "parsererror" );
  5276. }
  5277.  
  5278. // Allow a pre-filtering function to sanitize the response
  5279. // s is checked to keep backwards compatibility
  5280. if ( s && s.dataFilter ) {
  5281. data = s.dataFilter( data, type );
  5282. }
  5283.  
  5284. // The filter can actually parse the response
  5285. if ( typeof data === "string" ) {
  5286. // Get the JavaScript object, if JSON is used.
  5287. if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
  5288. data = jQuery.parseJSON( data );
  5289.  
  5290. // If the type is "script", eval it in global context
  5291. } else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
  5292. jQuery.globalEval( data );
  5293. }
  5294. }
  5295.  
  5296. return data;
  5297. },
  5298.  
  5299. // Serialize an array of form elements or a set of
  5300. // key/values into a query string
  5301. param: function( a, traditional ) {
  5302. var s = [];
  5303. // Set traditional to true for jQuery <= 1.3.2 behavior.
  5304. if ( traditional === undefined ) {
  5305. traditional = jQuery.ajaxSettings.traditional;
  5306. }
  5307. // If an array was passed in, assume that it is an array of form elements.
  5308. if ( jQuery.isArray(a) || a.jquery ) {
  5309. // Serialize the form elements
  5310. jQuery.each( a, function() {
  5311. add( this.name, this.value );
  5312. });
  5313. } else {
  5314. // If traditional, encode the "old" way (the way 1.3.2 or older
  5315. // did it), otherwise encode params recursively.
  5316. for ( var prefix in a ) {
  5317. buildParams( prefix, a[prefix] );
  5318. }
  5319. }
  5320.  
  5321. // Return the resulting serialization
  5322. return s.join("&").replace(r20, "+");
  5323.  
  5324. function buildParams( prefix, obj ) {
  5325. if ( jQuery.isArray(obj) ) {
  5326. // Serialize array item.
  5327. jQuery.each( obj, function( i, v ) {
  5328. if ( traditional || /\[\]$/.test( prefix ) ) {
  5329. // Treat each array item as a scalar.
  5330. add( prefix, v );
  5331. } else {
  5332. // If array item is non-scalar (array or object), encode its
  5333. // numeric index to resolve deserialization ambiguity issues.
  5334. // Note that rack (as of 1.0.0) can't currently deserialize
  5335. // nested arrays properly, and attempting to do so may cause
  5336. // a server error. Possible fixes are to modify rack's
  5337. // deserialization algorithm or to provide an option or flag
  5338. // to force array serialization to be shallow.
  5339. buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v );
  5340. }
  5341. });
  5342. } else if ( !traditional && obj != null && typeof obj === "object" ) {
  5343. // Serialize object item.
  5344. jQuery.each( obj, function( k, v ) {
  5345. buildParams( prefix + "[" + k + "]", v );
  5346. });
  5347. } else {
  5348. // Serialize scalar item.
  5349. add( prefix, obj );
  5350. }
  5351. }
  5352.  
  5353. function add( key, value ) {
  5354. // If value is a function, invoke it and return its value
  5355. value = jQuery.isFunction(value) ? value() : value;
  5356. s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
  5357. }
  5358. }
  5359. });
  5360. var elemdisplay = {},
  5361. rfxtypes = /toggle|show|hide/,
  5362. rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
  5363. timerId,
  5364. fxAttrs = [
  5365. // height animations
  5366. [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
  5367. // width animations
  5368. [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
  5369. // opacity animations
  5370. [ "opacity" ]
  5371. ];
  5372.  
  5373. jQuery.fn.extend({
  5374. show: function( speed, callback ) {
  5375. if ( speed || speed === 0) {
  5376. return this.animate( genFx("show", 3), speed, callback);
  5377.  
  5378. } else {
  5379. for ( var i = 0, l = this.length; i < l; i++ ) {
  5380. var old = jQuery.data(this[i], "olddisplay");
  5381.  
  5382. this[i].style.display = old || "";
  5383.  
  5384. if ( jQuery.css(this[i], "display") === "none" ) {
  5385. var nodeName = this[i].nodeName, display;
  5386.  
  5387. if ( elemdisplay[ nodeName ] ) {
  5388. display = elemdisplay[ nodeName ];
  5389.  
  5390. } else {
  5391. var elem = jQuery("<" + nodeName + " />").appendTo("body");
  5392.  
  5393. display = elem.css("display");
  5394.  
  5395. if ( display === "none" ) {
  5396. display = "block";
  5397. }
  5398.  
  5399. elem.remove();
  5400.  
  5401. elemdisplay[ nodeName ] = display;
  5402. }
  5403.  
  5404. jQuery.data(this[i], "olddisplay", display);
  5405. }
  5406. }
  5407.  
  5408. // Set the display of the elements in a second loop
  5409. // to avoid the constant reflow
  5410. for ( var j = 0, k = this.length; j < k; j++ ) {
  5411. this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
  5412. }
  5413.  
  5414. return this;
  5415. }
  5416. },
  5417.  
  5418. hide: function( speed, callback ) {
  5419. if ( speed || speed === 0 ) {
  5420. return this.animate( genFx("hide", 3), speed, callback);
  5421.  
  5422. } else {
  5423. for ( var i = 0, l = this.length; i < l; i++ ) {
  5424. var old = jQuery.data(this[i], "olddisplay");
  5425. if ( !old && old !== "none" ) {
  5426. jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
  5427. }
  5428. }
  5429.  
  5430. // Set the display of the elements in a second loop
  5431. // to avoid the constant reflow
  5432. for ( var j = 0, k = this.length; j < k; j++ ) {
  5433. this[j].style.display = "none";
  5434. }
  5435.  
  5436. return this;
  5437. }
  5438. },
  5439.  
  5440. // Save the old toggle function
  5441. _toggle: jQuery.fn.toggle,
  5442.  
  5443. toggle: function( fn, fn2 ) {
  5444. var bool = typeof fn === "boolean";
  5445.  
  5446. if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
  5447. this._toggle.apply( this, arguments );
  5448.  
  5449. } else if ( fn == null || bool ) {
  5450. this.each(function() {
  5451. var state = bool ? fn : jQuery(this).is(":hidden");
  5452. jQuery(this)[ state ? "show" : "hide" ]();
  5453. });
  5454.  
  5455. } else {
  5456. this.animate(genFx("toggle", 3), fn, fn2);
  5457. }
  5458.  
  5459. return this;
  5460. },
  5461.  
  5462. fadeTo: function( speed, to, callback ) {
  5463. return this.filter(":hidden").css("opacity", 0).show().end()
  5464. .animate({opacity: to}, speed, callback);
  5465. },
  5466.  
  5467. animate: function( prop, speed, easing, callback ) {
  5468. var optall = jQuery.speed(speed, easing, callback);
  5469.  
  5470. if ( jQuery.isEmptyObject( prop ) ) {
  5471. return this.each( optall.complete );
  5472. }
  5473.  
  5474. return this[ optall.queue === false ? "each" : "queue" ](function() {
  5475. var opt = jQuery.extend({}, optall), p,
  5476. hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
  5477. self = this;
  5478.  
  5479. for ( p in prop ) {
  5480. var name = p.replace(rdashAlpha, fcamelCase);
  5481.  
  5482. if ( p !== name ) {
  5483. prop[ name ] = prop[ p ];
  5484. delete prop[ p ];
  5485. p = name;
  5486. }
  5487.  
  5488. if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
  5489. return opt.complete.call(this);
  5490. }
  5491.  
  5492. if ( ( p === "height" || p === "width" ) && this.style ) {
  5493. // Store display property
  5494. opt.display = jQuery.css(this, "display");
  5495.  
  5496. // Make sure that nothing sneaks out
  5497. opt.overflow = this.style.overflow;
  5498. }
  5499.  
  5500. if ( jQuery.isArray( prop[p] ) ) {
  5501. // Create (if needed) and add to specialEasing
  5502. (opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
  5503. prop[p] = prop[p][0];
  5504. }
  5505. }
  5506.  
  5507. if ( opt.overflow != null ) {
  5508. this.style.overflow = "hidden";
  5509. }
  5510.  
  5511. opt.curAnim = jQuery.extend({}, prop);
  5512.  
  5513. jQuery.each( prop, function( name, val ) {
  5514. var e = new jQuery.fx( self, opt, name );
  5515.  
  5516. if ( rfxtypes.test(val) ) {
  5517. e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
  5518.  
  5519. } else {
  5520. var parts = rfxnum.exec(val),
  5521. start = e.cur(true) || 0;
  5522.  
  5523. if ( parts ) {
  5524. var end = parseFloat( parts[2] ),
  5525. unit = parts[3] || "px";
  5526.  
  5527. // We need to compute starting value
  5528. if ( unit !== "px" ) {
  5529. self.style[ name ] = (end || 1) + unit;
  5530. start = ((end || 1) / e.cur(true)) * start;
  5531. self.style[ name ] = start + unit;
  5532. }
  5533.  
  5534. // If a +=/-= token was provided, we're doing a relative animation
  5535. if ( parts[1] ) {
  5536. end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
  5537. }
  5538.  
  5539. e.custom( start, end, unit );
  5540.  
  5541. } else {
  5542. e.custom( start, val, "" );
  5543. }
  5544. }
  5545. });
  5546.  
  5547. // For JS strict compliance
  5548. return true;
  5549. });
  5550. },
  5551.  
  5552. stop: function( clearQueue, gotoEnd ) {
  5553. var timers = jQuery.timers;
  5554.  
  5555. if ( clearQueue ) {
  5556. this.queue([]);
  5557. }
  5558.  
  5559. this.each(function() {
  5560. // go in reverse order so anything added to the queue during the loop is ignored
  5561. for ( var i = timers.length - 1; i >= 0; i-- ) {
  5562. if ( timers[i].elem === this ) {
  5563. if (gotoEnd) {
  5564. // force the next step to be the last
  5565. timers[i](true);
  5566. }
  5567.  
  5568. timers.splice(i, 1);
  5569. }
  5570. }
  5571. });
  5572.  
  5573. // start the next in the queue if the last step wasn't forced
  5574. if ( !gotoEnd ) {
  5575. this.dequeue();
  5576. }
  5577.  
  5578. return this;
  5579. }
  5580.  
  5581. });
  5582.  
  5583. // Generate shortcuts for custom animations
  5584. jQuery.each({
  5585. slideDown: genFx("show", 1),
  5586. slideUp: genFx("hide", 1),
  5587. slideToggle: genFx("toggle", 1),
  5588. fadeIn: { opacity: "show" },
  5589. fadeOut: { opacity: "hide" }
  5590. }, function( name, props ) {
  5591. jQuery.fn[ name ] = function( speed, callback ) {
  5592. return this.animate( props, speed, callback );
  5593. };
  5594. });
  5595.  
  5596. jQuery.extend({
  5597. speed: function( speed, easing, fn ) {
  5598. var opt = speed && typeof speed === "object" ? speed : {
  5599. complete: fn || !fn && easing ||
  5600. jQuery.isFunction( speed ) && speed,
  5601. duration: speed,
  5602. easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
  5603. };
  5604.  
  5605. opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
  5606. jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
  5607.  
  5608. // Queueing
  5609. opt.old = opt.complete;
  5610. opt.complete = function() {
  5611. if ( opt.queue !== false ) {
  5612. jQuery(this).dequeue();
  5613. }
  5614. if ( jQuery.isFunction( opt.old ) ) {
  5615. opt.old.call( this );
  5616. }
  5617. };
  5618.  
  5619. return opt;
  5620. },
  5621.  
  5622. easing: {
  5623. linear: function( p, n, firstNum, diff ) {
  5624. return firstNum + diff * p;
  5625. },
  5626. swing: function( p, n, firstNum, diff ) {
  5627. return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
  5628. }
  5629. },
  5630.  
  5631. timers: [],
  5632.  
  5633. fx: function( elem, options, prop ) {
  5634. this.options = options;
  5635. this.elem = elem;
  5636. this.prop = prop;
  5637.  
  5638. if ( !options.orig ) {
  5639. options.orig = {};
  5640. }
  5641. }
  5642.  
  5643. });
  5644.  
  5645. jQuery.fx.prototype = {
  5646. // Simple function for setting a style value
  5647. update: function() {
  5648. if ( this.options.step ) {
  5649. this.options.step.call( this.elem, this.now, this );
  5650. }
  5651.  
  5652. (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
  5653.  
  5654. // Set display property to block for height/width animations
  5655. if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
  5656. this.elem.style.display = "block";
  5657. }
  5658. },
  5659.  
  5660. // Get the current size
  5661. cur: function( force ) {
  5662. if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
  5663. return this.elem[ this.prop ];
  5664. }
  5665.  
  5666. var r = parseFloat(jQuery.css(this.elem, this.prop, force));
  5667. return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
  5668. },
  5669.  
  5670. // Start an animation from one number to another
  5671. custom: function( from, to, unit ) {
  5672. this.startTime = now();
  5673. this.start = from;
  5674. this.end = to;
  5675. this.unit = unit || this.unit || "px";
  5676. this.now = this.start;
  5677. this.pos = this.state = 0;
  5678.  
  5679. var self = this;
  5680. function t( gotoEnd ) {
  5681. return self.step(gotoEnd);
  5682. }
  5683.  
  5684. t.elem = this.elem;
  5685.  
  5686. if ( t() && jQuery.timers.push(t) && !timerId ) {
  5687. timerId = setInterval(jQuery.fx.tick, 13);
  5688. }
  5689. },
  5690.  
  5691. // Simple 'show' function
  5692. show: function() {
  5693. // Remember where we started, so that we can go back to it later
  5694. this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
  5695. this.options.show = true;
  5696.  
  5697. // Begin the animation
  5698. // Make sure that we start at a small width/height to avoid any
  5699. // flash of content
  5700. this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
  5701.  
  5702. // Start by showing the element
  5703. jQuery( this.elem ).show();
  5704. },
  5705.  
  5706. // Simple 'hide' function
  5707. hide: function() {
  5708. // Remember where we started, so that we can go back to it later
  5709. this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
  5710. this.options.hide = true;
  5711.  
  5712. // Begin the animation
  5713. this.custom(this.cur(), 0);
  5714. },
  5715.  
  5716. // Each step of an animation
  5717. step: function( gotoEnd ) {
  5718. var t = now(), done = true;
  5719.  
  5720. if ( gotoEnd || t >= this.options.duration + this.startTime ) {
  5721. this.now = this.end;
  5722. this.pos = this.state = 1;
  5723. this.update();
  5724.  
  5725. this.options.curAnim[ this.prop ] = true;
  5726.  
  5727. for ( var i in this.options.curAnim ) {
  5728. if ( this.options.curAnim[i] !== true ) {
  5729. done = false;
  5730. }
  5731. }
  5732.  
  5733. if ( done ) {
  5734. if ( this.options.display != null ) {
  5735. // Reset the overflow
  5736. this.elem.style.overflow = this.options.overflow;
  5737.  
  5738. // Reset the display
  5739. var old = jQuery.data(this.elem, "olddisplay");
  5740. this.elem.style.display = old ? old : this.options.display;
  5741.  
  5742. if ( jQuery.css(this.elem, "display") === "none" ) {
  5743. this.elem.style.display = "block";
  5744. }
  5745. }
  5746.  
  5747. // Hide the element if the "hide" operation was done
  5748. if ( this.options.hide ) {
  5749. jQuery(this.elem).hide();
  5750. }
  5751.  
  5752. // Reset the properties, if the item has been hidden or shown
  5753. if ( this.options.hide || this.options.show ) {
  5754. for ( var p in this.options.curAnim ) {
  5755. jQuery.style(this.elem, p, this.options.orig[p]);
  5756. }
  5757. }
  5758.  
  5759. // Execute the complete function
  5760. this.options.complete.call( this.elem );
  5761. }
  5762.  
  5763. return false;
  5764.  
  5765. } else {
  5766. var n = t - this.startTime;
  5767. this.state = n / this.options.duration;
  5768.  
  5769. // Perform the easing function, defaults to swing
  5770. var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
  5771. var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
  5772. this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
  5773. this.now = this.start + ((this.end - this.start) * this.pos);
  5774.  
  5775. // Perform the next step of the animation
  5776. this.update();
  5777. }
  5778.  
  5779. return true;
  5780. }
  5781. };
  5782.  
  5783. jQuery.extend( jQuery.fx, {
  5784. tick: function() {
  5785. var timers = jQuery.timers;
  5786.  
  5787. for ( var i = 0; i < timers.length; i++ ) {
  5788. if ( !timers[i]() ) {
  5789. timers.splice(i--, 1);
  5790. }
  5791. }
  5792.  
  5793. if ( !timers.length ) {
  5794. jQuery.fx.stop();
  5795. }
  5796. },
  5797. stop: function() {
  5798. clearInterval( timerId );
  5799. timerId = null;
  5800. },
  5801. speeds: {
  5802. slow: 600,
  5803. fast: 200,
  5804. // Default speed
  5805. _default: 400
  5806. },
  5807.  
  5808. step: {
  5809. opacity: function( fx ) {
  5810. jQuery.style(fx.elem, "opacity", fx.now);
  5811. },
  5812.  
  5813. _default: function( fx ) {
  5814. if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
  5815. fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
  5816. } else {
  5817. fx.elem[ fx.prop ] = fx.now;
  5818. }
  5819. }
  5820. }
  5821. });
  5822.  
  5823. if ( jQuery.expr && jQuery.expr.filters ) {
  5824. jQuery.expr.filters.animated = function( elem ) {
  5825. return jQuery.grep(jQuery.timers, function( fn ) {
  5826. return elem === fn.elem;
  5827. }).length;
  5828. };
  5829. }
  5830.  
  5831. function genFx( type, num ) {
  5832. var obj = {};
  5833.  
  5834. jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
  5835. obj[ this ] = type;
  5836. });
  5837.  
  5838. return obj;
  5839. }
  5840. if ( "getBoundingClientRect" in document.documentElement ) {
  5841. jQuery.fn.offset = function( options ) {
  5842. var elem = this[0];
  5843.  
  5844. if ( options ) {
  5845. return this.each(function( i ) {
  5846. jQuery.offset.setOffset( this, options, i );
  5847. });
  5848. }
  5849.  
  5850. if ( !elem || !elem.ownerDocument ) {
  5851. return null;
  5852. }
  5853.  
  5854. if ( elem === elem.ownerDocument.body ) {
  5855. return jQuery.offset.bodyOffset( elem );
  5856. }
  5857.  
  5858. var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
  5859. clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
  5860. top = box.top + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
  5861. left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
  5862.  
  5863. return { top: top, left: left };
  5864. };
  5865.  
  5866. } else {
  5867. jQuery.fn.offset = function( options ) {
  5868. var elem = this[0];
  5869.  
  5870. if ( options ) {
  5871. return this.each(function( i ) {
  5872. jQuery.offset.setOffset( this, options, i );
  5873. });
  5874. }
  5875.  
  5876. if ( !elem || !elem.ownerDocument ) {
  5877. return null;
  5878. }
  5879.  
  5880. if ( elem === elem.ownerDocument.body ) {
  5881. return jQuery.offset.bodyOffset( elem );
  5882. }
  5883.  
  5884. jQuery.offset.initialize();
  5885.  
  5886. var offsetParent = elem.offsetParent, prevOffsetParent = elem,
  5887. doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
  5888. body = doc.body, defaultView = doc.defaultView,
  5889. prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
  5890. top = elem.offsetTop, left = elem.offsetLeft;
  5891.  
  5892. while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
  5893. if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
  5894. break;
  5895. }
  5896.  
  5897. computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
  5898. top -= elem.scrollTop;
  5899. left -= elem.scrollLeft;
  5900.  
  5901. if ( elem === offsetParent ) {
  5902. top += elem.offsetTop;
  5903. left += elem.offsetLeft;
  5904.  
  5905. if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
  5906. top += parseFloat( computedStyle.borderTopWidth ) || 0;
  5907. left += parseFloat( computedStyle.borderLeftWidth ) || 0;
  5908. }
  5909.  
  5910. prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
  5911. }
  5912.  
  5913. if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
  5914. top += parseFloat( computedStyle.borderTopWidth ) || 0;
  5915. left += parseFloat( computedStyle.borderLeftWidth ) || 0;
  5916. }
  5917.  
  5918. prevComputedStyle = computedStyle;
  5919. }
  5920.  
  5921. if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
  5922. top += body.offsetTop;
  5923. left += body.offsetLeft;
  5924. }
  5925.  
  5926. if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
  5927. top += Math.max( docElem.scrollTop, body.scrollTop );
  5928. left += Math.max( docElem.scrollLeft, body.scrollLeft );
  5929. }
  5930.  
  5931. return { top: top, left: left };
  5932. };
  5933. }
  5934.  
  5935. jQuery.offset = {
  5936. initialize: function() {
  5937. var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
  5938. 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>";
  5939.  
  5940. jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
  5941.  
  5942. container.innerHTML = html;
  5943. body.insertBefore( container, body.firstChild );
  5944. innerDiv = container.firstChild;
  5945. checkDiv = innerDiv.firstChild;
  5946. td = innerDiv.nextSibling.firstChild.firstChild;
  5947.  
  5948. this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
  5949. this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
  5950.  
  5951. checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
  5952. // safari subtracts parent border width here which is 5px
  5953. this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
  5954. checkDiv.style.position = checkDiv.style.top = "";
  5955.  
  5956. innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
  5957. this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
  5958.  
  5959. this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
  5960.  
  5961. body.removeChild( container );
  5962. body = container = innerDiv = checkDiv = table = td = null;
  5963. jQuery.offset.initialize = jQuery.noop;
  5964. },
  5965.  
  5966. bodyOffset: function( body ) {
  5967. var top = body.offsetTop, left = body.offsetLeft;
  5968.  
  5969. jQuery.offset.initialize();
  5970.  
  5971. if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
  5972. top += parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0;
  5973. left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
  5974. }
  5975.  
  5976. return { top: top, left: left };
  5977. },
  5978. setOffset: function( elem, options, i ) {
  5979. // set position first, in-case top/left are set even on static elem
  5980. if ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
  5981. elem.style.position = "relative";
  5982. }
  5983. var curElem = jQuery( elem ),
  5984. curOffset = curElem.offset(),
  5985. curTop = parseInt( jQuery.curCSS( elem, "top", true ), 10 ) || 0,
  5986. curLeft = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
  5987.  
  5988. if ( jQuery.isFunction( options ) ) {
  5989. options = options.call( elem, i, curOffset );
  5990. }
  5991.  
  5992. var props = {
  5993. top: (options.top - curOffset.top) + curTop,
  5994. left: (options.left - curOffset.left) + curLeft
  5995. };
  5996. if ( "using" in options ) {
  5997. options.using.call( elem, props );
  5998. } else {
  5999. curElem.css( props );
  6000. }
  6001. }
  6002. };
  6003.  
  6004.  
  6005. jQuery.fn.extend({
  6006. position: function() {
  6007. if ( !this[0] ) {
  6008. return null;
  6009. }
  6010.  
  6011. var elem = this[0],
  6012.  
  6013. // Get *real* offsetParent
  6014. offsetParent = this.offsetParent(),
  6015.  
  6016. // Get correct offsets
  6017. offset = this.offset(),
  6018. parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
  6019.  
  6020. // Subtract element margins
  6021. // note: when an element has margin: auto the offsetLeft and marginLeft
  6022. // are the same in Safari causing offset.left to incorrectly be 0
  6023. offset.top -= parseFloat( jQuery.curCSS(elem, "marginTop", true) ) || 0;
  6024. offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
  6025.  
  6026. // Add offsetParent borders
  6027. parentOffset.top += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth", true) ) || 0;
  6028. parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
  6029.  
  6030. // Subtract the two offsets
  6031. return {
  6032. top: offset.top - parentOffset.top,
  6033. left: offset.left - parentOffset.left
  6034. };
  6035. },
  6036.  
  6037. offsetParent: function() {
  6038. return this.map(function() {
  6039. var offsetParent = this.offsetParent || document.body;
  6040. while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
  6041. offsetParent = offsetParent.offsetParent;
  6042. }
  6043. return offsetParent;
  6044. });
  6045. }
  6046. });
  6047.  
  6048.  
  6049. // Create scrollLeft and scrollTop methods
  6050. jQuery.each( ["Left", "Top"], function( i, name ) {
  6051. var method = "scroll" + name;
  6052.  
  6053. jQuery.fn[ method ] = function(val) {
  6054. var elem = this[0], win;
  6055. if ( !elem ) {
  6056. return null;
  6057. }
  6058.  
  6059. if ( val !== undefined ) {
  6060. // Set the scroll offset
  6061. return this.each(function() {
  6062. win = getWindow( this );
  6063.  
  6064. if ( win ) {
  6065. win.scrollTo(
  6066. !i ? val : jQuery(win).scrollLeft(),
  6067. i ? val : jQuery(win).scrollTop()
  6068. );
  6069.  
  6070. } else {
  6071. this[ method ] = val;
  6072. }
  6073. });
  6074. } else {
  6075. win = getWindow( elem );
  6076.  
  6077. // Return the scroll offset
  6078. return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
  6079. jQuery.support.boxModel && win.document.documentElement[ method ] ||
  6080. win.document.body[ method ] :
  6081. elem[ method ];
  6082. }
  6083. };
  6084. });
  6085.  
  6086. function getWindow( elem ) {
  6087. return ("scrollTo" in elem && elem.document) ?
  6088. elem :
  6089. elem.nodeType === 9 ?
  6090. elem.defaultView || elem.parentWindow :
  6091. false;
  6092. }
  6093. // Create innerHeight, innerWidth, outerHeight and outerWidth methods
  6094. jQuery.each([ "Height", "Width" ], function( i, name ) {
  6095.  
  6096. var type = name.toLowerCase();
  6097.  
  6098. // innerHeight and innerWidth
  6099. jQuery.fn["inner" + name] = function() {
  6100. return this[0] ?
  6101. jQuery.css( this[0], type, false, "padding" ) :
  6102. null;
  6103. };
  6104.  
  6105. // outerHeight and outerWidth
  6106. jQuery.fn["outer" + name] = function( margin ) {
  6107. return this[0] ?
  6108. jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
  6109. null;
  6110. };
  6111.  
  6112. jQuery.fn[ type ] = function( size ) {
  6113. // Get window width or height
  6114. var elem = this[0];
  6115. if ( !elem ) {
  6116. return size == null ? null : this;
  6117. }
  6118. if ( jQuery.isFunction( size ) ) {
  6119. return this.each(function( i ) {
  6120. var self = jQuery( this );
  6121. self[ type ]( size.call( this, i, self[ type ]() ) );
  6122. });
  6123. }
  6124.  
  6125. return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
  6126. // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
  6127. elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
  6128. elem.document.body[ "client" + name ] :
  6129.  
  6130. // Get document width or height
  6131. (elem.nodeType === 9) ? // is it a document
  6132. // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
  6133. Math.max(
  6134. elem.documentElement["client" + name],
  6135. elem.body["scroll" + name], elem.documentElement["scroll" + name],
  6136. elem.body["offset" + name], elem.documentElement["offset" + name]
  6137. ) :
  6138.  
  6139. // Get or set width or height on the element
  6140. size === undefined ?
  6141. // Get width or height on the element
  6142. jQuery.css( elem, type ) :
  6143.  
  6144. // Set the width or height on the element (default to pixels if value is unitless)
  6145. this.css( type, typeof size === "string" ? size : size + "px" );
  6146. };
  6147.  
  6148. });
  6149. // Expose jQuery to the global object
  6150. window.jQuery = window.$ = jQuery;
  6151.  
  6152. })(window);