相信很多同学都注意到了,各大新闻或者娱乐网站都含有动态图片切换,那个漂亮的感觉让刚刚学习html的人,都非常好奇和心动。那下面就让我们看一下到底如何实现动态图片切换呢?看一下百度贴吧的效果图吧~

[javascript] view plaincopyprint?
 
[javascript] view plaincopyprint?
  1. // JavaScript Document
  2. var t = count = n = 0;
  3. $(function(){
  4. $(".big_img a:not(:first)").hide();
  5. $(".link_nav a:not(:first)").hide();
  6. $num_nav = $(".num_nav span");
  7. $big_img = $(".big_img a");
  8. count = $big_img.length;
  9. t = setInterval("showAuto()", 3000);
  10. $num_nav.click(function(){
  11. var num_nav = $(".num_nav span").index(this);
  12. $(this).addClass("selected").siblings().removeClass("selected");
  13. $big_img.filter(":visible").fadeOut(500).parent().children().eq(num_nav).fadeIn(1000);
  14. $(".link_nav a").filter(":visible").fadeOut(500).parent().children().eq(num_nav).fadeIn(1000);
  15. });
  16. $(".img_nav").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 3000);});
  17. })
  18. function showAuto()
  19. {
  20. n = n >= 2 ? 0 : (n + 1);
  21. $num_nav.eq(n).trigger('click');
  22. }
