1/*! 2 * jQuery JavaScript Library v1.4.4 3 * http://jquery.com/ 4 * 5 * Copyright 2010, John Resig 6 * Dual licensed under the MIT or GPL Version 2 licenses. 7 * http://jquery.org/license 8 * 9 * Includes Sizzle.js 10 * http://sizzlejs.com/ 11 * Copyright 2010, The Dojo Foundation 12 * Released under the MIT, BSD, and GPL Licenses. 13 * 14 * Date: Thu Nov 11 19:04:53 2010 -0500 15*/ 16 (function( window, undefined ) { 17 18// Use the correct document accordingly with window argument (sandbox) 19var document = window.document; 20var jQuery = (function() { 21 22// Define a local copy of jQuery 23var jQuery = function( selector, context ) { 24// The jQuery object is actually just the init constructor 'enhanced' 25returnnew jQuery.fn.init( selector, context ); 26 }, 27 28// Map over jQuery in case of overwrite 29 _jQuery = window.jQuery, 30 31// Map over the $ in case of overwrite 32 _$ = window.$, 33 34// A central reference to the root jQuery(document) 35 rootjQuery, 36 37// A simple way to check for HTML strings or ID strings 38// (both of which we optimize for) 39 quickExpr = /^(?:[^<]*(<[/w/W]+>)[^>]*$|#([/w/-]+)$)/, 40 41// Is it a simple selector 42 isSimple = /^.[^:#/[/.,]*$/, 43 44// Check if a string has a non-whitespace character in it 45 rnotwhite = //S/, 46 rwhite = //s/, 47 48// Used for trimming whitespace 49 trimLeft = /^/s+/, 50 trimRight = //s+$/, 51 52// Check for non-word characters 53 rnonword = //W/, 54 55// Check for digits 56 rdigit = //d/, 57 58// Match a standalone tag 59 rsingleTag = /^<(/w+)/s*//?>(?://1>)?$/, 60 61// JSON RegExp 62 rvalidchars = /^[/],:{}/s]*$/, 63 rvalidescape = ///(?:["////bfnrt]|u[0-9a-fA-F]{4})/g, 64 rvalidtokens = /"[^"///n/r]*"|true|false|null|-?/d+(?:/./d*)?(?:[eE][+/-]?/d+)?/g, 65 rvalidbraces = /(?:^|:|,)(?:/s*/[)+/g, 66 67// Useragent RegExp 68 rwebkit = /(webkit)[ //]([/w.]+)/, 69 ropera = /(opera)(?:.*version)?[ //]([/w.]+)/, 70 rmsie = /(msie) ([/w.]+)/, 71 rmozilla = /(mozilla)(?:.*? rv:([/w.]+))?/, 72 73// Keep a UserAgent string for use with jQuery.browser 74 userAgent = navigator.userAgent, 75 76// For matching the engine and version of the browser 77 browserMatch, 78 79// Has the ready events already been bound? 80 readyBound = false, 81 82// The functions to execute on DOM ready 83 readyList = [], 84 85// The ready event handler 86 DOMContentLoaded, 87 88// Save a reference to some core methods 89 toString = Object.prototype.toString, 90 hasOwn = Object.prototype.hasOwnProperty, 91 push = Array.prototype.push, 92 slice = Array.prototype.slice, 93 trim = String.prototype.trim, 94 indexOf = Array.prototype.indexOf, 95 96// [[Class]] -> type pairs 97 class2type = {}; 98 99 jQuery.fn = jQuery.prototype = { 100 init: function( selector, context ) { 101var match, elem, ret, doc; 102 103// Handle $(""), $(null), or $(undefined) 104if ( !selector ) { 105returnthis; 106 } 107 108// Handle $(DOMElement) 109if ( selector.nodeType ) { 110this.context = this[0] = selector; 111this.length = 1; 112returnthis; 113 } 114 115// The body element only exists once, optimize finding it 116if ( selector === "body" && !context && document.body ) { 117this.context = document; 118this[0] = document.body; 119this.selector = "body"; 120this.length = 1; 121returnthis; 122 } 123 124// Handle HTML strings 125if ( typeof selector === "string" ) { 126// Are we dealing with HTML string or an ID? 127 match = quickExpr.exec( selector ); 128 129// Verify a match, and that no context was specified for #id 130if ( match && (match[1] || !context) ) { 131 132// HANDLE: $(html) -> $(array) 133if ( match[1] ) { 134 doc = (context ? context.ownerDocument || context : document); 135 136// If a single string is passed in and it's a single tag 137// just do a createElement and skip the rest 138 ret = rsingleTag.exec( selector ); 139 140if ( ret ) { 141if ( jQuery.isPlainObject( context ) ) { 142 selector = [ document.createElement( ret[1] ) ]; 143 jQuery.fn.attr.call( selector, context, true ); 144 145 } else { 146 selector = [ doc.createElement( ret[1] ) ]; 147 } 148 149 } else { 150 ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); 151 selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; 152 } 153 154return jQuery.merge( this, selector ); 155 156// HANDLE: $("#id") 157 } else { 158 elem = document.getElementById( match[2] ); 159 160// Check parentNode to catch when Blackberry 4.6 returns 161// nodes that are no longer in the document #6963 162if ( elem && elem.parentNode ) { 163// Handle the case where IE and Opera return items 164// by name instead of ID 165if ( elem.id !== match[2] ) { 166return rootjQuery.find( selector ); 167 } 168 169// Otherwise, we inject the element directly into the jQuery object 170this.length = 1; 171this[0] = elem; 172 } 173 174this.context = document; 175this.selector = selector; 176returnthis; 177 } 178 179// HANDLE: $("TAG") 180 } elseif ( !context && !rnonword.test( selector ) ) { 181this.selector = selector; 182this.context = document; 183 selector = document.getElementsByTagName( selector ); 184return jQuery.merge( this, selector ); 185 186// HANDLE: $(expr, $(...)) 187 } elseif ( !context || context.jquery ) { 188return (context || rootjQuery).find( selector ); 189 190// HANDLE: $(expr, context) 191// (which is just equivalent to: $(context).find(expr) 192 } else { 193return jQuery( context ).find( selector ); 194 } 195 196// HANDLE: $(function) 197// Shortcut for document ready 198 } elseif ( jQuery.isFunction( selector ) ) { 199return rootjQuery.ready( selector ); 200 } 201 202if (selector.selector !== undefined) { 203this.selector = selector.selector; 204this.context = selector.context; 205 } 206 207return jQuery.makeArray( selector, this ); 208 }, 209 210// Start with an empty selector 211 selector: "", 212 213// The current version of jQuery being used 214 jquery: "1.4.4", 215 216// The default length of a jQuery object is 0 217 length: 0, 218 219// The number of elements contained in the matched element set 220 size: function() { 221returnthis.length; 222 }, 223 224 toArray: function() { 225return slice.call( this, 0 ); 226 }, 227 228// Get the Nth element in the matched element set OR 229// Get the whole matched element set as a clean array 230 get: function( num ) { 231return num == null ? 232 233// Return a 'clean' array 234this.toArray() : 235 236// Return just the object 237 ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); 238 }, 239 240// Take an array of elements and push it onto the stack 241// (returning the new matched element set) 242 pushStack: function( elems, name, selector ) { 243// Build a new jQuery matched element set 244var ret = jQuery(); 245 246if ( jQuery.isArray( elems ) ) { 247 push.apply( ret, elems ); 248 249 } else { 250 jQuery.merge( ret, elems ); 251 } 252 253// Add the old object onto the stack (as a reference) 254 ret.prevObject = this; 255 256 ret.context = this.context; 257 258if ( name === "find" ) { 259 ret.selector = this.selector + (this.selector ? " " : "") + selector; 260 } elseif ( name ) { 261 ret.selector = this.selector + "." + name + "(" + selector + ")"; 262 } 263 264// Return the newly-formed element set 265return ret; 266 }, 267 268// Execute a callback for every element in the matched set. 269// (You can seed the arguments with an array of args, but this is 270// only used internally.) 271 each: function( callback, args ) { 272return jQuery.each( this, callback, args ); 273 }, 274 275 ready: function( fn ) { 276// Attach the listeners 277 jQuery.bindReady(); 278 279// If the DOM is already ready 280if ( jQuery.isReady ) { 281// Execute the function immediately 282 fn.call( document, jQuery ); 283 284// Otherwise, remember the function for later 285 } elseif ( readyList ) { 286// Add the function to the wait list 287 readyList.push( fn ); 288 } 289 290returnthis; 291 }, 292 293 eq: function( i ) { 294return i === -1 ? 295this.slice( i ) : 296this.slice( i, +i + 1 ); 297 }, 298 299 first: function() { 300returnthis.eq( 0 ); 301 }, 302 303 last: function() { 304returnthis.eq( -1 ); 305 }, 306 307 slice: function() { 308returnthis.pushStack( slice.apply( this, arguments ), 309 "slice", slice.call(arguments).join(",") ); 310 }, 311 312 map: function( callback ) { 313returnthis.pushStack( jQuery.map(this, function( elem, i ) { 314return callback.call( elem, i, elem ); 315 })); 316 }, 317 318 end: function() { 319returnthis.prevObject || jQuery(null); 320 }, 321 322// For internal use only. 323// Behaves like an Array's method, not like a jQuery method. 324 push: push, 325 sort: [].sort, 326 splice: [].splice 327}; 328 329// Give the init function the jQuery prototype for later instantiation 330 jQuery.fn.init.prototype = jQuery.fn; 331 332 jQuery.extend = jQuery.fn.extend = function() { 333var options, name, src, copy, copyIsArray, clone, 334 target = arguments[0] || {}, 335 i = 1, 336 length = arguments.length, 337 deep = false; 338 339// Handle a deep copy situation 340if ( typeof target === "boolean" ) { 341 deep = target; 342 target = arguments[1] || {}; 343// skip the boolean and the target 344 i = 2; 345 } 346 347// Handle case when target is a string or something (possible in deep copy) 348if ( typeof target !== "object" && !jQuery.isFunction(target) ) { 349 target = {}; 350 } 351 352// extend jQuery itself if only one argument is passed 353if ( length === i ) { 354 target = this; 355 --i; 356 } 357 358for ( ; i < length; i++ ) { 359// Only deal with non-null/undefined values 360if ( (options = arguments[ i ]) != null ) { 361// Extend the base object 362for ( name in options ) { 363 src = target[ name ]; 364 copy = options[ name ]; 365 366// Prevent never-ending loop 367if ( target === copy ) { 368continue; 369 } 370 371// Recurse if we're merging plain objects or arrays 372if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { 373if ( copyIsArray ) { 374 copyIsArray = false; 375 clone = src && jQuery.isArray(src) ? src : []; 376 377 } else { 378 clone = src && jQuery.isPlainObject(src) ? src : {}; 379 } 380 381// Never move original objects, clone them 382 target[ name ] = jQuery.extend( deep, clone, copy ); 383 384// Don't bring in undefined values 385 } elseif ( copy !== undefined ) { 386 target[ name ] = copy; 387 } 388 } 389 } 390 } 391 392// Return the modified object 393return target; 394}; 395 396jQuery.extend({ 397 noConflict: function( deep ) { 398 window.$ = _$; 399 400if ( deep ) { 401 window.jQuery = _jQuery; 402 } 403 404return jQuery; 405 }, 406 407// Is the DOM ready to be used? Set to true once it occurs. 408 isReady: false, 409 410// A counter to track how many items to wait for before 411// the ready event fires. See #6781 412 readyWait: 1, 413 414// Handle when the DOM is ready 415 ready: function( wait ) { 416// A third-party is pushing the ready event forwards 417if ( wait === true ) { 418 jQuery.readyWait--; 419 } 420 421// Make sure that the DOM is not already loaded 422if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) { 423// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). 424if ( !document.body ) { 425return setTimeout( jQuery.ready, 1 ); 426 } 427 428// Remember that the DOM is ready 429 jQuery.isReady = true; 430 431// If a normal DOM Ready event fired, decrement, and wait if need be 432if ( wait !== true && --jQuery.readyWait > 0 ) { 433return; 434 } 435 436// If there are functions bound, to execute 437if ( readyList ) { 438// Execute all of them 439var fn, 440 i = 0, 441 ready = readyList; 442 443// Reset the list of functions 444 readyList = null; 445 446while ( (fn = ready[ i++ ]) ) { 447 fn.call( document, jQuery ); 448 } 449 450// Trigger any bound ready events 451if ( jQuery.fn.trigger ) { 452 jQuery( document ).trigger( "ready" ).unbind( "ready" ); 453 } 454 } 455 } 456 }, 457 458 bindReady: function() { 459if ( readyBound ) { 460return; 461 } 462 463 readyBound = true; 464 465// Catch cases where $(document).ready() is called after the 466// browser event has already occurred. 467if ( document.readyState === "complete" ) { 468// Handle it asynchronously to allow scripts the opportunity to delay ready 469return setTimeout( jQuery.ready, 1 ); 470 } 471 472// Mozilla, Opera and webkit nightlies currently support this event 473if ( document.addEventListener ) { 474// Use the handy event callback 475 document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); 476 477// A fallback to window.onload, that will always work 478 window.addEventListener( "load", jQuery.ready, false ); 479 480// If IE event model is used 481 } elseif ( document.attachEvent ) { 482// ensure firing before onload, 483// maybe late but safe also for iframes 484 document.attachEvent("onreadystatechange", DOMContentLoaded); 485 486// A fallback to window.onload, that will always work 487 window.attachEvent( "onload", jQuery.ready ); 488 489// If IE and not a frame 490// continually check to see if the document is ready 491var toplevel = false; 492 493try { 494 toplevel = window.frameElement == null; 495 } catch(e) {} 496 497if ( document.documentElement.doScroll && toplevel ) { 498 doScrollCheck(); 499 } 500 } 501 }, 502 503// See test/unit/core.js for details concerning isFunction. 504// Since version 1.3, DOM methods and functions like alert 505// aren't supported. They return false on IE (#2968). 506 isFunction: function( obj ) { 507return jQuery.type(obj) === "function"; 508 }, 509 510 isArray: Array.isArray || function( obj ) { 511return jQuery.type(obj) === "array"; 512 }, 513 514// A crude way of determining if an object is a window 515 isWindow: function( obj ) { 516return obj && typeof obj === "object" && "setInterval" in obj; 517 }, 518 519 isNaN: function( obj ) { 520return obj == null || !rdigit.test( obj ) || isNaN( obj ); 521 }, 522 523 type: function( obj ) { 524return obj == null ? 525 String( obj ) : 526 class2type[ toString.call(obj) ] || "object"; 527 }, 528 529 isPlainObject: function( obj ) { 530// Must be an Object. 531// Because of IE, we also have to check the presence of the constructor property. 532// Make sure that DOM nodes and window objects don't pass through, as well 533if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { 534returnfalse; 535 } 536 537// Not own constructor property must be Object 538if ( obj.constructor && 539 !hasOwn.call(obj, "constructor") && 540 !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { 541returnfalse; 542 } 543 544// Own properties are enumerated firstly, so to speed up, 545// if last one is own, then all properties are own. 546 547var key; 548for ( key in obj ) {} 549 550return key === undefined || hasOwn.call( obj, key ); 551 }, 552 553 isEmptyObject: function( obj ) { 554for ( var name in obj ) { 555returnfalse; 556 } 557returntrue; 558 }, 559 560 error: function( msg ) { 561throw msg; 562 }, 563 564 parseJSON: function( data ) { 565if ( typeof data !== "string" || !data ) { 566returnnull; 567 } 568 569// Make sure leading/trailing whitespace is removed (IE can't handle it) 570 data = jQuery.trim( data ); 571 572// Make sure the incoming data is actual JSON 573// Logic borrowed from http://json.org/json2.js 574if ( rvalidchars.test(data.replace(rvalidescape, "@") 575 .replace(rvalidtokens, "]") 576 .replace(rvalidbraces, "")) ) { 577 578// Try to use the native JSON parser first 579return window.JSON && window.JSON.parse ? 580 window.JSON.parse( data ) : 581 (new Function("return " + data))(); 582 583 } else { 584 jQuery.error( "Invalid JSON: " + data ); 585 } 586 }, 587 588 noop: function() {}, 589 590// Evalulates a script in a global context 591 globalEval: function( data ) { 592if ( data && rnotwhite.test(data) ) { 593// Inspired by code by Andrea Giammarchi 594// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html 595var head = document.getElementsByTagName("head")[0] || document.documentElement, 596 script = document.createElement("script"); 597 598 script.type = "text/javascript"; 599 600if ( jQuery.support.scriptEval ) { 601 script.appendChild( document.createTextNode( data ) ); 602 } else { 603 script.text = data; 604 } 605 606// Use insertBefore instead of appendChild to circumvent an IE6 bug. 607// This arises when a base node is used (#2709). 608 head.insertBefore( script, head.firstChild ); 609 head.removeChild( script ); 610 } 611 }, 612 613 nodeName: function( elem, name ) { 614return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); 615 }, 616 617// args is for internal usage only 618 each: function( object, callback, args ) { 619var name, i = 0, 620 length = object.length, 621 isObj = length === undefined || jQuery.isFunction(object); 622 623if ( args ) { 624if ( isObj ) { 625for ( name in object ) { 626if ( callback.apply( object[ name ], args ) === false ) { 627break; 628 } 629 } 630 } else { 631for ( ; i < length; ) { 632if ( callback.apply( object[ i++ ], args ) === false ) { 633break; 634 } 635 } 636 } 637 638// A special, fast, case for the most common use of each 639 } else { 640if ( isObj ) { 641for ( name in object ) { 642if ( callback.call( object[ name ], name, object[ name ] ) === false ) { 643break; 644 } 645 } 646 } else { 647for ( var value = object[0]; 648 i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} 649 } 650 } 651 652return object; 653 }, 654 655// Use native String.trim function wherever possible 656 trim: trim ? 657function( text ) { 658return text == null ? 659 "" : 660 trim.call( text ); 661 } : 662 663// Otherwise use our own trimming functionality 664function( text ) { 665return text == null ? 666 "" : 667 text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); 668 }, 669 670// results is for internal usage only 671 makeArray: function( array, results ) { 672var ret = results || []; 673 674if ( array != null ) { 675// The window, strings (and functions) also have 'length' 676// The extra typeof function check is to prevent crashes 677// in Safari 2 (See: #3039) 678// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 679var type = jQuery.type(array); 680 681if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { 682 push.call( ret, array ); 683 } else { 684 jQuery.merge( ret, array ); 685 } 686 } 687 688return ret; 689 }, 690 691 inArray: function( elem, array ) { 692if ( array.indexOf ) { 693return array.indexOf( elem ); 694 } 695 696for ( var i = 0, length = array.length; i < length; i++ ) { 697if ( array[ i ] === elem ) { 698return i; 699 } 700 } 701 702return -1; 703 }, 704 705 merge: function( first, second ) { 706var i = first.length, 707 j = 0; 708 709if ( typeof second.length === "number" ) { 710for ( var l = second.length; j < l; j++ ) { 711 first[ i++ ] = second[ j ]; 712 } 713 714 } else { 715while ( second[j] !== undefined ) { 716 first[ i++ ] = second[ j++ ]; 717 } 718 } 719 720 first.length = i; 721 722return first; 723 }, 724 725 grep: function( elems, callback, inv ) { 726var ret = [], retVal; 727 inv = !!inv; 728 729// Go through the array, only saving the items 730// that pass the validator function 731for ( var i = 0, length = elems.length; i < length; i++ ) { 732 retVal = !!callback( elems[ i ], i ); 733if ( inv !== retVal ) { 734 ret.push( elems[ i ] ); 735 } 736 } 737 738return ret; 739 }, 740 741// arg is for internal usage only 742 map: function( elems, callback, arg ) { 743var ret = [], value; 744 745// Go through the array, translating each of the items to their 746// new value (or values). 747for ( var i = 0, length = elems.length; i < length; i++ ) { 748 value = callback( elems[ i ], i, arg ); 749 750if ( value != null ) { 751 ret[ ret.length ] = value; 752 } 753 } 754 755return ret.concat.apply( [], ret ); 756 }, 757 758// A global GUID counter for objects 759 guid: 1, 760 761 proxy: function( fn, proxy, thisObject ) { 762if ( arguments.length === 2 ) { 763if ( typeof proxy === "string" ) { 764 thisObject = fn; 765 fn = thisObject[ proxy ]; 766 proxy = undefined; 767 768 } elseif ( proxy && !jQuery.isFunction( proxy ) ) { 769 thisObject = proxy; 770 proxy = undefined; 771 } 772 } 773 774if ( !proxy && fn ) { 775 proxy = function() { 776return fn.apply( thisObject || this, arguments ); 777 }; 778 } 779 780// Set the guid of unique handler to the same of original handler, so it can be removed 781if ( fn ) { 782 proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; 783 } 784 785// So proxy can be declared as an argument 786return proxy; 787 }, 788 789// Mutifunctional method to get and set values to a collection 790// The value/s can be optionally by executed if its a function 791 access: function( elems, key, value, exec, fn, pass ) { 792var length = elems.length; 793 794// Setting many attributes 795if ( typeof key === "object" ) { 796for ( var k in key ) { 797 jQuery.access( elems, k, key[k], exec, fn, value ); 798 } 799return elems; 800 } 801 802// Setting one attribute 803if ( value !== undefined ) { 804// Optionally, function values get executed if exec is true 805 exec = !pass && exec && jQuery.isFunction(value); 806 807for ( var i = 0; i < length; i++ ) { 808 fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); 809 } 810 811return elems; 812 } 813 814// Getting an attribute 815return length ? fn( elems[0], key ) : undefined; 816 }, 817 818 now: function() { 819return (new Date()).getTime(); 820 }, 821 822// Use of jQuery.browser is frowned upon. 823// More details: http://docs.jquery.com/Utilities/jQuery.browser 824 uaMatch: function( ua ) { 825 ua = ua.toLowerCase(); 826 827var match = rwebkit.exec( ua ) || 828 ropera.exec( ua ) || 829 rmsie.exec( ua ) || 830 ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || 831 []; 832 833return { browser: match[1] || "", version: match[2] || "0" }; 834 }, 835 836 browser: {} 837}); 838 839// Populate the class2type map 840 jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { 841 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 842}); 843 844 browserMatch = jQuery.uaMatch( userAgent ); 845if ( browserMatch.browser ) { 846 jQuery.browser[ browserMatch.browser ] = true; 847 jQuery.browser.version = browserMatch.version; 848} 849 850// Deprecated, use jQuery.browser.webkit instead 851if ( jQuery.browser.webkit ) { 852 jQuery.browser.safari = true; 853} 854 855if ( indexOf ) { 856 jQuery.inArray = function( elem, array ) { 857return indexOf.call( array, elem ); 858 }; 859} 860 861// Verify that /s matches non-breaking spaces 862// (IE fails on this test) 863if ( !rwhite.test( "/xA0" ) ) { 864 trimLeft = /^[/s/xA0]+/; 865 trimRight = /[/s/xA0]+$/; 866} 867 868// All jQuery objects should point back to these 869 rootjQuery = jQuery(document); 870 871// Cleanup functions for the document ready method 872if ( document.addEventListener ) { 873 DOMContentLoaded = function() { 874 document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); 875 jQuery.ready(); 876 }; 877 878 } elseif ( document.attachEvent ) { 879 DOMContentLoaded = function() { 880// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). 881if ( document.readyState === "complete" ) { 882 document.detachEvent( "onreadystatechange", DOMContentLoaded ); 883 jQuery.ready(); 884 } 885 }; 886} 887 888// The DOM ready check for Internet Explorer 889function doScrollCheck() { 890if ( jQuery.isReady ) { 891return; 892 } 893 894try { 895// If IE is used, use the trick by Diego Perini 896// http://javascript.nwbox.com/IEContentLoaded/ 897 document.documentElement.doScroll("left"); 898 } catch(e) { 899 setTimeout( doScrollCheck, 1 ); 900return; 901 } 902 903// and execute any waiting functions 904 jQuery.ready(); 905} 906 907// Expose jQuery to the global object 908return (window.jQuery = window.$ = jQuery); 909 910})(); 911 912 913 (function() { 914 915 jQuery.support = {}; 916 917var root = document.documentElement, 918 script = document.createElement("script"), 919 div = document.createElement("div"), 920 id = "script" + jQuery.now(); 921 922 div.style.display = "none"; 923 div.innerHTML = "
a"; 924 925var all = div.getElementsByTagName("*"), 926 a = div.getElementsByTagName("a")[0], 927 select = document.createElement("select"), 928 opt = select.appendChild( document.createElement("option") ); 929 930// Can't get basic test support 931if ( !all || !all.length || !a ) { 932return; 933 } 934 935 jQuery.support = { 936// IE strips leading whitespace when .innerHTML is used 937 leadingWhitespace: div.firstChild.nodeType === 3, 938 939// Make sure that tbody elements aren't automatically inserted 940// IE will insert them into empty tables 941 tbody: !div.getElementsByTagName("tbody").length, 942 943// Make sure that link elements get serialized correctly by innerHTML 944// This requires a wrapper element in IE 945 htmlSerialize: !!div.getElementsByTagName("link").length, 946 947// Get the style information from getAttribute 948// (IE uses .cssText insted) 949 style: /red/.test( a.getAttribute("style") ), 950 951// Make sure that URLs aren't manipulated 952// (IE normalizes it by default) 953 hrefNormalized: a.getAttribute("href") === "/a", 954 955// Make sure that element opacity exists 956// (IE uses filter instead) 957// Use a regex to work around a WebKit issue. See #5145 958 opacity: /^0.55$/.test( a.style.opacity ), 959 960// Verify style float existence 961// (IE uses styleFloat instead of cssFloat) 962 cssFloat: !!a.style.cssFloat, 963 964// Make sure that if no value is specified for a checkbox 965// that it defaults to "on". 966// (WebKit defaults to "" instead) 967 checkOn: div.getElementsByTagName("input")[0].value === "on", 968 969// Make sure that a selected-by-default option has a working selected property. 970// (WebKit defaults to false instead of true, IE too, if it's in an optgroup) 971 optSelected: opt.selected, 972 973// Will be defined later 974 deleteExpando: true, 975 optDisabled: false, 976 checkClone: false, 977 scriptEval: false, 978 noCloneEvent: true, 979 boxModel: null, 980 inlineBlockNeedsLayout: false, 981 shrinkWrapBlocks: false, 982 reliableHiddenOffsets: true 983 }; 984 985// Make sure that the options inside disabled selects aren't marked as disabled 986// (WebKit marks them as diabled) 987 select.disabled = true; 988 jQuery.support.optDisabled = !opt.disabled; 989 990 script.type = "text/javascript"; 991try { 992 script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); 993 } catch(e) {} 994 995 root.insertBefore( script, root.firstChild ); 996 997// Make sure that the execution of code works by injecting a script 998// tag with appendChild/createTextNode 999// (IE doesn't support this, fails, and uses .text instead)1000if ( window[ id ] ) {1001 jQuery.support.scriptEval = true;1002delete window[ id ];1003 }10041005// Test to see if it's possible to delete an expando from an element1006// Fails in Internet Explorer1007try {1008delete script.test;10091010 } catch(e) {1011 jQuery.support.deleteExpando = false;1012 }10131014 root.removeChild( script );10151016if ( div.attachEvent && div.fireEvent ) {1017 div.attachEvent("onclick", function click() {1018// Cloning a node shouldn't copy over any1019// bound event handlers (IE does this)1020 jQuery.support.noCloneEvent = false;1021 div.detachEvent("onclick", click);1022 });1023 div.cloneNode(true).fireEvent("onclick");1024 }10251026 div = document.createElement("div");1027 div.innerHTML = "";10281029var fragment = document.createDocumentFragment();1030 fragment.appendChild( div.firstChild );10311032// WebKit doesn't clone checked state correctly in fragments1033 jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;10341035// Figure out if the W3C box model works as expected1036// document.body must exist before we can do this1037 jQuery(function() {1038var div = document.createElement("div");1039 div.style.width = div.style.paddingLeft = "1px";10401041 document.body.appendChild( div );1042 jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;10431044if ( "zoom" in div.style ) {1045// Check if natively block-level elements act like inline-block1046// elements when setting their display to 'inline' and giving1047// them layout1048// (IE < 8 does this)1049 div.style.display = "inline";1050 div.style.zoom = 1;1051 jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;10521053// Check if elements with layout shrink-wrap their children1054// (IE 6 does this)1055 div.style.display = "";1056 div.innerHTML = "";1057 jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;1058 }10591060 div.innerHTML = "
t
";1061var tds = div.getElementsByTagName("td");10621063// Check if table cells still have offsetWidth/Height when they are set1064// to display:none and there are still other visible table cells in a1065// table row; if so, offsetWidth/Height are not reliable for use when1066// determining if an element has been hidden directly using1067// display:none (it is still safe to use offsets if a parent element is1068// hidden; don safety goggles and see bug #4512 for more information).1069// (only IE 8 fails this test)1070 jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;10711072 tds[0].style.display = "";1073 tds[1].style.display = "none";10741075// Check if empty table cells still have offsetWidth/Height1076// (IE < 8 fail this test)1077 jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;1078 div.innerHTML = "";10791080 document.body.removeChild( div ).style.display = "none";1081 div = tds = null;1082 });10831084// Technique from Juriy Zaytsev1085// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/1086var eventSupported = function( eventName ) {1087var el = document.createElement("div");1088 eventName = "on" + eventName;10891090var isSupported = (eventName in el);1091if ( !isSupported ) {1092 el.setAttribute(eventName, "return;");1093 isSupported = typeof el[eventName] === "function";1094 }1095 el = null;10961097return isSupported;1098 };10991100 jQuery.support.submitBubbles = eventSupported("submit");1101 jQuery.support.changeBubbles = eventSupported("change");11021103// release memory in IE1104 root = script = div = all = a = null;1105})();1106110711081109var windowData = {},1110 rbrace = /^(?:/{.*/}|/[.*/])$/;11111112jQuery.extend({1113 cache: {},11141115// Please use with caution1116 uuid: 0,11171118// Unique for each copy of jQuery on the page 1119 expando: "jQuery" + jQuery.now(),11201121// The following elements throw uncatchable exceptions if you1122// attempt to add expando properties to them.1123 noData: {1124 "embed": true,1125// Ban all objects except for Flash (which handle expandos)1126 "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",1127 "applet": true1128 },11291130 data: function( elem, name, data ) {1131if ( !jQuery.acceptData( elem ) ) {1132return;1133 }11341135 elem = elem == window ?1136 windowData :1137 elem;11381139var isNode = elem.nodeType,1140 id = isNode ? elem[ jQuery.expando ] : null,1141 cache = jQuery.cache, thisCache;11421143if ( isNode && !id && typeof name === "string" && data === undefined ) {1144return;1145 }11461147// Get the data from the object directly1148if ( !isNode ) {1149 cache = elem;11501151// Compute a unique ID for the element1152 } elseif ( !id ) {1153 elem[ jQuery.expando ] = id = ++jQuery.uuid;1154 }11551156// Avoid generating a new cache unless none exists and we1157// want to manipulate it.1158if ( typeof name === "object" ) {1159if ( isNode ) {1160 cache[ id ] = jQuery.extend(cache[ id ], name);11611162 } else {1163 jQuery.extend( cache, name );1164 }11651166 } elseif ( isNode && !cache[ id ] ) {1167 cache[ id ] = {};1168 }11691170 thisCache = isNode ? cache[ id ] : cache;11711172// Prevent overriding the named cache with undefined values1173if ( data !== undefined ) {1174 thisCache[ name ] = data;1175 }11761177returntypeof name === "string" ? thisCache[ name ] : thisCache;1178 },11791180 removeData: function( elem, name ) {1181if ( !jQuery.acceptData( elem ) ) {1182return;1183 }11841185 elem = elem == window ?1186 windowData :1187 elem;11881189var isNode = elem.nodeType,1190 id = isNode ? elem[ jQuery.expando ] : elem,1191 cache = jQuery.cache,1192 thisCache = isNode ? cache[ id ] : id;11931194// If we want to remove a specific section of the element's data1195if ( name ) {1196if ( thisCache ) {1197// Remove the section of cache data1198delete thisCache[ name ];11991200// If we've removed all the data, remove the element's cache1201if ( isNode && jQuery.isEmptyObject(thisCache) ) {1202 jQuery.removeData( elem );1203 }1204 }12051206// Otherwise, we want to remove all of the element's data1207 } else {1208if ( isNode && jQuery.support.deleteExpando ) {1209delete elem[ jQuery.expando ];12101211 } elseif ( elem.removeAttribute ) {1212 elem.removeAttribute( jQuery.expando );12131214// Completely remove the data cache1215 } elseif ( isNode ) {1216delete cache[ id ];12171218// Remove all fields from the object1219 } else {1220for ( var n in elem ) {1221delete elem[ n ];1222 }1223 }1224 }1225 },12261227// A method for determining if a DOM node can handle the data expando1228 acceptData: function( elem ) {1229if ( elem.nodeName ) {1230var match = jQuery.noData[ elem.nodeName.toLowerCase() ];12311232if ( match ) {1233return !(match === true || elem.getAttribute("classid") !== match);1234 }1235 }12361237returntrue;1238 }1239});12401241jQuery.fn.extend({1242 data: function( key, value ) {1243var data = null;12441245if ( typeof key === "undefined" ) {1246if ( this.length ) {1247var attr = this[0].attributes, name;1248 data = jQuery.data( this[0] );12491250for ( var i = 0, l = attr.length; i < l; i++ ) {1251 name = attr[i].name;12521253if ( name.indexOf( "data-" ) === 0 ) {1254 name = name.substr( 5 );1255 dataAttr( this[0], name, data[ name ] );1256 }1257 }1258 }12591260return data;12611262 } elseif ( typeof key === "object" ) {1263returnthis.each(function() {1264 jQuery.data( this, key );1265 });1266 }12671268var parts = key.split(".");1269 parts[1] = parts[1] ? "." + parts[1] : "";12701271if ( value === undefined ) {1272 data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);12731274// Try to fetch any internally stored data first1275if ( data === undefined && this.length ) {1276 data = jQuery.data( this[0], key );1277 data = dataAttr( this[0], key, data );1278 }12791280return data === undefined && parts[1] ?1281this.data( parts[0] ) :1282 data;12831284 } else {1285returnthis.each(function() {1286var $this = jQuery( this ),1287 args = [ parts[0], value ];12881289 $this.triggerHandler( "setData" + parts[1] + "!", args );1290 jQuery.data( this, key, value );1291 $this.triggerHandler( "changeData" + parts[1] + "!", args );1292 });1293 }1294 },12951296 removeData: function( key ) {1297returnthis.each(function() {1298 jQuery.removeData( this, key );1299 });1300 }1301});13021303function dataAttr( elem, key, data ) {1304// If nothing was found internally, try to fetch any1305// data from the HTML5 data-* attribute1306if ( data === undefined && elem.nodeType === 1 ) {1307 data = elem.getAttribute( "data-" + key );13081309if ( typeof data === "string" ) {1310try {1311 data = data === "true" ? true :1312 data === "false" ? false :1313 data === "null" ? null :1314 !jQuery.isNaN( data ) ? parseFloat( data ) :1315 rbrace.test( data ) ? jQuery.parseJSON( data ) :1316 data;1317 } catch( e ) {}13181319// Make sure we set the data so it isn't changed later1320 jQuery.data( elem, key, data );13211322 } else {1323 data = undefined;1324 }1325 }13261327return data;1328}13291330133113321333jQuery.extend({1334 queue: function( elem, type, data ) {1335if ( !elem ) {1336return;1337 }13381339 type = (type || "fx") + "queue";1340var q = jQuery.data( elem, type );13411342// Speed up dequeue by getting out quickly if this is just a lookup1343if ( !data ) {1344return q || [];1345 }13461347if ( !q || jQuery.isArray(data) ) {1348 q = jQuery.data( elem, type, jQuery.makeArray(data) );13491350 } else {1351 q.push( data );1352 }13531354return q;1355 },13561357 dequeue: function( elem, type ) {1358 type = type || "fx";13591360var queue = jQuery.queue( elem, type ),1361 fn = queue.shift();13621363// If the fx queue is dequeued, always remove the progress sentinel1364if ( fn === "inprogress" ) {1365 fn = queue.shift();1366 }13671368if ( fn ) {1369// Add a progress sentinel to prevent the fx queue from being1370// automatically dequeued1371if ( type === "fx" ) {1372 queue.unshift("inprogress");1373 }13741375 fn.call(elem, function() {1376 jQuery.dequeue(elem, type);1377 });1378 }1379 }1380});13811382jQuery.fn.extend({1383 queue: function( type, data ) {1384if ( typeof type !== "string" ) {1385 data = type;1386 type = "fx";1387 }13881389if ( data === undefined ) {1390return jQuery.queue( this[0], type );1391 }1392returnthis.each(function( i ) {1393var queue = jQuery.queue( this, type, data );13941395if ( type === "fx" && queue[0] !== "inprogress" ) {1396 jQuery.dequeue( this, type );1397 }1398 });1399 },1400 dequeue: function( type ) {1401returnthis.each(function() {1402 jQuery.dequeue( this, type );1403 });1404 },14051406// Based off of the plugin by Clint Helfers, with permission.1407// http://blindsignals.com/index.php/2009/07/jquery-delay/1408 delay: function( time, type ) {1409 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;1410 type = type || "fx";14111412returnthis.queue( type, function() {1413var elem = this;1414 setTimeout(function() {1415 jQuery.dequeue( elem, type );1416 }, time );1417 });1418 },14191420 clearQueue: function( type ) {1421returnthis.queue( type || "fx", [] );1422 }1423});14241425142614271428var rclass = /[/n/t]/g,1429 rspaces = //s+/,1430 rreturn = //r/g,1431 rspecialurl = /^(?:href|src|style)$/,1432 rtype = /^(?:button|input)$/i,1433 rfocusable = /^(?:button|input|object|select|textarea)$/i,1434 rclickable = /^a(?:rea)?$/i,1435 rradiocheck = /^(?:radio|checkbox)$/i;14361437 jQuery.props = {1438 "for": "htmlFor",1439 "class": "className",1440 readonly: "readOnly",1441 maxlength: "maxLength",1442 cellspacing: "cellSpacing",1443 rowspan: "rowSpan",1444 colspan: "colSpan",1445 tabindex: "tabIndex",1446 usemap: "useMap",1447 frameborder: "frameBorder"1448};14491450jQuery.fn.extend({1451 attr: function( name, value ) {1452return jQuery.access( this, name, value, true, jQuery.attr );1453 },14541455 removeAttr: function( name, fn ) {1456returnthis.each(function(){1457 jQuery.attr( this, name, "" );1458if ( this.nodeType === 1 ) {1459this.removeAttribute( name );1460 }1461 });1462 },14631464 addClass: function( value ) {1465if ( jQuery.isFunction(value) ) {1466returnthis.each(function(i) {1467var self = jQuery(this);1468 self.addClass( value.call(this, i, self.attr("class")) );1469 });1470 }14711472if ( value && typeof value === "string" ) {1473var classNames = (value || "").split( rspaces );14741475for ( var i = 0, l = this.length; i < l; i++ ) {1476var elem = this[i];14771478if ( elem.nodeType === 1 ) {1479if ( !elem.className ) {1480 elem.className = value;14811482 } else {1483var className = " " + elem.className + " ",1484 setClass = elem.className;14851486for ( var c = 0, cl = classNames.length; c < cl; c++ ) {1487if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {1488 setClass += " " + classNames[c];1489 }1490 }1491 elem.className = jQuery.trim( setClass );1492 }1493 }1494 }1495 }14961497returnthis;1498 },14991500 removeClass: function( value ) {1501if ( jQuery.isFunction(value) ) {1502returnthis.each(function(i) {1503var self = jQuery(this);1504 self.removeClass( value.call(this, i, self.attr("class")) );1505 });1506 }15071508if ( (value && typeof value === "string") || value === undefined ) {1509var classNames = (value || "").split( rspaces );15101511for ( var i = 0, l = this.length; i < l; i++ ) {1512var elem = this[i];15131514if ( elem.nodeType === 1 && elem.className ) {1515if ( value ) {1516var className = (" " + elem.className + " ").replace(rclass, " ");1517for ( var c = 0, cl = classNames.length; c < cl; c++ ) {1518 className = className.replace(" " + classNames[c] + " ", " ");1519 }1520 elem.className = jQuery.trim( className );15211522 } else {1523 elem.className = "";1524 }1525 }1526 }1527 }15281529returnthis;1530 },15311532 toggleClass: function( value, stateVal ) {1533var type = typeof value,1534 isBool = typeof stateVal === "boolean";15351536if ( jQuery.isFunction( value ) ) {1537returnthis.each(function(i) {1538var self = jQuery(this);1539 self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );1540 });1541 }15421543returnthis.each(function() {1544if ( type === "string" ) {1545// toggle individual class names1546var className,1547 i = 0,1548 self = jQuery( this ),1549 state = stateVal,1550 classNames = value.split( rspaces );15511552while ( (className = classNames[ i++ ]) ) {1553// check each className given, space seperated list1554 state = isBool ? state : !self.hasClass( className );1555 self[ state ? "addClass" : "removeClass" ]( className );1556 }15571558 } elseif ( type === "undefined" || type === "boolean" ) {1559if ( this.className ) {1560// store className if set1561 jQuery.data( this, "__className__", this.className );1562 }15631564// toggle whole className1565this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";1566 }1567 });1568 },15691570 hasClass: function( selector ) {1571var className = " " + selector + " ";1572for ( var i = 0, l = this.length; i < l; i++ ) {1573if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {1574returntrue;1575 }1576 }15771578returnfalse;1579 },15801581 val: function( value ) {1582if ( !arguments.length ) {1583var elem = this[0];15841585if ( elem ) {1586if ( jQuery.nodeName( elem, "option" ) ) {1587// attributes.value is undefined in Blackberry 4.7 but1588// uses .value. See #69321589var val = elem.attributes.value;1590return !val || val.specified ? elem.value : elem.text;1591 }15921593// We need to handle select boxes special1594if ( jQuery.nodeName( elem, "select" ) ) {1595var index = elem.selectedIndex,1596 values = [],1597 options = elem.options,1598 one = elem.type === "select-one";15991600// Nothing was selected1601if ( index < 0 ) {1602returnnull;1603 }16041605// Loop through all the selected options1606for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {1607var option = options[ i ];16081609// Don't return options that are disabled or in a disabled optgroup1610if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && 1611 (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {16121613// Get the specific value for the option1614 value = jQuery(option).val();16151616// We don't need an array for one selects1617if ( one ) {1618return value;1619 }16201621// Multi-Selects return an array1622 values.push( value );1623 }1624 }16251626return values;1627 }16281629// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified1630if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {1631return elem.getAttribute("value") === null ? "on" : elem.value;1632 }163316341635// Everything else, we just grab the value1636return (elem.value || "").replace(rreturn, "");16371638 }16391640return undefined;1641 }16421643var isFunction = jQuery.isFunction(value);16441645returnthis.each(function(i) {1646var self = jQuery(this), val = value;16471648if ( this.nodeType !== 1 ) {1649return;1650 }16511652if ( isFunction ) {1653 val = value.call(this, i, self.val());1654 }16551656// Treat null/undefined as ""; convert numbers to string1657if ( val == null ) {1658 val = "";1659 } elseif ( typeof val === "number" ) {1660 val += "";1661 } elseif ( jQuery.isArray(val) ) {1662 val = jQuery.map(val, function (value) {1663return value == null ? "" : value + "";1664 });1665 }16661667if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {1668this.checked = jQuery.inArray( self.val(), val ) >= 0;16691670 } elseif ( jQuery.nodeName( this, "select" ) ) {1671var values = jQuery.makeArray(val);16721673 jQuery( "option", this ).each(function() {1674this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;1675 });16761677if ( !values.length ) {1678this.selectedIndex = -1;1679 }16801681 } else {1682this.value = val;1683 }1684 });1685 }1686});16871688jQuery.extend({1689 attrFn: {1690 val: true,1691 css: true,1692 html: true,1693 text: true,1694 data: true,1695 width: true,1696 height: true,1697 offset: true1698 },16991700 attr: function( elem, name, value, pass ) {1701// don't set attributes on text and comment nodes1702if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {1703return undefined;1704 }17051706if ( pass && name in jQuery.attrFn ) {1707return jQuery(elem)[name](value);1708 }17091710var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),1711// Whether we are setting (or getting)1712 set = value !== undefined;17131714// Try to normalize/fix the name1715 name = notxml && jQuery.props[ name ] || name;17161717// These attributes require special treatment1718var special = rspecialurl.test( name );17191720// Safari mis-reports the default selected property of an option1721// Accessing the parent's selectedIndex property fixes it1722if ( name === "selected" && !jQuery.support.optSelected ) {1723var parent = elem.parentNode;1724if ( parent ) {1725 parent.selectedIndex;17261727// Make sure that it also works with optgroups, see #57011728if ( parent.parentNode ) {1729 parent.parentNode.selectedIndex;1730 }1731 }1732 }17331734// If applicable, access the attribute via the DOM 0 way1735// 'in' checks fail in Blackberry 4.7 #69311736if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {1737if ( set ) {1738// We can't allow the type property to be changed (since it causes problems in IE)1739if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {1740 jQuery.error( "type property can't be changed" );1741 }17421743if ( value === null ) {1744if ( elem.nodeType === 1 ) {1745 elem.removeAttribute( name );1746 }17471748 } else {1749 elem[ name ] = value;1750 }1751 }17521753// browsers index elements by id/name on forms, give priority to attributes.1754if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {1755return elem.getAttributeNode( name ).nodeValue;1756 }17571758// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set1759// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/1760if ( name === "tabIndex" ) {1761var attributeNode = elem.getAttributeNode( "tabIndex" );17621763return attributeNode && attributeNode.specified ?1764 attributeNode.value :1765 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?1766 0 :1767 undefined;1768 }17691770return elem[ name ];1771 }17721773if ( !jQuery.support.style && notxml && name === "style" ) {1774if ( set ) {1775 elem.style.cssText = "" + value;1776 }17771778return elem.style.cssText;1779 }17801781if ( set ) {1782// convert the value to a string (all browsers do this but IE) see #10701783 elem.setAttribute( name, "" + value );1784 }17851786// Ensure that missing attributes return undefined1787// Blackberry 4.7 returns "" from getAttribute #69381788if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {1789return undefined;1790 }17911792var attr = !jQuery.support.hrefNormalized && notxml && special ?1793// Some attributes require a special call on IE1794 elem.getAttribute( name, 2 ) :1795 elem.getAttribute( name );17961797// Non-existent attributes return null, we normalize to undefined1798return attr === null ? undefined : attr;1799 }1800});18011802180318041805var rnamespaces = //.(.*)$/,1806 rformElems = /^(?:textarea|input|select)$/i,1807 rperiod = //./g,1808 rspace = / /g,1809 rescape = /[^/w/s.|`]/g,1810 fcleanup = function( nm ) {1811return nm.replace(rescape, "//$&");1812 },1813 focusCounts = { focusin: 0, focusout: 0 };18141815/*1816 * A number of helper functions used for managing events.1817 * Many of the ideas behind this code originated from1818 * Dean Edwards' addEvent library.1819*/1820 jQuery.event = {18211822// Bind an event to an element1823// Original by Dean Edwards1824 add: function( elem, types, handler, data ) {1825if ( elem.nodeType === 3 || elem.nodeType === 8 ) {1826return;1827 }18281829// For whatever reason, IE has trouble passing the window object1830// around, causing it to be cloned in the process1831if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {1832 elem = window;1833 }18341835if ( handler === false ) {1836 handler = returnFalse;1837 } elseif ( !handler ) {1838// Fixes bug #7229. Fix recommended by jdalton1839return;1840 }18411842var handleObjIn, handleObj;18431844if ( handler.handler ) {1845 handleObjIn = handler;1846 handler = handleObjIn.handler;1847 }18481849// Make sure that the function being executed has a unique ID1850if ( !handler.guid ) {1851 handler.guid = jQuery.guid++;1852 }18531854// Init the element's event structure1855var elemData = jQuery.data( elem );18561857// If no elemData is found then we must be trying to bind to one of the1858// banned noData elements1859if ( !elemData ) {1860return;1861 }18621863// Use a key less likely to result in collisions for plain JS objects.1864// Fixes bug #7150.1865var eventKey = elem.nodeType ? "events" : "__events__",1866 events = elemData[ eventKey ],1867 eventHandle = elemData.handle;18681869if ( typeof events === "function" ) {1870// On plain objects events is a fn that holds the the data1871// which prevents this data from being JSON serialized1872// the function does not need to be called, it just contains the data1873 eventHandle = events.handle;1874 events = events.events;18751876 } elseif ( !events ) {1877if ( !elem.nodeType ) {1878// On plain objects, create a fn that acts as the holder1879// of the values to avoid JSON serialization of event data1880 elemData[ eventKey ] = elemData = function(){};1881 }18821883 elemData.events = events = {};1884 }18851886if ( !eventHandle ) {1887 elemData.handle = eventHandle = function() {1888// Handle the second event of a trigger and when1889// an event is called after a page has unloaded1890returntypeof jQuery !== "undefined" && !jQuery.event.triggered ?1891 jQuery.event.handle.apply( eventHandle.elem, arguments ) :1892 undefined;1893 };1894 }18951896// Add elem as a property of the handle function1897// This is to prevent a memory leak with non-native events in IE.1898 eventHandle.elem = elem;18991900// Handle multiple events separated by a space1901// jQuery(...).bind("mouseover mouseout", fn);1902 types = types.split(" ");19031904var type, i = 0, namespaces;19051906while ( (type = types[ i++ ]) ) {1907 handleObj = handleObjIn ?1908 jQuery.extend({}, handleObjIn) :1909 { handler: handler, data: data };19101911// Namespaced event handlers1912if ( type.indexOf(".") > -1 ) {1913 namespaces = type.split(".");1914 type = namespaces.shift();1915 handleObj.namespace = namespaces.slice(0).sort().join(".");19161917 } else {1918 namespaces = [];1919 handleObj.namespace = "";1920 }19211922 handleObj.type = type;1923if ( !handleObj.guid ) {1924 handleObj.guid = handler.guid;1925 }19261927// Get the current list of functions bound to this event1928var handlers = events[ type ],1929 special = jQuery.event.special[ type ] || {};19301931// Init the event handler queue1932if ( !handlers ) {1933 handlers = events[ type ] = [];19341935// Check for a special event handler1936// Only use addEventListener/attachEvent if the special1937// events handler returns false1938if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {1939// Bind the global event handler to the element1940if ( elem.addEventListener ) {1941 elem.addEventListener( type, eventHandle, false );19421943 } elseif ( elem.attachEvent ) {1944 elem.attachEvent( "on" + type, eventHandle );1945 }1946 }1947 }19481949if ( special.add ) { 1950 special.add.call( elem, handleObj ); 19511952if ( !handleObj.handler.guid ) {1953 handleObj.handler.guid = handler.guid;1954 }1955 }19561957// Add the function to the element's handler list1958 handlers.push( handleObj );19591960// Keep track of which events have been used, for global triggering1961 jQuery.event.global[ type ] = true;1962 }19631964// Nullify elem to prevent memory leaks in IE1965 elem = null;1966 },19671968 global: {},19691970// Detach an event or set of events from an element1971 remove: function( elem, types, handler, pos ) {1972// don't do events on text and comment nodes1973if ( elem.nodeType === 3 || elem.nodeType === 8 ) {1974return;1975 }19761977if ( handler === false ) {1978 handler = returnFalse;1979 }19801981var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,1982 eventKey = elem.nodeType ? "events" : "__events__",1983 elemData = jQuery.data( elem ),1984 events = elemData && elemData[ eventKey ];19851986if ( !elemData || !events ) {1987return;1988 }19891990if ( typeof events === "function" ) {1991 elemData = events;1992 events = events.events;1993 }19941995// types is actually an event object here1996if ( types && types.type ) {1997 handler = types.handler;1998 types = types.type;1999 }20002001// Unbind all events for the element2002if ( !types || typeof types === "string" && types.charAt(0) === "." ) {2003 types = types || "";20042005for ( type in events ) {2006 jQuery.event.remove( elem, type + types );2007 }20082009return;2010 }20112012// Handle multiple events separated by a space2013// jQuery(...).unbind("mouseover mouseout", fn);2014 types = types.split(" ");20152016while ( (type = types[ i++ ]) ) {2017 origType = type;2018 handleObj = null;2019 all = type.indexOf(".") < 0;2020 namespaces = [];20212022if ( !all ) {2023// Namespaced event handlers2024 namespaces = type.split(".");2025 type = namespaces.shift();20262027 namespace = new RegExp("(^|//.)" + 2028 jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("//.(?:.*//.)?") + "(//.|$)");2029 }20302031 eventType = events[ type ];20322033if ( !eventType ) {2034continue;2035 }20362037if ( !handler ) {2038for ( j = 0; j < eventType.length; j++ ) {2039 handleObj = eventType[ j ];20402041if ( all || namespace.test( handleObj.namespace ) ) {2042 jQuery.event.remove( elem, origType, handleObj.handler, j );2043 eventType.splice( j--, 1 );2044 }2045 }20462047continue;2048 }20492050 special = jQuery.event.special[ type ] || {};20512052for ( j = pos || 0; j < eventType.length; j++ ) {2053 handleObj = eventType[ j ];20542055if ( handler.guid === handleObj.guid ) {2056// remove the given handler for the given type2057if ( all || namespace.test( handleObj.namespace ) ) {2058if ( pos == null ) {2059 eventType.splice( j--, 1 );2060 }20612062if ( special.remove ) {2063 special.remove.call( elem, handleObj );2064 }2065 }20662067if ( pos != null ) {2068break;2069 }2070 }2071 }20722073// remove generic event handler if no more handlers exist2074if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {2075if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {2076 jQuery.removeEvent( elem, type, elemData.handle );2077 }20782079 ret = null;2080delete events[ type ];2081 }2082 }20832084// Remove the expando if it's no longer used2085if ( jQuery.isEmptyObject( events ) ) {2086var handle = elemData.handle;2087if ( handle ) {2088 handle.elem = null;2089 }20902091delete elemData.events;2092delete elemData.handle;20932094if ( typeof elemData === "function" ) {2095 jQuery.removeData( elem, eventKey );20962097 } elseif ( jQuery.isEmptyObject( elemData ) ) {2098 jQuery.removeData( elem );2099 }2100 }2101 },21022103// bubbling is internal2104 trigger: function( event, data, elem /*, bubbling */ ) {2105// Event object or event type2106var type = event.type || event,2107 bubbling = arguments[3];21082109if ( !bubbling ) {2110 event = typeof event === "object" ?2111// jQuery.Event object2112 event[ jQuery.expando ] ? event :2113// Object literal2114 jQuery.extend( jQuery.Event(type), event ) :2115// Just the event type (string)2116 jQuery.Event(type);21172118if ( type.indexOf("!") >= 0 ) {2119 event.type = type = type.slice(0, -1);2120 event.exclusive = true;2121 }21222123// Handle a global trigger2124if ( !elem ) {2125// Don't bubble custom events when global (to avoid too much overhead)2126 event.stopPropagation();21272128// Only trigger if we've ever bound an event for it2129if ( jQuery.event.global[ type ] ) {2130 jQuery.each( jQuery.cache, function() {2131if ( this.events && this.events[type] ) {2132 jQuery.event.trigger( event, data, this.handle.elem );2133 }2134 });2135 }2136 }21372138// Handle triggering a single element21392140// don't do events on text and comment nodes2141if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {2142return undefined;2143 }21442145// Clean up in case it is reused2146 event.result = undefined;2147 event.target = elem;21482149// Clone the incoming data, if any2150 data = jQuery.makeArray( data );2151 data.unshift( event );2152 }21532154 event.currentTarget = elem;21552156// Trigger the event, it is assumed that "handle" is a function2157var handle = elem.nodeType ?2158 jQuery.data( elem, "handle" ) :2159 (jQuery.data( elem, "__events__" ) || {}).handle;21602161if ( handle ) {2162 handle.apply( elem, data );2163 }21642165var parent = elem.parentNode || elem.ownerDocument;21662167// Trigger an inline bound script2168try {2169if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {2170if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {2171 event.result = false;2172 event.preventDefault();2173 }2174 }21752176// prevent IE from throwing an error for some elements with some event types, see #35332177 } catch (inlineError) {}21782179if ( !event.isPropagationStopped() && parent ) {2180 jQuery.event.trigger( event, data, parent, true );21812182 } elseif ( !event.isDefaultPrevented() ) {2183var old,2184 target = event.target,2185 targetType = type.replace( rnamespaces, "" ),2186 isClick = jQuery.nodeName( target, "a" ) && targetType === "click",2187 special = jQuery.event.special[ targetType ] || {};21882189if ( (!special._default || special._default.call( elem, event ) === false) && 2190 !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {21912192try {2193if ( target[ targetType ] ) {2194// Make sure that we don't accidentally re-trigger the onFOO events2195 old = target[ "on" + targetType ];21962197if ( old ) {2198 target[ "on" + targetType ] = null;2199 }22002201 jQuery.event.triggered = true;2202 target[ targetType ]();2203 }22042205// prevent IE from throwing an error for some elements with some event types, see #35332206 } catch (triggerError) {}22072208if ( old ) {2209 target[ "on" + targetType ] = old;2210 }22112212 jQuery.event.triggered = false;2213 }2214 }2215 },22162217 handle: function( event ) {2218var all, handlers, namespaces, namespace_re, events,2219 namespace_sort = [],2220 args = jQuery.makeArray( arguments );22212222 event = args[0] = jQuery.event.fix( event || window.event );2223 event.currentTarget = this;22242225// Namespaced event handlers2226 all = event.type.indexOf(".") < 0 && !event.exclusive;22272228if ( !all ) {2229 namespaces = event.type.split(".");2230 event.type = namespaces.shift();2231 namespace_sort = namespaces.slice(0).sort();2232 namespace_re = new RegExp("(^|//.)" + namespace_sort.join("//.(?:.*//.)?") + "(//.|$)");2233 }22342235 event.namespace = event.namespace || namespace_sort.join(".");22362237 events = jQuery.data(this, this.nodeType ? "events" : "__events__");22382239if ( typeof events === "function" ) {2240 events = events.events;2241 }22422243 handlers = (events || {})[ event.type ];22442245if ( events && handlers ) {2246// Clone the handlers to prevent manipulation2247 handlers = handlers.slice(0);22482249for ( var j = 0, l = handlers.length; j < l; j++ ) {2250var handleObj = handlers[ j ];22512252// Filter the functions by class2253if ( all || namespace_re.test( handleObj.namespace ) ) {2254// Pass in a reference to the handler function itself2255// So that we can later remove it2256 event.handler = handleObj.handler;2257 event.data = handleObj.data;2258 event.handleObj = handleObj;22592260var ret = handleObj.handler.apply( this, args );22612262if ( ret !== undefined ) {2263 event.result = ret;2264if ( ret === false ) {2265 event.preventDefault();2266 event.stopPropagation();2267 }2268 }22692270if ( event.isImmediatePropagationStopped() ) {2271break;2272 }2273 }2274 }2275 }22762277return event.result;2278 },22792280 props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),22812282 fix: function( event ) {2283if ( event[ jQuery.expando ] ) {2284return event;2285 }22862287// store a copy of the original event object2288// and "clone" to set read-only properties2289var originalEvent = event;2290 event = jQuery.Event( originalEvent );22912292for ( var i = this.props.length, prop; i; ) {2293 prop = this.props[ --i ];2294 event[ prop ] = originalEvent[ prop ];2295 }22962297// Fix target property, if necessary2298if ( !event.target ) {2299// Fixes #1925 where srcElement might not be defined either2300 event.target = event.srcElement || document;2301 }23022303// check if target is a textnode (safari)2304if ( event.target.nodeType === 3 ) {2305 event.target = event.target.parentNode;2306 }23072308// Add relatedTarget, if necessary2309if ( !event.relatedTarget && event.fromElement ) {2310 event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;2311 }23122313// Calculate pageX/Y if missing and clientX/Y available2314if ( event.pageX == null && event.clientX != null ) {2315var doc = document.documentElement,2316 body = document.body;23172318 event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);2319 event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);2320 }23212322// Add which for key events2323if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {2324 event.which = event.charCode != null ? event.charCode : event.keyCode;2325 }23262327// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)2328if ( !event.metaKey && event.ctrlKey ) {2329 event.metaKey = event.ctrlKey;2330 }23312332// Add which for click: 1 === left; 2 === middle; 3 === right2333// Note: button is not normalized, so don't use it2334if ( !event.which && event.button !== undefined ) {2335 event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));2336 }23372338return event;2339 },23402341// Deprecated, use jQuery.guid instead2342 guid: 1E8,23432344// Deprecated, use jQuery.proxy instead2345 proxy: jQuery.proxy,23462347 special: {2348 ready: {2349// Make sure the ready event is setup2350 setup: jQuery.bindReady,2351 teardown: jQuery.noop2352 },23532354 live: {2355 add: function( handleObj ) {2356 jQuery.event.add( this,2357 liveConvert( handleObj.origType, handleObj.selector ),2358 jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); 2359 },23602361 remove: function( handleObj ) {2362 jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );2363 }2364 },23652366 beforeunload: {2367 setup: function( data, namespaces, eventHandle ) {2368// We only want to do this special case on windows2369if ( jQuery.isWindow( this ) ) {2370this.onbeforeunload = eventHandle;2371 }2372 },23732374 teardown: function( namespaces, eventHandle ) {2375if ( this.onbeforeunload === eventHandle ) {2376this.onbeforeunload = null;2377 }2378 }2379 }2380 }2381};23822383 jQuery.removeEvent = document.removeEventListener ?2384function( elem, type, handle ) {2385if ( elem.removeEventListener ) {2386 elem.removeEventListener( type, handle, false );2387 }2388 } : 2389function( elem, type, handle ) {2390if ( elem.detachEvent ) {2391 elem.detachEvent( "on" + type, handle );2392 }2393 };23942395 jQuery.Event = function( src ) {2396// Allow instantiation without the 'new' keyword2397if ( !this.preventDefault ) {2398returnnew jQuery.Event( src );2399 }24002401// Event object2402if ( src && src.type ) {2403this.originalEvent = src;2404this.type = src.type;2405// Event type2406 } else {2407this.type = src;2408 }24092410// timeStamp is buggy for some events on Firefox(#3843)2411// So we won't rely on the native value2412this.timeStamp = jQuery.now();24132414// Mark it as fixed2415this[ jQuery.expando ] = true;2416};24172418function returnFalse() {2419returnfalse;2420}2421function returnTrue() {2422returntrue;2423}24242425// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding2426// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html2427 jQuery.Event.prototype = {2428 preventDefault: function() {2429this.isDefaultPrevented = returnTrue;24302431var e = this.originalEvent;2432if ( !e ) {2433return;2434 }24352436// if preventDefault exists run it on the original event2437if ( e.preventDefault ) {2438 e.preventDefault();24392440// otherwise set the returnValue property of the original event to false (IE)2441 } else {2442 e.returnValue = false;2443 }2444 },2445 stopPropagation: function() {2446this.isPropagationStopped = returnTrue;24472448var e = this.originalEvent;2449if ( !e ) {2450return;2451 }2452// if stopPropagation exists run it on the original event2453if ( e.stopPropagation ) {2454 e.stopPropagation();2455 }2456// otherwise set the cancelBubble property of the original event to true (IE)2457 e.cancelBubble = true;2458 },2459 stopImmediatePropagation: function() {2460this.isImmediatePropagationStopped = returnTrue;2461this.stopPropagation();2462 },2463 isDefaultPrevented: returnFalse,2464 isPropagationStopped: returnFalse,2465 isImmediatePropagationStopped: returnFalse2466};24672468// Checks if an event happened on an element within another element2469// Used in jQuery.event.special.mouseenter and mouseleave handlers2470var withinElement = function( event ) {2471// Check if mouse(over|out) are still within the same parent element2472var parent = event.relatedTarget;24732474// Firefox sometimes assigns relatedTarget a XUL element2475// which we cannot access the parentNode property of2476try {2477// Traverse up the tree2478while ( parent && parent !== this ) {2479 parent = parent.parentNode;2480 }24812482if ( parent !== this ) {2483// set the correct event type2484 event.type = event.data;24852486// handle event if we actually just moused on to a non sub-element2487 jQuery.event.handle.apply( this, arguments );2488 }24892490// assuming we've left the element since we most likely mousedover a xul element2491 } catch(e) { }2492},24932494// In case of event delegation, we only need to rename the event.type,2495// liveHandler will take care of the rest.2496 delegate = function( event ) {2497 event.type = event.data;2498 jQuery.event.handle.apply( this, arguments );2499};25002501// Create mouseenter and mouseleave events2502jQuery.each({2503 mouseenter: "mouseover",2504 mouseleave: "mouseout"2505 }, function( orig, fix ) {2506 jQuery.event.special[ orig ] = {2507 setup: function( data ) {2508 jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );2509 },2510 teardown: function( data ) {2511 jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );2512 }2513 };2514});25152516// submit delegation2517if ( !jQuery.support.submitBubbles ) {25182519 jQuery.event.special.submit = {2520 setup: function( data, namespaces ) {2521if ( this.nodeName.toLowerCase() !== "form" ) {2522 jQuery.event.add(this, "click.specialSubmit", function( e ) {2523var elem = e.target,2524 type = elem.type;25252526if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {2527 e.liveFired = undefined;2528return trigger( "submit", this, arguments );2529 }2530 });25312532 jQuery.event.add(this, "keypress.specialSubmit", function( e ) {2533var elem = e.target,2534 type = elem.type;25352536if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {2537 e.liveFired = undefined;2538return trigger( "submit", this, arguments );2539 }2540 });25412542 } else {2543returnfalse;2544 }2545 },25462547 teardown: function( namespaces ) {2548 jQuery.event.remove( this, ".specialSubmit" );2549 }2550 };25512552}25532554// change delegation, happens here so we have bind.2555if ( !jQuery.support.changeBubbles ) {25562557var changeFilters,25582559 getVal = function( elem ) {2560var type = elem.type, val = elem.value;25612562if ( type === "radio" || type === "checkbox" ) {2563 val = elem.checked;25642565 } elseif ( type === "select-multiple" ) {2566 val = elem.selectedIndex > -1 ?2567 jQuery.map( elem.options, function( elem ) {2568return elem.selected;2569 }).join("-") :2570 "";25712572 } elseif ( elem.nodeName.toLowerCase() === "select" ) {2573 val = elem.selectedIndex;2574 }25752576return val;2577 },25782579 testChange = function testChange( e ) {2580var elem = e.target, data, val;25812582if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {2583return;2584 }25852586 data = jQuery.data( elem, "_change_data" );2587 val = getVal(elem);25882589// the current data will be also retrieved by beforeactivate2590if ( e.type !== "focusout" || elem.type !== "radio" ) {2591 jQuery.data( elem, "_change_data", val );2592 }25932594if ( data === undefined || val === data ) {2595return;2596 }25972598if ( data != null || val ) {2599 e.type = "change";2600 e.liveFired = undefined;2601return jQuery.event.trigger( e, arguments[1], elem );2602 }2603 };26042605 jQuery.event.special.change = {2606 filters: {2607 focusout: testChange, 26082609 beforedeactivate: testChange,26102611 click: function( e ) {2612var elem = e.target, type = elem.type;26132614if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {2615return testChange.call( this, e );2616 }2617 },26182619// Change has to be called before submit2620// Keydown will be called before keypress, which is used in submit-event delegation2621 keydown: function( e ) {2622var elem = e.target, type = elem.type;26232624if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||2625 (e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||2626 type === "select-multiple" ) {2627return testChange.call( this, e );2628 }2629 },26302631// Beforeactivate happens also before the previous element is blurred2632// with this event you can't trigger a change event, but you can store2633// information2634 beforeactivate: function( e ) {2635var elem = e.target;2636 jQuery.data( elem, "_change_data", getVal(elem) );2637 }2638 },26392640 setup: function( data, namespaces ) {2641if ( this.type === "file" ) {2642returnfalse;2643 }26442645for ( var type in changeFilters ) {2646 jQuery.event.add( this, type + ".specialChange", changeFilters[type] );2647 }26482649return rformElems.test( this.nodeName );2650 },26512652 teardown: function( namespaces ) {2653 jQuery.event.remove( this, ".specialChange" );26542655return rformElems.test( this.nodeName );2656 }2657 };26582659 changeFilters = jQuery.event.special.change.filters;26602661// Handle when the input is .focus()'d2662 changeFilters.focus = changeFilters.beforeactivate;2663}26642665function trigger( type, elem, args ) {2666 args[0].type = type;2667return jQuery.event.handle.apply( elem, args );2668}26692670// Create "bubbling" focus and blur events2671if ( document.addEventListener ) {2672 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {2673 jQuery.event.special[ fix ] = {2674 setup: function() {2675if ( focusCounts[fix]++ === 0 ) {2676 document.addEventListener( orig, handler, true );2677 }2678 }, 2679 teardown: function() { 2680if ( --focusCounts[fix] === 0 ) {2681 document.removeEventListener( orig, handler, true );2682 }2683 }2684 };26852686function handler( e ) { 2687 e = jQuery.event.fix( e );2688 e.type = fix;2689return jQuery.event.trigger( e, null, e.target );2690 }2691 });2692}26932694 jQuery.each(["bind", "one"], function( i, name ) {2695 jQuery.fn[ name ] = function( type, data, fn ) {2696// Handle object literals2697if ( typeof type === "object" ) {2698for ( var key in type ) {2699this[ name ](key, data, type[key], fn);2700 }2701returnthis;2702 }27032704if ( jQuery.isFunction( data ) || data === false ) {2705 fn = data;2706 data = undefined;2707 }27082709var handler = name === "one" ? jQuery.proxy( fn, function( event ) {2710 jQuery( this ).unbind( event, handler );2711return fn.apply( this, arguments );2712 }) : fn;27132714if ( type === "unload" && name !== "one" ) {2715this.one( type, data, fn );27162717 } else {2718for ( var i = 0, l = this.length; i < l; i++ ) {2719 jQuery.event.add( this[i], type, handler, data );2720 }2721 }27222723returnthis;2724 };2725});27262727jQuery.fn.extend({2728 unbind: function( type, fn ) {2729// Handle object literals2730if ( typeof type === "object" && !type.preventDefault ) {2731for ( var key in type ) {2732this.unbind(key, type[key]);2733 }27342735 } else {2736for ( var i = 0, l = this.length; i < l; i++ ) {2737 jQuery.event.remove( this[i], type, fn );2738 }2739 }27402741returnthis;2742 },27432744 delegate: function( selector, types, data, fn ) {2745returnthis.live( types, data, fn, selector );2746 },27472748 undelegate: function( selector, types, fn ) {2749if ( arguments.length === 0 ) {2750returnthis.unbind( "live" );27512752 } else {2753returnthis.die( types, null, fn, selector );2754 }2755 },27562757 trigger: function( type, data ) {2758returnthis.each(function() {2759 jQuery.event.trigger( type, data, this );2760 });2761 },27622763 triggerHandler: function( type, data ) {2764if ( this[0] ) {2765var event = jQuery.Event( type );2766 event.preventDefault();2767 event.stopPropagation();2768 jQuery.event.trigger( event, data, this[0] );2769return event.result;2770 }2771 },27722773 toggle: function( fn ) {2774// Save reference to arguments for access in closure2775var args = arguments,2776 i = 1;27772778// link all the functions, so any of them can unbind this click handler2779while ( i < args.length ) {2780 jQuery.proxy( fn, args[ i++ ] );2781 }27822783returnthis.click( jQuery.proxy( fn, function( event ) {2784// Figure out which function to execute2785var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;2786 jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );27872788// Make sure that clicks stop2789 event.preventDefault();27902791// and execute the function2792return args[ lastToggle ].apply( this, arguments ) || false;2793 }));2794 },27952796 hover: function( fnOver, fnOut ) {2797returnthis.mouseenter( fnOver ).mouseleave( fnOut || fnOver );2798 }2799});28002801var liveMap = {2802 focus: "focusin",2803 blur: "focusout",2804 mouseenter: "mouseover",2805 mouseleave: "mouseout"2806};28072808 jQuery.each(["live", "die"], function( i, name ) {2809 jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {2810var type, i = 0, match, namespaces, preType,2811 selector = origSelector || this.selector,2812 context = origSelector ? this : jQuery( this.context );28132814if ( typeof types === "object" && !types.preventDefault ) {2815for ( var key in types ) {2816 context[ name ]( key, data, types[key], selector );2817 }28182819returnthis;2820 }28212822if ( jQuery.isFunction( data ) ) {2823 fn = data;2824 data = undefined;2825 }28262827 types = (types || "").split(" ");28282829while ( (type = types[ i++ ]) != null ) {2830 match = rnamespaces.exec( type );2831 namespaces = "";28322833if ( match ) {2834 namespaces = match[0];2835 type = type.replace( rnamespaces, "" );2836 }28372838if ( type === "hover" ) {2839 types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );2840continue;2841 }28422843 preType = type;28442845if ( type === "focus" || type === "blur" ) {2846 types.push( liveMap[ type ] + namespaces );2847 type = type + namespaces;28482849 } else {2850 type = (liveMap[ type ] || type) + namespaces;2851 }28522853if ( name === "live" ) {2854// bind live handler2855for ( var j = 0, l = context.length; j < l; j++ ) {2856 jQuery.event.add( context[j], "live." + liveConvert( type, selector ),2857 { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );2858 }28592860 } else {2861// unbind live handler2862 context.unbind( "live." + liveConvert( type, selector ), fn );2863 }2864 }28652866returnthis;2867 };2868});28692870function liveHandler( event ) {2871var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,2872 elems = [],2873 selectors = [],2874 events = jQuery.data( this, this.nodeType ? "events" : "__events__" );28752876if ( typeof events === "function" ) {2877 events = events.events;2878 }28792880// Make sure we avoid non-left-click bubbling in Firefox (#3861)2881if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {2882return;2883 }28842885if ( event.namespace ) {2886 namespace = new RegExp("(^|//.)" + event.namespace.split(".").join("//.(?:.*//.)?") + "(//.|$)");2887 }28882889 event.liveFired = this;28902891var live = events.live.slice(0);28922893for ( j = 0; j < live.length; j++ ) {2894 handleObj = live[j];28952896if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {2897 selectors.push( handleObj.selector );28982899 } else {2900 live.splice( j--, 1 );2901 }2902 }29032904 match = jQuery( event.target ).closest( selectors, event.currentTarget );29052906for ( i = 0, l = match.length; i < l; i++ ) {2907 close = match[i];29082909for ( j = 0; j < live.length; j++ ) {2910 handleObj = live[j];29112912if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) {2913 elem = close.elem;2914 related = null;29152916// Those two events require additional checking2917if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {2918 event.type = handleObj.preType;2919 related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];2920 }29212922if ( !related || related !== elem ) {2923 elems.push({ elem: elem, handleObj: handleObj, level: close.level });2924 }2925 }2926 }2927 }29282929for ( i = 0, l = elems.length; i < l; i++ ) {2930 match = elems[i];29312932if ( maxLevel && match.level > maxLevel ) {2933break;2934 }29352936 event.currentTarget = match.elem;2937 event.data = match.handleObj.data;2938 event.handleObj = match.handleObj;29392940 ret = match.handleObj.origHandler.apply( match.elem, arguments );29412942if ( ret === false || event.isPropagationStopped() ) {2943 maxLevel = match.level;29442945if ( ret === false ) {2946 stop = false;2947 }2948if ( event.isImmediatePropagationStopped() ) {2949break;2950 }2951 }2952 }29532954return stop;2955}29562957function liveConvert( type, selector ) {2958return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");2959}29602961 jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +2962 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +2963 "change select submit keydown keypress keyup error").split(" "), function( i, name ) {29642965// Handle event binding2966 jQuery.fn[ name ] = function( data, fn ) {2967if ( fn == null ) {2968 fn = data;2969 data = null;2970 }29712972return arguments.length > 0 ?2973this.bind( name, data, fn ) :2974this.trigger( name );2975 };29762977if ( jQuery.attrFn ) {2978 jQuery.attrFn[ name ] = true;2979 }2980});29812982// Prevent memory leaks in IE2983// Window isn't included so as not to unbind existing unload events2984// More info:2985// - http://isaacschlueter.com/2006/10/msie-memory-leaks/2986if ( window.attachEvent && !window.addEventListener ) {2987 jQuery(window).bind("unload", function() {2988for ( var id in jQuery.cache ) {2989if ( jQuery.cache[ id ].handle ) {2990// Try/Catch is to handle iframes being unloaded, see #42802991try {2992 jQuery.event.remove( jQuery.cache[ id ].handle.elem );2993 } catch(e) {}2994 }2995 }2996 });2997}299829993000/*!3001 * Sizzle CSS Selector Engine - v1.03002 * Copyright 2009, The Dojo Foundation3003 * Released under the MIT, BSD, and GPL Licenses.3004 * More information: http://sizzlejs.com/3005*/3006 (function(){30073008var chunker = /((?:/((?:/([^()]+/)|[^()]+)+/)|/[(?:/[[^/[/]]*/]|['"][^'"]*['"]|[^/[/]'"]+)+/]|//.|[^ >+~,(/[//]+)+|[>+~])(/s*,/s*)?((?:.|/r|/n)*)/g,3009 done = 0,3010 toString = Object.prototype.toString,3011 hasDuplicate = false,3012 baseHasDuplicate = true;30133014// Here we check if the JavaScript engine is using some sort of3015// optimization where it does not always call our comparision3016// function. If that is the case, discard the hasDuplicate value.3017// Thus far that includes Google Chrome.3018 [0, 0].sort(function() {3019 baseHasDuplicate = false;3020return 0;3021});30223023var Sizzle = function( selector, context, results, seed ) {3024 results = results || [];3025 context = context || document;30263027var origContext = context;30283029if ( context.nodeType !== 1 && context.nodeType !== 9 ) {3030return [];3031 }30323033if ( !selector || typeof selector !== "string" ) {3034return results;3035 }30363037var m, set, checkSet, extra, ret, cur, pop, i,3038 prune = true,3039 contextXML = Sizzle.isXML( context ),3040 parts = [],3041 soFar = selector;30423043// Reset the position of the chunker regexp (start from head)3044do {3045 chunker.exec( "" );3046 m = chunker.exec( soFar );30473048if ( m ) {3049 soFar = m[3];30503051 parts.push( m[1] );30523053if ( m[2] ) {3054 extra = m[3];3055break;3056 }3057 }3058 } while ( m );30593060if ( parts.length > 1 && origPOS.exec( selector ) ) {30613062if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {3063 set = posProcess( parts[0] + parts[1], context );30643065 } else {3066 set = Expr.relative[ parts[0] ] ?3067 [ context ] :3068 Sizzle( parts.shift(), context );30693070while ( parts.length ) {3071 selector = parts.shift();30723073if ( Expr.relative[ selector ] ) {3074 selector += parts.shift();3075 }30763077 set = posProcess( selector, set );3078 }3079 }30803081 } else {3082// Take a shortcut and set the context if the root selector is an ID3083// (but not if it'll be faster if the inner selector is an ID)3084if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&3085 Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {30863087 ret = Sizzle.find( parts.shift(), context, contextXML );3088 context = ret.expr ?3089 Sizzle.filter( ret.expr, ret.set )[0] :3090 ret.set[0];3091 }30923093if ( context ) {3094 ret = seed ?3095 { expr: parts.pop(), set: makeArray(seed) } :3096 Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );30973098 set = ret.expr ?3099 Sizzle.filter( ret.expr, ret.set ) :3100 ret.set;31013102if ( parts.length > 0 ) {3103 checkSet = makeArray( set );31043105 } else {3106 prune = false;3107 }31083109while ( parts.length ) {3110 cur = parts.pop();3111 pop = cur;31123113if ( !Expr.relative[ cur ] ) {3114 cur = "";3115 } else {3116 pop = parts.pop();3117 }31183119if ( pop == null ) {3120 pop = context;3121 }31223123 Expr.relative[ cur ]( checkSet, pop, contextXML );3124 }31253126 } else {3127 checkSet = parts = [];3128 }3129 }31303131if ( !checkSet ) {3132 checkSet = set;3133 }31343135if ( !checkSet ) {3136 Sizzle.error( cur || selector );3137 }31383139if ( toString.call(checkSet) === "[object Array]" ) {3140if ( !prune ) {3141 results.push.apply( results, checkSet );31423143 } elseif ( context && context.nodeType === 1 ) {3144for ( i = 0; checkSet[i] != null; i++ ) {3145if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {3146 results.push( set[i] );3147 }3148 }31493150 } else {3151for ( i = 0; checkSet[i] != null; i++ ) {3152if ( checkSet[i] && checkSet[i].nodeType === 1 ) {3153 results.push( set[i] );3154 }3155 }3156 }31573158 } else {3159 makeArray( checkSet, results );3160 }31613162if ( extra ) {3163 Sizzle( extra, origContext, results, seed );3164 Sizzle.uniqueSort( results );3165 }31663167return results;3168};31693170 Sizzle.uniqueSort = function( results ) {3171if ( sortOrder ) {3172 hasDuplicate = baseHasDuplicate;3173 results.sort( sortOrder );31743175if ( hasDuplicate ) {3176for ( var i = 1; i < results.length; i++ ) {3177if ( results[i] === results[ i - 1 ] ) {3178 results.splice( i--, 1 );3179 }3180 }3181 }3182 }31833184return results;3185};31863187 Sizzle.matches = function( expr, set ) {3188return Sizzle( expr, null, null, set );3189};31903191 Sizzle.matchesSelector = function( node, expr ) {3192return Sizzle( expr, null, null, [node] ).length > 0;3193};31943195 Sizzle.find = function( expr, context, isXML ) {3196var set;31973198if ( !expr ) {3199return [];3200 }32013202for ( var i = 0, l = Expr.order.length; i < l; i++ ) {3203var match,3204 type = Expr.order[i];32053206if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {3207var left = match[1];3208 match.splice( 1, 1 );32093210if ( left.substr( left.length - 1 ) !== "//" ) {3211 match[1] = (match[1] || "").replace(////g, "");3212 set = Expr.find[ type ]( match, context, isXML );32133214if ( set != null ) {3215 expr = expr.replace( Expr.match[ type ], "" );3216break;3217 }3218 }3219 }3220 }32213222if ( !set ) {3223 set = context.getElementsByTagName( "*" );3224 }32253226return { set: set, expr: expr };3227};32283229 Sizzle.filter = function( expr, set, inplace, not ) {3230var match, anyFound,3231 old = expr,3232 result = [],3233 curLoop = set,3234 isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );32353236while ( expr && set.length ) {3237for ( var type in Expr.filter ) {3238if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {3239var found, item,3240 filter = Expr.filter[ type ],3241 left = match[1];32423243 anyFound = false;32443245 match.splice(1,1);32463247if ( left.substr( left.length - 1 ) === "//" ) {3248continue;3249 }32503251if ( curLoop === result ) {3252 result = [];3253 }32543255if ( Expr.preFilter[ type ] ) {3256 match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );32573258if ( !match ) {3259 anyFound = found = true;32603261 } elseif ( match === true ) {3262continue;3263 }3264 }32653266if ( match ) {3267for ( var i = 0; (item = curLoop[i]) != null; i++ ) {3268if ( item ) {3269 found = filter( item, match, i, curLoop );3270var pass = not ^ !!found;32713272if ( inplace && found != null ) {3273if ( pass ) {3274 anyFound = true;32753276 } else {3277 curLoop[i] = false;3278 }32793280 } elseif ( pass ) {3281 result.push( item );3282 anyFound = true;3283 }3284 }3285 }3286 }32873288if ( found !== undefined ) {3289if ( !inplace ) {3290 curLoop = result;3291 }32923293 expr = expr.replace( Expr.match[ type ], "" );32943295if ( !anyFound ) {3296return [];3297 }32983299break;3300 }3301 }3302 }33033304// Improper expression3305if ( expr === old ) {3306if ( anyFound == null ) {3307 Sizzle.error( expr );33083309 } else {3310break;3311 }3312 }33133314 old = expr;3315 }33163317return curLoop;3318};33193320 Sizzle.error = function( msg ) {3321throw "Syntax error, unrecognized expression: " + msg;3322};33233324var Expr = Sizzle.selectors = {3325 order: [ "ID", "NAME", "TAG" ],33263327 match: {3328 ID: /#((?:[/w/u00c0-/uFFFF/-]|//.)+)/,3329 CLASS: //.((?:[/w/u00c0-/uFFFF/-]|//.)+)/,3330 NAME: //[name=['"]*((?:[/w/u00c0-/uFFFF/-]|//.)+)['"]*/]/,3331 ATTR: //[/s*((?:[/w/u00c0-/uFFFF/-]|//.)+)/s*(?:(/S?=)/s*(['"]*)(.*?)/3|)/s*/]/,3332 TAG: /^((?:[/w/u00c0-/uFFFF/*/-]|//.)+)/,3333 CHILD: /:(only|nth|last|first)-child(?:/((even|odd|[/dn+/-]*)/))?/,3334 POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:/((/d*)/))?(?=[^/-]|$)/,3335 PSEUDO: /:((?:[/w/u00c0-/uFFFF/-]|//.)+)(?:/((['"]?)((?:/([^/)]+/)|[^/(/)]*)+)/2/))?/3336 },33373338 leftMatch: {},33393340 attrMap: {3341 "class": "className",3342 "for": "htmlFor"3343 },33443345 attrHandle: {3346 href: function( elem ) {3347return elem.getAttribute( "href" );3348 }3349 },33503351 relative: {3352 "+": function(checkSet, part){3353var isPartStr = typeof part === "string",3354 isTag = isPartStr && !//W/.test( part ),3355 isPartStrNotTag = isPartStr && !isTag;33563357if ( isTag ) {3358 part = part.toLowerCase();3359 }33603361for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {3362if ( (elem = checkSet[i]) ) {3363while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}33643365 checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?3366 elem || false :3367 elem === part;3368 }3369 }33703371if ( isPartStrNotTag ) {3372 Sizzle.filter( part, checkSet, true );3373 }3374 },33753376 ">": function( checkSet, part ) {3377var elem,3378 isPartStr = typeof part === "string",3379 i = 0,3380 l = checkSet.length;33813382if ( isPartStr && !//W/.test( part ) ) {3383 part = part.toLowerCase();33843385for ( ; i < l; i++ ) {3386 elem = checkSet[i];33873388if ( elem ) {3389var parent = elem.parentNode;3390 checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;3391 }3392 }33933394 } else {3395for ( ; i < l; i++ ) {3396 elem = checkSet[i];33973398if ( elem ) {3399 checkSet[i] = isPartStr ?3400 elem.parentNode :3401 elem.parentNode === part;3402 }3403 }34043405if ( isPartStr ) {3406 Sizzle.filter( part, checkSet, true );3407 }3408 }3409 },34103411 "": function(checkSet, part, isXML){3412var nodeCheck,3413 doneName = done++,3414 checkFn = dirCheck;34153416if ( typeof part === "string" && !//W/.test(part) ) {3417 part = part.toLowerCase();3418 nodeCheck = part;3419 checkFn = dirNodeCheck;3420 }34213422 checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );3423 },34243425 "~": function( checkSet, part, isXML ) {3426var nodeCheck,3427 doneName = done++,3428 checkFn = dirCheck;34293430if ( typeof part === "string" && !//W/.test( part ) ) {3431 part = part.toLowerCase();3432 nodeCheck = part;3433 checkFn = dirNodeCheck;3434 }34353436 checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );3437 }3438 },34393440 find: {3441 ID: function( match, context, isXML ) {3442if ( typeof context.getElementById !== "undefined" && !isXML ) {3443var m = context.getElementById(match[1]);3444// Check parentNode to catch when Blackberry 4.6 returns3445// nodes that are no longer in the document #69633446return m && m.parentNode ? [m] : [];3447 }3448 },34493450 NAME: function( match, context ) {3451if ( typeof context.getElementsByName !== "undefined" ) {3452var ret = [],3453 results = context.getElementsByName( match[1] );34543455for ( var i = 0, l = results.length; i < l; i++ ) {3456if ( results[i].getAttribute("name") === match[1] ) {3457 ret.push( results[i] );3458 }3459 }34603461return ret.length === 0 ? null : ret;3462 }3463 },34643465 TAG: function( match, context ) {3466return context.getElementsByTagName( match[1] );3467 }3468 },3469 preFilter: {3470 CLASS: function( match, curLoop, inplace, result, not, isXML ) {3471 match = " " + match[1].replace(////g, "") + " ";34723473if ( isXML ) {3474return match;3475 }34763477for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {3478if ( elem ) {3479if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[/t/n]/g, " ").indexOf(match) >= 0) ) {3480if ( !inplace ) {3481 result.push( elem );3482 }34833484 } elseif ( inplace ) {3485 curLoop[i] = false;3486 }3487 }3488 }34893490returnfalse;3491 },34923493 ID: function( match ) {3494return match[1].replace(////g, "");3495 },34963497 TAG: function( match, curLoop ) {3498return match[1].toLowerCase();3499 },35003501 CHILD: function( match ) {3502if ( match[1] === "nth" ) {3503// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'3504var test = /(-?)(/d*)n((?:/+|-)?/d*)/.exec(3505 match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||3506 !//D/.test( match[2] ) && "0n+" + match[2] || match[2]);35073508// calculate the numbers (first)n+(last) including if they are negative3509 match[2] = (test[1] + (test[2] || 1)) - 0;3510 match[3] = test[3] - 0;3511 }35123513// TODO: Move to normal caching system3514 match[0] = done++;35153516return match;3517 },35183519 ATTR: function( match, curLoop, inplace, result, not, isXML ) {3520var name = match[1].replace(////g, "");35213522if ( !isXML && Expr.attrMap[name] ) {3523 match[1] = Expr.attrMap[name];3524 }35253526if ( match[2] === "~=" ) {3527 match[4] = " " + match[4] + " ";3528 }35293530return match;3531 },35323533 PSEUDO: function( match, curLoop, inplace, result, not ) {3534if ( match[1] === "not" ) {3535// If we're dealing with a complex expression, or a simple one3536if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^/w/.test(match[3]) ) {3537 match[3] = Sizzle(match[3], null, null, curLoop);35383539 } else {3540var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);35413542if ( !inplace ) {3543 result.push.apply( result, ret );3544 }35453546returnfalse;3547 }35483549 } elseif ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {3550returntrue;3551 }35523553return match;3554 },35553556 POS: function( match ) {3557 match.unshift( true );35583559return match;3560 }3561 },35623563 filters: {3564 enabled: function( elem ) {3565return elem.disabled === false && elem.type !== "hidden";3566 },35673568 disabled: function( elem ) {3569return elem.disabled === true;3570 },35713572 checked: function( elem ) {3573return elem.checked === true;3574 },35753576 selected: function( elem ) {3577// Accessing this property makes selected-by-default3578// options in Safari work properly3579 elem.parentNode.selectedIndex;35803581return elem.selected === true;3582 },35833584 parent: function( elem ) {3585return !!elem.firstChild;3586 },35873588 empty: function( elem ) {3589return !elem.firstChild;3590 },35913592 has: function( elem, i, match ) {3593return !!Sizzle( match[3], elem ).length;3594 },35953596 header: function( elem ) {3597return (/h/d/i).test( elem.nodeName );3598 },35993600 text: function( elem ) {3601return "text" === elem.type;3602 },3603 radio: function( elem ) {3604return "radio" === elem.type;3605 },36063607 checkbox: function( elem ) {3608return "checkbox" === elem.type;3609 },36103611 file: function( elem ) {3612return "file" === elem.type;3613 },3614 password: function( elem ) {3615return "password" === elem.type;3616 },36173618 submit: function( elem ) {3619return "submit" === elem.type;3620 },36213622 image: function( elem ) {3623return "image" === elem.type;3624 },36253626 reset: function( elem ) {3627return "reset" === elem.type;3628 },36293630 button: function( elem ) {3631return "button" === elem.type || elem.nodeName.toLowerCase() === "button";3632 },36333634 input: function( elem ) {3635return (/input|select|textarea|button/i).test( elem.nodeName );3636 }3637 },3638 setFilters: {3639 first: function( elem, i ) {3640return i === 0;3641 },36423643 last: function( elem, i, match, array ) {3644return i === array.length - 1;3645 },36463647 even: function( elem, i ) {3648return i % 2 === 0;3649 },36503651 odd: function( elem, i ) {3652return i % 2 === 1;3653 },36543655 lt: function( elem, i, match ) {3656return i < match[3] - 0;3657 },36583659 gt: function( elem, i, match ) {3660return i > match[3] - 0;3661 },36623663 nth: function( elem, i, match ) {3664return match[3] - 0 === i;3665 },36663667 eq: function( elem, i, match ) {3668return match[3] - 0 === i;3669 }3670 },3671 filter: {3672 PSEUDO: function( elem, match, i, array ) {3673var name = match[1],3674 filter = Expr.filters[ name ];36753676if ( filter ) {3677return filter( elem, i, match, array );36783679 } elseif ( name === "contains" ) {3680return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;36813682 } elseif ( name === "not" ) {3683var not = match[3];36843685for ( var j = 0, l = not.length; j < l; j++ ) {3686if ( not[j] === elem ) {3687returnfalse;3688 }3689 }36903691returntrue;36923693 } else {3694 Sizzle.error( "Syntax error, unrecognized expression: " + name );3695 }3696 },36973698 CHILD: function( elem, match ) {3699var type = match[1],3700 node = elem;37013702switch ( type ) {3703case "only":3704case "first":3705while ( (node = node.previousSibling) ) {3706if ( node.nodeType === 1 ) { 3707returnfalse; 3708 }3709 }37103711if ( type === "first" ) { 3712returntrue; 3713 }37143715 node = elem;37163717case "last":3718while ( (node = node.nextSibling) ) {3719if ( node.nodeType === 1 ) { 3720returnfalse; 3721 }3722 }37233724returntrue;37253726case "nth":3727var first = match[2],3728 last = match[3];37293730if ( first === 1 && last === 0 ) {3731returntrue;3732 }37333734var doneName = match[0],3735 parent = elem.parentNode;37363737if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {3738var count = 0;37393740for ( node = parent.firstChild; node; node = node.nextSibling ) {3741if ( node.nodeType === 1 ) {3742 node.nodeIndex = ++count;3743 }3744 } 37453746 parent.sizcache = doneName;3747 }37483749var diff = elem.nodeIndex - last;37503751if ( first === 0 ) {3752return diff === 0;37533754 } else {3755return ( diff % first === 0 && diff / first >= 0 );3756 }3757 }3758 },37593760 ID: function( elem, match ) {3761return elem.nodeType === 1 && elem.getAttribute("id") === match;3762 },37633764 TAG: function( elem, match ) {3765return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;3766 },37673768 CLASS: function( elem, match ) {3769return (" " + (elem.className || elem.getAttribute("class")) + " ")3770 .indexOf( match ) > -1;3771 },37723773 ATTR: function( elem, match ) {3774var name = match[1],3775 result = Expr.attrHandle[ name ] ?3776 Expr.attrHandle[ name ]( elem ) :3777 elem[ name ] != null ?3778 elem[ name ] :3779 elem.getAttribute( name ),3780 value = result + "",3781 type = match[2],3782 check = match[4];37833784return result == null ?3785 type === "!=" :3786 type === "=" ?3787 value === check :3788 type === "*=" ?3789 value.indexOf(check) >= 0 :3790 type === "~=" ?3791 (" " + value + " ").indexOf(check) >= 0 :3792 !check ?3793 value && result !== false :3794 type === "!=" ?3795 value !== check :3796 type === "^=" ?3797 value.indexOf(check) === 0 :3798 type === "$=" ?3799 value.substr(value.length - check.length) === check :3800 type === "|=" ?3801 value === check || value.substr(0, check.length + 1) === check + "-" :3802false;3803 },38043805 POS: function( elem, match, i, array ) {3806var name = match[2],3807 filter = Expr.setFilters[ name ];38083809if ( filter ) {3810return filter( elem, i, match, array );3811 }3812 }3813 }3814};38153816var origPOS = Expr.match.POS,3817 fescape = function(all, num){3818return "//" + (num - 0 + 1);3819 };38203821for ( var type in Expr.match ) {3822 Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^/[]*/])(?![^/(]*/))/.source) );3823 Expr.leftMatch[ type ] = new RegExp( /(^(?:.|/r|/n)*?)/.source + Expr.match[ type ].source.replace(///(/d+)/g, fescape) );3824}38253826var makeArray = function( array, results ) {3827 array = Array.prototype.slice.call( array, 0 );38283829if ( results ) {3830 results.push.apply( results, array );3831return results;3832 }38333834return array;3835};38363837// Perform a simple check to determine if the browser is capable of3838// converting a NodeList to an array using builtin methods.3839// Also verifies that the returned array holds DOM nodes3840// (which is not the case in the Blackberry browser)3841try {3842 Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;38433844// Provide a fallback method if it does not work3845 } catch( e ) {3846 makeArray = function( array, results ) {3847var i = 0,3848 ret = results || [];38493850if ( toString.call(array) === "[object Array]" ) {3851 Array.prototype.push.apply( ret, array );38523853 } else {3854if ( typeof array.length === "number" ) {3855for ( var l = array.length; i < l; i++ ) {3856 ret.push( array[i] );3857 }38583859 } else {3860for ( ; array[i]; i++ ) {3861 ret.push( array[i] );3862 }3863 }3864 }38653866return ret;3867 };3868}38693870var sortOrder, siblingCheck;38713872if ( document.documentElement.compareDocumentPosition ) {3873 sortOrder = function( a, b ) {3874if ( a === b ) {3875 hasDuplicate = true;3876return 0;3877 }38783879if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {3880return a.compareDocumentPosition ? -1 : 1;3881 }38823883return a.compareDocumentPosition(b) & 4 ? -1 : 1;3884 };38853886 } else {3887 sortOrder = function( a, b ) {3888var al, bl,3889 ap = [],3890 bp = [],3891 aup = a.parentNode,3892 bup = b.parentNode,3893 cur = aup;38943895// The nodes are identical, we can exit early3896if ( a === b ) {3897 hasDuplicate = true;3898return 0;38993900// If the nodes are siblings (or identical) we can do a quick check3901 } elseif ( aup === bup ) {3902return siblingCheck( a, b );39033904// If no parents were found then the nodes are disconnected3905 } elseif ( !aup ) {3906return -1;39073908 } elseif ( !bup ) {3909return 1;3910 }39113912// Otherwise they're somewhere else in the tree so we need3913// to build up a full list of the parentNodes for comparison3914while ( cur ) {3915 ap.unshift( cur );3916 cur = cur.parentNode;3917 }39183919 cur = bup;39203921while ( cur ) {3922 bp.unshift( cur );3923 cur = cur.parentNode;3924 }39253926 al = ap.length;3927 bl = bp.length;39283929// Start walking down the tree looking for a discrepancy3930for ( var i = 0; i < al && i < bl; i++ ) {3931if ( ap[i] !== bp[i] ) {3932return siblingCheck( ap[i], bp[i] );3933 }3934 }39353936// We ended someplace up the tree so do a sibling check3937return i === al ?3938 siblingCheck( a, bp[i], -1 ) :3939 siblingCheck( ap[i], b, 1 );3940 };39413942 siblingCheck = function( a, b, ret ) {3943if ( a === b ) {3944return ret;3945 }39463947var cur = a.nextSibling;39483949while ( cur ) {3950if ( cur === b ) {3951return -1;3952 }39533954 cur = cur.nextSibling;3955 }39563957return 1;3958 };3959}39603961// Utility function for retreiving the text value of an array of DOM nodes3962 Sizzle.getText = function( elems ) {3963var ret = "", elem;39643965for ( var i = 0; elems[i]; i++ ) {3966 elem = elems[i];39673968// Get the text from text nodes and CDATA nodes3969if ( elem.nodeType === 3 || elem.nodeType === 4 ) {3970 ret += elem.nodeValue;39713972// Traverse everything else, except comment nodes3973 } elseif ( elem.nodeType !== 8 ) {3974 ret += Sizzle.getText( elem.childNodes );3975 }3976 }39773978return ret;3979};39803981// Check to see if the browser returns elements by name when3982// querying by getElementById (and provide a workaround)3983 (function(){3984// We're going to inject a fake input element with a specified name3985var form = document.createElement("div"),3986 id = "script" + (new Date()).getTime(),3987 root = document.documentElement;39883989 form.innerHTML = "";39903991// Inject it into the root element, check its status, and remove it quickly3992 root.insertBefore( form, root.firstChild );39933994// The workaround has to do additional checks after a getElementById3995// Which slows things down for other browsers (hence the branching)3996if ( document.getElementById( id ) ) {3997 Expr.find.ID = function( match, context, isXML ) {3998if ( typeof context.getElementById !== "undefined" && !isXML ) {3999var m = context.getElementById(match[1]);40004001return m ?4002 m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?4003 [m] :4004 undefined :4005 [];4006 }4007 };40084009 Expr.filter.ID = function( elem, match ) {4010var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");40114012return elem.nodeType === 1 && node && node.nodeValue === match;4013 };4014 }40154016 root.removeChild( form );40174018// release memory in IE4019 root = form = null;4020})();40214022 (function(){4023// Check to see if the browser returns only elements4024// when doing getElementsByTagName("*")40254026// Create a fake element4027var div = document.createElement("div");4028 div.appendChild( document.createComment("") );40294030// Make sure no comments are found4031if ( div.getElementsByTagName("*").length > 0 ) {4032 Expr.find.TAG = function( match, context ) {4033var results = context.getElementsByTagName( match[1] );40344035// Filter out possible comments4036if ( match[1] === "*" ) {4037var tmp = [];40384039for ( var i = 0; results[i]; i++ ) {4040if ( results[i].nodeType === 1 ) {4041 tmp.push( results[i] );4042 }4043 }40444045 results = tmp;4046 }40474048return results;4049 };4050 }40514052// Check to see if an attribute returns normalized href attributes4053 div.innerHTML = "";40544055if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&4056 div.firstChild.getAttribute("href") !== "#" ) {40574058 Expr.attrHandle.href = function( elem ) {4059return elem.getAttribute( "href", 2 );4060 };4061 }40624063// release memory in IE4064 div = null;4065})();40664067if ( document.querySelectorAll ) {4068 (function(){4069var oldSizzle = Sizzle,4070 div = document.createElement("div"),4071 id = "__sizzle__";40724073 div.innerHTML = "";40744075// Safari can't handle uppercase or unicode characters when4076// in quirks mode.4077if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {4078return;4079 }40804081 Sizzle = function( query, context, extra, seed ) {4082 context = context || document;40834084// Make sure that attribute selectors are quoted4085 query = query.replace(//=/s*([^'"/]]*)/s*/]/g, "='$1']");40864087// Only use querySelectorAll on non-XML documents4088// (ID selectors don't work in non-HTML documents)4089if ( !seed && !Sizzle.isXML(context) ) {4090if ( context.nodeType === 9 ) {4091try {4092return makeArray( context.querySelectorAll(query), extra );4093 } catch(qsaError) {}40944095// qSA works strangely on Element-rooted queries4096// We can work around this by specifying an extra ID on the root4097// and working up from there (Thanks to Andrew Dupont for the technique)4098// IE 8 doesn't work on object elements4099 } elseif ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {4100var old = context.getAttribute( "id" ),4101 nid = old || id;41024103if ( !old ) {4104 context.setAttribute( "id", nid );4105 }41064107try {4108return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra );41094110 } catch(pseudoError) {4111 } finally {4112if ( !old ) {4113 context.removeAttribute( "id" );4114 }4115 }4116 }4117 }41184119return oldSizzle(query, context, extra, seed);4120 };41214122for ( var prop in oldSizzle ) {4123 Sizzle[ prop ] = oldSizzle[ prop ];4124 }41254126// release memory in IE4127 div = null;4128 })();4129}41304131 (function(){4132var html = document.documentElement,4133 matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector,4134 pseudoWorks = false;41354136try {4137// This should fail with an exception4138// Gecko does not error, returns false instead4139 matches.call( document.documentElement, "[test!='']:sizzle" );41404141 } catch( pseudoError ) {4142 pseudoWorks = true;4143 }41444145if ( matches ) {4146 Sizzle.matchesSelector = function( node, expr ) {4147// Make sure that attribute selectors are quoted4148 expr = expr.replace(//=/s*([^'"/]]*)/s*/]/g, "='$1']");41494150if ( !Sizzle.isXML( node ) ) {4151try { 4152if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {4153return matches.call( node, expr );4154 }4155 } catch(e) {}4156 }41574158return Sizzle(expr, null, null, [node]).length > 0;4159 };4160 }4161})();41624163 (function(){4164var div = document.createElement("div");41654166 div.innerHTML = "";41674168// Opera can't find a second classname (in 9.6)4169// Also, make sure that getElementsByClassName actually exists4170if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {4171return;4172 }41734174// Safari caches class attributes, doesn't catch changes (in 3.2)4175 div.lastChild.className = "e";41764177if ( div.getElementsByClassName("e").length === 1 ) {4178return;4179 }41804181 Expr.order.splice(1, 0, "CLASS");4182 Expr.find.CLASS = function( match, context, isXML ) {4183if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {4184return context.getElementsByClassName(match[1]);4185 }4186 };41874188// release memory in IE4189 div = null;4190})();41914192function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {4193for ( var i = 0, l = checkSet.length; i < l; i++ ) {4194var elem = checkSet[i];41954196if ( elem ) {4197var match = false;41984199 elem = elem[dir];42004201while ( elem ) {4202if ( elem.sizcache === doneName ) {4203 match = checkSet[elem.sizset];4204break;4205 }42064207if ( elem.nodeType === 1 && !isXML ){4208 elem.sizcache = doneName;4209 elem.sizset = i;4210 }42114212if ( elem.nodeName.toLowerCase() === cur ) {4213 match = elem;4214break;4215 }42164217 elem = elem[dir];4218 }42194220 checkSet[i] = match;4221 }4222 }4223}42244225function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {4226for ( var i = 0, l = checkSet.length; i < l; i++ ) {4227var elem = checkSet[i];42284229if ( elem ) {4230var match = false;42314232 elem = elem[dir];42334234while ( elem ) {4235if ( elem.sizcache === doneName ) {4236 match = checkSet[elem.sizset];4237break;4238 }42394240if ( elem.nodeType === 1 ) {4241if ( !isXML ) {4242 elem.sizcache = doneName;4243 elem.sizset = i;4244 }42454246if ( typeof cur !== "string" ) {4247if ( elem === cur ) {4248 match = true;4249break;4250 }42514252 } elseif ( Sizzle.filter( cur, [elem] ).length > 0 ) {4253 match = elem;4254break;4255 }4256 }42574258 elem = elem[dir];4259 }42604261 checkSet[i] = match;4262 }4263 }4264}42654266if ( document.documentElement.contains ) {4267 Sizzle.contains = function( a, b ) {4268return a !== b && (a.contains ? a.contains(b) : true);4269 };42704271 } elseif ( document.documentElement.compareDocumentPosition ) {4272 Sizzle.contains = function( a, b ) {4273return !!(a.compareDocumentPosition(b) & 16);4274 };42754276 } else {4277 Sizzle.contains = function() {4278returnfalse;4279 };4280}42814282 Sizzle.isXML = function( elem ) {4283// documentElement is verified for cases where it doesn't yet exist4284// (such as loading iframes in IE - #4833) 4285var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;42864287return documentElement ? documentElement.nodeName !== "HTML" : false;4288};42894290var posProcess = function( selector, context ) {4291var match,4292 tmpSet = [],4293 later = "",4294 root = context.nodeType ? [context] : context;42954296// Position selectors must be done after the filter4297// And so must :not(positional) so we move all PSEUDOs to the end4298while ( (match = Expr.match.PSEUDO.exec( selector )) ) {4299 later += match[0];4300 selector = selector.replace( Expr.match.PSEUDO, "" );4301 }43024303 selector = Expr.relative[selector] ? selector + "*" : selector;43044305for ( var i = 0, l = root.length; i < l; i++ ) {4306 Sizzle( selector, root[i], tmpSet );4307 }43084309return Sizzle.filter( later, tmpSet );4310};43114312// EXPOSE4313 jQuery.find = Sizzle;4314 jQuery.expr = Sizzle.selectors;4315 jQuery.expr[":"] = jQuery.expr.filters;4316 jQuery.unique = Sizzle.uniqueSort;4317 jQuery.text = Sizzle.getText;4318 jQuery.isXMLDoc = Sizzle.isXML;4319 jQuery.contains = Sizzle.contains;432043214322})();432343244325var runtil = /Until$/,4326 rparentsprev = /^(?:parents|prevUntil|prevAll)/,4327// Note: This RegExp should be improved, or likely pulled from Sizzle4328 rmultiselector = /,/,4329 isSimple = /^.[^:#/[/.,]*$/,4330 slice = Array.prototype.slice,4331 POS = jQuery.expr.match.POS;43324333jQuery.fn.extend({4334 find: function( selector ) {4335var ret = this.pushStack( "", "find", selector ),4336 length = 0;43374338for ( var i = 0, l = this.length; i < l; i++ ) {4339 length = ret.length;4340 jQuery.find( selector, this[i], ret );43414342if ( i > 0 ) {4343// Make sure that the results are unique4344for ( var n = length; n < ret.length; n++ ) {4345for ( var r = 0; r < length; r++ ) {4346if ( ret[r] === ret[n] ) {4347 ret.splice(n--, 1);4348break;4349 }4350 }4351 }4352 }4353 }43544355return ret;4356 },43574358 has: function( target ) {4359var targets = jQuery( target );4360returnthis.filter(function() {4361for ( var i = 0, l = targets.length; i < l; i++ ) {4362if ( jQuery.contains( this, targets[i] ) ) {4363returntrue;4364 }4365 }4366 });4367 },43684369 not: function( selector ) {4370returnthis.pushStack( winnow(this, selector, false), "not", selector);4371 },43724373 filter: function( selector ) {4374returnthis.pushStack( winnow(this, selector, true), "filter", selector );4375 },43764377 is: function( selector ) {4378return !!selector && jQuery.filter( selector, this ).length > 0;4379 },43804381 closest: function( selectors, context ) {4382var ret = [], i, l, cur = this[0];43834384if ( jQuery.isArray( selectors ) ) {4385var match, selector,4386 matches = {},4387 level = 1;43884389if ( cur && selectors.length ) {4390for ( i = 0, l = selectors.length; i < l; i++ ) {4391 selector = selectors[i];43924393if ( !matches[selector] ) {4394 matches[selector] = jQuery.expr.match.POS.test( selector ) ? 4395 jQuery( selector, context || this.context ) :4396 selector;4397 }4398 }43994400while ( cur && cur.ownerDocument && cur !== context ) {4401for ( selector in matches ) {4402 match = matches[selector];44034404if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {4405 ret.push({ selector: selector, elem: cur, level: level });4406 }4407 }44084409 cur = cur.parentNode;4410 level++;4411 }4412 }44134414return ret;4415 }44164417var pos = POS.test( selectors ) ? 4418 jQuery( selectors, context || this.context ) : null;44194420for ( i = 0, l = this.length; i < l; i++ ) {4421 cur = this[i];44224423while ( cur ) {4424if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {4425 ret.push( cur );4426break;44274428 } else {4429 cur = cur.parentNode;4430if ( !cur || !cur.ownerDocument || cur === context ) {4431break;4432 }4433 }4434 }4435 }44364437 ret = ret.length > 1 ? jQuery.unique(ret) : ret;44384439returnthis.pushStack( ret, "closest", selectors );4440 },44414442// Determine the position of an element within4443// the matched set of elements4444 index: function( elem ) {4445if ( !elem || typeof elem === "string" ) {4446return jQuery.inArray( this[0],4447// If it receives a string, the selector is used4448// If it receives nothing, the siblings are used4449 elem ? jQuery( elem ) : this.parent().children() );4450 }4451// Locate the position of the desired element4452return jQuery.inArray(4453// If it receives a jQuery object, the first element is used4454 elem.jquery ? elem[0] : elem, this );4455 },44564457 add: function( selector, context ) {4458var set = typeof selector === "string" ?4459 jQuery( selector, context || this.context ) :4460 jQuery.makeArray( selector ),4461 all = jQuery.merge( this.get(), set );44624463returnthis.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?4464 all :4465 jQuery.unique( all ) );4466 },44674468 andSelf: function() {4469returnthis.add( this.prevObject );4470 }4471});44724473// A painfully simple check to see if an element is disconnected4474// from a document (should be improved, where feasible).4475function isDisconnected( node ) {4476return !node || !node.parentNode || node.parentNode.nodeType === 11;4477}44784479jQuery.each({4480 parent: function( elem ) {4481var parent = elem.parentNode;4482return parent && parent.nodeType !== 11 ? parent : null;4483 },4484 parents: function( elem ) {4485return jQuery.dir( elem, "parentNode" );4486 },4487 parentsUntil: function( elem, i, until ) {4488return jQuery.dir( elem, "parentNode", until );4489 },4490 next: function( elem ) {4491return jQuery.nth( elem, 2, "nextSibling" );4492 },4493 prev: function( elem ) {4494return jQuery.nth( elem, 2, "previousSibling" );4495 },4496 nextAll: function( elem ) {4497return jQuery.dir( elem, "nextSibling" );4498 },4499 prevAll: function( elem ) {4500return jQuery.dir( elem, "previousSibling" );4501 },4502 nextUntil: function( elem, i, until ) {4503return jQuery.dir( elem, "nextSibling", until );4504 },4505 prevUntil: function( elem, i, until ) {4506return jQuery.dir( elem, "previousSibling", until );4507 },4508 siblings: function( elem ) {4509return jQuery.sibling( elem.parentNode.firstChild, elem );4510 },4511 children: function( elem ) {4512return jQuery.sibling( elem.firstChild );4513 },4514 contents: function( elem ) {4515return jQuery.nodeName( elem, "iframe" ) ?4516 elem.contentDocument || elem.contentWindow.document :4517 jQuery.makeArray( elem.childNodes );4518 }4519 }, function( name, fn ) {4520 jQuery.fn[ name ] = function( until, selector ) {4521var ret = jQuery.map( this, fn, until );45224523if ( !runtil.test( name ) ) {4524 selector = until;4525 }45264527if ( selector && typeof selector === "string" ) {4528 ret = jQuery.filter( selector, ret );4529 }45304531 ret = this.length > 1 ? jQuery.unique( ret ) : ret;45324533if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {4534 ret = ret.reverse();4535 }45364537returnthis.pushStack( ret, name, slice.call(arguments).join(",") );4538 };4539});45404541jQuery.extend({4542 filter: function( expr, elems, not ) {4543if ( not ) {4544 expr = ":not(" + expr + ")";4545 }45464547return elems.length === 1 ?4548 jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :4549 jQuery.find.matches(expr, elems);4550 },45514552 dir: function( elem, dir, until ) {4553var matched = [],4554 cur = elem[ dir ];45554556while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {4557if ( cur.nodeType === 1 ) {4558 matched.push( cur );4559 }4560 cur = cur[dir];4561 }4562return matched;4563 },45644565 nth: function( cur, result, dir, elem ) {4566 result = result || 1;4567var num = 0;45684569for ( ; cur; cur = cur[dir] ) {4570if ( cur.nodeType === 1 && ++num === result ) {4571break;4572 }4573 }45744575return cur;4576 },45774578 sibling: function( n, elem ) {4579var r = [];45804581for ( ; n; n = n.nextSibling ) {4582if ( n.nodeType === 1 && n !== elem ) {4583 r.push( n );4584 }4585 }45864587return r;4588 }4589});45904591// Implement the identical functionality for filter and not4592function winnow( elements, qualifier, keep ) {4593if ( jQuery.isFunction( qualifier ) ) {4594return jQuery.grep(elements, function( elem, i ) {4595var retVal = !!qualifier.call( elem, i, elem );4596return retVal === keep;4597 });45984599 } elseif ( qualifier.nodeType ) {4600return jQuery.grep(elements, function( elem, i ) {4601return (elem === qualifier) === keep;4602 });46034604 } elseif ( typeof qualifier === "string" ) {4605var filtered = jQuery.grep(elements, function( elem ) {4606return elem.nodeType === 1;4607 });46084609if ( isSimple.test( qualifier ) ) {4610return jQuery.filter(qualifier, filtered, !keep);4611 } else {4612 qualifier = jQuery.filter( qualifier, filtered );4613 }4614 }46154616return jQuery.grep(elements, function( elem, i ) {4617return (jQuery.inArray( elem, qualifier ) >= 0) === keep;4618 });4619}46204621462246234624var rinlinejQuery = / jQuery/d+="(?:/d+|null)"/g,4625 rleadingWhitespace = /^/s+/,4626 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([/w:]+)[^>]*)//>/ig,4627 rtagName = /<([/w:]+)/,4628 rtbody = /i,4629 rhtml = /<|?/w+;/,4630 rnocache = /<(?:script|object|embed|option|style)/i,4631// checked="checked" or checked (html5)4632 rchecked = /checked/s*(?:[^=]|=/s*.checked.)/i,4633 raction = //=([^="'>/s]+//)>/g,4634 wrapMap = {4635 option: [ 1, "" ],4636 legend: [ 1, "" ],4637 thead: [ 1, "
什么是Hessian
The Hessian binary web service protocol makes web services usable without requiring a large framework, and without learning yet another alphabet soup of protocols. Because it is a binary p
在Spark Shell上,通过创建HiveContext可以直接进行Hive操作
1. 操作Hive中已存在的表
[hadoop@hadoop bin]$ ./spark-shell
Spark assembly has been built with Hive, including Datanucleus jars on classpath
Welcom
JMS Message Delivery Reliability and Acknowledgement Patterns
http://wso2.com/library/articles/2013/01/jms-message-delivery-reliability-acknowledgement-patterns/
Transaction and redelivery in
转载请出自出处:http://eksliang.iteye.com/blog/2177567 一、游标
数据库使用游标返回find的执行结果。客户端对游标的实现通常能够对最终结果进行有效控制,从shell中定义一个游标非常简单,就是将查询结果分配给一个变量(用var声明的变量就是局部变量),便创建了一个游标,如下所示:
> var