// JavaScript Document
var t = count = n = 0;
$(function(){$(".big_img a:not(:first)").hide();$(".link_nav a:not(:first)").hide();$num_nav = $(".num_nav span");$big_img = $(".big_img a");count = $big_img.length;t = setInterval("showAuto()", 3000);  $num_nav.click(function(){var num_nav = $(".num_nav span").index(this);$(this).addClass("selected").siblings().removeClass("selected");$big_img.filter(":visible").fadeOut(500).parent().children().eq(num_nav).fadeIn(1000); $(".link_nav a").filter(":visible").fadeOut(500).parent().children().eq(num_nav).fadeIn(1000); });$(".img_nav").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 3000);});
})function showAuto()
{   n = n >= 2 ? 0 : (n + 1);   $num_nav.eq(n).trigger('click');
}
[javascript] view plaincopyprint?
  1. /*!
  2. * jQuery JavaScript Library v1.3.1
  3. * http://jquery.com/
  4. *
  5. * Copyright (c) 2009 John Resig
  6. * Dual licensed under the MIT and GPL licenses.
  7. * http://docs.jquery.com/License
  8. *
  9. * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)
  10. * Revision: 6158
  11. */
  12. (function(){
  13. var
  14. // Will speed up references to window, and allows munging its name.
  15. window = this,
  16. // Will speed up references to undefined, and allows munging its name.
  17. undefined,
  18. // Map over jQuery in case of overwrite
  19. _jQuery = window.jQuery,
  20. // Map over the $ in case of overwrite
  21. _$ = window.$,
  22. jQuery = window.jQuery = window.$ = function( selector, context ) {
  23. // The jQuery object is actually just the init constructor 'enhanced'
  24. return new jQuery.fn.init( selector, context );
  25. },
  26. // A simple way to check for HTML strings or ID strings
  27. // (both of which we optimize for)
  28. quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
  29. // Is it a simple selector
  30. isSimple = /^.[^:#\[\.,]*$/;
  31. jQuery.fn = jQuery.prototype = {
  32. init: function( selector, context ) {
  33. // Make sure that a selection was provided
  34. selector = selector || document;
  35. // Handle $(DOMElement)
  36. if ( selector.nodeType ) {
  37. this[0] = selector;
  38. this.length = 1;
  39. this.context = selector;
  40. return this;
  41. }
  42. // Handle HTML strings
  43. if ( typeof selector === "string" ) {
  44. // Are we dealing with HTML string or an ID?
  45. var match = quickExpr.exec( selector );
  46. // Verify a match, and that no context was specified for #id
  47. if ( match && (match[1] || !context) ) {
  48. // HANDLE: $(html) -> $(array)
  49. if ( match[1] )
  50. selector = jQuery.clean( [ match[1] ], context );
  51. // HANDLE: $("#id")
  52. else {
  53. var elem = document.getElementById( match[3] );
  54. // Handle the case where IE and Opera return items
  55. // by name instead of ID
  56. if ( elem && elem.id != match[3] )
  57. return jQuery().find( selector );
  58. // Otherwise, we inject the element directly into the jQuery object
  59. var ret = jQuery( elem || [] );
  60. ret.context = document;
  61. ret.selector = selector;
  62. return ret;
  63. }
  64. // HANDLE: $(expr, [context])
  65. // (which is just equivalent to: $(content).find(expr)
  66. else
  67. return jQuery( context ).find( selector );
  68. // HANDLE: $(function)
  69. // Shortcut for document ready
  70. else if ( jQuery.isFunction( selector ) )
  71. return jQuery( document ).ready( selector );
  72. // Make sure that old selector state is passed along
  73. if ( selector.selector && selector.context ) {
  74. this.selector = selector.selector;
  75. this.context = selector.context;
  76. }
  77. return this.setArray(jQuery.makeArray(selector));
  78. },
  79. // Start with an empty selector
  80. selector: "",
  81. // The current version of jQuery being used
  82. jquery: "1.3.1",
  83. // The number of elements contained in the matched element set
  84. size: function() {
  85. return this.length;
  86. },
  87. // Get the Nth element in the matched element set OR
  88. // Get the whole matched element set as a clean array
  89. get: function( num ) {
  90. return num === undefined ?
  91. // Return a 'clean' array
  92. jQuery.makeArray( this ) :
  93. // Return just the object
  94. this[ num ];
  95. },
  96. // Take an array of elements and push it onto the stack
  97. // (returning the new matched element set)
  98. pushStack: function( elems, name, selector ) {
  99. // Build a new jQuery matched element set
  100. var ret = jQuery( elems );
  101. // Add the old object onto the stack (as a reference)
  102. ret.prevObject = this;
  103. ret.context = this.context;
  104. if ( name === "find" )
  105. ret.selector = this.selector + (this.selector ? " " : "") + selector;
  106. else if ( name )
  107. ret.selector = this.selector + "." + name + "(" + selector + ")";
  108. // Return the newly-formed element set
  109. return ret;
  110. },
  111. // Force the current matched set of elements to become
  112. // the specified array of elements (destroying the stack in the process)
  113. // You should use pushStack() in order to do this, but maintain the stack
  114. setArray: function( elems ) {
  115. // Resetting the length to 0, then using the native Array push
  116. // is a super-fast way to populate an object with array-like properties
  117. this.length = 0;
  118. Array.prototype.push.apply( this, elems );
  119. return this;
  120. },
  121. // Execute a callback for every element in the matched set.
  122. // (You can seed the arguments with an array of args, but this is
  123. // only used internally.)
  124. each: function( callback, args ) {
  125. return jQuery.each( this, callback, args );
  126. },
  127. // Determine the position of an element within
  128. // the matched set of elements
  129. index: function( elem ) {
  130. // Locate the position of the desired element
  131. return jQuery.inArray(
  132. // If it receives a jQuery object, the first element is used
  133. elem && elem.jquery ? elem[0] : elem
  134. this );
  135. },
  136. attr: function( name, value, type ) {
  137. var options = name;
  138. // Look for the case where we're accessing a style value
  139. if ( typeof name === "string" )
  140. if ( value === undefined )
  141. return this[0] && jQuery[ type || "attr" ]( this[0], name );
  142. else {
  143. options = {};
  144. options[ name ] = value;
  145. }
  146. // Check to see if we're setting style values
  147. return this.each(function(i){
  148. // Set all the styles
  149. for ( name in options )
  150. jQuery.attr(
  151. type ?
  152. this.style :
  153. this,
  154. name, jQuery.prop( this, options[ name ], type, i, name )
  155. );
  156. });
  157. },
  158. css: function( key, value ) {
  159. // ignore negative width and height values
  160. if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
  161. value = undefined;
  162. return this.attr( key, value, "curCSS" );
  163. },
  164. text: function( text ) {
  165. if ( typeof text !== "object" && text != null )
  166. return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
  167. var ret = "";
  168. jQuery.each( text || thisfunction(){
  169. jQuery.each( this.childNodes, function(){
  170. if ( this.nodeType != 8 )
  171. ret += this.nodeType != 1 ?
  172. this.nodeValue :
  173. jQuery.fn.text( [ this ] );
  174. });
  175. });
  176. return ret;
  177. },
  178. wrapAll: function( html ) {
  179. if ( this[0] ) {
  180. // The elements to wrap the target around
  181. var wrap = jQuery( html, this[0].ownerDocument ).clone();
  182. if ( this[0].parentNode )
  183. wrap.insertBefore( this[0] );
  184. wrap.map(function(){
  185. var elem = this;
  186. while ( elem.firstChild )
  187. elem = elem.firstChild;
  188. return elem;
  189. }).append(this);
  190. }
  191. return this;
  192. },
  193. wrapInner: function( html ) {
  194. return this.each(function(){
  195. jQuery( this ).contents().wrapAll( html );
  196. });
  197. },
  198. wrap: function( html ) {
  199. return this.each(function(){
  200. jQuery( this ).wrapAll( html );
  201. });
  202. },
  203. append: function() {
  204. return this.domManip(arguments, truefunction(elem){
  205. if (this.nodeType == 1)
  206. this.appendChild( elem );
  207. });
  208. },
  209. prepend: function() {
  210. return this.domManip(arguments, truefunction(elem){
  211. if (this.nodeType == 1)
  212. this.insertBefore( elem, this.firstChild );
  213. });
  214. },
  215. before: function() {
  216. return this.domManip(arguments, falsefunction(elem){
  217. this.parentNode.insertBefore( elem, this );
  218. });
  219. },
  220. after: function() {
  221. return this.domManip(arguments, falsefunction(elem){
  222. this.parentNode.insertBefore( elem, this.nextSibling );
  223. });
  224. },
  225. end: function() {
  226. return this.prevObject || jQuery( [] );
  227. },
  228. // For internal use only.
  229. // Behaves like an Array's .push method, not like a jQuery method.
  230. push: [].push,
  231. find: function( selector ) {
  232. if ( this.length === 1 && !/,/.test(selector) ) {
  233. var ret = this.pushStack( [], "find", selector );
  234. ret.length = 0;
  235. jQuery.find( selector, this[0], ret );
  236. return ret;
  237. else {
  238. var elems = jQuery.map(thisfunction(elem){
  239. return jQuery.find( selector, elem );
  240. });
  241. return this.pushStack( /[^+>] [^+>]/.test( selector ) ?
  242. jQuery.unique( elems ) :
  243. elems, "find", selector );
  244. }
  245. },
  246. clone: function( events ) {
  247. // Do the clone
  248. var ret = this.map(function(){
  249. if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
  250. // IE copies events bound via attachEvent when
  251. // using cloneNode. Calling detachEvent on the
  252. // clone will also remove the events from the orignal
  253. // In order to get around this, we use innerHTML.
  254. // Unfortunately, this means some modifications to
  255. // attributes in IE that are actually only stored
  256. // as properties will not be copied (such as the
  257. // the name attribute on an input).
  258. var clone = this.cloneNode(true),
  259. container = document.createElement("div");
  260. container.appendChild(clone);
  261. return jQuery.clean([container.innerHTML])[0];
  262. else
  263. return this.cloneNode(true);
  264. });
  265. // Need to set the expando to null on the cloned set if it exists
  266. // removeData doesn't work here, IE removes it from the original as well
  267. // this is primarily for IE but the data expando shouldn't be copied over in any browser
  268. var clone = ret.find("*").andSelf().each(function(){
  269. if ( this[ expando ] !== undefined )
  270. this[ expando ] = null;
  271. });
  272. // Copy the events from the original to the clone
  273. if ( events === true )
  274. this.find("*").andSelf().each(function(i){
  275. if (this.nodeType == 3)
  276. return;
  277. var events = jQuery.data( this"events" );
  278. for ( var type in events )
  279. for ( var handler in events[ type ] )
  280. jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data );
  281. });
  282. // Return the cloned set
  283. return ret;
  284. },
  285. filter: function( selector ) {
  286. return this.pushStack(
  287. jQuery.isFunction( selector ) &&
  288. jQuery.grep(thisfunction(elem, i){
  289. return selector.call( elem, i );
  290. }) ||
  291. jQuery.multiFilter( selector, jQuery.grep(thisfunction(elem){
  292. return elem.nodeType === 1;
  293. }) ), "filter", selector );
  294. },
  295. closest: function( selector ) {
  296. var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null;
  297. return this.map(function(){
  298. var cur = this;
  299. while ( cur && cur.ownerDocument ) {
  300. if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) )
  301. return cur;
  302. cur = cur.parentNode;
  303. }
  304. });
  305. },
  306. not: function( selector ) {
  307. if ( typeof selector === "string" )
  308. // test special case where just one selector is passed in
  309. if ( isSimple.test( selector ) )
  310. return this.pushStack( jQuery.multiFilter( selector, thistrue ), "not", selector );
  311. else
  312. selector = jQuery.multiFilter( selector, this );
  313. var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
  314. return this.filter(function() {
  315. return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
  316. });
  317. },
  318. add: function( selector ) {
  319. return this.pushStack( jQuery.unique( jQuery.merge(
  320. this.get(),
  321. typeof selector === "string" ?
  322. jQuery( selector ) :
  323. jQuery.makeArray( selector )
  324. )));
  325. },
  326. is: function( selector ) {
  327. return !!selector && jQuery.multiFilter( selector, this ).length > 0;
  328. },
  329. hasClass: function( selector ) {
  330. return !!selector && this.is( "." + selector );
  331. },
  332. val: function( value ) {
  333. if ( value === undefined ) {
  334. var elem = this[0];
  335. if ( elem ) {
  336. if( jQuery.nodeName( elem, 'option' ) )
  337. return (elem.attributes.value || {}).specified ? elem.value : elem.text;
  338. // We need to handle select boxes special
  339. if ( jQuery.nodeName( elem, "select" ) ) {
  340. var index = elem.selectedIndex,
  341. values = [],
  342. options = elem.options,
  343. one = elem.type == "select-one";
  344. // Nothing was selected
  345. if ( index < 0 )
  346. return null;
  347. // Loop through all the selected options
  348. for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
  349. var option = options[ i ];
  350. if ( option.selected ) {
  351. // Get the specifc value for the option
  352. value = jQuery(option).val();
  353. // We don't need an array for one selects
  354. if ( one )
  355. return value;
  356. // Multi-Selects return an array
  357. values.push( value );
  358. }
  359. }
  360. return values;
  361. }
  362. // Everything else, we just grab the value
  363. return (elem.value || "").replace(/\r/g, "");
  364. }
  365. return undefined;
  366. }
  367. if ( typeof value === "number" )
  368. value += '';
  369. return this.each(function(){
  370. if ( this.nodeType != 1 )
  371. return;
  372. if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) )
  373. this.checked = (jQuery.inArray(this.value, value) >= 0 ||
  374. jQuery.inArray(this.name, value) >= 0);
  375. else if ( jQuery.nodeName( this"select" ) ) {
  376. var values = jQuery.makeArray(value);
  377. jQuery( "option"this ).each(function(){
  378. this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
  379. jQuery.inArray( this.text, values ) >= 0);
  380. });
  381. if ( !values.length )
  382. this.selectedIndex = -1;
  383. else
  384. this.value = value;
  385. });
  386. },
  387. html: function( value ) {
  388. return value === undefined ?
  389. (this[0] ?
  390. this[0].innerHTML :
  391. null) :
  392. this.empty().append( value );
  393. },
  394. replaceWith: function( value ) {
  395. return this.after( value ).remove();
  396. },
  397. eq: function( i ) {
  398. return this.slice( i, +i + 1 );
  399. },
  400. slice: function() {
  401. return this.pushStack( Array.prototype.slice.apply( this, arguments ),
  402. "slice", Array.prototype.slice.call(arguments).join(",") );
  403. },
  404. map: function( callback ) {
  405. return this.pushStack( jQuery.map(thisfunction(elem, i){
  406. return callback.call( elem, i, elem );
  407. }));
  408. },
  409. andSelf: function() {
  410. return this.add( this.prevObject );
  411. },
  412. domManip: function( args, table, callback ) {
  413. if ( this[0] ) {
  414. var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),
  415. scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ),
  416. first = fragment.firstChild,
  417. extra = this.length > 1 ? fragment.cloneNode(true) : fragment;
  418. if ( first )
  419. for ( var i = 0, l = this.length; i < l; i++ )
  420. callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment );
  421. if ( scripts )
  422. jQuery.each( scripts, evalScript );
  423. }
  424. return this;
  425. function root( elem, cur ) {
  426. return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ?
  427. (elem.getElementsByTagName("tbody")[0] ||
  428. elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
  429. elem;
  430. }
  431. }
  432. };
  433. // Give the init function the jQuery prototype for later instantiation
  434. jQuery.fn.init.prototype = jQuery.fn;
  435. function evalScript( i, elem ) {
  436. if ( elem.src )
  437. jQuery.ajax({
  438. url: elem.src,
  439. async: false,
  440. dataType: "script"
  441. });
  442. else
  443. jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
  444. if ( elem.parentNode )
  445. elem.parentNode.removeChild( elem );
  446. }
  447. function now(){
  448. return +new Date;
  449. }
  450. jQuery.extend = jQuery.fn.extend = function() {
  451. // copy reference to target object
  452. var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
  453. // Handle a deep copy situation
  454. if ( typeof target === "boolean" ) {
  455. deep = target;
  456. target = arguments[1] || {};
  457. // skip the boolean and the target
  458. i = 2;
  459. }
  460. // Handle case when target is a string or something (possible in deep copy)
  461. if ( typeof target !== "object" && !jQuery.isFunction(target) )
  462. target = {};
  463. // extend jQuery itself if only one argument is passed
  464. if ( length == i ) {
  465. target = this;
  466. --i;
  467. }
  468. for ( ; i < length; i++ )
  469. // Only deal with non-null/undefined values
  470. if ( (options = arguments[ i ]) != null )
  471. // Extend the base object
  472. for ( var name in options ) {
  473. var src = target[ name ], copy = options[ name ];
  474. // Prevent never-ending loop
  475. if ( target === copy )
  476. continue;
  477. // Recurse if we're merging object values
  478. if ( deep && copy && typeof copy === "object" && !copy.nodeType )
  479. target[ name ] = jQuery.extend( deep,
  480. // Never move original objects, clone them
  481. src || ( copy.length != null ? [ ] : { } )
  482. , copy );
  483. // Don't bring in undefined values
  484. else if ( copy !== undefined )
  485. target[ name ] = copy;
  486. }
  487. // Return the modified object
  488. return target;
  489. };
  490. // exclude the following css properties to add px
  491. var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
  492. // cache defaultView
  493. defaultView = document.defaultView || {},
  494. toString = Object.prototype.toString;
  495. jQuery.extend({
  496. noConflict: function( deep ) {
  497. window.$ = _$;
  498. if ( deep )
  499. window.jQuery = _jQuery;
  500. return jQuery;
  501. },
  502. // See test/unit/core.js for details concerning isFunction.
  503. // Since version 1.3, DOM methods and functions like alert
  504. // aren't supported. They return false on IE (#2968).
  505. isFunction: function( obj ) {
  506. return toString.call(obj) === "[object Function]";
  507. },
  508. isArray: function( obj ) {
  509. return toString.call(obj) === "[object Array]";
  510. },
  511. // check if an element is in a (or is an) XML document
  512. isXMLDoc: function( elem ) {
  513. return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
  514. !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument );
  515. },
  516. // Evalulates a script in a global context
  517. globalEval: function( data ) {
  518. data = jQuery.trim( data );
  519. if ( data ) {
  520. // Inspired by code by Andrea Giammarchi
  521. // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
  522. var head = document.getElementsByTagName("head")[0] || document.documentElement,
  523. script = document.createElement("script");
  524. script.type = "text/javascript";
  525. if ( jQuery.support.scriptEval )
  526. script.appendChild( document.createTextNode( data ) );
  527. else
  528. script.text = data;
  529. // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
  530. // This arises when a base node is used (#2709).
  531. head.insertBefore( script, head.firstChild );
  532. head.removeChild( script );
  533. }
  534. },
  535. nodeName: function( elem, name ) {
  536. return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
  537. },
  538. // args is for internal usage only
  539. each: function( object, callback, args ) {
  540. var name, i = 0, length = object.length;
  541. if ( args ) {
  542. if ( length === undefined ) {
  543. for ( name in object )
  544. if ( callback.apply( object[ name ], args ) === false )
  545. break;
  546. else
  547. for ( ; i < length; )
  548. if ( callback.apply( object[ i++ ], args ) === false )
  549. break;
  550. // A special, fast, case for the most common use of each
  551. else {
  552. if ( length === undefined ) {
  553. for ( name in object )
  554. if ( callback.call( object[ name ], name, object[ name ] ) === false )
  555. break;
  556. else
  557. for ( var value = object[0];
  558. i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
  559. }
  560. return object;
  561. },
  562. prop: function( elem, value, type, i, name ) {
  563. // Handle executable functions
  564. if ( jQuery.isFunction( value ) )
  565. value = value.call( elem, i );
  566. // Handle passing in a number to a CSS property
  567. return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ?
  568. value + "px" :
  569. value;
  570. },
  571. className: {
  572. // internal only, use addClass("class")
  573. add: function( elem, classNames ) {
  574. jQuery.each((classNames || "").split(/\s+/), function(i, className){
  575. if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
  576. elem.className += (elem.className ? " " : "") + className;
  577. });
  578. },
  579. // internal only, use removeClass("class")
  580. remove: function( elem, classNames ) {
  581. if (elem.nodeType == 1)
  582. elem.className = classNames !== undefined ?
  583. jQuery.grep(elem.className.split(/\s+/), function(className){
  584. return !jQuery.className.has( classNames, className );
  585. }).join(" ") :
  586. "";
  587. },
  588. // internal only, use hasClass("class")
  589. has: function( elem, className ) {
  590. return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
  591. }
  592. },
  593. // A method for quickly swapping in/out CSS properties to get correct calculations
  594. swap: function( elem, options, callback ) {
  595. var old = {};
  596. // Remember the old values, and insert the new ones
  597. for ( var name in options ) {
  598. old[ name ] = elem.style[ name ];
  599. elem.style[ name ] = options[ name ];
  600. }
  601. callback.call( elem );
  602. // Revert the old values
  603. for ( var name in options )
  604. elem.style[ name ] = old[ name ];
  605. },
  606. css: function( elem, name, force ) {
  607. if ( name == "width" || name == "height" ) {
  608. var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left""Right" ] : [ "Top""Bottom" ];
  609. function getWH() {
  610. val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
  611. var padding = 0, border = 0;
  612. jQuery.each( which, function() {
  613. padding += parseFloat(jQuery.curCSS( elem, "padding" + thistrue)) || 0;
  614. border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width"true)) || 0;
  615. });
  616. val -= Math.round(padding + border);
  617. }
  618. if ( jQuery(elem).is(":visible") )
  619. getWH();
  620. else
  621. jQuery.swap( elem, props, getWH );
  622. return Math.max(0, val);
  623. }
  624. return jQuery.curCSS( elem, name, force );
  625. },
  626. curCSS: function( elem, name, force ) {
  627. var ret, style = elem.style;
  628. // We need to handle opacity special in IE
  629. if ( name == "opacity" && !jQuery.support.opacity ) {
  630. ret = jQuery.attr( style, "opacity" );
  631. return ret == "" ?
  632. "1" :
  633. ret;
  634. }
  635. // Make sure we're using the right name for getting the float value
  636. if ( name.match( /float/i ) )
  637. name = styleFloat;
  638. if ( !force && style && style[ name ] )
  639. ret = style[ name ];
  640. else if ( defaultView.getComputedStyle ) {
  641. // Only "float" is needed here
  642. if ( name.match( /float/i ) )
  643. name = "float";
  644. name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
  645. var computedStyle = defaultView.getComputedStyle( elem, null );
  646. if ( computedStyle )
  647. ret = computedStyle.getPropertyValue( name );
  648. // We should always get a number back from opacity
  649. if ( name == "opacity" && ret == "" )
  650. ret = "1";
  651. else if ( elem.currentStyle ) {
  652. var camelCase = name.replace(/\-(\w)/g, function(all, letter){
  653. return letter.toUpperCase();
  654. });
  655. ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
  656. // From the awesome hack by Dean Edwards
  657. // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
  658. // If we're not dealing with a regular pixel number
  659. // but a number that has a weird ending, we need to convert it to pixels
  660. if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
  661. // Remember the original values
  662. var left = style.left, rsLeft = elem.runtimeStyle.left;
  663. // Put in the new values to get a computed value out
  664. elem.runtimeStyle.left = elem.currentStyle.left;
  665. style.left = ret || 0;
  666. ret = style.pixelLeft + "px";
  667. // Revert the changed values
  668. style.left = left;
  669. elem.runtimeStyle.left = rsLeft;
  670. }
  671. }
  672. return ret;
  673. },
  674. clean: function( elems, context, fragment ) {
  675. context = context || document;
  676. // !context.createElement fails in IE with an error but returns typeof 'object'
  677. if ( typeof context.createElement === "undefined" )
  678. context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
  679. // If a single string is passed in and it's a single tag
  680. // just do a createElement and skip the rest
  681. if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) {
  682. var match = /^<(\w+)\s*\/?>$/.exec(elems[0]);
  683. if ( match )
  684. return [ context.createElement( match[1] ) ];
  685. }
  686. var ret = [], scripts = [], div = context.createElement("div");
  687. jQuery.each(elems, function(i, elem){
  688. if ( typeof elem === "number" )
  689. elem += '';
  690. if ( !elem )
  691. return;
  692. // Convert html string into DOM nodes
  693. if ( typeof elem === "string" ) {
  694. // Fix "XHTML"-style tags in all browsers
  695. elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
  696. return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
  697. all :
  698. front + "></" + tag + ">";
  699. });
  700. // Trim whitespace, otherwise indexOf won't work as expected
  701. var tags = jQuery.trim( elem ).toLowerCase();
  702. var wrap =
  703. // option or optgroup
  704. !tags.indexOf("<opt") &&
  705. [ 1, "<select multiple='multiple'>""</select>" ] ||
  706. !tags.indexOf("<leg") &&
  707. [ 1, "<fieldset>""</fieldset>" ] ||
  708. tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
  709. [ 1, "<table>""</table>" ] ||
  710. !tags.indexOf("<tr") &&
  711. [ 2, "<table><tbody>""</tbody></table>" ] ||
  712. // <thead> matched above
  713. (!tags.indexOf("<td") || !tags.indexOf("<th")) &&
  714. [ 3, "<table><tbody><tr>""</tr></tbody></table>" ] ||
  715. !tags.indexOf("<col") &&
  716. [ 2, "<table><tbody></tbody><colgroup>""</colgroup></table>" ] ||
  717. // IE can't serialize <link> and <script> tags normally
  718. !jQuery.support.htmlSerialize &&
  719. [ 1, "div<div>""</div>" ] ||
  720. [ 0, """" ];
  721. // Go to html and back, then peel off extra wrappers
  722. div.innerHTML = wrap[1] + elem + wrap[2];
  723. // Move to the right depth
  724. while ( wrap[0]-- )
  725. div = div.lastChild;
  726. // Remove IE's autoinserted <tbody> from table fragments
  727. if ( !jQuery.support.tbody ) {
  728. // String was a <table>, *may* have spurious <tbody>
  729. var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
  730. div.firstChild && div.firstChild.childNodes :
  731. // String was a bare <thead> or <tfoot>
  732. wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?
  733. div.childNodes :
  734. [];
  735. for ( var j = tbody.length - 1; j >= 0 ; --j )
  736. if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
  737. tbody[ j ].parentNode.removeChild( tbody[ j ] );
  738. }
  739. // IE completely kills leading whitespace when innerHTML is used
  740. if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) )
  741. div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
  742. elem = jQuery.makeArray( div.childNodes );
  743. }
  744. if ( elem.nodeType )
  745. ret.push( elem );
  746. else
  747. ret = jQuery.merge( ret, elem );
  748. });
  749. if ( fragment ) {
  750. for ( var i = 0; ret[i]; i++ ) {
  751. if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
  752. scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
  753. else {
  754. if ( ret[i].nodeType === 1 )
  755. ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
  756. fragment.appendChild( ret[i] );
  757. }
  758. }
  759. return scripts;
  760. }
  761. return ret;
  762. },
  763. attr: function( elem, name, value ) {
  764. // don't set attributes on text and comment nodes
  765. if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
  766. return undefined;
  767. var notxml = !jQuery.isXMLDoc( elem ),
  768. // Whether we are setting (or getting)
  769. set = value !== undefined;
  770. // Try to normalize/fix the name
  771. name = notxml && jQuery.props[ name ] || name;
  772. // Only do all the following if this is a node (faster for style)
  773. // IE elem.getAttribute passes even for style
  774. if ( elem.tagName ) {
  775. // These attributes require special treatment
  776. var special = /href|src|style/.test( name );
  777. // Safari mis-reports the default selected property of a hidden option
  778. // Accessing the parent's selectedIndex property fixes it
  779. if ( name == "selected" && elem.parentNode )
  780. elem.parentNode.selectedIndex;
  781. // If applicable, access the attribute via the DOM 0 way
  782. if ( name in elem && notxml && !special ) {
  783. if ( set ){
  784. // We can't allow the type property to be changed (since it causes problems in IE)
  785. if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
  786. throw "type property can't be changed";
  787. elem[ name ] = value;
  788. }
  789. // browsers index elements by id/name on forms, give priority to attributes.
  790. if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
  791. return elem.getAttributeNode( name ).nodeValue;
  792. // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
  793. // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  794. if ( name == "tabIndex" ) {
  795. var attributeNode = elem.getAttributeNode( "tabIndex" );
  796. return attributeNode && attributeNode.specified
  797. ? attributeNode.value
  798. : elem.nodeName.match(/(button|input|object|select|textarea)/i)
  799. ? 0
  800. : elem.nodeName.match(/^(a|area)$/i) && elem.href
  801. ? 0
  802. : undefined;
  803. }
  804. return elem[ name ];
  805. }
  806. if ( !jQuery.support.style && notxml &&  name == "style" )
  807. return jQuery.attr( elem.style, "cssText", value );
  808. if ( set )
  809. // convert the value to a string (all browsers do this but IE) see #1070
  810. elem.setAttribute( name, "" + value );
  811. var attr = !jQuery.support.hrefNormalized && notxml && special
  812. // Some attributes require a special call on IE
  813. ? elem.getAttribute( name, 2 )
  814. : elem.getAttribute( name );
  815. // Non-existent attributes return null, we normalize to undefined
  816. return attr === null ? undefined : attr;
  817. }
  818. // elem is actually elem.style ... set the style
  819. // IE uses filters for opacity
  820. if ( !jQuery.support.opacity && name == "opacity" ) {
  821. if ( set ) {
  822. // IE has trouble with opacity if it does not have layout
  823. // Force it by setting the zoom level
  824. elem.zoom = 1;
  825. // Set the alpha filter to set the opacity
  826. elem.filter = (elem.filter || "").replace( /alpha[)]/, "" ) +
  827. (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
  828. }
  829. return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
  830. (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
  831. "";
  832. }
  833. name = name.replace(/-([a-z])/ig, function(all, letter){
  834. return letter.toUpperCase();
  835. });
  836. if ( set )
  837. elem[ name ] = value;
  838. return elem[ name ];
  839. },
  840. trim: function( text ) {
  841. return (text || "").replace( /^\s+|\s+$/g, "" );
  842. },
  843. makeArray: function( array ) {
  844. var ret = [];
  845. if( array != null ){
  846. var i = array.length;
  847. // The window, strings (and functions) also have 'length'
  848. if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval )
  849. ret[0] = array;
  850. else
  851. while( i )
  852. ret[--i] = array[i];
  853. }
  854. return ret;
  855. },
  856. inArray: function( elem, array ) {
  857. for ( var i = 0, length = array.length; i < length; i++ )
  858. // Use === because on IE, window == document
  859. if ( array[ i ] === elem )
  860. return i;
  861. return -1;
  862. },
  863. merge: function( first, second ) {
  864. // We have to loop this way because IE & Opera overwrite the length
  865. // expando of getElementsByTagName
  866. var i = 0, elem, pos = first.length;
  867. // Also, we need to make sure that the correct elements are being returned
  868. // (IE returns comment nodes in a '*' query)
  869. if ( !jQuery.support.getAll ) {
  870. while ( (elem = second[ i++ ]) != null )
  871. if ( elem.nodeType != 8 )
  872. first[ pos++ ] = elem;
  873. else
  874. while ( (elem = second[ i++ ]) != null )
  875. first[ pos++ ] = elem;
  876. return first;
  877. },
  878. unique: function( array ) {
  879. var ret = [], done = {};
  880. try {
  881. for ( var i = 0, length = array.length; i < length; i++ ) {
  882. var id = jQuery.data( array[ i ] );
  883. if ( !done[ id ] ) {
  884. done[ id ] = true;
  885. ret.push( array[ i ] );
  886. }
  887. }
  888. catch( e ) {
  889. ret = array;
  890. }
  891. return ret;
  892. },
  893. grep: function( elems, callback, inv ) {
  894. var ret = [];
  895. // Go through the array, only saving the items
  896. // that pass the validator function
  897. for ( var i = 0, length = elems.length; i < length; i++ )
  898. if ( !inv != !callback( elems[ i ], i ) )
  899. ret.push( elems[ i ] );
  900. return ret;
  901. },
  902. map: function( elems, callback ) {
  903. var ret = [];
  904. // Go through the array, translating each of the items to their
  905. // new value (or values).
  906. for ( var i = 0, length = elems.length; i < length; i++ ) {
  907. var value = callback( elems[ i ], i );
  908. if ( value != null )
  909. ret[ ret.length ] = value;
  910. }
  911. return ret.concat.apply( [], ret );
  912. }
  913. });
  914. // Use of jQuery.browser is deprecated.
  915. // It's included for backwards compatibility and plugins,
  916. // although they should work to migrate away.
  917. var userAgent = navigator.userAgent.toLowerCase();
  918. // Figure out what browser is being used
  919. jQuery.browser = {
  920. version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
  921. safari: /webkit/.test( userAgent ),
  922. opera: /opera/.test( userAgent ),
  923. msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
  924. mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
  925. };
  926. jQuery.each({
  927. parent: function(elem){return elem.parentNode;},
  928. parents: function(elem){return jQuery.dir(elem,"parentNode");},
  929. next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
  930. prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
  931. nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
  932. prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
  933. siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
  934. children: function(elem){return jQuery.sibling(elem.firstChild);},
  935. contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
  936. }, function(name, fn){
  937. jQuery.fn[ name ] = function( selector ) {
  938. var ret = jQuery.map( this, fn );
  939. if ( selector && typeof selector == "string" )
  940. ret = jQuery.multiFilter( selector, ret );
  941. return this.pushStack( jQuery.unique( ret ), name, selector );
  942. };
  943. });
  944. jQuery.each({
  945. appendTo: "append",
  946. prependTo: "prepend",
  947. insertBefore: "before",
  948. insertAfter: "after",
  949. replaceAll: "replaceWith"
  950. }, function(name, original){
  951. jQuery.fn[ name ] = function() {
  952. var args = arguments;
  953. return this.each(function(){
  954. for ( var i = 0, length = args.length; i < length; i++ )
  955. jQuery( args[ i ] )[ original ]( this );
  956. });
  957. };
  958. });
  959. jQuery.each({
  960. removeAttr: function( name ) {
  961. jQuery.attr( this, name, "" );
  962. if (this.nodeType == 1)
  963. this.removeAttribute( name );
  964. },
  965. addClass: function( classNames ) {
  966. jQuery.className.add( this, classNames );
  967. },
  968. removeClass: function( classNames ) {
  969. jQuery.className.remove( this, classNames );
  970. },
  971. toggleClass: function( classNames, state ) {
  972. iftypeof state !== "boolean" )
  973. state = !jQuery.className.has( this, classNames );
  974. jQuery.className[ state ? "add" : "remove" ]( this, classNames );
  975. },
  976. remove: function( selector ) {
  977. if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
  978. // Prevent memory leaks
  979. jQuery( "*"this ).add([this]).each(function(){
  980. jQuery.event.remove(this);
  981. jQuery.removeData(this);
  982. });
  983. if (this.parentNode)
  984. this.parentNode.removeChild( this );
  985. }
  986. },
  987. empty: function() {
  988. // Remove element nodes and prevent memory leaks
  989. jQuery( ">*"this ).remove();
  990. // Remove any remaining nodes
  991. while ( this.firstChild )
  992. this.removeChild( this.firstChild );
  993. }
  994. }, function(name, fn){
  995. jQuery.fn[ name ] = function(){
  996. return this.each( fn, arguments );
  997. };
  998. });
  999. // Helper function used by the dimensions and offset modules
  1000. function num(elem, prop) {
  1001. return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
  1002. }
  1003. var expando = "jQuery" + now(), uuid = 0, windowData = {};
  1004. jQuery.extend({
  1005. cache: {},
  1006. data: function( elem, name, data ) {
  1007. elem = elem == window ?
  1008. windowData :
  1009. elem;
  1010. var id = elem[ expando ];
  1011. // Compute a unique ID for the element
  1012. if ( !id )
  1013. id = elem[ expando ] = ++uuid;
  1014. // Only generate the data cache if we're
  1015. // trying to access or manipulate it
  1016. if ( name && !jQuery.cache[ id ] )
  1017. jQuery.cache[ id ] = {};
  1018. // Prevent overriding the named cache with undefined values
  1019. if ( data !== undefined )
  1020. jQuery.cache[ id ][ name ] = data;
  1021. // Return the named cache data, or the ID for the element
  1022. return name ?
  1023. jQuery.cache[ id ][ name ] :
  1024. id;
  1025. },
  1026. removeData: function( elem, name ) {
  1027. elem = elem == window ?
  1028. windowData :
  1029. elem;
  1030. var id = elem[ expando ];
  1031. // If we want to remove a specific section of the element's data
  1032. if ( name ) {
  1033. if ( jQuery.cache[ id ] ) {
  1034. // Remove the section of cache data
  1035. delete jQuery.cache[ id ][ name ];
  1036. // If we've removed all the data, remove the element's cache
  1037. name = "";
  1038. for ( name in jQuery.cache[ id ] )
  1039. break;
  1040. if ( !name )
  1041. jQuery.removeData( elem );
  1042. }
  1043. // Otherwise, we want to remove all of the element's data
  1044. else {
  1045. // Clean up the element expando
  1046. try {
  1047. delete elem[ expando ];
  1048. catch(e){
  1049. // IE has trouble directly removing the expando
  1050. // but it's ok with using removeAttribute
  1051. if ( elem.removeAttribute )
  1052. elem.removeAttribute( expando );
  1053. }
  1054. // Completely remove the data cache
  1055. delete jQuery.cache[ id ];
  1056. }
  1057. },
  1058. queue: function( elem, type, data ) {
  1059. if ( elem ){
  1060. type = (type || "fx") + "queue";
  1061. var q = jQuery.data( elem, type );
  1062. if ( !q || jQuery.isArray(data) )
  1063. q = jQuery.data( elem, type, jQuery.makeArray(data) );
  1064. else if( data )
  1065. q.push( data );
  1066. }
  1067. return q;
  1068. },
  1069. dequeue: function( elem, type ){
  1070. var queue = jQuery.queue( elem, type ),
  1071. fn = queue.shift();
  1072. if( !type || type === "fx" )
  1073. fn = queue[0];
  1074. if( fn !== undefined )
  1075. fn.call(elem);
  1076. }
  1077. });
  1078. jQuery.fn.extend({
  1079. data: function( key, value ){
  1080. var parts = key.split(".");
  1081. parts[1] = parts[1] ? "." + parts[1] : "";
  1082. if ( value === undefined ) {
  1083. var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
  1084. if ( data === undefined && this.length )
  1085. data = jQuery.data( this[0], key );
  1086. return data === undefined && parts[1] ?
  1087. this.data( parts[0] ) :
  1088. data;
  1089. else
  1090. return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
  1091. jQuery.data( this, key, value );
  1092. });
  1093. },
  1094. removeData: function( key ){
  1095. return this.each(function(){
  1096. jQuery.removeData( this, key );
  1097. });
  1098. },
  1099. queue: function(type, data){
  1100. if ( typeof type !== "string" ) {
  1101. data = type;
  1102. type = "fx";
  1103. }
  1104. if ( data === undefined )
  1105. return jQuery.queue( this[0], type );
  1106. return this.each(function(){
  1107. var queue = jQuery.queue( this, type, data );
  1108. if( type == "fx" && queue.length == 1 )
  1109. queue[0].call(this);
  1110. });
  1111. },
  1112. dequeue: function(type){
  1113. return this.each(function(){
  1114. jQuery.dequeue( this, type );
  1115. });
  1116. }
  1117. });/*!
  1118. * Sizzle CSS Selector Engine - v0.9.3
  1119. *  Copyright 2009, The Dojo Foundation
  1120. *  Released under the MIT, BSD, and GPL Licenses.
  1121. *  More information: http://sizzlejs.com/
  1122. */
  1123. (function(){
  1124. var chunker = /((?:(?:\([()]+|[^()]+)+\)|
    (?:\[[[

    ]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,

  1125. done = 0,
  1126. toString = Object.prototype.toString;
  1127. var Sizzle = function(selector, context, results, seed) {
  1128. results = results || [];
  1129. context = context || document;
  1130. if ( context.nodeType !== 1 && context.nodeType !== 9 )
  1131. return [];
  1132. if ( !selector || typeof selector !== "string" ) {
  1133. return results;
  1134. }
  1135. var parts = [], m, set, checkSet, check, mode, extra, prune = true;
  1136. // Reset the position of the chunker regexp (start from head)
  1137. chunker.lastIndex = 0;
  1138. while ( (m = chunker.exec(selector)) !== null ) {
  1139. parts.push( m[1] );
  1140. if ( m[2] ) {
  1141. extra = RegExp.rightContext;
  1142. break;
  1143. }
  1144. }
  1145. if ( parts.length > 1 && origPOS.exec( selector ) ) {
  1146. if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
  1147. set = posProcess( parts[0] + parts[1], context );
  1148. else {
  1149. set = Expr.relative[ parts[0] ] ?
  1150. [ context ] :
  1151. Sizzle( parts.shift(), context );
  1152. while ( parts.length ) {
  1153. selector = parts.shift();
  1154. if ( Expr.relative[ selector ] )
  1155. selector += parts.shift();
  1156. set = posProcess( selector, set );
  1157. }
  1158. }
  1159. else {
  1160. var ret = seed ?
  1161. { expr: parts.pop(), set: makeArray(seed) } :
  1162. Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) );
  1163. set = Sizzle.filter( ret.expr, ret.set );
  1164. if ( parts.length > 0 ) {
  1165. checkSet = makeArray(set);
  1166. else {
  1167. prune = false;
  1168. }
  1169. while ( parts.length ) {
  1170. var cur = parts.pop(), pop = cur;
  1171. if ( !Expr.relative[ cur ] ) {
  1172. cur = "";
  1173. else {
  1174. pop = parts.pop();
  1175. }
  1176. if ( pop == null ) {
  1177. pop = context;
  1178. }
  1179. Expr.relative[ cur ]( checkSet, pop, isXML(context) );
  1180. }
  1181. }
  1182. if ( !checkSet ) {
  1183. checkSet = set;
  1184. }
  1185. if ( !checkSet ) {
  1186. throw "Syntax error, unrecognized expression: " + (cur || selector);
  1187. }
  1188. if ( toString.call(checkSet) === "[object Array]" ) {
  1189. if ( !prune ) {
  1190. results.push.apply( results, checkSet );
  1191. else if ( context.nodeType === 1 ) {
  1192. for ( var i = 0; checkSet[i] != null; i++ ) {
  1193. if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
  1194. results.push( set[i] );
  1195. }
  1196. }
  1197. else {
  1198. for ( var i = 0; checkSet[i] != null; i++ ) {
  1199. if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
  1200. results.push( set[i] );
  1201. }
  1202. }
  1203. }
  1204. else {
  1205. makeArray( checkSet, results );
  1206. }
  1207. if ( extra ) {
  1208. Sizzle( extra, context, results, seed );
  1209. }
  1210. return results;
  1211. };
  1212. Sizzle.matches = function(expr, set){
  1213. return Sizzle(expr, nullnull, set);
  1214. };
  1215. Sizzle.find = function(expr, context, isXML){
  1216. var set, match;
  1217. if ( !expr ) {
  1218. return [];
  1219. }
  1220. for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
  1221. var type = Expr.order[i], match;
  1222. if ( (match = Expr.match[ type ].exec( expr )) ) {
  1223. var left = RegExp.leftContext;
  1224. if ( left.substr( left.length - 1 ) !== "\\" ) {
  1225. match[1] = (match[1] || "").replace(/\\/g, "");
  1226. set = Expr.find[ type ]( match, context, isXML );
  1227. if ( set != null ) {
  1228. expr = expr.replace( Expr.match[ type ], "" );
  1229. break;
  1230. }
  1231. }
  1232. }
  1233. }
  1234. if ( !set ) {
  1235. set = context.getElementsByTagName("*");
  1236. }
  1237. return {set: set, expr: expr};
  1238. };
  1239. Sizzle.filter = function(expr, set, inplace, not){
  1240. var old = expr, result = [], curLoop = set, match, anyFound;
  1241. while ( expr && set.length ) {
  1242. for ( var type in Expr.filter ) {
  1243. if ( (match = Expr.match[ type ].exec( expr )) != null ) {
  1244. var filter = Expr.filter[ type ], found, item;
  1245. anyFound = false;
  1246. if ( curLoop == result ) {
  1247. result = [];
  1248. }
  1249. if ( Expr.preFilter[ type ] ) {
  1250. match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not );
  1251. if ( !match ) {
  1252. anyFound = found = true;
  1253. else if ( match === true ) {
  1254. continue;
  1255. }
  1256. }
  1257. if ( match ) {
  1258. for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
  1259. if ( item ) {
  1260. found = filter( item, match, i, curLoop );
  1261. var pass = not ^ !!found;
  1262. if ( inplace && found != null ) {
  1263. if ( pass ) {
  1264. anyFound = true;
  1265. else {
  1266. curLoop[i] = false;
  1267. }
  1268. else if ( pass ) {
  1269. result.push( item );
  1270. anyFound = true;
  1271. }
  1272. }
  1273. }
  1274. }
  1275. if ( found !== undefined ) {
  1276. if ( !inplace ) {
  1277. curLoop = result;
  1278. }
  1279. expr = expr.replace( Expr.match[ type ], "" );
  1280. if ( !anyFound ) {
  1281. return [];
  1282. }
  1283. break;
  1284. }
  1285. }
  1286. }
  1287. expr = expr.replace(/\s*,\s*/, "");
  1288. // Improper expression
  1289. if ( expr == old ) {
  1290. if ( anyFound == null ) {
  1291. throw "Syntax error, unrecognized expression: " + expr;
  1292. else {
  1293. break;
  1294. }
  1295. }
  1296. old = expr;
  1297. }
  1298. return curLoop;
  1299. };
  1300. var Expr = Sizzle.selectors = {
  1301. order: [ "ID""NAME""TAG" ],
  1302. match: {
  1303. ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
  1304. CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
  1305. NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
  1306. ATTR: /
    \s((?:[\w\u00c0\uFFFF]|.)+)\s(?:(§?=)\s(["])(.?)\3|)\s

    /,

  1307. TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
  1308. CHILD: /:(only|nth|last|first)-child(?:(even|odd|[\dn+]))?/,
  1309. POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:(\d))?(?=[^-]|$)/,
  1310. PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:(['"]*)((?:\([^]+\)|[^\2]*)+)\2\))?/
  1311. },
  1312. attrMap: {
  1313. "class""className",
  1314. "for""htmlFor"
  1315. },
  1316. attrHandle: {
  1317. href: function(elem){
  1318. return elem.getAttribute("href");
  1319. }
  1320. },
  1321. relative: {
  1322. "+"function(checkSet, part){
  1323. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  1324. var elem = checkSet[i];
  1325. if ( elem ) {
  1326. var cur = elem.previousSibling;
  1327. while ( cur && cur.nodeType !== 1 ) {
  1328. cur = cur.previousSibling;
  1329. }
  1330. checkSet[i] = typeof part === "string" ?
  1331. cur || false :
  1332. cur === part;
  1333. }
  1334. }
  1335. if ( typeof part === "string" ) {
  1336. Sizzle.filter( part, checkSet, true );
  1337. }
  1338. },
  1339. ">"function(checkSet, part, isXML){
  1340. if ( typeof part === "string" && !/\W/.test(part) ) {
  1341. part = isXML ? part : part.toUpperCase();
  1342. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  1343. var elem = checkSet[i];
  1344. if ( elem ) {
  1345. var parent = elem.parentNode;
  1346. checkSet[i] = parent.nodeName === part ? parent : false;
  1347. }
  1348. }
  1349. else {
  1350. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  1351. var elem = checkSet[i];
  1352. if ( elem ) {
  1353. checkSet[i] = typeof part === "string" ?
  1354. elem.parentNode :
  1355. elem.parentNode === part;
  1356. }
  1357. }
  1358. if ( typeof part === "string" ) {
  1359. Sizzle.filter( part, checkSet, true );
  1360. }
  1361. }
  1362. },
  1363. ""function(checkSet, part, isXML){
  1364. var doneName = "done" + (done++), checkFn = dirCheck;
  1365. if ( !part.match(/\W/) ) {
  1366. var nodeCheck = part = isXML ? part : part.toUpperCase();
  1367. checkFn = dirNodeCheck;
  1368. }
  1369. checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
  1370. },
  1371. "~"function(checkSet, part, isXML){
  1372. var doneName = "done" + (done++), checkFn = dirCheck;
  1373. if ( typeof part === "string" && !part.match(/\W/) ) {
  1374. var nodeCheck = part = isXML ? part : part.toUpperCase();
  1375. checkFn = dirNodeCheck;
  1376. }
  1377. checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
  1378. }
  1379. },
  1380. find: {
  1381. ID: function(match, context, isXML){
  1382. if ( typeof context.getElementById !== "undefined" && !isXML ) {
  1383. var m = context.getElementById(match[1]);
  1384. return m ? [m] : [];
  1385. }
  1386. },
  1387. NAME: function(match, context, isXML){
  1388. if ( typeof context.getElementsByName !== "undefined" && !isXML ) {
  1389. return context.getElementsByName(match[1]);
  1390. }
  1391. },
  1392. TAG: function(match, context){
  1393. return context.getElementsByTagName(match[1]);
  1394. }
  1395. },
  1396. preFilter: {
  1397. CLASS: function(match, curLoop, inplace, result, not){
  1398. match = " " + match[1].replace(/\\/g, "") + " ";
  1399. var elem;
  1400. for ( var i = 0; (elem = curLoop[i]) != null; i++ ) {
  1401. if ( elem ) {
  1402. if ( not ^ (" " + elem.className + " ").indexOf(match) >= 0 ) {
  1403. if ( !inplace )
  1404. result.push( elem );
  1405. else if ( inplace ) {
  1406. curLoop[i] = false;
  1407. }
  1408. }
  1409. }
  1410. return false;
  1411. },
  1412. ID: function(match){
  1413. return match[1].replace(/\\/g, "");
  1414. },
  1415. TAG: function(match, curLoop){
  1416. for ( var i = 0; curLoop[i] === false; i++ ){}
  1417. return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
  1418. },
  1419. CHILD: function(match){
  1420. if ( match[1] == "nth" ) {
  1421. // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
  1422. var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
  1423. match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
  1424. !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
  1425. // calculate the numbers (first)n+(last) including if they are negative
  1426. match[2] = (test[1] + (test[2] || 1)) - 0;
  1427. match[3] = test[3] - 0;
  1428. }
  1429. // TODO: Move to normal caching system
  1430. match[0] = "done" + (done++);
  1431. return match;
  1432. },
  1433. ATTR: function(match){
  1434. var name = match[1].replace(/\\/g, "");
  1435. if ( Expr.attrMap[name] ) {
  1436. match[1] = Expr.attrMap[name];
  1437. }
  1438. if ( match[2] === "~=" ) {
  1439. match[4] = " " + match[4] + " ";
  1440. }
  1441. return match;
  1442. },
  1443. PSEUDO: function(match, curLoop, inplace, result, not){
  1444. if ( match[1] === "not" ) {
  1445. // If we're dealing with a complex expression, or a simple one
  1446. if ( match[3].match(chunker).length > 1 ) {
  1447. match[3] = Sizzle(match[3], nullnull, curLoop);
  1448. else {
  1449. var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
  1450. if ( !inplace ) {
  1451. result.push.apply( result, ret );
  1452. }
  1453. return false;
  1454. }
  1455. else if ( Expr.match.POS.test( match[0] ) ) {
  1456. return true;
  1457. }
  1458. return match;
  1459. },
  1460. POS: function(match){
  1461. match.unshift( true );
  1462. return match;
  1463. }
  1464. },
  1465. filters: {
  1466. enabled: function(elem){
  1467. return elem.disabled === false && elem.type !== "hidden";
  1468. },
  1469. disabled: function(elem){
  1470. return elem.disabled === true;
  1471. },
  1472. checked: function(elem){
  1473. return elem.checked === true;
  1474. },
  1475. selected: function(elem){
  1476. // Accessing this property makes selected-by-default
  1477. // options in Safari work properly
  1478. elem.parentNode.selectedIndex;
  1479. return elem.selected === true;
  1480. },
  1481. parent: function(elem){
  1482. return !!elem.firstChild;
  1483. },
  1484. empty: function(elem){
  1485. return !elem.firstChild;
  1486. },
  1487. has: function(elem, i, match){
  1488. return !!Sizzle( match[3], elem ).length;
  1489. },
  1490. header: function(elem){
  1491. return /h\d/i.test( elem.nodeName );
  1492. },
  1493. text: function(elem){
  1494. return "text" === elem.type;
  1495. },
  1496. radio: function(elem){
  1497. return "radio" === elem.type;
  1498. },
  1499. checkbox: function(elem){
  1500. return "checkbox" === elem.type;
  1501. },
  1502. file: function(elem){
  1503. return "file" === elem.type;
  1504. },
  1505. password: function(elem){
  1506. return "password" === elem.type;
  1507. },
  1508. submit: function(elem){
  1509. return "submit" === elem.type;
  1510. },
  1511. image: function(elem){
  1512. return "image" === elem.type;
  1513. },
  1514. reset: function(elem){
  1515. return "reset" === elem.type;
  1516. },
  1517. button: function(elem){
  1518. return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
  1519. },
  1520. input: function(elem){
  1521. return /input|select|textarea|button/i.test(elem.nodeName);
  1522. }
  1523. },
  1524. setFilters: {
  1525. first: function(elem, i){
  1526. return i === 0;
  1527. },
  1528. last: function(elem, i, match, array){
  1529. return i === array.length - 1;
  1530. },
  1531. even: function(elem, i){
  1532. return i % 2 === 0;
  1533. },
  1534. odd: function(elem, i){
  1535. return i % 2 === 1;
  1536. },
  1537. lt: function(elem, i, match){
  1538. return i < match[3] - 0;
  1539. },
  1540. gt: function(elem, i, match){
  1541. return i > match[3] - 0;
  1542. },
  1543. nth: function(elem, i, match){
  1544. return match[3] - 0 == i;
  1545. },
  1546. eq: function(elem, i, match){
  1547. return match[3] - 0 == i;
  1548. }
  1549. },
  1550. filter: {
  1551. CHILD: function(elem, match){
  1552. var type = match[1], parent = elem.parentNode;
  1553. var doneName = match[0];
  1554. if ( parent && (!parent[ doneName ] || !elem.nodeIndex) ) {
  1555. var count = 1;
  1556. for ( var node = parent.firstChild; node; node = node.nextSibling ) {
  1557. if ( node.nodeType == 1 ) {
  1558. node.nodeIndex = count++;
  1559. }
  1560. }
  1561. parent[ doneName ] = count - 1;
  1562. }
  1563. if ( type == "first" ) {
  1564. return elem.nodeIndex == 1;
  1565. else if ( type == "last" ) {
  1566. return elem.nodeIndex == parent[ doneName ];
  1567. else if ( type == "only" ) {
  1568. return parent[ doneName ] == 1;
  1569. else if ( type == "nth" ) {
  1570. var add = false, first = match[2], last = match[3];
  1571. if ( first == 1 && last == 0 ) {
  1572. return true;
  1573. }
  1574. if ( first == 0 ) {
  1575. if ( elem.nodeIndex == last ) {
  1576. add = true;
  1577. }
  1578. else if ( (elem.nodeIndex - last) % first == 0 && (elem.nodeIndex - last) / first >= 0 ) {
  1579. add = true;
  1580. }
  1581. return add;
  1582. }
  1583. },
  1584. PSEUDO: function(elem, match, i, array){
  1585. var name = match[1], filter = Expr.filters[ name ];
  1586. if ( filter ) {
  1587. return filter( elem, i, match, array );
  1588. else if ( name === "contains" ) {
  1589. return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
  1590. else if ( name === "not" ) {
  1591. var not = match[3];
  1592. for ( var i = 0, l = not.length; i < l; i++ ) {
  1593. if ( not[i] === elem ) {
  1594. return false;
  1595. }
  1596. }
  1597. return true;
  1598. }
  1599. },
  1600. ID: function(elem, match){
  1601. return elem.nodeType === 1 && elem.getAttribute("id") === match;
  1602. },
  1603. TAG: function(elem, match){
  1604. return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
  1605. },
  1606. CLASS: function(elem, match){
  1607. return match.test( elem.className );
  1608. },
  1609. ATTR: function(elem, match){
  1610. var result = Expr.attrHandle[ match[1] ] ? Expr.attrHandle[ match[1] ]( elem ) : elem[ match[1] ] || elem.getAttribute( match[1] ), value = result + "", type = match[2], check = match[4];
  1611. return result == null ?
  1612. type === "!=" :
  1613. type === "=" ?
  1614. value === check :
  1615. type === "*=" ?
  1616. value.indexOf(check) >= 0 :
  1617. type === "~=" ?
  1618. (" " + value + " ").indexOf(check) >= 0 :
  1619. !match[4] ?
  1620. result :
  1621. type === "!=" ?
  1622. value != check :
  1623. type === "^=" ?
  1624. value.indexOf(check) === 0 :
  1625. type === "$=" ?
  1626. value.substr(value.length - check.length) === check :
  1627. type === "|=" ?
  1628. value === check || value.substr(0, check.length + 1) === check + "-" :
  1629. false;
  1630. },
  1631. POS: function(elem, match, i, array){
  1632. var name = match[2], filter = Expr.setFilters[ name ];
  1633. if ( filter ) {
  1634. return filter( elem, i, match, array );
  1635. }
  1636. }
  1637. }
  1638. };
  1639. var origPOS = Expr.match.POS;
  1640. for ( var type in Expr.match ) {
  1641. Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^
    ]

    )(?![^])/.source );

  1642. }
  1643. var makeArray = function(array, results) {
  1644. array = Array.prototype.slice.call( array );
  1645. if ( results ) {
  1646. results.push.apply( results, array );
  1647. return results;
  1648. }
  1649. return array;
  1650. };
  1651. // Perform a simple check to determine if the browser is capable of
  1652. // converting a NodeList to an array using builtin methods.
  1653. try {
  1654. Array.prototype.slice.call( document.documentElement.childNodes );
  1655. // Provide a fallback method if it does not work
  1656. catch(e){
  1657. makeArray = function(array, results) {
  1658. var ret = results || [];
  1659. if ( toString.call(array) === "[object Array]" ) {
  1660. Array.prototype.push.apply( ret, array );
  1661. else {
  1662. if ( typeof array.length === "number" ) {
  1663. for ( var i = 0, l = array.length; i < l; i++ ) {
  1664. ret.push( array[i] );
  1665. }
  1666. else {
  1667. for ( var i = 0; array[i]; i++ ) {
  1668. ret.push( array[i] );
  1669. }
  1670. }
  1671. }
  1672. return ret;
  1673. };
  1674. }
  1675. // Check to see if the browser returns elements by name when
  1676. // querying by getElementById (and provide a workaround)
  1677. (function(){
  1678. // We're going to inject a fake input element with a specified name
  1679. var form = document.createElement("form"),
  1680. id = "script" + (new Date).getTime();
  1681. form.innerHTML = "<input name='" + id + "'/>";
  1682. // Inject it into the root element, check its status, and remove it quickly
  1683. var root = document.documentElement;
  1684. root.insertBefore( form, root.firstChild );
  1685. // The workaround has to do additional checks after a getElementById
  1686. // Which slows things down for other browsers (hence the branching)
  1687. if ( !!document.getElementById( id ) ) {
  1688. Expr.find.ID = function(match, context, isXML){
  1689. if ( typeof context.getElementById !== "undefined" && !isXML ) {
  1690. var m = context.getElementById(match[1]);
  1691. return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
  1692. }
  1693. };
  1694. Expr.filter.ID = function(elem, match){
  1695. var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
  1696. return elem.nodeType === 1 && node && node.nodeValue === match;
  1697. };
  1698. }
  1699. root.removeChild( form );
  1700. })();
  1701. (function(){
  1702. // Check to see if the browser returns only elements
  1703. // when doing getElementsByTagName("*")
  1704. // Create a fake element
  1705. var div = document.createElement("div");
  1706. div.appendChild( document.createComment("") );
  1707. // Make sure no comments are found
  1708. if ( div.getElementsByTagName("*").length > 0 ) {
  1709. Expr.find.TAG = function(match, context){
  1710. var results = context.getElementsByTagName(match[1]);
  1711. // Filter out possible comments
  1712. if ( match[1] === "*" ) {
  1713. var tmp = [];
  1714. for ( var i = 0; results[i]; i++ ) {
  1715. if ( results[i].nodeType === 1 ) {
  1716. tmp.push( results[i] );
  1717. }
  1718. }
  1719. results = tmp;
  1720. }
  1721. return results;
  1722. };
  1723. }
  1724. // Check to see if an attribute returns normalized href attributes
  1725. div.innerHTML = "<a href='#'></a>";
  1726. if ( div.firstChild && div.firstChild.getAttribute("href") !== "#" ) {
  1727. Expr.attrHandle.href = function(elem){
  1728. return elem.getAttribute("href", 2);
  1729. };
  1730. }
  1731. })();
  1732. if ( document.querySelectorAll ) (function(){
  1733. var oldSizzle = Sizzle, div = document.createElement("div");
  1734. div.innerHTML = "<p class='TEST'></p>";
  1735. // Safari can't handle uppercase or unicode characters when
  1736. // in quirks mode.
  1737. if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
  1738. return;
  1739. }
  1740. Sizzle = function(query, context, extra, seed){
  1741. context = context || document;
  1742. // Only use querySelectorAll on non-XML documents
  1743. // (ID selectors don't work in non-HTML documents)
  1744. if ( !seed && context.nodeType === 9 && !isXML(context) ) {
  1745. try {
  1746. return makeArray( context.querySelectorAll(query), extra );
  1747. catch(e){}
  1748. }
  1749. return oldSizzle(query, context, extra, seed);
  1750. };
  1751. Sizzle.find = oldSizzle.find;
  1752. Sizzle.filter = oldSizzle.filter;
  1753. Sizzle.selectors = oldSizzle.selectors;
  1754. Sizzle.matches = oldSizzle.matches;
  1755. })();
  1756. if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) {
  1757. Expr.order.splice(1, 0, "CLASS");
  1758. Expr.find.CLASS = function(match, context) {
  1759. return context.getElementsByClassName(match[1]);
  1760. };
  1761. }
  1762. function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
  1763. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  1764. var elem = checkSet[i];
  1765. if ( elem ) {
  1766. elem = elem[dir];
  1767. var match = false;
  1768. while ( elem && elem.nodeType ) {
  1769. var done = elem[doneName];
  1770. if ( done ) {
  1771. match = checkSet[ done ];
  1772. break;
  1773. }
  1774. if ( elem.nodeType === 1 && !isXML )
  1775. elem[doneName] = i;
  1776. if ( elem.nodeName === cur ) {
  1777. match = elem;
  1778. break;
  1779. }
  1780. elem = elem[dir];
  1781. }
  1782. checkSet[i] = match;
  1783. }
  1784. }
  1785. }
  1786. function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
  1787. for ( var i = 0, l = checkSet.length; i < l; i++ ) {
  1788. var elem = checkSet[i];
  1789. if ( elem ) {
  1790. elem = elem[dir];
  1791. var match = false;
  1792. while ( elem && elem.nodeType ) {
  1793. if ( elem[doneName] ) {
  1794. match = checkSet[ elem[doneName] ];
  1795. break;
  1796. }
  1797. if ( elem.nodeType === 1 ) {
  1798. if ( !isXML )
  1799. elem[doneName] = i;
  1800. if ( typeof cur !== "string" ) {
  1801. if ( elem === cur ) {
  1802. match = true;
  1803. break;
  1804. }
  1805. else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
  1806. match = elem;
  1807. break;
  1808. }
  1809. }
  1810. elem = elem[dir];
  1811. }
  1812. checkSet[i] = match;
  1813. }
  1814. }
  1815. }
  1816. var contains = document.compareDocumentPosition ?  function(a, b){
  1817. return a.compareDocumentPosition(b) & 16;
  1818. } : function(a, b){
  1819. return a !== b && (a.contains ? a.contains(b) : true);
  1820. };
  1821. var isXML = function(elem){
  1822. return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
  1823. !!elem.ownerDocument && isXML( elem.ownerDocument );
  1824. };
  1825. var posProcess = function(selector, context){
  1826. var tmpSet = [], later = "", match,
  1827. root = context.nodeType ? [context] : context;
  1828. // Position selectors must be done after the filter
  1829. // And so must :not(positional) so we move all PSEUDOs to the end
  1830. while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
  1831. later += match[0];
  1832. selector = selector.replace( Expr.match.PSEUDO, "" );
  1833. }
  1834. selector = Expr.relative[selector] ? selector + "*" : selector;
  1835. for ( var i = 0, l = root.length; i < l; i++ ) {
  1836. Sizzle( selector, root[i], tmpSet );
  1837. }
  1838. return Sizzle.filter( later, tmpSet );
  1839. };
  1840. // EXPOSE
  1841. jQuery.find = Sizzle;
  1842. jQuery.filter = Sizzle.filter;
  1843. jQuery.expr = Sizzle.selectors;
  1844. jQuery.expr[":"] = jQuery.expr.filters;
  1845. Sizzle.selectors.filters.hidden = function(elem){
  1846. return "hidden" === elem.type ||
  1847. jQuery.css(elem, "display") === "none" ||
  1848. jQuery.css(elem, "visibility") === "hidden";
  1849. };
  1850. Sizzle.selectors.filters.visible = function(elem){
  1851. return "hidden" !== elem.type &&
  1852. jQuery.css(elem, "display") !== "none" &&
  1853. jQuery.css(elem, "visibility") !== "hidden";
  1854. };
  1855. Sizzle.selectors.filters.animated = function(elem){
  1856. return jQuery.grep(jQuery.timers, function(fn){
  1857. return elem === fn.elem;
  1858. }).length;
  1859. };
  1860. jQuery.multiFilter = function( expr, elems, not ) {
  1861. if ( not ) {
  1862. expr = ":not(" + expr + ")";
  1863. }
  1864. return Sizzle.matches(expr, elems);
  1865. };
  1866. jQuery.dir = function( elem, dir ){
  1867. var matched = [], cur = elem[dir];
  1868. while ( cur && cur != document ) {
  1869. if ( cur.nodeType == 1 )
  1870. matched.push( cur );
  1871. cur = cur[dir];
  1872. }
  1873. return matched;
  1874. };
  1875. jQuery.nth = function(cur, result, dir, elem){
  1876. result = result || 1;
  1877. var num = 0;
  1878. for ( ; cur; cur = cur[dir] )
  1879. if ( cur.nodeType == 1 && ++num == result )
  1880. break;
  1881. return cur;
  1882. };
  1883. jQuery.sibling = function(n, elem){
  1884. var r = [];
  1885. for ( ; n; n = n.nextSibling ) {
  1886. if ( n.nodeType == 1 && n != elem )
  1887. r.push( n );
  1888. }
  1889. return r;
  1890. };
  1891. return;
  1892. window.Sizzle = Sizzle;
  1893. })();
  1894. /*
  1895. * A number of helper functions used for managing events.
  1896. * Many of the ideas behind this code originated from
  1897. * Dean Edwards' addEvent library.
  1898. */
  1899. jQuery.event = {
  1900. // Bind an event to an element
  1901. // Original by Dean Edwards
  1902. add: function(elem, types, handler, data) {
  1903. if ( elem.nodeType == 3 || elem.nodeType == 8 )
  1904. return;
  1905. // For whatever reason, IE has trouble passing the window object
  1906. // around, causing it to be cloned in the process
  1907. if ( elem.setInterval && elem != window )
  1908. elem = window;
  1909. // Make sure that the function being executed has a unique ID
  1910. if ( !handler.guid )
  1911. handler.guid = this.guid++;
  1912. // if data is passed, bind to handler
  1913. if ( data !== undefined ) {
  1914. // Create temporary function pointer to original handler
  1915. var fn = handler;
  1916. // Create unique handler function, wrapped around original handler
  1917. handler = this.proxy( fn );
  1918. // Store data in unique handler
  1919. handler.data = data;
  1920. }
  1921. // Init the element's event structure
  1922. var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
  1923. handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle"function(){
  1924. // Handle the second event of a trigger and when
  1925. // an event is called after a page has unloaded
  1926. return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
  1927. jQuery.event.handle.apply(arguments.callee.elem, arguments) :
  1928. undefined;
  1929. });
  1930. // Add elem as a property of the handle function
  1931. // This is to prevent a memory leak with non-native
  1932. // event in IE.
  1933. handle.elem = elem;
  1934. // Handle multiple events separated by a space
  1935. // jQuery(...).bind("mouseover mouseout", fn);
  1936. jQuery.each(types.split(/\s+/), function(index, type) {
  1937. // Namespaced event handlers
  1938. var namespaces = type.split(".");
  1939. type = namespaces.shift();
  1940. handler.type = namespaces.slice().sort().join(".");
  1941. // Get the current list of functions bound to this event
  1942. var handlers = events[type];
  1943. if ( jQuery.event.specialAll[type] )
  1944. jQuery.event.specialAll[type].setup.call(elem, data, namespaces);
  1945. // Init the event handler queue
  1946. if (!handlers) {
  1947. handlers = events[type] = {};
  1948. // Check for a special event handler
  1949. // Only use addEventListener/attachEvent if the special
  1950. // events handler returns false
  1951. if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {
  1952. // Bind the global event handler to the element
  1953. if (elem.addEventListener)
  1954. elem.addEventListener(type, handle, false);
  1955. else if (elem.attachEvent)
  1956. elem.attachEvent("on" + type, handle);
  1957. }
  1958. }
  1959. // Add the function to the element's handler list
  1960. handlers[handler.guid] = handler;
  1961. // Keep track of which events have been used, for global triggering
  1962. jQuery.event.global[type] = true;
  1963. });
  1964. // Nullify elem to prevent memory leaks in IE
  1965. elem = null;
  1966. },
  1967. guid: 1,
  1968. global: {},
  1969. // Detach an event or set of events from an element
  1970. remove: function(elem, types, handler) {
  1971. // don't do events on text and comment nodes
  1972. if ( elem.nodeType == 3 || elem.nodeType == 8 )
  1973. return;
  1974. var events = jQuery.data(elem, "events"), ret, index;
  1975. if ( events ) {
  1976. // Unbind all events for the element
  1977. if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") )
  1978. for ( var type in events )
  1979. this.remove( elem, type + (types || "") );
  1980. else {
  1981. // types is actually an event object here
  1982. if ( types.type ) {
  1983. handler = types.handler;
  1984. types = types.type;
  1985. }
  1986. // Handle multiple events seperated by a space
  1987. // jQuery(...).unbind("mouseover mouseout", fn);
  1988. jQuery.each(types.split(/\s+/), function(index, type){
  1989. // Namespaced event handlers
  1990. var namespaces = type.split(".");
  1991. type = namespaces.shift();
  1992. var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
  1993. if ( events[type] ) {
  1994. // remove the given handler for the given type
  1995. if ( handler )
  1996. delete events[type][handler.guid];
  1997. // remove all handlers for the given type
  1998. else
  1999. for ( var handle in events[type] )
  2000. // Handle the removal of namespaced events
  2001. if ( namespace.test(events[type][handle].type) )
  2002. delete events[type][handle];
  2003. if ( jQuery.event.specialAll[type] )
  2004. jQuery.event.specialAll[type].teardown.call(elem, namespaces);
  2005. // remove generic event handler if no more handlers exist
  2006. for ( ret in events[type] ) break;
  2007. if ( !ret ) {
  2008. if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
  2009. if (elem.removeEventListener)
  2010. elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
  2011. else if (elem.detachEvent)
  2012. elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
  2013. }
  2014. ret = null;
  2015. delete events[type];
  2016. }
  2017. }
  2018. });
  2019. }
  2020. // Remove the expando if it's no longer used
  2021. for ( ret in events ) break;
  2022. if ( !ret ) {
  2023. var handle = jQuery.data( elem, "handle" );
  2024. if ( handle ) handle.elem = null;
  2025. jQuery.removeData( elem, "events" );
  2026. jQuery.removeData( elem, "handle" );
  2027. }
  2028. }
  2029. },
  2030. // bubbling is internal
  2031. trigger: function( event, data, elem, bubbling ) {
  2032. // Event object or event type
  2033. var type = event.type || event;
  2034. if( !bubbling ){
  2035. event = typeof event === "object" ?
  2036. // jQuery.Event object
  2037. event[expando] ? event :
  2038. // Object literal
  2039. jQuery.extend( jQuery.Event(type), event ) :
  2040. // Just the event type (string)
  2041. jQuery.Event(type);
  2042. if ( type.indexOf("!") >= 0 ) {
  2043. event.type = type = type.slice(0, -1);
  2044. event.exclusive = true;
  2045. }
  2046. // Handle a global trigger
  2047. if ( !elem ) {
  2048. // Don't bubble custom events when global (to avoid too much overhead)
  2049. event.stopPropagation();
  2050. // Only trigger if we've ever bound an event for it
  2051. if ( this.global[type] )
  2052. jQuery.each( jQuery.cache, function(){
  2053. if ( this.events && this.events[type] )
  2054. jQuery.event.trigger( event, data, this.handle.elem );
  2055. });
  2056. }
  2057. // Handle triggering a single element
  2058. // don't do events on text and comment nodes
  2059. if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 )
  2060. return undefined;
  2061. // Clean up in case it is reused
  2062. event.result = undefined;
  2063. event.target = elem;
  2064. // Clone the incoming data, if any
  2065. data = jQuery.makeArray(data);
  2066. data.unshift( event );
  2067. }
  2068. event.currentTarget = elem;
  2069. // Trigger the event, it is assumed that "handle" is a function
  2070. var handle = jQuery.data(elem, "handle");
  2071. if ( handle )
  2072. handle.apply( elem, data );
  2073. // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
  2074. if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
  2075. event.result = false;
  2076. // Trigger the native events (except for clicks on links)
  2077. if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
  2078. this.triggered = true;
  2079. try {
  2080. elem[ type ]();
  2081. // prevent IE from throwing an error for some hidden elements
  2082. catch (e) {}
  2083. }
  2084. this.triggered = false;
  2085. if ( !event.isPropagationStopped() ) {
  2086. var parent = elem.parentNode || elem.ownerDocument;
  2087. if ( parent )
  2088. jQuery.event.trigger(event, data, parent, true);
  2089. }
  2090. },
  2091. handle: function(event) {
  2092. // returned undefined or false
  2093. var all, handlers;
  2094. event = arguments[0] = jQuery.event.fix( event || window.event );
  2095. // Namespaced event handlers
  2096. var namespaces = event.type.split(".");
  2097. event.type = namespaces.shift();
  2098. // Cache this now, all = true means, any handler
  2099. all = !namespaces.length && !event.exclusive;
  2100. var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
  2101. handlers = ( jQuery.data(this"events") || {} )[event.type];
  2102. for ( var j in handlers ) {
  2103. var handler = handlers[j];
  2104. // Filter the functions by class
  2105. if ( all || namespace.test(handler.type) ) {
  2106. // Pass in a reference to the handler function itself
  2107. // So that we can later remove it
  2108. event.handler = handler;
  2109. event.data = handler.data;
  2110. var ret = handler.apply(this, arguments);
  2111. if( ret !== undefined ){
  2112. event.result = ret;
  2113. if ( ret === false ) {
  2114. event.preventDefault();
  2115. event.stopPropagation();
  2116. }
  2117. }
  2118. if( event.isImmediatePropagationStopped() )
  2119. break;
  2120. }
  2121. }
  2122. },
  2123. props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
  2124. fix: function(event) {
  2125. if ( event[expando] )
  2126. return event;
  2127. // store a copy of the original event object
  2128. // and "clone" to set read-only properties
  2129. var originalEvent = event;
  2130. event = jQuery.Event( originalEvent );
  2131. for ( var i = this.props.length, prop; i; ){
  2132. prop = this.props[ --i ];
  2133. event[ prop ] = originalEvent[ prop ];
  2134. }
  2135. // Fix target property, if necessary
  2136. if ( !event.target )
  2137. event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
  2138. // check if target is a textnode (safari)
  2139. if ( event.target.nodeType == 3 )
  2140. event.target = event.target.parentNode;
  2141. // Add relatedTarget, if necessary
  2142. if ( !event.relatedTarget && event.fromElement )
  2143. event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
  2144. // Calculate pageX/Y if missing and clientX/Y available
  2145. if ( event.pageX == null && event.clientX != null ) {
  2146. var doc = document.documentElement, body = document.body;
  2147. event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
  2148. event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
  2149. }
  2150. // Add which for key events
  2151. if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
  2152. event.which = event.charCode || event.keyCode;
  2153. // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
  2154. if ( !event.metaKey && event.ctrlKey )
  2155. event.metaKey = event.ctrlKey;
  2156. // Add which for click: 1 == left; 2 == middle; 3 == right
  2157. // Note: button is not normalized, so don't use it
  2158. if ( !event.which && event.button )
  2159. event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
  2160. return event;
  2161. },
  2162. proxy: function( fn, proxy ){
  2163. proxy = proxy || function(){ return fn.apply(this, arguments); };
  2164. // Set the guid of unique handler to the same of original handler, so it can be removed
  2165. proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
  2166. // So proxy can be declared as an argument
  2167. return proxy;
  2168. },
  2169. special: {
  2170. ready: {
  2171. // Make sure the ready event is setup
  2172. setup: bindReady,
  2173. teardown: function() {}
  2174. }
  2175. },
  2176. specialAll: {
  2177. live: {
  2178. setup: function( selector, namespaces ){
  2179. jQuery.event.add( this, namespaces[0], liveHandler );
  2180. },
  2181. teardown:  function( namespaces ){
  2182. if ( namespaces.length ) {
  2183. var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
  2184. jQuery.each( (jQuery.data(this"events").live || {}), function(){
  2185. if ( name.test(this.type) )
  2186. remove++;
  2187. });
  2188. if ( remove < 1 )
  2189. jQuery.event.remove( this, namespaces[0], liveHandler );
  2190. }
  2191. }
  2192. }
  2193. }
  2194. };
  2195. jQuery.Event = function( src ){
  2196. // Allow instantiation without the 'new' keyword
  2197. if( !this.preventDefault )
  2198. return new jQuery.Event(src);
  2199. // Event object
  2200. if( src && src.type ){
  2201. this.originalEvent = src;
  2202. this.type = src.type;
  2203. // Event type
  2204. }else
  2205. this.type = src;
  2206. // timeStamp is buggy for some events on Firefox(#3843)
  2207. // So we won't rely on the native value
  2208. this.timeStamp = now();
  2209. // Mark it as fixed
  2210. this[expando] = true;
  2211. };
  2212. function returnFalse(){
  2213. return false;
  2214. }
  2215. function returnTrue(){
  2216. return true;
  2217. }
  2218. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  2219. // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  2220. jQuery.Event.prototype = {
  2221. preventDefault: function() {
  2222. this.isDefaultPrevented = returnTrue;
  2223. var e = this.originalEvent;
  2224. if( !e )
  2225. return;
  2226. // if preventDefault exists run it on the original event
  2227. if (e.preventDefault)
  2228. e.preventDefault();
  2229. // otherwise set the returnValue property of the original event to false (IE)
  2230. e.returnValue = false;
  2231. },
  2232. stopPropagation: function() {
  2233. this.isPropagationStopped = returnTrue;
  2234. var e = this.originalEvent;
  2235. if( !e )
  2236. return;
  2237. // if stopPropagation exists run it on the original event
  2238. if (e.stopPropagation)
  2239. e.stopPropagation();
  2240. // otherwise set the cancelBubble property of the original event to true (IE)
  2241. e.cancelBubble = true;
  2242. },
  2243. stopImmediatePropagation:function(){
  2244. this.isImmediatePropagationStopped = returnTrue;
  2245. this.stopPropagation();
  2246. },
  2247. isDefaultPrevented: returnFalse,
  2248. isPropagationStopped: returnFalse,
  2249. isImmediatePropagationStopped: returnFalse
  2250. };
  2251. // Checks if an event happened on an element within another element
  2252. // Used in jQuery.event.special.mouseenter and mouseleave handlers
  2253. var withinElement = function(event) {
  2254. // Check if mouse(over|out) are still within the same parent element
  2255. var parent = event.relatedTarget;
  2256. // Traverse up the tree
  2257. while ( parent && parent != this )
  2258. try { parent = parent.parentNode; }
  2259. catch(e) { parent = this; }
  2260. if( parent != this ){
  2261. // set the correct event type
  2262. event.type = event.data;
  2263. // handle event if we actually just moused on to a non sub-element
  2264. jQuery.event.handle.apply( this, arguments );
  2265. }
  2266. };
  2267. jQuery.each({
  2268. mouseover: 'mouseenter',
  2269. mouseout: 'mouseleave'
  2270. }, function( orig, fix ){
  2271. jQuery.event.special[ fix ] = {
  2272. setup: function(){
  2273. jQuery.event.add( this, orig, withinElement, fix );
  2274. },
  2275. teardown: function(){
  2276. jQuery.event.remove( this, orig, withinElement );
  2277. }
  2278. };
  2279. });
  2280. jQuery.fn.extend({
  2281. bind: function( type, data, fn ) {
  2282. return type == "unload" ? this.one(type, data, fn) : this.each(function(){
  2283. jQuery.event.add( this, type, fn || data, fn && data );
  2284. });
  2285. },
  2286. one: function( type, data, fn ) {
  2287. var one = jQuery.event.proxy( fn || data, function(event) {
  2288. jQuery(this).unbind(event, one);
  2289. return (fn || data).apply( this, arguments );
  2290. });
  2291. return this.each(function(){
  2292. jQuery.event.add( this, type, one, fn && data);
  2293. });
  2294. },
  2295. unbind: function( type, fn ) {
  2296. return this.each(function(){
  2297. jQuery.event.remove( this, type, fn );
  2298. });
  2299. },
  2300. trigger: function( type, data ) {
  2301. return this.each(function(){
  2302. jQuery.event.trigger( type, data, this );
  2303. });
  2304. },
  2305. triggerHandler: function( type, data ) {
  2306. ifthis[0] ){
  2307. var event = jQuery.Event(type);
  2308. event.preventDefault();
  2309. event.stopPropagation();
  2310. jQuery.event.trigger( event, data, this[0] );
  2311. return event.result;
  2312. }
  2313. },
  2314. toggle: function( fn ) {
  2315. // Save reference to arguments for access in closure
  2316. var args = arguments, i = 1;
  2317. // link all the functions, so any of them can unbind this click handler
  2318. while( i < args.length )
  2319. jQuery.event.proxy( fn, args[i++] );
  2320. return this.click( jQuery.event.proxy( fn, function(event) {
  2321. // Figure out which function to execute
  2322. this.lastToggle = ( this.lastToggle || 0 ) % i;
  2323. // Make sure that clicks stop
  2324. event.preventDefault();
  2325. // and execute the function
  2326. return args[ this.lastToggle++ ].apply( this, arguments ) || false;
  2327. }));
  2328. },
  2329. hover: function(fnOver, fnOut) {
  2330. return this.mouseenter(fnOver).mouseleave(fnOut);
  2331. },
  2332. ready: function(fn) {
  2333. // Attach the listeners
  2334. bindReady();
  2335. // If the DOM is already ready
  2336. if ( jQuery.isReady )
  2337. // Execute the function immediately
  2338. fn.call( document, jQuery );
  2339. // Otherwise, remember the function for later
  2340. else
  2341. // Add the function to the wait list
  2342. jQuery.readyList.push( fn );
  2343. return this;
  2344. },
  2345. live: function( type, fn ){
  2346. var proxy = jQuery.event.proxy( fn );
  2347. proxy.guid += this.selector + type;
  2348. jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy );
  2349. return this;
  2350. },
  2351. die: function( type, fn ){
  2352. jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null );
  2353. return this;
  2354. }
  2355. });
  2356. function liveHandler( event ){
  2357. var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
  2358. stop = true,
  2359. elems = [];
  2360. jQuery.each(jQuery.data(this"events").live || [], function(i, fn){
  2361. if ( check.test(fn.type) ) {
  2362. var elem = jQuery(event.target).closest(fn.data)[0];
  2363. if ( elem )
  2364. elems.push({ elem: elem, fn: fn });
  2365. }
  2366. });
  2367. jQuery.each(elems, function(){
  2368. if ( this.fn.call(this.elem, event, this.fn.data) === false )
  2369. stop = false;
  2370. });
  2371. return stop;
  2372. }
  2373. function liveConvert(type, selector){
  2374. return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join(".");
  2375. }
  2376. jQuery.extend({
  2377. isReady: false,
  2378. readyList: [],
  2379. // Handle when the DOM is ready
  2380. ready: function() {
  2381. // Make sure that the DOM is not already loaded
  2382. if ( !jQuery.isReady ) {
  2383. // Remember that the DOM is ready
  2384. jQuery.isReady = true;
  2385. // If there are functions bound, to execute
  2386. if ( jQuery.readyList ) {
  2387. // Execute all of them
  2388. jQuery.each( jQuery.readyList, function(){
  2389. this.call( document, jQuery );
  2390. });
  2391. // Reset the list of functions
  2392. jQuery.readyList = null;
  2393. }
  2394. // Trigger any bound ready events
  2395. jQuery(document).triggerHandler("ready");
  2396. }
  2397. }
  2398. });
  2399. var readyBound = false;
  2400. function bindReady(){
  2401. if ( readyBound ) return;
  2402. readyBound = true;
  2403. // Mozilla, Opera and webkit nightlies currently support this event
  2404. if ( document.addEventListener ) {
  2405. // Use the handy event callback
  2406. document.addEventListener( "DOMContentLoaded"function(){
  2407. document.removeEventListener( "DOMContentLoaded", arguments.callee, false );
  2408. jQuery.ready();
  2409. }, false );
  2410. // If IE event model is used
  2411. else if ( document.attachEvent ) {
  2412. // ensure firing before onload,
  2413. // maybe late but safe also for iframes
  2414. document.attachEvent("onreadystatechange"function(){
  2415. if ( document.readyState === "complete" ) {
  2416. document.detachEvent( "onreadystatechange", arguments.callee );
  2417. jQuery.ready();
  2418. }
  2419. });
  2420. // If IE and not an iframe
  2421. // continually check to see if the document is ready
  2422. if ( document.documentElement.doScroll && typeof window.frameElement === "undefined" ) (function(){
  2423. if ( jQuery.isReady ) return;
  2424. try {
  2425. // If IE is used, use the trick by Diego Perini
  2426. // http://javascript.nwbox.com/IEContentLoaded/
  2427. document.documentElement.doScroll("left");
  2428. catch( error ) {
  2429. setTimeout( arguments.callee, 0 );
  2430. return;
  2431. }
  2432. // and execute any waiting functions
  2433. jQuery.ready();
  2434. })();
  2435. }
  2436. // A fallback to window.onload, that will always work
  2437. jQuery.event.add( window, "load", jQuery.ready );
  2438. }
  2439. jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
  2440. "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," +
  2441. "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){
  2442. // Handle event binding
  2443. jQuery.fn[name] = function(fn){
  2444. return fn ? this.bind(name, fn) : this.trigger(name);
  2445. };
  2446. });
  2447. // Prevent memory leaks in IE
  2448. // And prevent errors on refresh with events like mouseover in other browsers
  2449. // Window isn't included so as not to unbind existing unload events
  2450. jQuery( window ).bind( 'unload'function(){
  2451. for ( var id in jQuery.cache )
  2452. // Skip the window
  2453. if ( id != 1 && jQuery.cache[ id ].handle )
  2454. jQuery.event.remove( jQuery.cache[ id ].handle.elem );
  2455. });
  2456. (function(){
  2457. jQuery.support = {};
  2458. var root = document.documentElement,
  2459. script = document.createElement("script"),
  2460. div = document.createElement("div"),
  2461. id = "script" + (new Date).getTime();
  2462. div.style.display = "none";
  2463. div.innerHTML = '   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';
  2464. var all = div.getElementsByTagName("*"),
  2465. a = div.getElementsByTagName("a")[0];
  2466. // Can't get basic test support
  2467. if ( !all || !all.length || !a ) {
  2468. return;
  2469. }
  2470. jQuery.support = {
  2471. // IE strips leading whitespace when .innerHTML is used
  2472. leadingWhitespace: div.firstChild.nodeType == 3,
  2473. // Make sure that tbody elements aren't automatically inserted
  2474. // IE will insert them into empty tables
  2475. tbody: !div.getElementsByTagName("tbody").length,
  2476. // Make sure that you can get all elements in an <object> element
  2477. // IE 7 always returns no results
  2478. objectAll: !!div.getElementsByTagName("object")[0]
  2479. .getElementsByTagName("*").length,
  2480. // Make sure that link elements get serialized correctly by innerHTML
  2481. // This requires a wrapper element in IE
  2482. htmlSerialize: !!div.getElementsByTagName("link").length,
  2483. // Get the style information from getAttribute
  2484. // (IE uses .cssText insted)
  2485. style: /red/.test( a.getAttribute("style") ),
  2486. // Make sure that URLs aren't manipulated
  2487. // (IE normalizes it by default)
  2488. hrefNormalized: a.getAttribute("href") === "/a",
  2489. // Make sure that element opacity exists
  2490. // (IE uses filter instead)
  2491. opacity: a.style.opacity === "0.5",
  2492. // Verify style float existence
  2493. // (IE uses styleFloat instead of cssFloat)
  2494. cssFloat: !!a.style.cssFloat,
  2495. // Will be defined later
  2496. scriptEval: false,
  2497. noCloneEvent: true,
  2498. boxModel: null
  2499. };
  2500. script.type = "text/javascript";
  2501. try {
  2502. script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
  2503. catch(e){}
  2504. root.insertBefore( script, root.firstChild );
  2505. // Make sure that the execution of code works by injecting a script
  2506. // tag with appendChild/createTextNode
  2507. // (IE doesn't support this, fails, and uses .text instead)
  2508. if ( window[ id ] ) {
  2509. jQuery.support.scriptEval = true;
  2510. delete window[ id ];
  2511. }
  2512. root.removeChild( script );
  2513. if ( div.attachEvent && div.fireEvent ) {
  2514. div.attachEvent("onclick"function(){
  2515. // Cloning a node shouldn't copy over any
  2516. // bound event handlers (IE does this)
  2517. jQuery.support.noCloneEvent = false;
  2518. div.detachEvent("onclick", arguments.callee);
  2519. });
  2520. div.cloneNode(true).fireEvent("onclick");
  2521. }
  2522. // Figure out if the W3C box model works as expected
  2523. // document.body must exist before we can do this
  2524. jQuery(function(){
  2525. var div = document.createElement("div");
  2526. div.style.width = "1px";
  2527. div.style.paddingLeft = "1px";
  2528. document.body.appendChild( div );
  2529. jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
  2530. document.body.removeChild( div );
  2531. });
  2532. })();
  2533. var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";
  2534. jQuery.props = {
  2535. "for""htmlFor",
  2536. "class""className",
  2537. "float": styleFloat,
  2538. cssFloat: styleFloat,
  2539. styleFloat: styleFloat,
  2540. readonly: "readOnly",
  2541. maxlength: "maxLength",
  2542. cellspacing: "cellSpacing",
  2543. rowspan: "rowSpan",
  2544. tabindex: "tabIndex"
  2545. };
  2546. jQuery.fn.extend({
  2547. // Keep a copy of the old load
  2548. _load: jQuery.fn.load,
  2549. load: function( url, params, callback ) {
  2550. if ( typeof url !== "string" )
  2551. return this._load( url );
  2552. var off = url.indexOf(" ");
  2553. if ( off >= 0 ) {
  2554. var selector = url.slice(off, url.length);
  2555. url = url.slice(0, off);
  2556. }
  2557. // Default to a GET request
  2558. var type = "GET";
  2559. // If the second parameter was provided
  2560. if ( params )
  2561. // If it's a function
  2562. if ( jQuery.isFunction( params ) ) {
  2563. // We assume that it's the callback
  2564. callback = params;
  2565. params = null;
  2566. // Otherwise, build a param string
  2567. else iftypeof params === "object" ) {
  2568. params = jQuery.param( params );
  2569. type = "POST";
  2570. }
  2571. var self = this;
  2572. // Request the remote document
  2573. jQuery.ajax({
  2574. url: url,
  2575. type: type,
  2576. dataType: "html",
  2577. data: params,
  2578. complete: function(res, status){
  2579. // If successful, inject the HTML into all the matched elements
  2580. if ( status == "success" || status == "notmodified" )
  2581. // See if a selector was specified
  2582. self.html( selector ?
  2583. // Create a dummy div to hold the results
  2584. jQuery("<div/>")
  2585. // inject the contents of the document in, removing the scripts
  2586. // to avoid any 'Permission Denied' errors in IE
  2587. .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
  2588. // Locate the specified elements
  2589. .find(selector) :
  2590. // If not, just inject the full result
  2591. res.responseText );
  2592. if( callback )
  2593. self.each( callback, [res.responseText, status, res] );
  2594. }
  2595. });
  2596. return this;
  2597. },
  2598. serialize: function() {
  2599. return jQuery.param(this.serializeArray());
  2600. },
  2601. serializeArray: function() {
  2602. return this.map(function(){
  2603. return this.elements ? jQuery.makeArray(this.elements) : this;
  2604. })
  2605. .filter(function(){
  2606. return this.name && !this.disabled &&
  2607. (this.checked || /select|textarea/i.test(this.nodeName) ||
  2608. /text|hidden|password/i.test(this.type));
  2609. })
  2610. .map(function(i, elem){
  2611. var val = jQuery(this).val();
  2612. return val == null ? null :
  2613. jQuery.isArray(val) ?
  2614. jQuery.map( val, function(val, i){
  2615. return {name: elem.name, value: val};
  2616. }) :
  2617. {name: elem.name, value: val};
  2618. }).get();
  2619. }
  2620. });
  2621. // Attach a bunch of functions for handling common AJAX events
  2622. jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
  2623. jQuery.fn[o] = function(f){
  2624. return this.bind(o, f);
  2625. };
  2626. });
  2627. var jsc = now();
  2628. jQuery.extend({
  2629. get: function( url, data, callback, type ) {
  2630. // shift arguments if data argument was ommited
  2631. if ( jQuery.isFunction( data ) ) {
  2632. callback = data;
  2633. data = null;
  2634. }
  2635. return jQuery.ajax({
  2636. type: "GET",
  2637. url: url,
  2638. data: data,
  2639. success: callback,
  2640. dataType: type
  2641. });
  2642. },
  2643. getScript: function( url, callback ) {
  2644. return jQuery.get(url, null, callback, "script");
  2645. },
  2646. getJSON: function( url, data, callback ) {
  2647. return jQuery.get(url, data, callback, "json");
  2648. },
  2649. post: function( url, data, callback, type ) {
  2650. if ( jQuery.isFunction( data ) ) {
  2651. callback = data;
  2652. data = {};
  2653. }
  2654. return jQuery.ajax({
  2655. type: "POST",
  2656. url: url,
  2657. data: data,
  2658. success: callback,
  2659. dataType: type
  2660. });
  2661. },
  2662. ajaxSetup: function( settings ) {
  2663. jQuery.extend( jQuery.ajaxSettings, settings );
  2664. },
  2665. ajaxSettings: {
  2666. url: location.href,
  2667. global: true,
  2668. type: "GET",
  2669. contentType: "application/x-www-form-urlencoded",
  2670. processData: true,
  2671. async: true,
  2672. /*
  2673. timeout: 0,
  2674. data: null,
  2675. username: null,
  2676. password: null,
  2677. */
  2678. // Create the request object; Microsoft failed to properly
  2679. // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
  2680. // This function can be overriden by calling jQuery.ajaxSetup
  2681. xhr:function(){
  2682. return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
  2683. },
  2684. accepts: {
  2685. xml: "application/xml, text/xml",
  2686. html: "text/html",
  2687. script: "text/javascript, application/javascript",
  2688. json: "application/json, text/javascript",
  2689. text: "text/plain",
  2690. _default: "*/*"
  2691. }
  2692. },
  2693. // Last-Modified header cache for next request
  2694. lastModified: {},
  2695. ajax: function( s ) {
  2696. // Extend the settings, but re-extend 's' so that it can be
  2697. // checked again later (in the test suite, specifically)
  2698. s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
  2699. var jsonp, jsre = /=\?(&|$)/g, status, data,
  2700. type = s.type.toUpperCase();
  2701. // convert data if not already a string
  2702. if ( s.data && s.processData && typeof s.data !== "string" )
  2703. s.data = jQuery.param(s.data);
  2704. // Handle JSONP Parameter Callbacks
  2705. if ( s.dataType == "jsonp" ) {
  2706. if ( type == "GET" ) {
  2707. if ( !s.url.match(jsre) )
  2708. s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
  2709. else if ( !s.data || !s.data.match(jsre) )
  2710. s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
  2711. s.dataType = "json";
  2712. }
  2713. // Build temporary JSONP function
  2714. if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
  2715. jsonp = "jsonp" + jsc++;
  2716. // Replace the =? sequence both in the query string and the data
  2717. if ( s.data )
  2718. s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
  2719. s.url = s.url.replace(jsre, "=" + jsonp + "$1");
  2720. // We need to make sure
  2721. // that a JSONP style response is executed properly
  2722. s.dataType = "script";
  2723. // Handle JSONP-style loading
  2724. window[ jsonp ] = function(tmp){
  2725. data = tmp;
  2726. success();
  2727. complete();
  2728. // Garbage collect
  2729. window[ jsonp ] = undefined;
  2730. trydelete window[ jsonp ]; } catch(e){}
  2731. if ( head )
  2732. head.removeChild( script );
  2733. };
  2734. }
  2735. if ( s.dataType == "script" && s.cache == null )
  2736. s.cache = false;
  2737. if ( s.cache === false && type == "GET" ) {
  2738. var ts = now();
  2739. // try replacing _= if it is there
  2740. var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
  2741. // if nothing was replaced, add timestamp to the end
  2742. s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
  2743. }
  2744. // If data is available, append data to url for get requests
  2745. if ( s.data && type == "GET" ) {
  2746. s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
  2747. // IE likes to send both get and post data, prevent this
  2748. s.data = null;
  2749. }
  2750. // Watch for a new set of requests
  2751. if ( s.global && ! jQuery.active++ )
  2752. jQuery.event.trigger( "ajaxStart" );
  2753. // Matches an absolute URL, and saves the domain
  2754. var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url );
  2755. // If we're requesting a remote document
  2756. // and trying to load JSON or Script with a GET
  2757. if ( s.dataType == "script" && type == "GET" && parts
  2758. && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){
  2759. var head = document.getElementsByTagName("head")[0];
  2760. var script = document.createElement("script");
  2761. script.src = s.url;
  2762. if (s.scriptCharset)
  2763. script.charset = s.scriptCharset;
  2764. // Handle Script loading
  2765. if ( !jsonp ) {
  2766. var done = false;
  2767. // Attach handlers for all browsers
  2768. script.onload = script.onreadystatechange = function(){
  2769. if ( !done && (!this.readyState ||
  2770. this.readyState == "loaded" || this.readyState == "complete") ) {
  2771. done = true;
  2772. success();
  2773. complete();
  2774. head.removeChild( script );
  2775. }
  2776. };
  2777. }
  2778. head.appendChild(script);
  2779. // We handle everything using the script element injection
  2780. return undefined;
  2781. }
  2782. var requestDone = false;
  2783. // Create the request object
  2784. var xhr = s.xhr();
  2785. // Open the socket
  2786. // Passing null username, generates a login popup on Opera (#2865)
  2787. if( s.username )
  2788. xhr.open(type, s.url, s.async, s.username, s.password);
  2789. else
  2790. xhr.open(type, s.url, s.async);
  2791. // Need an extra try/catch for cross domain requests in Firefox 3
  2792. try {
  2793. // Set the correct header, if data is being sent
  2794. if ( s.data )
  2795. xhr.setRequestHeader("Content-Type", s.contentType);
  2796. // Set the If-Modified-Since header, if ifModified mode.
  2797. if ( s.ifModified )
  2798. xhr.setRequestHeader("If-Modified-Since",
  2799. jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
  2800. // Set header so the called script knows that it's an XMLHttpRequest
  2801. xhr.setRequestHeader("X-Requested-With""XMLHttpRequest");
  2802. // Set the Accepts header for the server, depending on the dataType
  2803. xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
  2804. s.accepts[ s.dataType ] + ", */*" :
  2805. s.accepts._default );
  2806. catch(e){}
  2807. // Allow custom headers/mimetypes and early abort
  2808. if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
  2809. // Handle the global AJAX counter
  2810. if ( s.global && ! --jQuery.active )
  2811. jQuery.event.trigger( "ajaxStop" );
  2812. // close opended socket
  2813. xhr.abort();
  2814. return false;
  2815. }
  2816. if ( s.global )
  2817. jQuery.event.trigger("ajaxSend", [xhr, s]);
  2818. // Wait for a response to come back
  2819. var onreadystatechange = function(isTimeout){
  2820. // The request was aborted, clear the interval and decrement jQuery.active
  2821. if (xhr.readyState == 0) {
  2822. if (ival) {
  2823. // clear poll interval
  2824. clearInterval(ival);
  2825. ival = null;
  2826. // Handle the global AJAX counter
  2827. if ( s.global && ! --jQuery.active )
  2828. jQuery.event.trigger( "ajaxStop" );
  2829. }
  2830. // The transfer is complete and the data is available, or the request timed out
  2831. else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {
  2832. requestDone = true;
  2833. // clear poll interval
  2834. if (ival) {
  2835. clearInterval(ival);
  2836. ival = null;
  2837. }
  2838. status = isTimeout == "timeout" ? "timeout" :
  2839. !jQuery.httpSuccess( xhr ) ? "error" :
  2840. s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" :
  2841. "success";
  2842. if ( status == "success" ) {
  2843. // Watch for, and catch, XML document parse errors
  2844. try {
  2845. // process the data (runs the xml through httpData regardless of callback)
  2846. data = jQuery.httpData( xhr, s.dataType, s );
  2847. catch(e) {
  2848. status = "parsererror";
  2849. }
  2850. }
  2851. // Make sure that the request was successful or notmodified
  2852. if ( status == "success" ) {
  2853. // Cache Last-Modified header, if ifModified mode.
  2854. var modRes;
  2855. try {
  2856. modRes = xhr.getResponseHeader("Last-Modified");
  2857. catch(e) {} // swallow exception thrown by FF if header is not available
  2858. if ( s.ifModified && modRes )
  2859. jQuery.lastModified[s.url] = modRes;
  2860. // JSONP handles its own success callback
  2861. if ( !jsonp )
  2862. success();
  2863. else
  2864. jQuery.handleError(s, xhr, status);
  2865. // Fire the complete handlers
  2866. complete();
  2867. if ( isTimeout )
  2868. xhr.abort();
  2869. // Stop memory leaks
  2870. if ( s.async )
  2871. xhr = null;
  2872. }
  2873. };
  2874. if ( s.async ) {
  2875. // don't attach the handler to the request, just poll it instead
  2876. var ival = setInterval(onreadystatechange, 13);
  2877. // Timeout checker
  2878. if ( s.timeout > 0 )
  2879. setTimeout(function(){
  2880. // Check to see if the request is still happening
  2881. if ( xhr && !requestDone )
  2882. onreadystatechange( "timeout" );
  2883. }, s.timeout);
  2884. }
  2885. // Send the data
  2886. try {
  2887. xhr.send(s.data);
  2888. catch(e) {
  2889. jQuery.handleError(s, xhr, null, e);
  2890. }
  2891. // firefox 1.5 doesn't fire statechange for sync requests
  2892. if ( !s.async )
  2893. onreadystatechange();
  2894. function success(){
  2895. // If a local callback was specified, fire it and pass it the data
  2896. if ( s.success )
  2897. s.success( data, status );
  2898. // Fire the global callback
  2899. if ( s.global )
  2900. jQuery.event.trigger( "ajaxSuccess", [xhr, s] );
  2901. }
  2902. function complete(){
  2903. // Process result
  2904. if ( s.complete )
  2905. s.complete(xhr, status);
  2906. // The request was completed
  2907. if ( s.global )
  2908. jQuery.event.trigger( "ajaxComplete", [xhr, s] );
  2909. // Handle the global AJAX counter
  2910. if ( s.global && ! --jQuery.active )
  2911. jQuery.event.trigger( "ajaxStop" );
  2912. }
  2913. // return XMLHttpRequest to allow aborting the request etc.
  2914. return xhr;
  2915. },
  2916. handleError: function( s, xhr, status, e ) {
  2917. // If a local callback was specified, fire it
  2918. if ( s.error ) s.error( xhr, status, e );
  2919. // Fire the global callback
  2920. if ( s.global )
  2921. jQuery.event.trigger( "ajaxError", [xhr, s, e] );
  2922. },
  2923. // Counter for holding the number of active queries
  2924. active: 0,
  2925. // Determines if an XMLHttpRequest was successful or not
  2926. httpSuccess: function( xhr ) {
  2927. try {
  2928. // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
  2929. return !xhr.status && location.protocol == "file:" ||
  2930. ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223;
  2931. catch(e){}
  2932. return false;
  2933. },
  2934. // Determines if an XMLHttpRequest returns NotModified
  2935. httpNotModified: function( xhr, url ) {
  2936. try {
  2937. var xhrRes = xhr.getResponseHeader("Last-Modified");
  2938. // Firefox always returns 200. check Last-Modified date
  2939. return xhr.status == 304 || xhrRes == jQuery.lastModified[url];
  2940. catch(e){}
  2941. return false;
  2942. },
  2943. httpData: function( xhr, type, s ) {
  2944. var ct = xhr.getResponseHeader("content-type"),
  2945. xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
  2946. data = xml ? xhr.responseXML : xhr.responseText;
  2947. if ( xml && data.documentElement.tagName == "parsererror" )
  2948. throw "parsererror";
  2949. // Allow a pre-filtering function to sanitize the response
  2950. // s != null is checked to keep backwards compatibility
  2951. if( s && s.dataFilter )
  2952. data = s.dataFilter( data, type );
  2953. // The filter can actually parse the response
  2954. iftypeof data === "string" ){
  2955. // If the type is "script", eval it in global context
  2956. if ( type == "script" )
  2957. jQuery.globalEval( data );
  2958. // Get the JavaScript object, if JSON is used.
  2959. if ( type == "json" )
  2960. data = window["eval"]("(" + data + ")");
  2961. }
  2962. return data;
  2963. },
  2964. // Serialize an array of form elements or a set of
  2965. // key/values into a query string
  2966. param: function( a ) {
  2967. var s = [ ];
  2968. function add( key, value ){
  2969. s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
  2970. };
  2971. // If an array was passed in, assume that it is an array
  2972. // of form elements
  2973. if ( jQuery.isArray(a) || a.jquery )
  2974. // Serialize the form elements
  2975. jQuery.each( a, function(){
  2976. add( this.name, this.value );
  2977. });
  2978. // Otherwise, assume that it's an object of key/value pairs
  2979. else
  2980. // Serialize the key/values
  2981. for ( var j in a )
  2982. // If the value is an array then the key names need to be repeated
  2983. if ( jQuery.isArray(a[j]) )
  2984. jQuery.each( a[j], function(){
  2985. add( j, this );
  2986. });
  2987. else
  2988. add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] );
  2989. // Return the resulting serialization
  2990. return s.join("&").replace(/%20/g, "+");
  2991. }
  2992. });
  2993. var elemdisplay = {},
  2994. timerId,
  2995. fxAttrs = [
  2996. // height animations
  2997. "height""marginTop""marginBottom""paddingTop""paddingBottom" ],
  2998. // width animations
  2999. "width""marginLeft""marginRight""paddingLeft""paddingRight" ],
  3000. // opacity animations
  3001. "opacity" ]
  3002. ];
  3003. function genFx( type, num ){
  3004. var obj = {};
  3005. jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){
  3006. obj[ this ] = type;
  3007. });
  3008. return obj;
  3009. }
  3010. jQuery.fn.extend({
  3011. show: function(speed,callback){
  3012. if ( speed ) {
  3013. return this.animate( genFx("show", 3), speed, callback);
  3014. else {
  3015. for ( var i = 0, l = this.length; i < l; i++ ){
  3016. var old = jQuery.data(this[i], "olddisplay");
  3017. this[i].style.display = old || "";
  3018. if ( jQuery.css(this[i], "display") === "none" ) {
  3019. var tagName = this[i].tagName, display;
  3020. if ( elemdisplay[ tagName ] ) {
  3021. display = elemdisplay[ tagName ];
  3022. else {
  3023. var elem = jQuery("<" + tagName + " />").appendTo("body");
  3024. display = elem.css("display");
  3025. if ( display === "none" )
  3026. display = "block";
  3027. elem.remove();
  3028. elemdisplay[ tagName ] = display;
  3029. }
  3030. this[i].style.display = jQuery.data(this[i], "olddisplay", display);
  3031. }
  3032. }
  3033. return this;
  3034. }
  3035. },
  3036. hide: function(speed,callback){
  3037. if ( speed ) {
  3038. return this.animate( genFx("hide", 3), speed, callback);
  3039. else {
  3040. for ( var i = 0, l = this.length; i < l; i++ ){
  3041. var old = jQuery.data(this[i], "olddisplay");
  3042. if ( !old && old !== "none" )
  3043. jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
  3044. this[i].style.display = "none";
  3045. }
  3046. return this;
  3047. }
  3048. },
  3049. // Save the old toggle function
  3050. _toggle: jQuery.fn.toggle,
  3051. toggle: function( fn, fn2 ){
  3052. var bool = typeof fn === "boolean";
  3053. return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
  3054. this._toggle.apply( this, arguments ) :
  3055. fn == null || bool ?
  3056. this.each(function(){
  3057. var state = bool ? fn : jQuery(this).is(":hidden");
  3058. jQuery(this)[ state ? "show" : "hide" ]();
  3059. }) :
  3060. this.animate(genFx("toggle", 3), fn, fn2);
  3061. },
  3062. fadeTo: function(speed,to,callback){
  3063. return this.animate({opacity: to}, speed, callback);
  3064. },
  3065. animate: function( prop, speed, easing, callback ) {
  3066. var optall = jQuery.speed(speed, easing, callback);
  3067. return this[ optall.queue === false ? "each" : "queue" ](function(){
  3068. var opt = jQuery.extend({}, optall), p,
  3069. hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
  3070. self = this;
  3071. for ( p in prop ) {
  3072. if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
  3073. return opt.complete.call(this);
  3074. if ( ( p == "height" || p == "width" ) && this.style ) {
  3075. // Store display property
  3076. opt.display = jQuery.css(this"display");
  3077. // Make sure that nothing sneaks out
  3078. opt.overflow = this.style.overflow;
  3079. }
  3080. }
  3081. if ( opt.overflow != null )
  3082. this.style.overflow = "hidden";
  3083. opt.curAnim = jQuery.extend({}, prop);
  3084. jQuery.each( prop, function(name, val){
  3085. var e = new jQuery.fx( self, opt, name );
  3086. if ( /toggle|show|hide/.test(val) )
  3087. e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
  3088. else {
  3089. var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
  3090. start = e.cur(true) || 0;
  3091. if ( parts ) {
  3092. var end = parseFloat(parts[2]),
  3093. unit = parts[3] || "px";
  3094. // We need to compute starting value
  3095. if ( unit != "px" ) {
  3096. self.style[ name ] = (end || 1) + unit;
  3097. start = ((end || 1) / e.cur(true)) * start;
  3098. self.style[ name ] = start + unit;
  3099. }
  3100. // If a +=/-= token was provided, we're doing a relative animation
  3101. if ( parts[1] )
  3102. end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
  3103. e.custom( start, end, unit );
  3104. else
  3105. e.custom( start, val, "" );
  3106. }
  3107. });
  3108. // For JS strict compliance
  3109. return true;
  3110. });
  3111. },
  3112. stop: function(clearQueue, gotoEnd){
  3113. var timers = jQuery.timers;
  3114. if (clearQueue)
  3115. this.queue([]);
  3116. this.each(function(){
  3117. // go in reverse order so anything added to the queue during the loop is ignored
  3118. for ( var i = timers.length - 1; i >= 0; i-- )
  3119. if ( timers[i].elem == this ) {
  3120. if (gotoEnd)
  3121. // force the next step to be the last
  3122. timers[i](true);
  3123. timers.splice(i, 1);
  3124. }
  3125. });
  3126. // start the next in the queue if the last step wasn't forced
  3127. if (!gotoEnd)
  3128. this.dequeue();
  3129. return this;
  3130. }
  3131. });
  3132. // Generate shortcuts for custom animations
  3133. jQuery.each({
  3134. slideDown: genFx("show", 1),
  3135. slideUp: genFx("hide", 1),
  3136. slideToggle: genFx("toggle", 1),
  3137. fadeIn: { opacity: "show" },
  3138. fadeOut: { opacity: "hide" }
  3139. }, function( name, props ){
  3140. jQuery.fn[ name ] = function( speed, callback ){
  3141. return this.animate( props, speed, callback );
  3142. };
  3143. });
  3144. jQuery.extend({
  3145. speed: function(speed, easing, fn) {
  3146. var opt = typeof speed === "object" ? speed : {
  3147. complete: fn || !fn && easing ||
  3148. jQuery.isFunction( speed ) && speed,
  3149. duration: speed,
  3150. easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
  3151. };
  3152. opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
  3153. jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
  3154. // Queueing
  3155. opt.old = opt.complete;
  3156. opt.complete = function(){
  3157. if ( opt.queue !== false )
  3158. jQuery(this).dequeue();
  3159. if ( jQuery.isFunction( opt.old ) )
  3160. opt.old.call( this );
  3161. };
  3162. return opt;
  3163. },
  3164. easing: {
  3165. linear: function( p, n, firstNum, diff ) {
  3166. return firstNum + diff * p;
  3167. },
  3168. swing: function( p, n, firstNum, diff ) {
  3169. return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
  3170. }
  3171. },
  3172. timers: [],
  3173. fx: function( elem, options, prop ){
  3174. this.options = options;
  3175. this.elem = elem;
  3176. this.prop = prop;
  3177. if ( !options.orig )
  3178. options.orig = {};
  3179. }
  3180. });
  3181. jQuery.fx.prototype = {
  3182. // Simple function for setting a style value
  3183. update: function(){
  3184. if ( this.options.step )
  3185. this.options.step.call( this.elem, this.now, this );
  3186. (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
  3187. // Set display property to block for height/width animations
  3188. if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )
  3189. this.elem.style.display = "block";
  3190. },
  3191. // Get the current size
  3192. cur: function(force){
  3193. if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )
  3194. return this.elem[ this.prop ];
  3195. var r = parseFloat(jQuery.css(this.elem, this.prop, force));
  3196. return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
  3197. },
  3198. // Start an animation from one number to another
  3199. custom: function(from, to, unit){
  3200. this.startTime = now();
  3201. this.start = from;
  3202. this.end = to;
  3203. this.unit = unit || this.unit || "px";
  3204. this.now = this.start;
  3205. this.pos = this.state = 0;
  3206. var self = this;
  3207. function t(gotoEnd){
  3208. return self.step(gotoEnd);
  3209. }
  3210. t.elem = this.elem;
  3211. if ( t() && jQuery.timers.push(t) == 1 ) {
  3212. timerId = setInterval(function(){
  3213. var timers = jQuery.timers;
  3214. for ( var i = 0; i < timers.length; i++ )
  3215. if ( !timers[i]() )
  3216. timers.splice(i--, 1);
  3217. if ( !timers.length ) {
  3218. clearInterval( timerId );
  3219. }
  3220. }, 13);
  3221. }
  3222. },
  3223. // Simple 'show' function
  3224. show: function(){
  3225. // Remember where we started, so that we can go back to it later
  3226. this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
  3227. this.options.show = true;
  3228. // Begin the animation
  3229. // Make sure that we start at a small width/height to avoid any
  3230. // flash of content
  3231. this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur());
  3232. // Start by showing the element
  3233. jQuery(this.elem).show();
  3234. },
  3235. // Simple 'hide' function
  3236. hide: function(){
  3237. // Remember where we started, so that we can go back to it later
  3238. this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
  3239. this.options.hide = true;
  3240. // Begin the animation
  3241. this.custom(this.cur(), 0);
  3242. },
  3243. // Each step of an animation
  3244. step: function(gotoEnd){
  3245. var t = now();
  3246. if ( gotoEnd || t >= this.options.duration + this.startTime ) {
  3247. this.now = this.end;
  3248. this.pos = this.state = 1;
  3249. this.update();
  3250. this.options.curAnim[ this.prop ] = true;
  3251. var done = true;
  3252. for ( var i in this.options.curAnim )
  3253. if ( this.options.curAnim[i] !== true )
  3254. done = false;
  3255. if ( done ) {
  3256. if ( this.options.display != null ) {
  3257. // Reset the overflow
  3258. this.elem.style.overflow = this.options.overflow;
  3259. // Reset the display
  3260. this.elem.style.display = this.options.display;
  3261. if ( jQuery.css(this.elem, "display") == "none" )
  3262. this.elem.style.display = "block";
  3263. }
  3264. // Hide the element if the "hide" operation was done
  3265. if ( this.options.hide )
  3266. jQuery(this.elem).hide();
  3267. // Reset the properties, if the item has been hidden or shown
  3268. if ( this.options.hide || this.options.show )
  3269. for ( var p in this.options.curAnim )
  3270. jQuery.attr(this.elem.style, p, this.options.orig[p]);
  3271. // Execute the complete function
  3272. this.options.complete.call( this.elem );
  3273. }
  3274. return false;
  3275. else {
  3276. var n = t - this.startTime;
  3277. this.state = n / this.options.duration;
  3278. // Perform the easing function, defaults to swing
  3279. this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
  3280. this.now = this.start + ((this.end - this.start) * this.pos);
  3281. // Perform the next step of the animation
  3282. this.update();
  3283. }
  3284. return true;
  3285. }
  3286. };
  3287. jQuery.extend( jQuery.fx, {
  3288. speeds:{
  3289. slow: 600,
  3290. fast: 200,
  3291. // Default speed
  3292. _default: 400
  3293. },
  3294. step: {
  3295. opacity: function(fx){
  3296. jQuery.attr(fx.elem.style, "opacity", fx.now);
  3297. },
  3298. _default: function(fx){
  3299. if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
  3300. fx.elem.style[ fx.prop ] = fx.now + fx.unit;
  3301. else
  3302. fx.elem[ fx.prop ] = fx.now;
  3303. }
  3304. }
  3305. });
  3306. if ( document.documentElement["getBoundingClientRect"] )
  3307. jQuery.fn.offset = function() {
  3308. if ( !this[0] ) return { top: 0, left: 0 };
  3309. if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
  3310. var box  = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement,
  3311. clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
  3312. top  = box.top  + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,
  3313. left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
  3314. return { top: top, left: left };
  3315. };
  3316. else
  3317. jQuery.fn.offset = function() {
  3318. if ( !this[0] ) return { top: 0, left: 0 };
  3319. if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
  3320. jQuery.offset.initialized || jQuery.offset.initialize();
  3321. var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem,
  3322. doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
  3323. body = doc.body, defaultView = doc.defaultView,
  3324. prevComputedStyle = defaultView.getComputedStyle(elem, null),
  3325. top = elem.offsetTop, left = elem.offsetLeft;
  3326. while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
  3327. computedStyle = defaultView.getComputedStyle(elem, null);
  3328. top -= elem.scrollTop, left -= elem.scrollLeft;
  3329. if ( elem === offsetParent ) {
  3330. top += elem.offsetTop, left += elem.offsetLeft;
  3331. if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) )
  3332. top  += parseInt( computedStyle.borderTopWidth,  10) || 0,
  3333. left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
  3334. prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
  3335. }
  3336. if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" )
  3337. top  += parseInt( computedStyle.borderTopWidth,  10) || 0,
  3338. left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
  3339. prevComputedStyle = computedStyle;
  3340. }
  3341. if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" )
  3342. top  += body.offsetTop,
  3343. left += body.offsetLeft;
  3344. if ( prevComputedStyle.position === "fixed" )
  3345. top  += Math.max(docElem.scrollTop, body.scrollTop),
  3346. left += Math.max(docElem.scrollLeft, body.scrollLeft);
  3347. return { top: top, left: left };
  3348. };
  3349. jQuery.offset = {
  3350. initialize: function() {
  3351. if ( this.initialized ) return;
  3352. var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,
  3353. html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';
  3354. rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };
  3355. for ( prop in rules ) container.style[prop] = rules[prop];
  3356. container.innerHTML = html;
  3357. body.insertBefore(container, body.firstChild);
  3358. innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;
  3359. this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
  3360. this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
  3361. innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
  3362. this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
  3363. body.style.marginTop = '1px';
  3364. this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0);
  3365. body.style.marginTop = bodyMarginTop;
  3366. body.removeChild(container);
  3367. this.initialized = true;
  3368. },
  3369. bodyOffset: function(body) {
  3370. jQuery.offset.initialized || jQuery.offset.initialize();
  3371. var top = body.offsetTop, left = body.offsetLeft;
  3372. if ( jQuery.offset.doesNotIncludeMarginInBodyOffset )
  3373. top  += parseInt( jQuery.curCSS(body, 'marginTop',  true), 10 ) || 0,
  3374. left += parseInt( jQuery.curCSS(body, 'marginLeft'true), 10 ) || 0;
  3375. return { top: top, left: left };
  3376. }
  3377. };
  3378. jQuery.fn.extend({
  3379. position: function() {
  3380. var left = 0, top = 0, results;
  3381. if ( this[0] ) {
  3382. // Get *real* offsetParent
  3383. var offsetParent = this.offsetParent(),
  3384. // Get correct offsets
  3385. offset       = this.offset(),
  3386. parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
  3387. // Subtract element margins
  3388. // note: when an element has margin: auto the offsetLeft and marginLeft
  3389. // are the same in Safari causing offset.left to incorrectly be 0
  3390. offset.top  -= num( this'marginTop'  );
  3391. offset.left -= num( this'marginLeft' );
  3392. // Add offsetParent borders
  3393. parentOffset.top  += num( offsetParent, 'borderTopWidth'  );
  3394. parentOffset.left += num( offsetParent, 'borderLeftWidth' );
  3395. // Subtract the two offsets
  3396. results = {
  3397. top:  offset.top  - parentOffset.top,
  3398. left: offset.left - parentOffset.left
  3399. };
  3400. }
  3401. return results;
  3402. },
  3403. offsetParent: function() {
  3404. var offsetParent = this[0].offsetParent || document.body;
  3405. while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
  3406. offsetParent = offsetParent.offsetParent;
  3407. return jQuery(offsetParent);
  3408. }
  3409. });
  3410. // Create scrollLeft and scrollTop methods
  3411. jQuery.each( ['Left''Top'], function(i, name) {
  3412. var method = 'scroll' + name;
  3413. jQuery.fn[ method ] = function(val) {
  3414. if (!this[0]) return null;
  3415. return val !== undefined ?
  3416. // Set the scroll offset
  3417. this.each(function() {
  3418. this == window || this == document ?
  3419. window.scrollTo(
  3420. !i ? val : jQuery(window).scrollLeft(),
  3421. i ? val : jQuery(window).scrollTop()
  3422. ) :
  3423. this[ method ] = val;
  3424. }) :
  3425. // Return the scroll offset
  3426. this[0] == window || this[0] == document ?
  3427. self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
  3428. jQuery.boxModel && document.documentElement[ method ] ||
  3429. document.body[ method ] :
  3430. this[0][ method ];
  3431. };
  3432. });
  3433. // Create innerHeight, innerWidth, outerHeight and outerWidth methods
  3434. jQuery.each([ "Height""Width" ], function(i, name){
  3435. var tl = i ? "Left"  : "Top",  // top or left
  3436. br = i ? "Right" : "Bottom"// bottom or right
  3437. // innerHeight and innerWidth
  3438. jQuery.fn["inner" + name] = function(){
  3439. return this[ name.toLowerCase() ]() +
  3440. num(this"padding" + tl) +
  3441. num(this"padding" + br);
  3442. };
  3443. // outerHeight and outerWidth
  3444. jQuery.fn["outer" + name] = function(margin) {
  3445. return this["inner" + name]() +
  3446. num(this"border" + tl + "Width") +
  3447. num(this"border" + br + "Width") +
  3448. (margin ?
  3449. num(this"margin" + tl) + num(this"margin" + br) : 0);
  3450. };
  3451. var type = name.toLowerCase();
  3452. jQuery.fn[ type ] = function( size ) {
  3453. // Get window width or height
  3454. return this[0] == window ?
  3455. // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
  3456. document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] ||
  3457. document.body[ "client" + name ] :
  3458. // Get document width or height
  3459. this[0] == document ?
  3460. // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
  3461. Math.max(
  3462. document.documentElement["client" + name],
  3463. document.body["scroll" + name], document.documentElement["scroll" + name],
  3464. document.body["offset" + name], document.documentElement["offset" + name]
  3465. ) :
  3466. // Get or set width or height on the element
  3467. size === undefined ?
  3468. // Get width or height on the element
  3469. (this.length ? jQuery.css( this[0], type ) : null) :
  3470. // Set the width or height on the element (default to pixels if value is unitless)
  3471. this.css( type, typeof size === "string" ? size : size + "px" );
  3472. };
  3473. });})();
/*!* jQuery JavaScript Library v1.3.1* http://jquery.com/** Copyright (c) 2009 John Resig* Dual licensed under the MIT and GPL licenses.* http://docs.jquery.com/License** Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)* Revision: 6158*/
(function(){var // Will speed up references to window, and allows munging its name.window = this,// Will speed up references to undefined, and allows munging its name.undefined,// Map over jQuery in case of overwrite_jQuery = window.jQuery,// Map over the $ in case of overwrite_$ = window.$,jQuery = window.jQuery = window.$ = function( selector, context ) {// The jQuery object is actually just the init constructor 'enhanced'return new jQuery.fn.init( selector, context );},// A simple way to check for HTML strings or ID strings// (both of which we optimize for)quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,// Is it a simple selectorisSimple = /^.[^:#\[\.,]*$/;jQuery.fn = jQuery.prototype = {init: function( selector, context ) {// Make sure that a selection was providedselector = selector || document;// Handle $(DOMElement)if ( selector.nodeType ) {this[0] = selector;this.length = 1;this.context = selector;return this;}// Handle HTML stringsif ( typeof selector === "string" ) {// Are we dealing with HTML string or an ID?var match = quickExpr.exec( selector );// Verify a match, and that no context was specified for #idif ( match && (match[1] || !context) ) {// HANDLE: $(html) -> $(array)if ( match[1] )selector = jQuery.clean( [ match[1] ], context );// HANDLE: $("#id")else {var elem = document.getElementById( match[3] );// Handle the case where IE and Opera return items// by name instead of IDif ( elem && elem.id != match[3] )return jQuery().find( selector );// Otherwise, we inject the element directly into the jQuery objectvar ret = jQuery( elem || [] );ret.context = document;ret.selector = selector;return ret;}// HANDLE: $(expr, [context])// (which is just equivalent to: $(content).find(expr)} elsereturn jQuery( context ).find( selector );// HANDLE: $(function)// Shortcut for document ready} else if ( jQuery.isFunction( selector ) )return jQuery( document ).ready( selector );// Make sure that old selector state is passed alongif ( selector.selector && selector.context ) {this.selector = selector.selector;this.context = selector.context;}return this.setArray(jQuery.makeArray(selector));},// Start with an empty selectorselector: "",// The current version of jQuery being usedjquery: "1.3.1",// The number of elements contained in the matched element setsize: function() {return this.length;},// Get the Nth element in the matched element set OR// Get the whole matched element set as a clean arrayget: function( num ) {return num === undefined ?// Return a 'clean' arrayjQuery.makeArray( this ) :// Return just the objectthis[ num ];},// Take an array of elements and push it onto the stack// (returning the new matched element set)pushStack: function( elems, name, selector ) {// Build a new jQuery matched element setvar ret = jQuery( elems );// Add the old object onto the stack (as a reference)ret.prevObject = this;ret.context = this.context;if ( name === "find" )ret.selector = this.selector + (this.selector ? " " : "") + selector;else if ( name )ret.selector = this.selector + "." + name + "(" + selector + ")";// Return the newly-formed element setreturn ret;},// Force the current matched set of elements to become// the specified array of elements (destroying the stack in the process)// You should use pushStack() in order to do this, but maintain the stacksetArray: function( elems ) {// Resetting the length to 0, then using the native Array push// is a super-fast way to populate an object with array-like propertiesthis.length = 0;Array.prototype.push.apply( this, elems );return this;},// Execute a callback for every element in the matched set.// (You can seed the arguments with an array of args, but this is// only used internally.)each: function( callback, args ) {return jQuery.each( this, callback, args );},// Determine the position of an element within// the matched set of elementsindex: function( elem ) {// Locate the position of the desired elementreturn jQuery.inArray(// If it receives a jQuery object, the first element is usedelem && elem.jquery ? elem[0] : elem, this );},attr: function( name, value, type ) {var options = name;// Look for the case where we're accessing a style valueif ( typeof name === "string" )if ( value === undefined )return this[0] && jQuery[ type || "attr" ]( this[0], name );else {options = {};options[ name ] = value;}// Check to see if we're setting style valuesreturn this.each(function(i){// Set all the stylesfor ( name in options )jQuery.attr(type ?this.style :this,name, jQuery.prop( this, options[ name ], type, i, name ));});},css: function( key, value ) {// ignore negative width and height valuesif ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )value = undefined;return this.attr( key, value, "curCSS" );},text: function( text ) {if ( typeof text !== "object" && text != null )return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );var ret = "";jQuery.each( text || this, function(){jQuery.each( this.childNodes, function(){if ( this.nodeType != 8 )ret += this.nodeType != 1 ?this.nodeValue :jQuery.fn.text( [ this ] );});});return ret;},wrapAll: function( html ) {if ( this[0] ) {// The elements to wrap the target aroundvar wrap = jQuery( html, this[0].ownerDocument ).clone();if ( this[0].parentNode )wrap.insertBefore( this[0] );wrap.map(function(){var elem = this;while ( elem.firstChild )elem = elem.firstChild;return elem;}).append(this);}return this;},wrapInner: function( html ) {return this.each(function(){jQuery( this ).contents().wrapAll( html );});},wrap: function( html ) {return this.each(function(){jQuery( this ).wrapAll( html );});},append: function() {return this.domManip(arguments, true, function(elem){if (this.nodeType == 1)this.appendChild( elem );});},prepend: function() {return this.domManip(arguments, true, function(elem){if (this.nodeType == 1)this.insertBefore( elem, this.firstChild );});},before: function() {return this.domManip(arguments, false, function(elem){this.parentNode.insertBefore( elem, this );});},after: function() {return this.domManip(arguments, false, function(elem){this.parentNode.insertBefore( elem, this.nextSibling );});},end: function() {return this.prevObject || jQuery( [] );},// For internal use only.// Behaves like an Array's .push method, not like a jQuery method.push: [].push,find: function( selector ) {if ( this.length === 1 && !/,/.test(selector) ) {var ret = this.pushStack( [], "find", selector );ret.length = 0;jQuery.find( selector, this[0], ret );return ret;} else {var elems = jQuery.map(this, function(elem){return jQuery.find( selector, elem );});return this.pushStack( /[^+>] [^+>]/.test( selector ) ?jQuery.unique( elems ) :elems, "find", selector );}},clone: function( events ) {// Do the clonevar ret = this.map(function(){if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {// IE copies events bound via attachEvent when// using cloneNode. Calling detachEvent on the// clone will also remove the events from the orignal// In order to get around this, we use innerHTML.// Unfortunately, this means some modifications to// attributes in IE that are actually only stored// as properties will not be copied (such as the// the name attribute on an input).var clone = this.cloneNode(true),container = document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];} elsereturn this.cloneNode(true);});// Need to set the expando to null on the cloned set if it exists// removeData doesn't work here, IE removes it from the original as well// this is primarily for IE but the data expando shouldn't be copied over in any browservar clone = ret.find("*").andSelf().each(function(){if ( this[ expando ] !== undefined )this[ expando ] = null;});// Copy the events from the original to the cloneif ( events === true )this.find("*").andSelf().each(function(i){if (this.nodeType == 3)return;var events = jQuery.data( this, "events" );for ( var type in events )for ( var handler in events[ type ] )jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data );});// Return the cloned setreturn ret;},filter: function( selector ) {return this.pushStack(jQuery.isFunction( selector ) &&jQuery.grep(this, function(elem, i){return selector.call( elem, i );}) ||jQuery.multiFilter( selector, jQuery.grep(this, function(elem){return elem.nodeType === 1;}) ), "filter", selector );},closest: function( selector ) {var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null;return this.map(function(){var cur = this;while ( cur && cur.ownerDocument ) {if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) )return cur;cur = cur.parentNode;}});},not: function( selector ) {if ( typeof selector === "string" )// test special case where just one selector is passed inif ( isSimple.test( selector ) )return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector );elseselector = jQuery.multiFilter( selector, this );var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;return this.filter(function() {return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;});},add: function( selector ) {return this.pushStack( jQuery.unique( jQuery.merge(this.get(),typeof selector === "string" ?jQuery( selector ) :jQuery.makeArray( selector ))));},is: function( selector ) {return !!selector && jQuery.multiFilter( selector, this ).length > 0;},hasClass: function( selector ) {return !!selector && this.is( "." + selector );},val: function( value ) {if ( value === undefined ) {          var elem = this[0];if ( elem ) {if( jQuery.nodeName( elem, 'option' ) )return (elem.attributes.value || {}).specified ? elem.value : elem.text;// We need to handle select boxes specialif ( jQuery.nodeName( elem, "select" ) ) {var index = elem.selectedIndex,values = [],options = elem.options,one = elem.type == "select-one";// Nothing was selectedif ( index < 0 )return null;// Loop through all the selected optionsfor ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {var option = options[ i ];if ( option.selected ) {// Get the specifc value for the optionvalue = jQuery(option).val();// We don't need an array for one selectsif ( one )return value;// Multi-Selects return an arrayvalues.push( value );}}return values;             }// Everything else, we just grab the valuereturn (elem.value || "").replace(/\r/g, "");}return undefined;}if ( typeof value === "number" )value += '';return this.each(function(){if ( this.nodeType != 1 )return;if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) )this.checked = (jQuery.inArray(this.value, value) >= 0 ||jQuery.inArray(this.name, value) >= 0);else if ( jQuery.nodeName( this, "select" ) ) {var values = jQuery.makeArray(value);jQuery( "option", this ).each(function(){this.selected = (jQuery.inArray( this.value, values ) >= 0 ||jQuery.inArray( this.text, values ) >= 0);});if ( !values.length )this.selectedIndex = -1;} elsethis.value = value;});},html: function( value ) {return value === undefined ?(this[0] ?this[0].innerHTML :null) :this.empty().append( value );},replaceWith: function( value ) {return this.after( value ).remove();},eq: function( i ) {return this.slice( i, +i + 1 );},slice: function() {return this.pushStack( Array.prototype.slice.apply( this, arguments ),"slice", Array.prototype.slice.call(arguments).join(",") );},map: function( callback ) {return this.pushStack( jQuery.map(this, function(elem, i){return callback.call( elem, i, elem );}));},andSelf: function() {return this.add( this.prevObject );},domManip: function( args, table, callback ) {if ( this[0] ) {var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ),first = fragment.firstChild,extra = this.length > 1 ? fragment.cloneNode(true) : fragment;if ( first )for ( var i = 0, l = this.length; i < l; i++ )callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment );if ( scripts )jQuery.each( scripts, evalScript );}return this;function root( elem, cur ) {return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ?(elem.getElementsByTagName("tbody")[0] ||elem.appendChild(elem.ownerDocument.createElement("tbody"))) :elem;}}
};// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;function evalScript( i, elem ) {if ( elem.src )jQuery.ajax({url: elem.src,async: false,dataType: "script"});elsejQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );if ( elem.parentNode )elem.parentNode.removeChild( elem );
}function now(){return +new Date;
}jQuery.extend = jQuery.fn.extend = function() {// copy reference to target objectvar target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;// Handle a deep copy situationif ( typeof target === "boolean" ) {deep = target;target = arguments[1] || {};// skip the boolean and the targeti = 2;}// Handle case when target is a string or something (possible in deep copy)if ( typeof target !== "object" && !jQuery.isFunction(target) )target = {};// extend jQuery itself if only one argument is passedif ( length == i ) {target = this;--i;}for ( ; i < length; i++ )// Only deal with non-null/undefined valuesif ( (options = arguments[ i ]) != null )// Extend the base objectfor ( var name in options ) {var src = target[ name ], copy = options[ name ];// Prevent never-ending loopif ( target === copy )continue;// Recurse if we're merging object valuesif ( deep && copy && typeof copy === "object" && !copy.nodeType )target[ name ] = jQuery.extend( deep, // Never move original objects, clone themsrc || ( copy.length != null ? [ ] : { } ), copy );// Don't bring in undefined valueselse if ( copy !== undefined )target[ name ] = copy;}// Return the modified objectreturn target;
};// exclude the following css properties to add px
var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,// cache defaultViewdefaultView = document.defaultView || {},toString = Object.prototype.toString;jQuery.extend({noConflict: function( deep ) {window.$ = _$;if ( deep )window.jQuery = _jQuery;return jQuery;},// See test/unit/core.js for details concerning isFunction.// Since version 1.3, DOM methods and functions like alert// aren't supported. They return false on IE (#2968).isFunction: function( obj ) {return toString.call(obj) === "[object Function]";},isArray: function( obj ) {return toString.call(obj) === "[object Array]";},// check if an element is in a (or is an) XML documentisXMLDoc: function( elem ) {return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||!!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument );},// Evalulates a script in a global contextglobalEval: function( data ) {data = jQuery.trim( data );if ( data ) {// Inspired by code by Andrea Giammarchi// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.htmlvar head = document.getElementsByTagName("head")[0] || document.documentElement,script = document.createElement("script");script.type = "text/javascript";if ( jQuery.support.scriptEval )script.appendChild( document.createTextNode( data ) );elsescript.text = data;// Use insertBefore instead of appendChild  to circumvent an IE6 bug.// This arises when a base node is used (#2709).head.insertBefore( script, head.firstChild );head.removeChild( script );}},nodeName: function( elem, name ) {return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();},// args is for internal usage onlyeach: function( object, callback, args ) {var name, i = 0, length = object.length;if ( args ) {if ( length === undefined ) {for ( name in object )if ( callback.apply( object[ name ], args ) === false )break;} elsefor ( ; i < length; )if ( callback.apply( object[ i++ ], args ) === false )break;// A special, fast, case for the most common use of each} else {if ( length === undefined ) {for ( name in object )if ( callback.call( object[ name ], name, object[ name ] ) === false )break;} elsefor ( var value = object[0];i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}}return object;},prop: function( elem, value, type, i, name ) {// Handle executable functionsif ( jQuery.isFunction( value ) )value = value.call( elem, i );// Handle passing in a number to a CSS propertyreturn typeof value === "number" && type == "curCSS" && !exclude.test( name ) ?value + "px" :value;},className: {// internal only, use addClass("class")add: function( elem, classNames ) {jQuery.each((classNames || "").split(/\s+/), function(i, className){if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )elem.className += (elem.className ? " " : "") + className;});},// internal only, use removeClass("class")remove: function( elem, classNames ) {if (elem.nodeType == 1)elem.className = classNames !== undefined ?jQuery.grep(elem.className.split(/\s+/), function(className){return !jQuery.className.has( classNames, className );}).join(" ") :"";},// internal only, use hasClass("class")has: function( elem, className ) {return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;}},// A method for quickly swapping in/out CSS properties to get correct calculationsswap: function( elem, options, callback ) {var old = {};// Remember the old values, and insert the new onesfor ( var name in options ) {old[ name ] = elem.style[ name ];elem.style[ name ] = options[ name ];}callback.call( elem );// Revert the old valuesfor ( var name in options )elem.style[ name ] = old[ name ];},css: function( elem, name, force ) {if ( name == "width" || name == "height" ) {var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];function getWH() {val = name == "width" ? elem.offsetWidth : elem.offsetHeight;var padding = 0, border = 0;jQuery.each( which, function() {padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;});val -= Math.round(padding + border);}if ( jQuery(elem).is(":visible") )getWH();elsejQuery.swap( elem, props, getWH );return Math.max(0, val);}return jQuery.curCSS( elem, name, force );},curCSS: function( elem, name, force ) {var ret, style = elem.style;// We need to handle opacity special in IEif ( name == "opacity" && !jQuery.support.opacity ) {ret = jQuery.attr( style, "opacity" );return ret == "" ?"1" :ret;}// Make sure we're using the right name for getting the float valueif ( name.match( /float/i ) )name = styleFloat;if ( !force && style && style[ name ] )ret = style[ name ];else if ( defaultView.getComputedStyle ) {// Only "float" is needed hereif ( name.match( /float/i ) )name = "float";name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();var computedStyle = defaultView.getComputedStyle( elem, null );if ( computedStyle )ret = computedStyle.getPropertyValue( name );// We should always get a number back from opacityif ( name == "opacity" && ret == "" )ret = "1";} else if ( elem.currentStyle ) {var camelCase = name.replace(/\-(\w)/g, function(all, letter){return letter.toUpperCase();});ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];// From the awesome hack by Dean Edwards// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291// If we're not dealing with a regular pixel number// but a number that has a weird ending, we need to convert it to pixelsif ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {// Remember the original valuesvar left = style.left, rsLeft = elem.runtimeStyle.left;// Put in the new values to get a computed value outelem.runtimeStyle.left = elem.currentStyle.left;style.left = ret || 0;ret = style.pixelLeft + "px";// Revert the changed valuesstyle.left = left;elem.runtimeStyle.left = rsLeft;}}return ret;},clean: function( elems, context, fragment ) {context = context || document;// !context.createElement fails in IE with an error but returns typeof 'object'if ( typeof context.createElement === "undefined" )context = context.ownerDocument || context[0] && context[0].ownerDocument || document;// If a single string is passed in and it's a single tag// just do a createElement and skip the restif ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) {var match = /^<(\w+)\s*\/?>$/.exec(elems[0]);if ( match )return [ context.createElement( match[1] ) ];}var ret = [], scripts = [], div = context.createElement("div");jQuery.each(elems, function(i, elem){if ( typeof elem === "number" )elem += '';if ( !elem )return;// Convert html string into DOM nodesif ( typeof elem === "string" ) {// Fix "XHTML"-style tags in all browserselem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?all :front + "></" + tag + ">";});// Trim whitespace, otherwise indexOf won't work as expectedvar tags = jQuery.trim( elem ).toLowerCase();var wrap =// option or optgroup!tags.indexOf("<opt") &&[ 1, "<select multiple='multiple'>", "</select>" ] ||!tags.indexOf("<leg") &&[ 1, "<fieldset>", "</fieldset>" ] ||tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&[ 1, "<table>", "</table>" ] ||!tags.indexOf("<tr") &&[ 2, "<table><tbody>", "</tbody></table>" ] ||// <thead> matched above(!tags.indexOf("<td") || !tags.indexOf("<th")) &&[ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||!tags.indexOf("<col") &&[ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||// IE can't serialize <link> and <script> tags normally!jQuery.support.htmlSerialize &&[ 1, "div<div>", "</div>" ] ||[ 0, "", "" ];// Go to html and back, then peel off extra wrappersdiv.innerHTML = wrap[1] + elem + wrap[2];// Move to the right depthwhile ( wrap[0]-- )div = div.lastChild;// Remove IE's autoinserted <tbody> from table fragmentsif ( !jQuery.support.tbody ) {// String was a <table>, *may* have spurious <tbody>var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?div.firstChild && div.firstChild.childNodes :// String was a bare <thead> or <tfoot>wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?div.childNodes :[];for ( var j = tbody.length - 1; j >= 0 ; --j )if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )tbody[ j ].parentNode.removeChild( tbody[ j ] );}// IE completely kills leading whitespace when innerHTML is usedif ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) )div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );elem = jQuery.makeArray( div.childNodes );}if ( elem.nodeType )ret.push( elem );elseret = jQuery.merge( ret, elem );});if ( fragment ) {for ( var i = 0; ret[i]; i++ ) {if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );} else {if ( ret[i].nodeType === 1 )ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );fragment.appendChild( ret[i] );}}return scripts;}return ret;},attr: function( elem, name, value ) {// don't set attributes on text and comment nodesif (!elem || elem.nodeType == 3 || elem.nodeType == 8)return undefined;var notxml = !jQuery.isXMLDoc( elem ),// Whether we are setting (or getting)set = value !== undefined;// Try to normalize/fix the namename = notxml && jQuery.props[ name ] || name;// Only do all the following if this is a node (faster for style)// IE elem.getAttribute passes even for styleif ( elem.tagName ) {// These attributes require special treatmentvar special = /href|src|style/.test( name );// Safari mis-reports the default selected property of a hidden option// Accessing the parent's selectedIndex property fixes itif ( name == "selected" && elem.parentNode )elem.parentNode.selectedIndex;// If applicable, access the attribute via the DOM 0 wayif ( name in elem && notxml && !special ) {if ( set ){// We can't allow the type property to be changed (since it causes problems in IE)if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )throw "type property can't be changed";elem[ name ] = value;}// browsers index elements by id/name on forms, give priority to attributes.if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )return elem.getAttributeNode( name ).nodeValue;// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/if ( name == "tabIndex" ) {var attributeNode = elem.getAttributeNode( "tabIndex" );return attributeNode && attributeNode.specified? attributeNode.value: elem.nodeName.match(/(button|input|object|select|textarea)/i)? 0: elem.nodeName.match(/^(a|area)$/i) && elem.href? 0: undefined;}return elem[ name ];}if ( !jQuery.support.style && notxml &&  name == "style" )return jQuery.attr( elem.style, "cssText", value );if ( set )// convert the value to a string (all browsers do this but IE) see #1070elem.setAttribute( name, "" + value );var attr = !jQuery.support.hrefNormalized && notxml && special// Some attributes require a special call on IE? elem.getAttribute( name, 2 ): elem.getAttribute( name );// Non-existent attributes return null, we normalize to undefinedreturn attr === null ? undefined : attr;}// elem is actually elem.style ... set the style// IE uses filters for opacityif ( !jQuery.support.opacity && name == "opacity" ) {if ( set ) {// IE has trouble with opacity if it does not have layout// Force it by setting the zoom levelelem.zoom = 1;// Set the alpha filter to set the opacityelem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +(parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");}return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':"";}name = name.replace(/-([a-z])/ig, function(all, letter){return letter.toUpperCase();});if ( set )elem[ name ] = value;return elem[ name ];},trim: function( text ) {return (text || "").replace( /^\s+|\s+$/g, "" );},makeArray: function( array ) {var ret = [];if( array != null ){var i = array.length;// The window, strings (and functions) also have 'length'if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval )ret[0] = array;elsewhile( i )ret[--i] = array[i];}return ret;},inArray: function( elem, array ) {for ( var i = 0, length = array.length; i < length; i++ )// Use === because on IE, window == documentif ( array[ i ] === elem )return i;return -1;},merge: function( first, second ) {// We have to loop this way because IE & Opera overwrite the length// expando of getElementsByTagNamevar i = 0, elem, pos = first.length;// Also, we need to make sure that the correct elements are being returned// (IE returns comment nodes in a '*' query)if ( !jQuery.support.getAll ) {while ( (elem = second[ i++ ]) != null )if ( elem.nodeType != 8 )first[ pos++ ] = elem;} elsewhile ( (elem = second[ i++ ]) != null )first[ pos++ ] = elem;return first;},unique: function( array ) {var ret = [], done = {};try {for ( var i = 0, length = array.length; i < length; i++ ) {var id = jQuery.data( array[ i ] );if ( !done[ id ] ) {done[ id ] = true;ret.push( array[ i ] );}}} catch( e ) {ret = array;}return ret;},grep: function( elems, callback, inv ) {var ret = [];// Go through the array, only saving the items// that pass the validator functionfor ( var i = 0, length = elems.length; i < length; i++ )if ( !inv != !callback( elems[ i ], i ) )ret.push( elems[ i ] );return ret;},map: function( elems, callback ) {var ret = [];// Go through the array, translating each of the items to their// new value (or values).for ( var i = 0, length = elems.length; i < length; i++ ) {var value = callback( elems[ i ], i );if ( value != null )ret[ ret.length ] = value;}return ret.concat.apply( [], ret );}
});// Use of jQuery.browser is deprecated.
// It's included for backwards compatibility and plugins,
// although they should work to migrate away.var userAgent = navigator.userAgent.toLowerCase();// Figure out what browser is being used
jQuery.browser = {version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],safari: /webkit/.test( userAgent ),opera: /opera/.test( userAgent ),msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
};jQuery.each({parent: function(elem){return elem.parentNode;},parents: function(elem){return jQuery.dir(elem,"parentNode");},next: function(elem){return jQuery.nth(elem,2,"nextSibling");},prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children: function(elem){return jQuery.sibling(elem.firstChild);},contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
}, function(name, fn){jQuery.fn[ name ] = function( selector ) {var ret = jQuery.map( this, fn );if ( selector && typeof selector == "string" )ret = jQuery.multiFilter( selector, ret );return this.pushStack( jQuery.unique( ret ), name, selector );};
});jQuery.each({appendTo: "append",prependTo: "prepend",insertBefore: "before",insertAfter: "after",replaceAll: "replaceWith"
}, function(name, original){jQuery.fn[ name ] = function() {var args = arguments;return this.each(function(){for ( var i = 0, length = args.length; i < length; i++ )jQuery( args[ i ] )[ original ]( this );});};
});jQuery.each({removeAttr: function( name ) {jQuery.attr( this, name, "" );if (this.nodeType == 1)this.removeAttribute( name );},addClass: function( classNames ) {jQuery.className.add( this, classNames );},removeClass: function( classNames ) {jQuery.className.remove( this, classNames );},toggleClass: function( classNames, state ) {if( typeof state !== "boolean" )state = !jQuery.className.has( this, classNames );jQuery.className[ state ? "add" : "remove" ]( this, classNames );},remove: function( selector ) {if ( !selector || jQuery.filter( selector, [ this ] ).length ) {// Prevent memory leaksjQuery( "*", this ).add([this]).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if (this.parentNode)this.parentNode.removeChild( this );}},empty: function() {// Remove element nodes and prevent memory leaksjQuery( ">*", this ).remove();// Remove any remaining nodeswhile ( this.firstChild )this.removeChild( this.firstChild );}
}, function(name, fn){jQuery.fn[ name ] = function(){return this.each( fn, arguments );};
});// Helper function used by the dimensions and offset modules
function num(elem, prop) {return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
}
var expando = "jQuery" + now(), uuid = 0, windowData = {};jQuery.extend({cache: {},data: function( elem, name, data ) {elem = elem == window ?windowData :elem;var id = elem[ expando ];// Compute a unique ID for the elementif ( !id )id = elem[ expando ] = ++uuid;// Only generate the data cache if we're// trying to access or manipulate itif ( name && !jQuery.cache[ id ] )jQuery.cache[ id ] = {};// Prevent overriding the named cache with undefined valuesif ( data !== undefined )jQuery.cache[ id ][ name ] = data;// Return the named cache data, or the ID for the elementreturn name ?jQuery.cache[ id ][ name ] :id;},removeData: function( elem, name ) {elem = elem == window ?windowData :elem;var id = elem[ expando ];// If we want to remove a specific section of the element's dataif ( name ) {if ( jQuery.cache[ id ] ) {// Remove the section of cache datadelete jQuery.cache[ id ][ name ];// If we've removed all the data, remove the element's cachename = "";for ( name in jQuery.cache[ id ] )break;if ( !name )jQuery.removeData( elem );}// Otherwise, we want to remove all of the element's data} else {// Clean up the element expandotry {delete elem[ expando ];} catch(e){// IE has trouble directly removing the expando// but it's ok with using removeAttributeif ( elem.removeAttribute )elem.removeAttribute( expando );}// Completely remove the data cachedelete jQuery.cache[ id ];}},queue: function( elem, type, data ) {if ( elem ){type = (type || "fx") + "queue";var q = jQuery.data( elem, type );if ( !q || jQuery.isArray(data) )q = jQuery.data( elem, type, jQuery.makeArray(data) );else if( data )q.push( data );}return q;},dequeue: function( elem, type ){var queue = jQuery.queue( elem, type ),fn = queue.shift();if( !type || type === "fx" )fn = queue[0];if( fn !== undefined )fn.call(elem);}
});jQuery.fn.extend({data: function( key, value ){var parts = key.split(".");parts[1] = parts[1] ? "." + parts[1] : "";if ( value === undefined ) {var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);if ( data === undefined && this.length )data = jQuery.data( this[0], key );return data === undefined && parts[1] ?this.data( parts[0] ) :data;} elsereturn this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){jQuery.data( this, key, value );});},removeData: function( key ){return this.each(function(){jQuery.removeData( this, key );});},queue: function(type, data){if ( typeof type !== "string" ) {data = type;type = "fx";}if ( data === undefined )return jQuery.queue( this[0], type );return this.each(function(){var queue = jQuery.queue( this, type, data );if( type == "fx" && queue.length == 1 )queue[0].call(this);});},dequeue: function(type){return this.each(function(){jQuery.dequeue( this, type );});}
});/*!* Sizzle CSS Selector Engine - v0.9.3*  Copyright 2009, The Dojo Foundation*  Released under the MIT, BSD, and GPL Licenses.*  More information: http://sizzlejs.com/*/
(function(){var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,done = 0,toString = Object.prototype.toString;var Sizzle = function(selector, context, results, seed) {results = results || [];context = context || document;if ( context.nodeType !== 1 && context.nodeType !== 9 )return [];if ( !selector || typeof selector !== "string" ) {return results;}var parts = [], m, set, checkSet, check, mode, extra, prune = true;// Reset the position of the chunker regexp (start from head)chunker.lastIndex = 0;while ( (m = chunker.exec(selector)) !== null ) {parts.push( m[1] );if ( m[2] ) {extra = RegExp.rightContext;break;}}if ( parts.length > 1 && origPOS.exec( selector ) ) {if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {set = posProcess( parts[0] + parts[1], context );} else {set = Expr.relative[ parts[0] ] ?[ context ] :Sizzle( parts.shift(), context );while ( parts.length ) {selector = parts.shift();if ( Expr.relative[ selector ] )selector += parts.shift();set = posProcess( selector, set );}}} else {var ret = seed ?{ expr: parts.pop(), set: makeArray(seed) } :Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) );set = Sizzle.filter( ret.expr, ret.set );if ( parts.length > 0 ) {checkSet = makeArray(set);} else {prune = false;}while ( parts.length ) {var cur = parts.pop(), pop = cur;if ( !Expr.relative[ cur ] ) {cur = "";} else {pop = parts.pop();}if ( pop == null ) {pop = context;}Expr.relative[ cur ]( checkSet, pop, isXML(context) );}}if ( !checkSet ) {checkSet = set;}if ( !checkSet ) {throw "Syntax error, unrecognized expression: " + (cur || selector);}if ( toString.call(checkSet) === "[object Array]" ) {if ( !prune ) {results.push.apply( results, checkSet );} else if ( context.nodeType === 1 ) {for ( var i = 0; checkSet[i] != null; i++ ) {if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {results.push( set[i] );}}} else {for ( var i = 0; checkSet[i] != null; i++ ) {if ( checkSet[i] && checkSet[i].nodeType === 1 ) {results.push( set[i] );}}}} else {makeArray( checkSet, results );}if ( extra ) {Sizzle( extra, context, results, seed );}return results;
};Sizzle.matches = function(expr, set){return Sizzle(expr, null, null, set);
};Sizzle.find = function(expr, context, isXML){var set, match;if ( !expr ) {return [];}for ( var i = 0, l = Expr.order.length; i < l; i++ ) {var type = Expr.order[i], match;if ( (match = Expr.match[ type ].exec( expr )) ) {var left = RegExp.leftContext;if ( left.substr( left.length - 1 ) !== "\\" ) {match[1] = (match[1] || "").replace(/\\/g, "");set = Expr.find[ type ]( match, context, isXML );if ( set != null ) {expr = expr.replace( Expr.match[ type ], "" );break;}}}}if ( !set ) {set = context.getElementsByTagName("*");}return {set: set, expr: expr};
};Sizzle.filter = function(expr, set, inplace, not){var old = expr, result = [], curLoop = set, match, anyFound;while ( expr && set.length ) {for ( var type in Expr.filter ) {if ( (match = Expr.match[ type ].exec( expr )) != null ) {var filter = Expr.filter[ type ], found, item;anyFound = false;if ( curLoop == result ) {result = [];}if ( Expr.preFilter[ type ] ) {match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not );if ( !match ) {anyFound = found = true;} else if ( match === true ) {continue;}}if ( match ) {for ( var i = 0; (item = curLoop[i]) != null; i++ ) {if ( item ) {found = filter( item, match, i, curLoop );var pass = not ^ !!found;if ( inplace && found != null ) {if ( pass ) {anyFound = true;} else {curLoop[i] = false;}} else if ( pass ) {result.push( item );anyFound = true;}}}}if ( found !== undefined ) {if ( !inplace ) {curLoop = result;}expr = expr.replace( Expr.match[ type ], "" );if ( !anyFound ) {return [];}break;}}}expr = expr.replace(/\s*,\s*/, "");// Improper expressionif ( expr == old ) {if ( anyFound == null ) {throw "Syntax error, unrecognized expression: " + expr;} else {break;}}old = expr;}return curLoop;
};var Expr = Sizzle.selectors = {order: [ "ID", "NAME", "TAG" ],match: {ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap: {"class": "className","for": "htmlFor"},attrHandle: {href: function(elem){return elem.getAttribute("href");}},relative: {"+": function(checkSet, part){for ( var i = 0, l = checkSet.length; i < l; i++ ) {var elem = checkSet[i];if ( elem ) {var cur = elem.previousSibling;while ( cur && cur.nodeType !== 1 ) {cur = cur.previousSibling;}checkSet[i] = typeof part === "string" ?cur || false :cur === part;}}if ( typeof part === "string" ) {Sizzle.filter( part, checkSet, true );}},">": function(checkSet, part, isXML){if ( typeof part === "string" && !/\W/.test(part) ) {part = isXML ? part : part.toUpperCase();for ( var i = 0, l = checkSet.length; i < l; i++ ) {var elem = checkSet[i];if ( elem ) {var parent = elem.parentNode;checkSet[i] = parent.nodeName === part ? parent : false;}}} else {for ( var i = 0, l = checkSet.length; i < l; i++ ) {var elem = checkSet[i];if ( elem ) {checkSet[i] = typeof part === "string" ?elem.parentNode :elem.parentNode === part;}}if ( typeof part === "string" ) {Sizzle.filter( part, checkSet, true );}}},"": function(checkSet, part, isXML){var doneName = "done" + (done++), checkFn = dirCheck;if ( !part.match(/\W/) ) {var nodeCheck = part = isXML ? part : part.toUpperCase();checkFn = dirNodeCheck;}checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);},"~": function(checkSet, part, isXML){var doneName = "done" + (done++), checkFn = dirCheck;if ( typeof part === "string" && !part.match(/\W/) ) {var nodeCheck = part = isXML ? part : part.toUpperCase();checkFn = dirNodeCheck;}checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);}},find: {ID: function(match, context, isXML){if ( typeof context.getElementById !== "undefined" && !isXML ) {var m = context.getElementById(match[1]);return m ? [m] : [];}},NAME: function(match, context, isXML){if ( typeof context.getElementsByName !== "undefined" && !isXML ) {return context.getElementsByName(match[1]);}},TAG: function(match, context){return context.getElementsByTagName(match[1]);}},preFilter: {CLASS: function(match, curLoop, inplace, result, not){match = " " + match[1].replace(/\\/g, "") + " ";var elem;for ( var i = 0; (elem = curLoop[i]) != null; i++ ) {if ( elem ) {if ( not ^ (" " + elem.className + " ").indexOf(match) >= 0 ) {if ( !inplace )result.push( elem );} else if ( inplace ) {curLoop[i] = false;}}}return false;},ID: function(match){return match[1].replace(/\\/g, "");},TAG: function(match, curLoop){for ( var i = 0; curLoop[i] === false; i++ ){}return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();},CHILD: function(match){if ( match[1] == "nth" ) {// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);// calculate the numbers (first)n+(last) including if they are negativematch[2] = (test[1] + (test[2] || 1)) - 0;match[3] = test[3] - 0;}// TODO: Move to normal caching systemmatch[0] = "done" + (done++);return match;},ATTR: function(match){var name = match[1].replace(/\\/g, "");if ( Expr.attrMap[name] ) {match[1] = Expr.attrMap[name];}if ( match[2] === "~=" ) {match[4] = " " + match[4] + " ";}return match;},PSEUDO: function(match, curLoop, inplace, result, not){if ( match[1] === "not" ) {// If we're dealing with a complex expression, or a simple oneif ( match[3].match(chunker).length > 1 ) {match[3] = Sizzle(match[3], null, null, curLoop);} else {var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);if ( !inplace ) {result.push.apply( result, ret );}return false;}} else if ( Expr.match.POS.test( match[0] ) ) {return true;}return match;},POS: function(match){match.unshift( true );return match;}},filters: {enabled: function(elem){return elem.disabled === false && elem.type !== "hidden";},disabled: function(elem){return elem.disabled === true;},checked: function(elem){return elem.checked === true;},selected: function(elem){// Accessing this property makes selected-by-default// options in Safari work properlyelem.parentNode.selectedIndex;return elem.selected === true;},parent: function(elem){return !!elem.firstChild;},empty: function(elem){return !elem.firstChild;},has: function(elem, i, match){return !!Sizzle( match[3], elem ).length;},header: function(elem){return /h\d/i.test( elem.nodeName );},text: function(elem){return "text" === elem.type;},radio: function(elem){return "radio" === elem.type;},checkbox: function(elem){return "checkbox" === elem.type;},file: function(elem){return "file" === elem.type;},password: function(elem){return "password" === elem.type;},submit: function(elem){return "submit" === elem.type;},image: function(elem){return "image" === elem.type;},reset: function(elem){return "reset" === elem.type;},button: function(elem){return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";},input: function(elem){return /input|select|textarea|button/i.test(elem.nodeName);}},setFilters: {first: function(elem, i){return i === 0;},last: function(elem, i, match, array){return i === array.length - 1;},even: function(elem, i){return i % 2 === 0;},odd: function(elem, i){return i % 2 === 1;},lt: function(elem, i, match){return i < match[3] - 0;},gt: function(elem, i, match){return i > match[3] - 0;},nth: function(elem, i, match){return match[3] - 0 == i;},eq: function(elem, i, match){return match[3] - 0 == i;}},filter: {CHILD: function(elem, match){var type = match[1], parent = elem.parentNode;var doneName = match[0];if ( parent && (!parent[ doneName ] || !elem.nodeIndex) ) {var count = 1;for ( var node = parent.firstChild; node; node = node.nextSibling ) {if ( node.nodeType == 1 ) {node.nodeIndex = count++;}}parent[ doneName ] = count - 1;}if ( type == "first" ) {return elem.nodeIndex == 1;} else if ( type == "last" ) {return elem.nodeIndex == parent[ doneName ];} else if ( type == "only" ) {return parent[ doneName ] == 1;} else if ( type == "nth" ) {var add = false, first = match[2], last = match[3];if ( first == 1 && last == 0 ) {return true;}if ( first == 0 ) {if ( elem.nodeIndex == last ) {add = true;}} else if ( (elem.nodeIndex - last) % first == 0 && (elem.nodeIndex - last) / first >= 0 ) {add = true;}return add;}},PSEUDO: function(elem, match, i, array){var name = match[1], filter = Expr.filters[ name ];if ( filter ) {return filter( elem, i, match, array );} else if ( name === "contains" ) {return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;} else if ( name === "not" ) {var not = match[3];for ( var i = 0, l = not.length; i < l; i++ ) {if ( not[i] === elem ) {return false;}}return true;}},ID: function(elem, match){return elem.nodeType === 1 && elem.getAttribute("id") === match;},TAG: function(elem, match){return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;},CLASS: function(elem, match){return match.test( elem.className );},ATTR: function(elem, match){var result = Expr.attrHandle[ match[1] ] ? Expr.attrHandle[ match[1] ]( elem ) : elem[ match[1] ] || elem.getAttribute( match[1] ), value = result + "", type = match[2], check = match[4];return result == null ?type === "!=" :type === "=" ?value === check :type === "*=" ?value.indexOf(check) >= 0 :type === "~=" ?(" " + value + " ").indexOf(check) >= 0 :!match[4] ?result :type === "!=" ?value != check :type === "^=" ?value.indexOf(check) === 0 :type === "$=" ?value.substr(value.length - check.length) === check :type === "|=" ?value === check || value.substr(0, check.length + 1) === check + "-" :false;},POS: function(elem, match, i, array){var name = match[2], filter = Expr.setFilters[ name ];if ( filter ) {return filter( elem, i, match, array );}}}
};var origPOS = Expr.match.POS;for ( var type in Expr.match ) {Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
}var makeArray = function(array, results) {array = Array.prototype.slice.call( array );if ( results ) {results.push.apply( results, array );return results;}return array;
};// Perform a simple check to determine if the browser is capable of
// converting a NodeList to an array using builtin methods.
try {Array.prototype.slice.call( document.documentElement.childNodes );// Provide a fallback method if it does not work
} catch(e){makeArray = function(array, results) {var ret = results || [];if ( toString.call(array) === "[object Array]" ) {Array.prototype.push.apply( ret, array );} else {if ( typeof array.length === "number" ) {for ( var i = 0, l = array.length; i < l; i++ ) {ret.push( array[i] );}} else {for ( var i = 0; array[i]; i++ ) {ret.push( array[i] );}}}return ret;};
}// Check to see if the browser returns elements by name when
// querying by getElementById (and provide a workaround)
(function(){// We're going to inject a fake input element with a specified namevar form = document.createElement("form"),id = "script" + (new Date).getTime();form.innerHTML = "<input name='" + id + "'/>";// Inject it into the root element, check its status, and remove it quicklyvar root = document.documentElement;root.insertBefore( form, root.firstChild );// The workaround has to do additional checks after a getElementById// Which slows things down for other browsers (hence the branching)if ( !!document.getElementById( id ) ) {Expr.find.ID = function(match, context, isXML){if ( typeof context.getElementById !== "undefined" && !isXML ) {var m = context.getElementById(match[1]);return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];}};Expr.filter.ID = function(elem, match){var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");return elem.nodeType === 1 && node && node.nodeValue === match;};}root.removeChild( form );
})();(function(){// Check to see if the browser returns only elements// when doing getElementsByTagName("*")// Create a fake elementvar div = document.createElement("div");div.appendChild( document.createComment("") );// Make sure no comments are foundif ( div.getElementsByTagName("*").length > 0 ) {Expr.find.TAG = function(match, context){var results = context.getElementsByTagName(match[1]);// Filter out possible commentsif ( match[1] === "*" ) {var tmp = [];for ( var i = 0; results[i]; i++ ) {if ( results[i].nodeType === 1 ) {tmp.push( results[i] );}}results = tmp;}return results;};}// Check to see if an attribute returns normalized href attributesdiv.innerHTML = "<a href='#'></a>";if ( div.firstChild && div.firstChild.getAttribute("href") !== "#" ) {Expr.attrHandle.href = function(elem){return elem.getAttribute("href", 2);};}
})();if ( document.querySelectorAll ) (function(){var oldSizzle = Sizzle, div = document.createElement("div");div.innerHTML = "<p class='TEST'></p>";// Safari can't handle uppercase or unicode characters when// in quirks mode.if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {return;}Sizzle = function(query, context, extra, seed){context = context || document;// Only use querySelectorAll on non-XML documents// (ID selectors don't work in non-HTML documents)if ( !seed && context.nodeType === 9 && !isXML(context) ) {try {return makeArray( context.querySelectorAll(query), extra );} catch(e){}}return oldSizzle(query, context, extra, seed);};Sizzle.find = oldSizzle.find;Sizzle.filter = oldSizzle.filter;Sizzle.selectors = oldSizzle.selectors;Sizzle.matches = oldSizzle.matches;
})();if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) {Expr.order.splice(1, 0, "CLASS");Expr.find.CLASS = function(match, context) {return context.getElementsByClassName(match[1]);};
}function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {for ( var i = 0, l = checkSet.length; i < l; i++ ) {var elem = checkSet[i];if ( elem ) {elem = elem[dir];var match = false;while ( elem && elem.nodeType ) {var done = elem[doneName];if ( done ) {match = checkSet[ done ];break;}if ( elem.nodeType === 1 && !isXML )elem[doneName] = i;if ( elem.nodeName === cur ) {match = elem;break;}elem = elem[dir];}checkSet[i] = match;}}
}function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {for ( var i = 0, l = checkSet.length; i < l; i++ ) {var elem = checkSet[i];if ( elem ) {elem = elem[dir];var match = false;while ( elem && elem.nodeType ) {if ( elem[doneName] ) {match = checkSet[ elem[doneName] ];break;}if ( elem.nodeType === 1 ) {if ( !isXML )elem[doneName] = i;if ( typeof cur !== "string" ) {if ( elem === cur ) {match = true;break;}} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {match = elem;break;}}elem = elem[dir];}checkSet[i] = match;}}
}var contains = document.compareDocumentPosition ?  function(a, b){return a.compareDocumentPosition(b) & 16;
} : function(a, b){return a !== b && (a.contains ? a.contains(b) : true);
};var isXML = function(elem){return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||!!elem.ownerDocument && isXML( elem.ownerDocument );
};var posProcess = function(selector, context){var tmpSet = [], later = "", match,root = context.nodeType ? [context] : context;// Position selectors must be done after the filter// And so must :not(positional) so we move all PSEUDOs to the endwhile ( (match = Expr.match.PSEUDO.exec( selector )) ) {later += match[0];selector = selector.replace( Expr.match.PSEUDO, "" );}selector = Expr.relative[selector] ? selector + "*" : selector;for ( var i = 0, l = root.length; i < l; i++ ) {Sizzle( selector, root[i], tmpSet );}return Sizzle.filter( later, tmpSet );
};// EXPOSE
jQuery.find = Sizzle;
jQuery.filter = Sizzle.filter;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;Sizzle.selectors.filters.hidden = function(elem){return "hidden" === elem.type ||jQuery.css(elem, "display") === "none" ||jQuery.css(elem, "visibility") === "hidden";
};Sizzle.selectors.filters.visible = function(elem){return "hidden" !== elem.type &&jQuery.css(elem, "display") !== "none" &&jQuery.css(elem, "visibility") !== "hidden";
};Sizzle.selectors.filters.animated = function(elem){return jQuery.grep(jQuery.timers, function(fn){return elem === fn.elem;}).length;
};jQuery.multiFilter = function( expr, elems, not ) {if ( not ) {expr = ":not(" + expr + ")";}return Sizzle.matches(expr, elems);
};jQuery.dir = function( elem, dir ){var matched = [], cur = elem[dir];while ( cur && cur != document ) {if ( cur.nodeType == 1 )matched.push( cur );cur = cur[dir];}return matched;
};jQuery.nth = function(cur, result, dir, elem){result = result || 1;var num = 0;for ( ; cur; cur = cur[dir] )if ( cur.nodeType == 1 && ++num == result )break;return cur;
};jQuery.sibling = function(n, elem){var r = [];for ( ; n; n = n.nextSibling ) {if ( n.nodeType == 1 && n != elem )r.push( n );}return r;
};return;window.Sizzle = Sizzle;})();
/** A number of helper functions used for managing events.* Many of the ideas behind this code originated from* Dean Edwards' addEvent library.*/
jQuery.event = {// Bind an event to an element// Original by Dean Edwardsadd: function(elem, types, handler, data) {if ( elem.nodeType == 3 || elem.nodeType == 8 )return;// For whatever reason, IE has trouble passing the window object// around, causing it to be cloned in the processif ( elem.setInterval && elem != window )elem = window;// Make sure that the function being executed has a unique IDif ( !handler.guid )handler.guid = this.guid++;// if data is passed, bind to handlerif ( data !== undefined ) {// Create temporary function pointer to original handlervar fn = handler;// Create unique handler function, wrapped around original handlerhandler = this.proxy( fn );// Store data in unique handlerhandler.data = data;}// Init the element's event structurevar events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){// Handle the second event of a trigger and when// an event is called after a page has unloadedreturn typeof jQuery !== "undefined" && !jQuery.event.triggered ?jQuery.event.handle.apply(arguments.callee.elem, arguments) :undefined;});// Add elem as a property of the handle function// This is to prevent a memory leak with non-native// event in IE.handle.elem = elem;// Handle multiple events separated by a space// jQuery(...).bind("mouseover mouseout", fn);jQuery.each(types.split(/\s+/), function(index, type) {// Namespaced event handlersvar namespaces = type.split(".");type = namespaces.shift();handler.type = namespaces.slice().sort().join(".");// Get the current list of functions bound to this eventvar handlers = events[type];if ( jQuery.event.specialAll[type] )jQuery.event.specialAll[type].setup.call(elem, data, namespaces);// Init the event handler queueif (!handlers) {handlers = events[type] = {};// Check for a special event handler// Only use addEventListener/attachEvent if the special// events handler returns falseif ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {// Bind the global event handler to the elementif (elem.addEventListener)elem.addEventListener(type, handle, false);else if (elem.attachEvent)elem.attachEvent("on" + type, handle);}}// Add the function to the element's handler listhandlers[handler.guid] = handler;// Keep track of which events have been used, for global triggeringjQuery.event.global[type] = true;});// Nullify elem to prevent memory leaks in IEelem = null;},guid: 1,global: {},// Detach an event or set of events from an elementremove: function(elem, types, handler) {// don't do events on text and comment nodesif ( elem.nodeType == 3 || elem.nodeType == 8 )return;var events = jQuery.data(elem, "events"), ret, index;if ( events ) {// Unbind all events for the elementif ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") )for ( var type in events )this.remove( elem, type + (types || "") );else {// types is actually an event object hereif ( types.type ) {handler = types.handler;types = types.type;}// Handle multiple events seperated by a space// jQuery(...).unbind("mouseover mouseout", fn);jQuery.each(types.split(/\s+/), function(index, type){// Namespaced event handlersvar namespaces = type.split(".");type = namespaces.shift();var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");if ( events[type] ) {// remove the given handler for the given typeif ( handler )delete events[type][handler.guid];// remove all handlers for the given typeelsefor ( var handle in events[type] )// Handle the removal of namespaced eventsif ( namespace.test(events[type][handle].type) )delete events[type][handle];if ( jQuery.event.specialAll[type] )jQuery.event.specialAll[type].teardown.call(elem, namespaces);// remove generic event handler if no more handlers existfor ( ret in events[type] ) break;if ( !ret ) {if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {if (elem.removeEventListener)elem.removeEventListener(type, jQuery.data(elem, "handle"), false);else if (elem.detachEvent)elem.detachEvent("on" + type, jQuery.data(elem, "handle"));}ret = null;delete events[type];}}});}// Remove the expando if it's no longer usedfor ( ret in events ) break;if ( !ret ) {var handle = jQuery.data( elem, "handle" );if ( handle ) handle.elem = null;jQuery.removeData( elem, "events" );jQuery.removeData( elem, "handle" );}}},// bubbling is internaltrigger: function( event, data, elem, bubbling ) {// Event object or event typevar type = event.type || event;if( !bubbling ){event = typeof event === "object" ?// jQuery.Event objectevent[expando] ? event :// Object literaljQuery.extend( jQuery.Event(type), event ) :// Just the event type (string)jQuery.Event(type);if ( type.indexOf("!") >= 0 ) {event.type = type = type.slice(0, -1);event.exclusive = true;}// Handle a global triggerif ( !elem ) {// Don't bubble custom events when global (to avoid too much overhead)event.stopPropagation();// Only trigger if we've ever bound an event for itif ( this.global[type] )jQuery.each( jQuery.cache, function(){if ( this.events && this.events[type] )jQuery.event.trigger( event, data, this.handle.elem );});}// Handle triggering a single element// don't do events on text and comment nodesif ( !elem || elem.nodeType == 3 || elem.nodeType == 8 )return undefined;// Clean up in case it is reusedevent.result = undefined;event.target = elem;// Clone the incoming data, if anydata = jQuery.makeArray(data);data.unshift( event );}event.currentTarget = elem;// Trigger the event, it is assumed that "handle" is a functionvar handle = jQuery.data(elem, "handle");if ( handle )handle.apply( elem, data );// Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )event.result = false;// Trigger the native events (except for clicks on links)if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) {this.triggered = true;try {elem[ type ]();// prevent IE from throwing an error for some hidden elements} catch (e) {}}this.triggered = false;if ( !event.isPropagationStopped() ) {var parent = elem.parentNode || elem.ownerDocument;if ( parent )jQuery.event.trigger(event, data, parent, true);}},handle: function(event) {// returned undefined or falsevar all, handlers;event = arguments[0] = jQuery.event.fix( event || window.event );// Namespaced event handlersvar namespaces = event.type.split(".");event.type = namespaces.shift();// Cache this now, all = true means, any handlerall = !namespaces.length && !event.exclusive;var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");handlers = ( jQuery.data(this, "events") || {} )[event.type];for ( var j in handlers ) {var handler = handlers[j];// Filter the functions by classif ( all || namespace.test(handler.type) ) {// Pass in a reference to the handler function itself// So that we can later remove itevent.handler = handler;event.data = handler.data;var ret = handler.apply(this, arguments);if( ret !== undefined ){event.result = ret;if ( ret === false ) {event.preventDefault();event.stopPropagation();}}if( event.isImmediatePropagationStopped() )break;}}},props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix: function(event) {if ( event[expando] )return event;// store a copy of the original event object// and "clone" to set read-only propertiesvar originalEvent = event;event = jQuery.Event( originalEvent );for ( var i = this.props.length, prop; i; ){prop = this.props[ --i ];event[ prop ] = originalEvent[ prop ];}// Fix target property, if necessaryif ( !event.target )event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either// check if target is a textnode (safari)if ( event.target.nodeType == 3 )event.target = event.target.parentNode;// Add relatedTarget, if necessaryif ( !event.relatedTarget && event.fromElement )event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;// Calculate pageX/Y if missing and clientX/Y availableif ( event.pageX == null && event.clientX != null ) {var doc = document.documentElement, body = document.body;event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);}// Add which for key eventsif ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )event.which = event.charCode || event.keyCode;// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)if ( !event.metaKey && event.ctrlKey )event.metaKey = event.ctrlKey;// Add which for click: 1 == left; 2 == middle; 3 == right// Note: button is not normalized, so don't use itif ( !event.which && event.button )event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));return event;},proxy: function( fn, proxy ){proxy = proxy || function(){ return fn.apply(this, arguments); };// Set the guid of unique handler to the same of original handler, so it can be removedproxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;// So proxy can be declared as an argumentreturn proxy;},special: {ready: {// Make sure the ready event is setupsetup: bindReady,teardown: function() {}}},specialAll: {live: {setup: function( selector, namespaces ){jQuery.event.add( this, namespaces[0], liveHandler );},teardown:  function( namespaces ){if ( namespaces.length ) {var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");jQuery.each( (jQuery.data(this, "events").live || {}), function(){if ( name.test(this.type) )remove++;});if ( remove < 1 )jQuery.event.remove( this, namespaces[0], liveHandler );}}}}
};jQuery.Event = function( src ){// Allow instantiation without the 'new' keywordif( !this.preventDefault )return new jQuery.Event(src);// Event objectif( src && src.type ){this.originalEvent = src;this.type = src.type;// Event type}elsethis.type = src;// timeStamp is buggy for some events on Firefox(#3843)// So we won't rely on the native valuethis.timeStamp = now();// Mark it as fixedthis[expando] = true;
};function returnFalse(){return false;
}
function returnTrue(){return true;
}// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {preventDefault: function() {this.isDefaultPrevented = returnTrue;var e = this.originalEvent;if( !e )return;// if preventDefault exists run it on the original eventif (e.preventDefault)e.preventDefault();// otherwise set the returnValue property of the original event to false (IE)e.returnValue = false;},stopPropagation: function() {this.isPropagationStopped = returnTrue;var e = this.originalEvent;if( !e )return;// if stopPropagation exists run it on the original eventif (e.stopPropagation)e.stopPropagation();// otherwise set the cancelBubble property of the original event to true (IE)e.cancelBubble = true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped = returnTrue;this.stopPropagation();},isDefaultPrevented: returnFalse,isPropagationStopped: returnFalse,isImmediatePropagationStopped: returnFalse
};
// Checks if an event happened on an element within another element
// Used in jQuery.event.special.mouseenter and mouseleave handlers
var withinElement = function(event) {// Check if mouse(over|out) are still within the same parent elementvar parent = event.relatedTarget;// Traverse up the treewhile ( parent && parent != this )try { parent = parent.parentNode; }catch(e) { parent = this; }if( parent != this ){// set the correct event typeevent.type = event.data;// handle event if we actually just moused on to a non sub-elementjQuery.event.handle.apply( this, arguments );}
};jQuery.each({ mouseover: 'mouseenter', mouseout: 'mouseleave'
}, function( orig, fix ){jQuery.event.special[ fix ] = {setup: function(){jQuery.event.add( this, orig, withinElement, fix );},teardown: function(){jQuery.event.remove( this, orig, withinElement );}};
});jQuery.fn.extend({bind: function( type, data, fn ) {return type == "unload" ? this.one(type, data, fn) : this.each(function(){jQuery.event.add( this, type, fn || data, fn && data );});},one: function( type, data, fn ) {var one = jQuery.event.proxy( fn || data, function(event) {jQuery(this).unbind(event, one);return (fn || data).apply( this, arguments );});return this.each(function(){jQuery.event.add( this, type, one, fn && data);});},unbind: function( type, fn ) {return this.each(function(){jQuery.event.remove( this, type, fn );});},trigger: function( type, data ) {return this.each(function(){jQuery.event.trigger( type, data, this );});},triggerHandler: function( type, data ) {if( this[0] ){var event = jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger( event, data, this[0] );return event.result;}     },toggle: function( fn ) {// Save reference to arguments for access in closurevar args = arguments, i = 1;// link all the functions, so any of them can unbind this click handlerwhile( i < args.length )jQuery.event.proxy( fn, args[i++] );return this.click( jQuery.event.proxy( fn, function(event) {// Figure out which function to executethis.lastToggle = ( this.lastToggle || 0 ) % i;// Make sure that clicks stopevent.preventDefault();// and execute the functionreturn args[ this.lastToggle++ ].apply( this, arguments ) || false;}));},hover: function(fnOver, fnOut) {return this.mouseenter(fnOver).mouseleave(fnOut);},ready: function(fn) {// Attach the listenersbindReady();// If the DOM is already readyif ( jQuery.isReady )// Execute the function immediatelyfn.call( document, jQuery );// Otherwise, remember the function for laterelse// Add the function to the wait listjQuery.readyList.push( fn );return this;},live: function( type, fn ){var proxy = jQuery.event.proxy( fn );proxy.guid += this.selector + type;jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy );return this;},die: function( type, fn ){jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null );return this;}
});function liveHandler( event ){var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),stop = true,elems = [];jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){if ( check.test(fn.type) ) {var elem = jQuery(event.target).closest(fn.data)[0];if ( elem )elems.push({ elem: elem, fn: fn });}});jQuery.each(elems, function(){if ( this.fn.call(this.elem, event, this.fn.data) === false )stop = false;});return stop;
}function liveConvert(type, selector){return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join(".");
}jQuery.extend({isReady: false,readyList: [],// Handle when the DOM is readyready: function() {// Make sure that the DOM is not already loadedif ( !jQuery.isReady ) {// Remember that the DOM is readyjQuery.isReady = true;// If there are functions bound, to executeif ( jQuery.readyList ) {// Execute all of themjQuery.each( jQuery.readyList, function(){this.call( document, jQuery );});// Reset the list of functionsjQuery.readyList = null;}// Trigger any bound ready eventsjQuery(document).triggerHandler("ready");}}
});var readyBound = false;function bindReady(){if ( readyBound ) return;readyBound = true;// Mozilla, Opera and webkit nightlies currently support this eventif ( document.addEventListener ) {// Use the handy event callbackdocument.addEventListener( "DOMContentLoaded", function(){document.removeEventListener( "DOMContentLoaded", arguments.callee, false );jQuery.ready();}, false );// If IE event model is used} else if ( document.attachEvent ) {// ensure firing before onload,// maybe late but safe also for iframesdocument.attachEvent("onreadystatechange", function(){if ( document.readyState === "complete" ) {document.detachEvent( "onreadystatechange", arguments.callee );jQuery.ready();}});// If IE and not an iframe// continually check to see if the document is readyif ( document.documentElement.doScroll && typeof window.frameElement === "undefined" ) (function(){if ( jQuery.isReady ) return;try {// If IE is used, use the trick by Diego Perini// http://javascript.nwbox.com/IEContentLoaded/document.documentElement.doScroll("left");} catch( error ) {setTimeout( arguments.callee, 0 );return;}// and execute any waiting functionsjQuery.ready();})();}// A fallback to window.onload, that will always workjQuery.event.add( window, "load", jQuery.ready );
}jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +"mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," +"change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){// Handle event bindingjQuery.fn[name] = function(fn){return fn ? this.bind(name, fn) : this.trigger(name);};
});// Prevent memory leaks in IE
// And prevent errors on refresh with events like mouseover in other browsers
// Window isn't included so as not to unbind existing unload events
jQuery( window ).bind( 'unload', function(){ for ( var id in jQuery.cache )// Skip the windowif ( id != 1 && jQuery.cache[ id ].handle )jQuery.event.remove( jQuery.cache[ id ].handle.elem );
});
(function(){jQuery.support = {};var root = document.documentElement,script = document.createElement("script"),div = document.createElement("div"),id = "script" + (new Date).getTime();div.style.display = "none";div.innerHTML = '   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var all = div.getElementsByTagName("*"),a = div.getElementsByTagName("a")[0];// Can't get basic test supportif ( !all || !all.length || !a ) {return;}jQuery.support = {// IE strips leading whitespace when .innerHTML is usedleadingWhitespace: div.firstChild.nodeType == 3,// Make sure that tbody elements aren't automatically inserted// IE will insert them into empty tablestbody: !div.getElementsByTagName("tbody").length,// Make sure that you can get all elements in an <object> element// IE 7 always returns no resultsobjectAll: !!div.getElementsByTagName("object")[0].getElementsByTagName("*").length,// Make sure that link elements get serialized correctly by innerHTML// This requires a wrapper element in IEhtmlSerialize: !!div.getElementsByTagName("link").length,// Get the style information from getAttribute// (IE uses .cssText insted)style: /red/.test( a.getAttribute("style") ),// Make sure that URLs aren't manipulated// (IE normalizes it by default)hrefNormalized: a.getAttribute("href") === "/a",// Make sure that element opacity exists// (IE uses filter instead)opacity: a.style.opacity === "0.5",// Verify style float existence// (IE uses styleFloat instead of cssFloat)cssFloat: !!a.style.cssFloat,// Will be defined laterscriptEval: false,noCloneEvent: true,boxModel: null};script.type = "text/javascript";try {script.appendChild( document.createTextNode( "window." + id + "=1;" ) );} catch(e){}root.insertBefore( script, root.firstChild );// Make sure that the execution of code works by injecting a script// tag with appendChild/createTextNode// (IE doesn't support this, fails, and uses .text instead)if ( window[ id ] ) {jQuery.support.scriptEval = true;delete window[ id ];}root.removeChild( script );if ( div.attachEvent && div.fireEvent ) {div.attachEvent("onclick", function(){// Cloning a node shouldn't copy over any// bound event handlers (IE does this)jQuery.support.noCloneEvent = false;div.detachEvent("onclick", arguments.callee);});div.cloneNode(true).fireEvent("onclick");}// Figure out if the W3C box model works as expected// document.body must exist before we can do thisjQuery(function(){var div = document.createElement("div");div.style.width = "1px";div.style.paddingLeft = "1px";document.body.appendChild( div );jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;document.body.removeChild( div );});
})();var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";jQuery.props = {"for": "htmlFor","class": "className","float": styleFloat,cssFloat: styleFloat,styleFloat: styleFloat,readonly: "readOnly",maxlength: "maxLength",cellspacing: "cellSpacing",rowspan: "rowSpan",tabindex: "tabIndex"
};
jQuery.fn.extend({// Keep a copy of the old load_load: jQuery.fn.load,load: function( url, params, callback ) {if ( typeof url !== "string" )return this._load( url );var off = url.indexOf(" ");if ( off >= 0 ) {var selector = url.slice(off, url.length);url = url.slice(0, off);}// Default to a GET requestvar type = "GET";// If the second parameter was providedif ( params )// If it's a functionif ( jQuery.isFunction( params ) ) {// We assume that it's the callbackcallback = params;params = null;// Otherwise, build a param string} else if( typeof params === "object" ) {params = jQuery.param( params );type = "POST";}var self = this;// Request the remote documentjQuery.ajax({url: url,type: type,dataType: "html",data: params,complete: function(res, status){// If successful, inject the HTML into all the matched elementsif ( status == "success" || status == "notmodified" )// See if a selector was specifiedself.html( selector ?// Create a dummy div to hold the resultsjQuery("<div/>")// inject the contents of the document in, removing the scripts// to avoid any 'Permission Denied' errors in IE.append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))// Locate the specified elements.find(selector) :// If not, just inject the full resultres.responseText );if( callback )self.each( callback, [res.responseText, status, res] );}});return this;},serialize: function() {return jQuery.param(this.serializeArray());},serializeArray: function() {return this.map(function(){return this.elements ? jQuery.makeArray(this.elements) : this;}).filter(function(){return this.name && !this.disabled &&(this.checked || /select|textarea/i.test(this.nodeName) ||/text|hidden|password/i.test(this.type));}).map(function(i, elem){var val = jQuery(this).val();return val == null ? null :jQuery.isArray(val) ?jQuery.map( val, function(val, i){return {name: elem.name, value: val};}) :{name: elem.name, value: val};}).get();}
});// Attach a bunch of functions for handling common AJAX events
jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){jQuery.fn[o] = function(f){return this.bind(o, f);};
});var jsc = now();jQuery.extend({get: function( url, data, callback, type ) {// shift arguments if data argument was ommitedif ( jQuery.isFunction( data ) ) {callback = data;data = null;}return jQuery.ajax({type: "GET",url: url,data: data,success: callback,dataType: type});},getScript: function( url, callback ) {return jQuery.get(url, null, callback, "script");},getJSON: function( url, data, callback ) {return jQuery.get(url, data, callback, "json");},post: function( url, data, callback, type ) {if ( jQuery.isFunction( data ) ) {callback = data;data = {};}return jQuery.ajax({type: "POST",url: url,data: data,success: callback,dataType: type});},ajaxSetup: function( settings ) {jQuery.extend( jQuery.ajaxSettings, settings );},ajaxSettings: {url: location.href,global: true,type: "GET",contentType: "application/x-www-form-urlencoded",processData: true,async: true,/*timeout: 0,data: null,username: null,password: null,*/// Create the request object; Microsoft failed to properly// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available// This function can be overriden by calling jQuery.ajaxSetupxhr:function(){return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();},accepts: {xml: "application/xml, text/xml",html: "text/html",script: "text/javascript, application/javascript",json: "application/json, text/javascript",text: "text/plain",_default: "*/*"}},// Last-Modified header cache for next requestlastModified: {},ajax: function( s ) {// Extend the settings, but re-extend 's' so that it can be// checked again later (in the test suite, specifically)s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));var jsonp, jsre = /=\?(&|$)/g, status, data,type = s.type.toUpperCase();// convert data if not already a stringif ( s.data && s.processData && typeof s.data !== "string" )s.data = jQuery.param(s.data);// Handle JSONP Parameter Callbacksif ( s.dataType == "jsonp" ) {if ( type == "GET" ) {if ( !s.url.match(jsre) )s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";} else if ( !s.data || !s.data.match(jsre) )s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";s.dataType = "json";}// Build temporary JSONP functionif ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {jsonp = "jsonp" + jsc++;// Replace the =? sequence both in the query string and the dataif ( s.data )s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");s.url = s.url.replace(jsre, "=" + jsonp + "$1");// We need to make sure// that a JSONP style response is executed properlys.dataType = "script";// Handle JSONP-style loadingwindow[ jsonp ] = function(tmp){data = tmp;success();complete();// Garbage collectwindow[ jsonp ] = undefined;try{ delete window[ jsonp ]; } catch(e){}if ( head )head.removeChild( script );};}if ( s.dataType == "script" && s.cache == null )s.cache = false;if ( s.cache === false && type == "GET" ) {var ts = now();// try replacing _= if it is therevar ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");// if nothing was replaced, add timestamp to the ends.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");}// If data is available, append data to url for get requestsif ( s.data && type == "GET" ) {s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;// IE likes to send both get and post data, prevent thiss.data = null;}// Watch for a new set of requestsif ( s.global && ! jQuery.active++ )jQuery.event.trigger( "ajaxStart" );// Matches an absolute URL, and saves the domainvar parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url );// If we're requesting a remote document// and trying to load JSON or Script with a GETif ( s.dataType == "script" && type == "GET" && parts&& ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){var head = document.getElementsByTagName("head")[0];var script = document.createElement("script");script.src = s.url;if (s.scriptCharset)script.charset = s.scriptCharset;// Handle Script loadingif ( !jsonp ) {var done = false;// Attach handlers for all browsersscript.onload = script.onreadystatechange = function(){if ( !done && (!this.readyState ||this.readyState == "loaded" || this.readyState == "complete") ) {done = true;success();complete();head.removeChild( script );}};}head.appendChild(script);// We handle everything using the script element injectionreturn undefined;}var requestDone = false;// Create the request objectvar xhr = s.xhr();// Open the socket// Passing null username, generates a login popup on Opera (#2865)if( s.username )xhr.open(type, s.url, s.async, s.username, s.password);elsexhr.open(type, s.url, s.async);// Need an extra try/catch for cross domain requests in Firefox 3try {// Set the correct header, if data is being sentif ( s.data )xhr.setRequestHeader("Content-Type", s.contentType);// Set the If-Modified-Since header, if ifModified mode.if ( s.ifModified )xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );// Set header so the called script knows that it's an XMLHttpRequestxhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");// Set the Accepts header for the server, depending on the dataTypexhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?s.accepts[ s.dataType ] + ", */*" :s.accepts._default );} catch(e){}// Allow custom headers/mimetypes and early abortif ( s.beforeSend && s.beforeSend(xhr, s) === false ) {// Handle the global AJAX counterif ( s.global && ! --jQuery.active )jQuery.event.trigger( "ajaxStop" );// close opended socketxhr.abort();return false;}if ( s.global )jQuery.event.trigger("ajaxSend", [xhr, s]);// Wait for a response to come backvar onreadystatechange = function(isTimeout){// The request was aborted, clear the interval and decrement jQuery.activeif (xhr.readyState == 0) {if (ival) {// clear poll intervalclearInterval(ival);ival = null;// Handle the global AJAX counterif ( s.global && ! --jQuery.active )jQuery.event.trigger( "ajaxStop" );}// The transfer is complete and the data is available, or the request timed out} else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {requestDone = true;// clear poll intervalif (ival) {clearInterval(ival);ival = null;}status = isTimeout == "timeout" ? "timeout" :!jQuery.httpSuccess( xhr ) ? "error" :s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" :"success";if ( status == "success" ) {// Watch for, and catch, XML document parse errorstry {// process the data (runs the xml through httpData regardless of callback)data = jQuery.httpData( xhr, s.dataType, s );} catch(e) {status = "parsererror";}}// Make sure that the request was successful or notmodifiedif ( status == "success" ) {// Cache Last-Modified header, if ifModified mode.var modRes;try {modRes = xhr.getResponseHeader("Last-Modified");} catch(e) {} // swallow exception thrown by FF if header is not availableif ( s.ifModified && modRes )jQuery.lastModified[s.url] = modRes;// JSONP handles its own success callbackif ( !jsonp )success();} elsejQuery.handleError(s, xhr, status);// Fire the complete handlerscomplete();if ( isTimeout )xhr.abort();// Stop memory leaksif ( s.async )xhr = null;}};if ( s.async ) {// don't attach the handler to the request, just poll it insteadvar ival = setInterval(onreadystatechange, 13);// Timeout checkerif ( s.timeout > 0 )setTimeout(function(){// Check to see if the request is still happeningif ( xhr && !requestDone )onreadystatechange( "timeout" );}, s.timeout);}// Send the datatry {xhr.send(s.data);} catch(e) {jQuery.handleError(s, xhr, null, e);}// firefox 1.5 doesn't fire statechange for sync requestsif ( !s.async )onreadystatechange();function success(){// If a local callback was specified, fire it and pass it the dataif ( s.success )s.success( data, status );// Fire the global callbackif ( s.global )jQuery.event.trigger( "ajaxSuccess", [xhr, s] );}function complete(){// Process resultif ( s.complete )s.complete(xhr, status);// The request was completedif ( s.global )jQuery.event.trigger( "ajaxComplete", [xhr, s] );// Handle the global AJAX counterif ( s.global && ! --jQuery.active )jQuery.event.trigger( "ajaxStop" );}// return XMLHttpRequest to allow aborting the request etc.return xhr;},handleError: function( s, xhr, status, e ) {// If a local callback was specified, fire itif ( s.error ) s.error( xhr, status, e );// Fire the global callbackif ( s.global )jQuery.event.trigger( "ajaxError", [xhr, s, e] );},// Counter for holding the number of active queriesactive: 0,// Determines if an XMLHttpRequest was successful or nothttpSuccess: function( xhr ) {try {// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450return !xhr.status && location.protocol == "file:" ||( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223;} catch(e){}return false;},// Determines if an XMLHttpRequest returns NotModifiedhttpNotModified: function( xhr, url ) {try {var xhrRes = xhr.getResponseHeader("Last-Modified");// Firefox always returns 200. check Last-Modified datereturn xhr.status == 304 || xhrRes == jQuery.lastModified[url];} catch(e){}return false;},httpData: function( xhr, type, s ) {var ct = xhr.getResponseHeader("content-type"),xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,data = xml ? xhr.responseXML : xhr.responseText;if ( xml && data.documentElement.tagName == "parsererror" )throw "parsererror";// Allow a pre-filtering function to sanitize the response// s != null is checked to keep backwards compatibilityif( s && s.dataFilter )data = s.dataFilter( data, type );// The filter can actually parse the responseif( typeof data === "string" ){// If the type is "script", eval it in global contextif ( type == "script" )jQuery.globalEval( data );// Get the JavaScript object, if JSON is used.if ( type == "json" )data = window["eval"]("(" + data + ")");}return data;},// Serialize an array of form elements or a set of// key/values into a query stringparam: function( a ) {var s = [ ];function add( key, value ){s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);};// If an array was passed in, assume that it is an array// of form elementsif ( jQuery.isArray(a) || a.jquery )// Serialize the form elementsjQuery.each( a, function(){add( this.name, this.value );});// Otherwise, assume that it's an object of key/value pairselse// Serialize the key/valuesfor ( var j in a )// If the value is an array then the key names need to be repeatedif ( jQuery.isArray(a[j]) )jQuery.each( a[j], function(){add( j, this );});elseadd( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] );// Return the resulting serializationreturn s.join("&").replace(/%20/g, "+");}});
var elemdisplay = {},timerId,fxAttrs = [// height animations[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],// width animations[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],// opacity animations[ "opacity" ]];function genFx( type, num ){var obj = {};jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){obj[ this ] = type;});return obj;
}jQuery.fn.extend({show: function(speed,callback){if ( speed ) {return this.animate( genFx("show", 3), speed, callback);} else {for ( var i = 0, l = this.length; i < l; i++ ){var old = jQuery.data(this[i], "olddisplay");this[i].style.display = old || "";if ( jQuery.css(this[i], "display") === "none" ) {var tagName = this[i].tagName, display;if ( elemdisplay[ tagName ] ) {display = elemdisplay[ tagName ];} else {var elem = jQuery("<" + tagName + " />").appendTo("body");display = elem.css("display");if ( display === "none" )display = "block";elem.remove();elemdisplay[ tagName ] = display;}this[i].style.display = jQuery.data(this[i], "olddisplay", display);}}return this;}},hide: function(speed,callback){if ( speed ) {return this.animate( genFx("hide", 3), speed, callback);} else {for ( var i = 0, l = this.length; i < l; i++ ){var old = jQuery.data(this[i], "olddisplay");if ( !old && old !== "none" )jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));this[i].style.display = "none";}return this;}},// Save the old toggle function_toggle: jQuery.fn.toggle,toggle: function( fn, fn2 ){var bool = typeof fn === "boolean";return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?this._toggle.apply( this, arguments ) :fn == null || bool ?this.each(function(){var state = bool ? fn : jQuery(this).is(":hidden");jQuery(this)[ state ? "show" : "hide" ]();}) :this.animate(genFx("toggle", 3), fn, fn2);},fadeTo: function(speed,to,callback){return this.animate({opacity: to}, speed, callback);},animate: function( prop, speed, easing, callback ) {var optall = jQuery.speed(speed, easing, callback);return this[ optall.queue === false ? "each" : "queue" ](function(){var opt = jQuery.extend({}, optall), p,hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),self = this;for ( p in prop ) {if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )return opt.complete.call(this);if ( ( p == "height" || p == "width" ) && this.style ) {// Store display propertyopt.display = jQuery.css(this, "display");// Make sure that nothing sneaks outopt.overflow = this.style.overflow;}}if ( opt.overflow != null )this.style.overflow = "hidden";opt.curAnim = jQuery.extend({}, prop);jQuery.each( prop, function(name, val){var e = new jQuery.fx( self, opt, name );if ( /toggle|show|hide/.test(val) )e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );else {var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start = e.cur(true) || 0;if ( parts ) {var end = parseFloat(parts[2]),unit = parts[3] || "px";// We need to compute starting valueif ( unit != "px" ) {self.style[ name ] = (end || 1) + unit;start = ((end || 1) / e.cur(true)) * start;self.style[ name ] = start + unit;}// If a +=/-= token was provided, we're doing a relative animationif ( parts[1] )end = ((parts[1] == "-=" ? -1 : 1) * end) + start;e.custom( start, end, unit );} elsee.custom( start, val, "" );}});// For JS strict compliancereturn true;});},stop: function(clearQueue, gotoEnd){var timers = jQuery.timers;if (clearQueue)this.queue([]);this.each(function(){// go in reverse order so anything added to the queue during the loop is ignoredfor ( var i = timers.length - 1; i >= 0; i-- )if ( timers[i].elem == this ) {if (gotoEnd)// force the next step to be the lasttimers[i](true);timers.splice(i, 1);}});// start the next in the queue if the last step wasn't forcedif (!gotoEnd)this.dequeue();return this;}});// Generate shortcuts for custom animations
jQuery.each({slideDown: genFx("show", 1),slideUp: genFx("hide", 1),slideToggle: genFx("toggle", 1),fadeIn: { opacity: "show" },fadeOut: { opacity: "hide" }
}, function( name, props ){jQuery.fn[ name ] = function( speed, callback ){return this.animate( props, speed, callback );};
});jQuery.extend({speed: function(speed, easing, fn) {var opt = typeof speed === "object" ? speed : {complete: fn || !fn && easing ||jQuery.isFunction( speed ) && speed,duration: speed,easing: fn && easing || easing && !jQuery.isFunction(easing) && easing};opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;// Queueingopt.old = opt.complete;opt.complete = function(){if ( opt.queue !== false )jQuery(this).dequeue();if ( jQuery.isFunction( opt.old ) )opt.old.call( this );};return opt;},easing: {linear: function( p, n, firstNum, diff ) {return firstNum + diff * p;},swing: function( p, n, firstNum, diff ) {return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;}},timers: [],fx: function( elem, options, prop ){this.options = options;this.elem = elem;this.prop = prop;if ( !options.orig )options.orig = {};}});jQuery.fx.prototype = {// Simple function for setting a style valueupdate: function(){if ( this.options.step )this.options.step.call( this.elem, this.now, this );(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );// Set display property to block for height/width animationsif ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )this.elem.style.display = "block";},// Get the current sizecur: function(force){if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )return this.elem[ this.prop ];var r = parseFloat(jQuery.css(this.elem, this.prop, force));return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;},// Start an animation from one number to anothercustom: function(from, to, unit){this.startTime = now();this.start = from;this.end = to;this.unit = unit || this.unit || "px";this.now = this.start;this.pos = this.state = 0;var self = this;function t(gotoEnd){return self.step(gotoEnd);}t.elem = this.elem;if ( t() && jQuery.timers.push(t) == 1 ) {timerId = setInterval(function(){var timers = jQuery.timers;for ( var i = 0; i < timers.length; i++ )if ( !timers[i]() )timers.splice(i--, 1);if ( !timers.length ) {clearInterval( timerId );}}, 13);}},// Simple 'show' functionshow: function(){// Remember where we started, so that we can go back to it laterthis.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );this.options.show = true;// Begin the animation// Make sure that we start at a small width/height to avoid any// flash of contentthis.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur());// Start by showing the elementjQuery(this.elem).show();},// Simple 'hide' functionhide: function(){// Remember where we started, so that we can go back to it laterthis.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );this.options.hide = true;// Begin the animationthis.custom(this.cur(), 0);},// Each step of an animationstep: function(gotoEnd){var t = now();if ( gotoEnd || t >= this.options.duration + this.startTime ) {this.now = this.end;this.pos = this.state = 1;this.update();this.options.curAnim[ this.prop ] = true;var done = true;for ( var i in this.options.curAnim )if ( this.options.curAnim[i] !== true )done = false;if ( done ) {if ( this.options.display != null ) {// Reset the overflowthis.elem.style.overflow = this.options.overflow;// Reset the displaythis.elem.style.display = this.options.display;if ( jQuery.css(this.elem, "display") == "none" )this.elem.style.display = "block";}// Hide the element if the "hide" operation was doneif ( this.options.hide )jQuery(this.elem).hide();// Reset the properties, if the item has been hidden or shownif ( this.options.hide || this.options.show )for ( var p in this.options.curAnim )jQuery.attr(this.elem.style, p, this.options.orig[p]);// Execute the complete functionthis.options.complete.call( this.elem );}return false;} else {var n = t - this.startTime;this.state = n / this.options.duration;// Perform the easing function, defaults to swingthis.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);this.now = this.start + ((this.end - this.start) * this.pos);// Perform the next step of the animationthis.update();}return true;}};jQuery.extend( jQuery.fx, {speeds:{slow: 600,fast: 200,// Default speed_default: 400},step: {opacity: function(fx){jQuery.attr(fx.elem.style, "opacity", fx.now);},_default: function(fx){if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )fx.elem.style[ fx.prop ] = fx.now + fx.unit;elsefx.elem[ fx.prop ] = fx.now;}}
});
if ( document.documentElement["getBoundingClientRect"] )jQuery.fn.offset = function() {if ( !this[0] ) return { top: 0, left: 0 };if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );var box  = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement,clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,top  = box.top  + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;return { top: top, left: left };};
else jQuery.fn.offset = function() {if ( !this[0] ) return { top: 0, left: 0 };if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );jQuery.offset.initialized || jQuery.offset.initialize();var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem,doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,body = doc.body, defaultView = doc.defaultView,prevComputedStyle = defaultView.getComputedStyle(elem, null),top = elem.offsetTop, left = elem.offsetLeft;while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {computedStyle = defaultView.getComputedStyle(elem, null);top -= elem.scrollTop, left -= elem.scrollLeft;if ( elem === offsetParent ) {top += elem.offsetTop, left += elem.offsetLeft;if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) )top  += parseInt( computedStyle.borderTopWidth,  10) || 0,left += parseInt( computedStyle.borderLeftWidth, 10) || 0;prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;}if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" )top  += parseInt( computedStyle.borderTopWidth,  10) || 0,left += parseInt( computedStyle.borderLeftWidth, 10) || 0;prevComputedStyle = computedStyle;}if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" )top  += body.offsetTop,left += body.offsetLeft;if ( prevComputedStyle.position === "fixed" )top  += Math.max(docElem.scrollTop, body.scrollTop),left += Math.max(docElem.scrollLeft, body.scrollLeft);return { top: top, left: left };};jQuery.offset = {initialize: function() {if ( this.initialized ) return;var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };for ( prop in rules ) container.style[prop] = rules[prop];container.innerHTML = html;body.insertBefore(container, body.firstChild);innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder = (checkDiv.offsetTop !== 5);this.doesAddBorderForTableAndCells = (td.offsetTop === 5);innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);body.style.marginTop = '1px';this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0);body.style.marginTop = bodyMarginTop;body.removeChild(container);this.initialized = true;},bodyOffset: function(body) {jQuery.offset.initialized || jQuery.offset.initialize();var top = body.offsetTop, left = body.offsetLeft;if ( jQuery.offset.doesNotIncludeMarginInBodyOffset )top  += parseInt( jQuery.curCSS(body, 'marginTop',  true), 10 ) || 0,left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0;return { top: top, left: left };}
};jQuery.fn.extend({position: function() {var left = 0, top = 0, results;if ( this[0] ) {// Get *real* offsetParentvar offsetParent = this.offsetParent(),// Get correct offsetsoffset       = this.offset(),parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();// Subtract element margins// note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0offset.top  -= num( this, 'marginTop'  );offset.left -= num( this, 'marginLeft' );// Add offsetParent bordersparentOffset.top  += num( offsetParent, 'borderTopWidth'  );parentOffset.left += num( offsetParent, 'borderLeftWidth' );// Subtract the two offsetsresults = {top:  offset.top  - parentOffset.top,left: offset.left - parentOffset.left};}return results;},offsetParent: function() {var offsetParent = this[0].offsetParent || document.body;while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )offsetParent = offsetParent.offsetParent;return jQuery(offsetParent);}
});// Create scrollLeft and scrollTop methods
jQuery.each( ['Left', 'Top'], function(i, name) {var method = 'scroll' + name;jQuery.fn[ method ] = function(val) {if (!this[0]) return null;return val !== undefined ?// Set the scroll offsetthis.each(function() {this == window || this == document ?window.scrollTo(!i ? val : jQuery(window).scrollLeft(),i ? val : jQuery(window).scrollTop()) :this[ method ] = val;}) :// Return the scroll offsetthis[0] == window || this[0] == document ?self[ i ? 'pageYOffset' : 'pageXOffset' ] ||jQuery.boxModel && document.documentElement[ method ] ||document.body[ method ] :this[0][ method ];};
});
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
jQuery.each([ "Height", "Width" ], function(i, name){var tl = i ? "Left"  : "Top",  // top or leftbr = i ? "Right" : "Bottom"; // bottom or right// innerHeight and innerWidthjQuery.fn["inner" + name] = function(){return this[ name.toLowerCase() ]() +num(this, "padding" + tl) +num(this, "padding" + br);};// outerHeight and outerWidthjQuery.fn["outer" + name] = function(margin) {return this["inner" + name]() +num(this, "border" + tl + "Width") +num(this, "border" + br + "Width") +(margin ?num(this, "margin" + tl) + num(this, "margin" + br) : 0);};var type = name.toLowerCase();jQuery.fn[ type ] = function( size ) {// Get window width or heightreturn this[0] == window ?// Everyone else use document.documentElement or document.body depending on Quirks vs Standards modedocument.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] ||document.body[ "client" + name ] :// Get document width or heightthis[0] == document ?// Either scroll[Width/Height] or offset[Width/Height], whichever is greaterMath.max(document.documentElement["client" + name],document.body["scroll" + name], document.documentElement["scroll" + name],document.body["offset" + name], document.documentElement["offset" + name]) :// Get or set width or height on the elementsize === undefined ?// Get width or height on the element(this.length ? jQuery.css( this[0], type ) : null) :// Set the width or height on the element (default to pixels if value is unitless)this.css( type, typeof size === "string" ? size : size + "px" );};});})();

好的,历经千辛万苦我们将jQuery部分和js部分都制作好了,让我们在页面上实现他们吧

[html] view plaincopyprint?
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <style type="text/css">
  6. a {text-decoration:none; color:#282828;}
  7. a img {border:none;}
  8. body {font-size:12px; font-family:宋体,arial, helvetica, sans-serif; color:#282828;}
  9. .img_nav {position: relative; width: 300px; float: left; height: 356px}
  10. .big_img a {position: absolute; top: 0px; left: 0px}
  11. .img_nav img {width: 300px; height: 356px}
  12. .link_nav {position: absolute; filter: alpha(opacity=50); width: 300px; bottom: 0px; background: #000; height: 32px; opacity: 0.5}
  13. .link_nav a {position: absolute; line-height: 32px; color: #fff; left: 5px}
  14. .num_nav {position: absolute; bottom: 7px; right: 2px}
  15. .num_nav span {border-bottom: #b2b2b2 1px solid; text-align: center; border-left: #b2b2b2 1px solid; line-height: 18px; width: 18px; background: #84827e; float: left; height: 18px; color: #fff; font-size: 14px; border-top: #b2b2b2 1px solid; cursor: pointer; font-weight: bold; margin-right: 4px; border-right: #b2b2b2 1px solid}
  16. .num_nav span.selected {border-bottom: #c25e5e 1px solid; border-left: #c25e5e 1px solid; background: #86312e; border-top: #c25e5e 1px solid; border-right: #c25e5e 1px solid}
  17. </style>
  18. <script type="text/javascript" src="jquery-1.3.1.js"></script>
  19. <script type="text/javascript" src="foucs.js"></script>
  20. <title>滚动图片-示例</title>
  21. </head>
  22. <body>
  23. <div class="img_nav">
  24. <div class="big_img">
  25. <a href="#" target="_blank"><img src="images/1.jpg" /></a>
  26. <a href="#" target="_blank"><img src="images/2.jpg" /></a>
  27. <a href="#" target="_blank"><img src="images/3.jpg" /></a>
  28. </div>
  29. <div class="link_nav">
  30. <a href="#" target="_blank">图片1:标题</a> <a href="#" target="_blank">图片2:标题</a> <a href="#" target="_blank">图片3:标题</a>
  31. </div>
  32. <div class="num_nav">
  33. <span class="selected">1</span> <span>2</span> <span>3</span>
  34. </div>
  35. </div>
  36. </body>
  37. </html>

HTML中动态图片切换JQuery实现相关推荐

  1. html圆形图片切换,jQuery和CSS3炫酷圆形图片切换特效

    这是一款效果非常酷的jQuery和CSS3圆形图片切换特效.该圆形图片特效可以使用animate.css来制作图片的进入动画和离开动画.可以任意设置多张图片进行来回翻转.旋转切换,效果堪称一流. 使用 ...

  2. 在html中三个图片切换,轻松搞定网页中的图片切换

    生活中经常看到,像新浪等很多门户网站的首页都有滚动图片的展示,如下图所示: 某网站首页滚动切换图片 这样不但可以减少文字的单一.乏味,而且可以直观内容,更好的吸引用户.那在我们做软件系统时,是否也可以 ...

  3. 使用Direct3D实现如幻灯片的动态图片切换效果

    上一篇文章演示了如何用GDI技术实现图片切换效果,这一篇文章给大家讲解怎么用Direct3D API实现图片动画效果. 一.Direct3D概述 Direct3D是Microsoft的DirectX软 ...

  4. jsp页面中实现图片切换显示

    今天遇到一个需求,要求要在页面实现一张或多张图片的显示,如果为多张图片时要实现图片切换,于是自己就写了.但是在写的时候发现如果有多个容器都有这个需求的时就很容易造成id冲突(就是在多个div中了),于 ...

  5. html中轮换图片插件,jQuery轮播图插件

    插件描述:该插件基于jquery开发,现阶段很多PC网站都需要用到轮播图切换的效果 全屏轮播图 该插件基于jquery开发,现阶段很多PC网站都需要用到轮播图切换的效果,很多时候要在页面中复用轮播图, ...

  6. jq加css制作图片切换,jQuery+css实现的切换图片功能代码

    本文实例讲述了jQuery+css实现的切换图片功能代码.分享给大家供大家参考,具体如下: 运行效果截图如下: 具体代码如下: demo body { margin:0; padding:0; } . ...

  7. dw如何制作图片自动切换效果_如何在Dreamweaver中制作图片切换的效果?

    展开全部 无标题文档 var s=function(){ var interv=2000; //切换32313133353236313431303231363533e4b893e5b19e313332 ...

  8. iReport-3.7.6实现动态图片切换

    首先在选项栏中找到窗口-->组件面板 将image拖动到要防止的地方,拖动到放置的地方会要让我们选个路径,我们就不要选,点取消,这个时候会有一个图片域在哪里,然后点击这个图片域 按照自己的要求, ...

  9. HTML中动态图片的onclick事件参数传递

    需要在信息窗口的小图中,加上点击后,显示大图的功能. 首先尝试的是超链接的方式,<a href,但效果不好,因为直接在当前窗口显示了,而我希望的是在另一个窗口. onclick方法肯定是可以的, ...

最新文章

  1. 兑换量子计算机,阅读 | 【量子计算机】构造置换量子门
  2. 盘点数据科学20个最好的Python库(附链接)
  3. 为freetextbox1.6.5上传图片加上水印
  4. Thread concepts
  5. Python爬虫开发:中文字符编码问题quote解决
  6. Spring Security基于角色的权限管理
  7. QT的QModbusRequest类的使用
  8. preg_filter用法
  9. 11-13SQLserver基础--数据库之事务
  10. Netty工作笔记0041---Netty入门--服务端2
  11. Apache Flink Meetup · 北京站,1.13 新版本 x 互娱实践分享的开发者盛筵!
  12. myeclipse优化方案 myeclipse 10 优化
  13. 基于vue2使用vue-awesome-swiper 轮播图(踩坑记录)
  14. [Mysql]WARN: Establishing SSL connection without server's identity verificatio
  15. 如果“永远”只是一瞬间
  16. 88E1111与千兆网口连接
  17. word2vec中计算两个词的距离或者相似程度。
  18. java安装的时候无效参数,java.sql.SQLException: 调用中无效的参数
  19. Android 整合高德地图SDK实现 地图预览,定位,模拟导航
  20. 使用Navicat将MySql数据库导入和导出

热门文章

  1. GY-Kit 物联网开发板
  2. 如何将Chrome设为iPhone和iPad上的默认Web浏览器
  3. 全局负载均衡GSLB
  4. 关于switch的一些理解
  5. OCR文本识别系统项目文档——欢迎探讨交流
  6. Java并发编程系列18:多线程之生产者和消费者模式_信号灯法(wait/notify通知机制)
  7. 现60岁,一次性缴纳60万养老金,一个月领取4000元,你愿意吗
  8. 系统集成项目管理|十大管理
  9. 阿爸,通往地狱的路要走好
  10. 小程序--广州旅游推荐