Greasy Fork is available in English.

Chess.com Bot

Chess.com Bot that finds the best move!

Verze ze dne 17. 02. 2023. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name Chess.com Bot
  3. // @namespace MrAuzzie
  4. // @version 1.0
  5. // @description Chess.com Bot that finds the best move!
  6. // @author MrAuzzie
  7. // @match https://www.chess.com/play/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant GM_getValue
  10. // @grant GM_setValue
  11. // @grant GM_xmlhttpRequest
  12. // @grant GM_getResourceText
  13. // @grant GM_registerMenuCommand
  14. // @resource lozza.js https://raw.githubusercontent.com/Hakorr/Userscripts/main/Other/A.C.A.S/content/lozza.js
  15. // @require https://greatest.deepsurf.us/scripts/445697/code/index.js
  16. // @run-at document-start
  17. // @antifeature ads
  18. // ==/UserScript==
  19. var lozzaObjectURL;
  20. var engine = document.engine = {};
  21. var myVars = document.myVars = {};
  22. myVars.autoMovePiece = false;
  23. myVars.autoRun = false;
  24. var myFunctions = document.myFunctions = {};
  25.  
  26. (function(A, w) {
  27. function oa() {
  28. if (!c.isReady) {
  29. try {
  30. s.documentElement.doScroll("left")
  31. } catch (a) {
  32. setTimeout(oa, 1);
  33. return
  34. }
  35. c.ready()
  36. }
  37. }
  38. function La(a, b) {
  39. b.src ? c.ajax({
  40. url: b.src,
  41. async: false,
  42. dataType: "script"
  43. }) : c.globalEval(b.text || b.textContent || b.innerHTML || "");
  44. b.parentNode && b.parentNode.removeChild(b)
  45. }
  46. function $(a, b, d, f, e, i) {
  47. var j = a.length;
  48. if (typeof b === "object") {
  49. for (var o in b) $(a, o, b[o], f, e, d);
  50. return a
  51. }
  52. if (d !== w) {
  53. f = !i && f && c.isFunction(d);
  54. for (o = 0; o < j; o++) e(a[o], b, f ? d.call(a[o], o, e(a[o], b)) : d, i);
  55. return a
  56. }
  57. return j ?
  58. e(a[0], b) : null
  59. }
  60. function K() {
  61. return (new Date)
  62. .getTime()
  63. }
  64. function aa() {
  65. return false
  66. }
  67. function ba() {
  68. return true
  69. }
  70. function pa(a, b, d) {
  71. d[0].type = a;
  72. return c.event.handle.apply(b, d)
  73. }
  74. function qa(a) {
  75. var b = true,
  76. d = [],
  77. f = [],
  78. e = arguments,
  79. i, j, o, p, n, t = c.extend({}, c.data(this, "events")
  80. .live);
  81. for (p in t) {
  82. j = t[p];
  83. if (j.live === a.type || j.altLive && c.inArray(a.type, j.altLive) > -1) {
  84. i = j.data;
  85. i.beforeFilter && i.beforeFilter[a.type] && !i.beforeFilter[a.type](a) || f.push(j.selector)
  86. } else delete t[p]
  87. }
  88. i = c(a.target)
  89. .closest(f, a.currentTarget);
  90. n = 0;
  91. for (l = i.length; n < l; n++)
  92. for (p in t) {
  93. j = t[p];
  94. o = i[n].elem;
  95. f = null;
  96. if (i[n].selector === j.selector) {
  97. if (j.live === "mouseenter" || j.live === "mouseleave") f = c(a.relatedTarget)
  98. .closest(j.selector)[0];
  99. if (!f || f !== o) d.push({
  100. elem: o,
  101. fn: j
  102. })
  103. }
  104. }
  105. n = 0;
  106. for (l = d.length; n < l; n++) {
  107. i = d[n];
  108. a.currentTarget = i.elem;
  109. a.data = i.fn.data;
  110. if (i.fn.apply(i.elem, e) === false) {
  111. b = false;
  112. break
  113. }
  114. }
  115. return b
  116. }
  117. function ra(a, b) {
  118. return ["live", a, b.replace(/\./g, "`")
  119. .replace(/ /g, "&")
  120. ].join(".")
  121. }
  122. function sa(a) {
  123. return !a || !a.parentNode || a.parentNode.nodeType ===
  124. 11
  125. }
  126. function ta(a, b) {
  127. var d = 0;
  128. b.each(function() {
  129. if (this.nodeName === (a[d] && a[d].nodeName)) {
  130. var f = c.data(a[d++]),
  131. e = c.data(this, f);
  132. if (f = f && f.events) {
  133. delete e.handle;
  134. e.events = {};
  135. for (var i in f)
  136. for (var j in f[i]) c.event.add(this, i, f[i][j], f[i][j].data)
  137. }
  138. }
  139. })
  140. }
  141. function ua(a, b, d) {
  142. var f, e, i;
  143. if (a.length === 1 && typeof a[0] === "string" && a[0].length < 512 && a[0].indexOf("<option") < 0) {
  144. e = true;
  145. if (i = c.fragments[a[0]])
  146. if (i !== 1) f = i
  147. }
  148. if (!f) {
  149. b = b && b[0] ? b[0].ownerDocument || b[0] : s;
  150. f = b.createDocumentFragment();
  151. c.clean(a, b, f, d)
  152. }
  153. if (e) c.fragments[a[0]] =
  154. i ? f : 1;
  155. return {
  156. fragment: f,
  157. cacheable: e
  158. }
  159. }
  160. function T(a) {
  161. for (var b = 0, d, f;
  162. (d = a[b]) != null; b++)
  163. if (!c.noData[d.nodeName.toLowerCase()] && (f = d[H])) delete c.cache[f]
  164. }
  165. function L(a, b) {
  166. var d = {};
  167. c.each(va.concat.apply([], va.slice(0, b)), function() {
  168. d[this] = a
  169. });
  170. return d
  171. }
  172. function wa(a) {
  173. return "scrollTo" in a && a.document ? a : a.nodeType === 9 ? a.defaultView || a.parentWindow : false
  174. }
  175. var c = function(a, b) {
  176. return new c.fn.init(a, b)
  177. },
  178. Ma = A.jQuery,
  179. Na = A.$,
  180. s = A.document,
  181. U, Oa = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
  182. Pa = /^.[^:#\[\.,]*$/,
  183. Qa = /\S/,
  184. Ra = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
  185. Sa = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
  186. P = navigator.userAgent,
  187. xa = false,
  188. Q = [],
  189. M, ca = Object.prototype.toString,
  190. da = Object.prototype.hasOwnProperty,
  191. ea = Array.prototype.push,
  192. R = Array.prototype.slice,
  193. V = Array.prototype.indexOf;
  194. c.fn = c.prototype = {
  195. init: function(a, b) {
  196. var d, f;
  197. if (!a) return this;
  198. if (a.nodeType) {
  199. this.context = this[0] = a;
  200. this.length = 1;
  201. return this
  202. }
  203. if (typeof a === "string")
  204. if ((d = Oa.exec(a)) && (d[1] || !b))
  205. if (d[1]) {
  206. f = b ? b.ownerDocument || b : s;
  207. if (a = Sa.exec(a))
  208. if (c.isPlainObject(b)) {
  209. a = [s.createElement(a[1])];
  210. c.fn.attr.call(a, b, true)
  211. } else a = [f.createElement(a[1])];
  212. else {
  213. a = ua([d[1]], [f]);
  214. a = (a.cacheable ? a.fragment.cloneNode(true) : a.fragment)
  215. .childNodes
  216. }
  217. } else {
  218. if (b = s.getElementById(d[2])) {
  219. if (b.id !== d[2]) return U.find(a);
  220. this.length = 1;
  221. this[0] = b
  222. }
  223. this.context = s;
  224. this.selector = a;
  225. return this
  226. }
  227. else if (!b && /^\w+$/.test(a)) {
  228. this.selector = a;
  229. this.context = s;
  230. a = s.getElementsByTagName(a)
  231. } else return !b || b.jquery ? (b || U)
  232. .find(a) : c(b)
  233. .find(a);
  234. else if (c.isFunction(a)) return U.ready(a);
  235. if (a.selector !== w) {
  236. this.selector = a.selector;
  237. this.context = a.context
  238. }
  239. return c.isArray(a) ? this.setArray(a) : c.makeArray(a, this)
  240. },
  241. selector: "",
  242. jquery: "1.4",
  243. length: 0,
  244. size: function() {
  245. return this.length
  246. },
  247. toArray: function() {
  248. return R.call(this, 0)
  249. },
  250. get: function(a) {
  251. return a == null ? this.toArray() : a < 0 ? this.slice(a)[0] : this[a]
  252. },
  253. pushStack: function(a, b, d) {
  254. a = c(a || null);
  255. a.prevObject = this;
  256. a.context = this.context;
  257. if (b === "find") a.selector = this.selector + (this.selector ? " " : "") + d;
  258. else if (b) a.selector = this.selector + "." + b + "(" + d + ")";
  259. return a
  260. },
  261. setArray: function(a) {
  262. this.length =
  263. 0;
  264. ea.apply(this, a);
  265. return this
  266. },
  267. each: function(a, b) {
  268. return c.each(this, a, b)
  269. },
  270. ready: function(a) {
  271. c.bindReady();
  272. if (c.isReady) a.call(s, c);
  273. else Q && Q.push(a);
  274. return this
  275. },
  276. eq: function(a) {
  277. return a === -1 ? this.slice(a) : this.slice(a, +a + 1)
  278. },
  279. first: function() {
  280. return this.eq(0)
  281. },
  282. last: function() {
  283. return this.eq(-1)
  284. },
  285. slice: function() {
  286. return this.pushStack(R.apply(this, arguments), "slice", R.call(arguments)
  287. .join(","))
  288. },
  289. map: function(a) {
  290. return this.pushStack(c.map(this, function(b, d) {
  291. return a.call(b, d, b)
  292. }))
  293. },
  294. end: function() {
  295. return this.prevObject ||
  296. c(null)
  297. },
  298. push: ea,
  299. sort: [].sort,
  300. splice: [].splice
  301. };
  302. c.fn.init.prototype = c.fn;
  303. c.extend = c.fn.extend = function() {
  304. var a = arguments[0] || {},
  305. b = 1,
  306. d = arguments.length,
  307. f = false,
  308. e, i, j, o;
  309. if (typeof a === "boolean") {
  310. f = a;
  311. a = arguments[1] || {};
  312. b = 2
  313. }
  314. if (typeof a !== "object" && !c.isFunction(a)) a = {};
  315. if (d === b) {
  316. a = this;
  317. --b
  318. }
  319. for (; b < d; b++)
  320. if ((e = arguments[b]) != null)
  321. for (i in e) {
  322. j = a[i];
  323. o = e[i];
  324. if (a !== o)
  325. if (f && o && (c.isPlainObject(o) || c.isArray(o))) {
  326. j = j && (c.isPlainObject(j) || c.isArray(j)) ? j : c.isArray(o) ? [] : {};
  327. a[i] = c.extend(f, j, o)
  328. } else if (o !== w) a[i] =
  329. o
  330. }
  331. return a
  332. };
  333. c.extend({
  334. noConflict: function(a) {
  335. A.$ = Na;
  336. if (a) A.jQuery = Ma;
  337. return c
  338. },
  339. isReady: false,
  340. ready: function() {
  341. if (!c.isReady) {
  342. if (!s.body) return setTimeout(c.ready, 13);
  343. c.isReady = true;
  344. if (Q) {
  345. for (var a, b = 0; a = Q[b++];) a.call(s, c);
  346. Q = null
  347. }
  348. c.fn.triggerHandler && c(s)
  349. .triggerHandler("ready")
  350. }
  351. },
  352. bindReady: function() {
  353. if (!xa) {
  354. xa = true;
  355. if (s.readyState === "complete") return c.ready();
  356. if (s.addEventListener) {
  357. s.addEventListener("DOMContentLoaded", M, false);
  358. A.addEventListener("load", c.ready, false)
  359. } else if (s.attachEvent) {
  360. s.attachEvent("onreadystatechange",
  361. M);
  362. A.attachEvent("onload", c.ready);
  363. var a = false;
  364. try {
  365. a = A.frameElement == null
  366. } catch (b) {}
  367. s.documentElement.doScroll && a && oa()
  368. }
  369. }
  370. },
  371. isFunction: function(a) {
  372. return ca.call(a) === "[object Function]"
  373. },
  374. isArray: function(a) {
  375. return ca.call(a) === "[object Array]"
  376. },
  377. isPlainObject: function(a) {
  378. if (!a || ca.call(a) !== "[object Object]" || a.nodeType || a.setInterval) return false;
  379. if (a.constructor && !da.call(a, "constructor") && !da.call(a.constructor.prototype, "isPrototypeOf")) return false;
  380. var b;
  381. for (b in a);
  382. return b === w || da.call(a, b)
  383. },
  384. isEmptyObject: function(a) {
  385. for (var b in a) return false;
  386. return true
  387. },
  388. noop: function() {},
  389. globalEval: function(a) {
  390. if (a && Qa.test(a)) {
  391. var b = s.getElementsByTagName("head")[0] || s.documentElement,
  392. d = s.createElement("script");
  393. d.type = "text/javascript";
  394. if (c.support.scriptEval) d.appendChild(s.createTextNode(a));
  395. else d.text = a;
  396. b.insertBefore(d, b.firstChild);
  397. b.removeChild(d)
  398. }
  399. },
  400. nodeName: function(a, b) {
  401. return a.nodeName && a.nodeName.toUpperCase() === b.toUpperCase()
  402. },
  403. each: function(a, b, d) {
  404. var f, e = 0,
  405. i = a.length,
  406. j = i === w || c.isFunction(a);
  407. if (d)
  408. if (j)
  409. for (f in a) {
  410. if (b.apply(a[f], d) === false) break
  411. } else
  412. for (; e < i;) {
  413. if (b.apply(a[e++], d) === false) break
  414. } else if (j)
  415. for (f in a) {
  416. if (b.call(a[f], f, a[f]) === false) break
  417. } else
  418. for (d = a[0]; e < i && b.call(d, e, d) !== false; d = a[++e]);
  419. return a
  420. },
  421. trim: function(a) {
  422. return (a || "")
  423. .replace(Ra, "")
  424. },
  425. makeArray: function(a, b) {
  426. b = b || [];
  427. if (a != null) a.length == null || typeof a === "string" || c.isFunction(a) || typeof a !== "function" && a.setInterval ? ea.call(b, a) : c.merge(b, a);
  428. return b
  429. },
  430. inArray: function(a, b) {
  431. if (b.indexOf) return b.indexOf(a);
  432. for (var d =
  433. 0, f = b.length; d < f; d++)
  434. if (b[d] === a) return d;
  435. return -1
  436. },
  437. merge: function(a, b) {
  438. var d = a.length,
  439. f = 0;
  440. if (typeof b.length === "number")
  441. for (var e = b.length; f < e; f++) a[d++] = b[f];
  442. else
  443. for (; b[f] !== w;) a[d++] = b[f++];
  444. a.length = d;
  445. return a
  446. },
  447. grep: function(a, b, d) {
  448. for (var f = [], e = 0, i = a.length; e < i; e++) !d !== !b(a[e], e) && f.push(a[e]);
  449. return f
  450. },
  451. map: function(a, b, d) {
  452. for (var f = [], e, i = 0, j = a.length; i < j; i++) {
  453. e = b(a[i], i, d);
  454. if (e != null) f[f.length] = e
  455. }
  456. return f.concat.apply([], f)
  457. },
  458. guid: 1,
  459. proxy: function(a, b, d) {
  460. if (arguments.length === 2)
  461. if (typeof b ===
  462. "string") {
  463. d = a;
  464. a = d[b];
  465. b = w
  466. } else if (b && !c.isFunction(b)) {
  467. d = b;
  468. b = w
  469. }
  470. if (!b && a) b = function() {
  471. return a.apply(d || this, arguments)
  472. };
  473. if (a) b.guid = a.guid = a.guid || b.guid || c.guid++;
  474. return b
  475. },
  476. uaMatch: function(a) {
  477. var b = {
  478. browser: ""
  479. };
  480. a = a.toLowerCase();
  481. if (/webkit/.test(a)) b = {
  482. browser: "webkit",
  483. version: /webkit[\/ ]([\w.]+)/
  484. };
  485. else if (/opera/.test(a)) b = {
  486. browser: "opera",
  487. version: /version/.test(a) ? /version[\/ ]([\w.]+)/ : /opera[\/ ]([\w.]+)/
  488. };
  489. else if (/msie/.test(a)) b = {
  490. browser: "msie",
  491. version: /msie ([\w.]+)/
  492. };
  493. else if (/mozilla/.test(a) &&
  494. !/compatible/.test(a)) b = {
  495. browser: "mozilla",
  496. version: /rv:([\w.]+)/
  497. };
  498. b.version = (b.version && b.version.exec(a) || [0, "0"])[1];
  499. return b
  500. },
  501. browser: {}
  502. });
  503. P = c.uaMatch(P);
  504. if (P.browser) {
  505. c.browser[P.browser] = true;
  506. c.browser.version = P.version
  507. }
  508. if (c.browser.webkit) c.browser.safari = true;
  509. if (V) c.inArray = function(a, b) {
  510. return V.call(b, a)
  511. };
  512. U = c(s);
  513. if (s.addEventListener) M = function() {
  514. s.removeEventListener("DOMContentLoaded", M, false);
  515. c.ready()
  516. };
  517. else if (s.attachEvent) M = function() {
  518. if (s.readyState === "complete") {
  519. s.detachEvent("onreadystatechange",
  520. M);
  521. c.ready()
  522. }
  523. };
  524. if (V) c.inArray = function(a, b) {
  525. return V.call(b, a)
  526. };
  527. (function() {
  528. c.support = {};
  529. var a = s.documentElement,
  530. b = s.createElement("script"),
  531. d = s.createElement("div"),
  532. f = "script" + K();
  533. d.style.display = "none";
  534. d.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
  535. var e = d.getElementsByTagName("*"),
  536. i = d.getElementsByTagName("a")[0];
  537. if (!(!e || !e.length || !i)) {
  538. c.support = {
  539. leadingWhitespace: d.firstChild.nodeType === 3,
  540. tbody: !d.getElementsByTagName("tbody")
  541. .length,
  542. htmlSerialize: !!d.getElementsByTagName("link")
  543. .length,
  544. style: /red/.test(i.getAttribute("style")),
  545. hrefNormalized: i.getAttribute("href") === "/a",
  546. opacity: /^0.55$/.test(i.style.opacity),
  547. cssFloat: !!i.style.cssFloat,
  548. checkOn: d.getElementsByTagName("input")[0].value === "on",
  549. optSelected: s.createElement("select")
  550. .appendChild(s.createElement("option"))
  551. .selected,
  552. scriptEval: false,
  553. noCloneEvent: true,
  554. boxModel: null
  555. };
  556. b.type = "text/javascript";
  557. try {
  558. b.appendChild(s.createTextNode("window." + f + "=1;"))
  559. } catch (j) {}
  560. a.insertBefore(b,
  561. a.firstChild);
  562. if (A[f]) {
  563. c.support.scriptEval = true;
  564. delete A[f]
  565. }
  566. a.removeChild(b);
  567. if (d.attachEvent && d.fireEvent) {
  568. d.attachEvent("onclick", function o() {
  569. c.support.noCloneEvent = false;
  570. d.detachEvent("onclick", o)
  571. });
  572. d.cloneNode(true)
  573. .fireEvent("onclick")
  574. }
  575. c(function() {
  576. var o = s.createElement("div");
  577. o.style.width = o.style.paddingLeft = "1px";
  578. s.body.appendChild(o);
  579. c.boxModel = c.support.boxModel = o.offsetWidth === 2;
  580. s.body.removeChild(o)
  581. .style.display = "none"
  582. });
  583. a = function(o) {
  584. var p = s.createElement("div");
  585. o = "on" + o;
  586. var n = o in
  587. p;
  588. if (!n) {
  589. p.setAttribute(o, "return;");
  590. n = typeof p[o] === "function"
  591. }
  592. return n
  593. };
  594. c.support.submitBubbles = a("submit");
  595. c.support.changeBubbles = a("change");
  596. a = b = d = e = i = null
  597. }
  598. })();
  599. c.props = {
  600. "for": "htmlFor",
  601. "class": "className",
  602. readonly: "readOnly",
  603. maxlength: "maxLength",
  604. cellspacing: "cellSpacing",
  605. rowspan: "rowSpan",
  606. colspan: "colSpan",
  607. tabindex: "tabIndex",
  608. usemap: "useMap",
  609. frameborder: "frameBorder"
  610. };
  611. var H = "jQuery" + K(),
  612. Ta = 0,
  613. ya = {},
  614. Ua = {};
  615. c.extend({
  616. cache: {},
  617. expando: H,
  618. noData: {
  619. embed: true,
  620. object: true,
  621. applet: true
  622. },
  623. data: function(a,
  624. b, d) {
  625. if (!(a.nodeName && c.noData[a.nodeName.toLowerCase()])) {
  626. a = a == A ? ya : a;
  627. var f = a[H],
  628. e = c.cache;
  629. if (!b && !f) return null;
  630. f || (f = ++Ta);
  631. if (typeof b === "object") {
  632. a[H] = f;
  633. e = e[f] = c.extend(true, {}, b)
  634. } else e = e[f] ? e[f] : typeof d === "undefined" ? Ua : (e[f] = {});
  635. if (d !== w) {
  636. a[H] = f;
  637. e[b] = d
  638. }
  639. return typeof b === "string" ? e[b] : e
  640. }
  641. },
  642. removeData: function(a, b) {
  643. if (!(a.nodeName && c.noData[a.nodeName.toLowerCase()])) {
  644. a = a == A ? ya : a;
  645. var d = a[H],
  646. f = c.cache,
  647. e = f[d];
  648. if (b) {
  649. if (e) {
  650. delete e[b];
  651. c.isEmptyObject(e) && c.removeData(a)
  652. }
  653. } else {
  654. try {
  655. delete a[H]
  656. } catch (i) {
  657. a.removeAttribute &&
  658. a.removeAttribute(H)
  659. }
  660. delete f[d]
  661. }
  662. }
  663. }
  664. });
  665. c.fn.extend({
  666. data: function(a, b) {
  667. if (typeof a === "undefined" && this.length) return c.data(this[0]);
  668. else if (typeof a === "object") return this.each(function() {
  669. c.data(this, a)
  670. });
  671. var d = a.split(".");
  672. d[1] = d[1] ? "." + d[1] : "";
  673. if (b === w) {
  674. var f = this.triggerHandler("getData" + d[1] + "!", [d[0]]);
  675. if (f === w && this.length) f = c.data(this[0], a);
  676. return f === w && d[1] ? this.data(d[0]) : f
  677. } else return this.trigger("setData" + d[1] + "!", [d[0], b])
  678. .each(function() {
  679. c.data(this, a, b)
  680. })
  681. },
  682. removeData: function(a) {
  683. return this.each(function() {
  684. c.removeData(this,
  685. a)
  686. })
  687. }
  688. });
  689. c.extend({
  690. queue: function(a, b, d) {
  691. if (a) {
  692. b = (b || "fx") + "queue";
  693. var f = c.data(a, b);
  694. if (!d) return f || [];
  695. if (!f || c.isArray(d)) f = c.data(a, b, c.makeArray(d));
  696. else f.push(d);
  697. return f
  698. }
  699. },
  700. dequeue: function(a, b) {
  701. b = b || "fx";
  702. var d = c.queue(a, b),
  703. f = d.shift();
  704. if (f === "inprogress") f = d.shift();
  705. if (f) {
  706. b === "fx" && d.unshift("inprogress");
  707. f.call(a, function() {
  708. c.dequeue(a, b)
  709. })
  710. }
  711. }
  712. });
  713. c.fn.extend({
  714. queue: function(a, b) {
  715. if (typeof a !== "string") {
  716. b = a;
  717. a = "fx"
  718. }
  719. if (b === w) return c.queue(this[0], a);
  720. return this.each(function() {
  721. var d = c.queue(this,
  722. a, b);
  723. a === "fx" && d[0] !== "inprogress" && c.dequeue(this, a)
  724. })
  725. },
  726. dequeue: function(a) {
  727. return this.each(function() {
  728. c.dequeue(this, a)
  729. })
  730. },
  731. delay: function(a, b) {
  732. a = c.fx ? c.fx.speeds[a] || a : a;
  733. b = b || "fx";
  734. return this.queue(b, function() {
  735. var d = this;
  736. setTimeout(function() {
  737. c.dequeue(d, b)
  738. }, a)
  739. })
  740. },
  741. clearQueue: function(a) {
  742. return this.queue(a || "fx", [])
  743. }
  744. });
  745. var za = /[\n\t]/g,
  746. fa = /\s+/,
  747. Va = /\r/g,
  748. Wa = /href|src|style/,
  749. Xa = /(button|input)/i,
  750. Ya = /(button|input|object|select|textarea)/i,
  751. Za = /^(a|area)$/i,
  752. Aa = /radio|checkbox/;
  753. c.fn.extend({
  754. attr: function(a,
  755. b) {
  756. return $(this, a, b, true, c.attr)
  757. },
  758. removeAttr: function(a) {
  759. return this.each(function() {
  760. c.attr(this, a, "");
  761. this.nodeType === 1 && this.removeAttribute(a)
  762. })
  763. },
  764. addClass: function(a) {
  765. if (c.isFunction(a)) return this.each(function(p) {
  766. var n = c(this);
  767. n.addClass(a.call(this, p, n.attr("class")))
  768. });
  769. if (a && typeof a === "string")
  770. for (var b = (a || "")
  771. .split(fa), d = 0, f = this.length; d < f; d++) {
  772. var e = this[d];
  773. if (e.nodeType === 1)
  774. if (e.className)
  775. for (var i = " " + e.className + " ", j = 0, o = b.length; j < o; j++) {
  776. if (i.indexOf(" " + b[j] + " ") < 0) e.className +=
  777. " " + b[j]
  778. } else e.className = a
  779. }
  780. return this
  781. },
  782. removeClass: function(a) {
  783. if (c.isFunction(a)) return this.each(function(p) {
  784. var n = c(this);
  785. n.removeClass(a.call(this, p, n.attr("class")))
  786. });
  787. if (a && typeof a === "string" || a === w)
  788. for (var b = (a || "")
  789. .split(fa), d = 0, f = this.length; d < f; d++) {
  790. var e = this[d];
  791. if (e.nodeType === 1 && e.className)
  792. if (a) {
  793. for (var i = (" " + e.className + " ")
  794. .replace(za, " "), j = 0, o = b.length; j < o; j++) i = i.replace(" " + b[j] + " ", " ");
  795. e.className = i.substring(1, i.length - 1)
  796. } else e.className = ""
  797. }
  798. return this
  799. },
  800. toggleClass: function(a,
  801. b) {
  802. var d = typeof a,
  803. f = typeof b === "boolean";
  804. if (c.isFunction(a)) return this.each(function(e) {
  805. var i = c(this);
  806. i.toggleClass(a.call(this, e, i.attr("class"), b), b)
  807. });
  808. return this.each(function() {
  809. if (d === "string")
  810. for (var e, i = 0, j = c(this), o = b, p = a.split(fa); e = p[i++];) {
  811. o = f ? o : !j.hasClass(e);
  812. j[o ? "addClass" : "removeClass"](e)
  813. } else if (d === "undefined" || d === "boolean") {
  814. this.className && c.data(this, "__className__", this.className);
  815. this.className = this.className || a === false ? "" : c.data(this, "__className__") || ""
  816. }
  817. })
  818. },
  819. hasClass: function(a) {
  820. a =
  821. " " + a + " ";
  822. for (var b = 0, d = this.length; b < d; b++)
  823. if ((" " + this[b].className + " ")
  824. .replace(za, " ")
  825. .indexOf(a) > -1) return true;
  826. return false
  827. },
  828. val: function(a) {
  829. if (a === w) {
  830. var b = this[0];
  831. if (b) {
  832. if (c.nodeName(b, "option")) return (b.attributes.value || {})
  833. .specified ? b.value : b.text;
  834. if (c.nodeName(b, "select")) {
  835. var d = b.selectedIndex,
  836. f = [],
  837. e = b.options;
  838. b = b.type === "select-one";
  839. if (d < 0) return null;
  840. var i = b ? d : 0;
  841. for (d = b ? d + 1 : e.length; i < d; i++) {
  842. var j = e[i];
  843. if (j.selected) {
  844. a = c(j)
  845. .val();
  846. if (b) return a;
  847. f.push(a)
  848. }
  849. }
  850. return f
  851. }
  852. if (Aa.test(b.type) &&
  853. !c.support.checkOn) return b.getAttribute("value") === null ? "on" : b.value;
  854. return (b.value || "")
  855. .replace(Va, "")
  856. }
  857. return w
  858. }
  859. var o = c.isFunction(a);
  860. return this.each(function(p) {
  861. var n = c(this),
  862. t = a;
  863. if (this.nodeType === 1) {
  864. if (o) t = a.call(this, p, n.val());
  865. if (typeof t === "number") t += "";
  866. if (c.isArray(t) && Aa.test(this.type)) this.checked = c.inArray(n.val(), t) >= 0;
  867. else if (c.nodeName(this, "select")) {
  868. var z = c.makeArray(t);
  869. c("option", this)
  870. .each(function() {
  871. this.selected = c.inArray(c(this)
  872. .val(), z) >= 0
  873. });
  874. if (!z.length) this.selectedIndex = -1
  875. } else this.value = t
  876. }
  877. })
  878. }
  879. });
  880. c.extend({
  881. attrFn: {
  882. val: true,
  883. css: true,
  884. html: true,
  885. text: true,
  886. data: true,
  887. width: true,
  888. height: true,
  889. offset: true
  890. },
  891. attr: function(a, b, d, f) {
  892. if (!a || a.nodeType === 3 || a.nodeType === 8) return w;
  893. if (f && b in c.attrFn) return c(a)[b](d);
  894. f = a.nodeType !== 1 || !c.isXMLDoc(a);
  895. var e = d !== w;
  896. b = f && c.props[b] || b;
  897. if (a.nodeType === 1) {
  898. var i = Wa.test(b);
  899. if (b in a && f && !i) {
  900. if (e) {
  901. if (b === "type" && Xa.test(a.nodeName) && a.parentNode) throw "type property can't be changed";
  902. a[b] = d
  903. }
  904. if (c.nodeName(a, "form") && a.getAttributeNode(b)) return a.getAttributeNode(b)
  905. .nodeValue;
  906. if (b === "tabIndex") return (b = a.getAttributeNode("tabIndex")) && b.specified ? b.value : Ya.test(a.nodeName) || Za.test(a.nodeName) && a.href ? 0 : w;
  907. return a[b]
  908. }
  909. if (!c.support.style && f && b === "style") {
  910. if (e) a.style.cssText = "" + d;
  911. return a.style.cssText
  912. }
  913. e && a.setAttribute(b, "" + d);
  914. a = !c.support.hrefNormalized && f && i ? a.getAttribute(b, 2) : a.getAttribute(b);
  915. return a === null ? w : a
  916. }
  917. return c.style(a, b, d)
  918. }
  919. });
  920. var $a = function(a) {
  921. return a.replace(/[^\w\s\.\|`]/g, function(b) {
  922. return "\\" + b
  923. })
  924. };
  925. c.event = {
  926. add: function(a, b, d, f) {
  927. if (!(a.nodeType ===
  928. 3 || a.nodeType === 8)) {
  929. if (a.setInterval && a !== A && !a.frameElement) a = A;
  930. if (!d.guid) d.guid = c.guid++;
  931. if (f !== w) {
  932. d = c.proxy(d);
  933. d.data = f
  934. }
  935. var e = c.data(a, "events") || c.data(a, "events", {}),
  936. i = c.data(a, "handle"),
  937. j;
  938. if (!i) {
  939. j = function() {
  940. return typeof c !== "undefined" && !c.event.triggered ? c.event.handle.apply(j.elem, arguments) : w
  941. };
  942. i = c.data(a, "handle", j)
  943. }
  944. if (i) {
  945. i.elem = a;
  946. b = b.split(/\s+/);
  947. for (var o, p = 0; o = b[p++];) {
  948. var n = o.split(".");
  949. o = n.shift();
  950. d.type = n.slice(0)
  951. .sort()
  952. .join(".");
  953. var t = e[o],
  954. z = this.special[o] || {};
  955. if (!t) {
  956. t = e[o] = {};
  957. if (!z.setup || z.setup.call(a, f, n, d) === false)
  958. if (a.addEventListener) a.addEventListener(o, i, false);
  959. else a.attachEvent && a.attachEvent("on" + o, i)
  960. }
  961. if (z.add)
  962. if ((n = z.add.call(a, d, f, n, t)) && c.isFunction(n)) {
  963. n.guid = n.guid || d.guid;
  964. d = n
  965. } t[d.guid] = d;
  966. this.global[o] = true
  967. }
  968. a = null
  969. }
  970. }
  971. },
  972. global: {},
  973. remove: function(a, b, d) {
  974. if (!(a.nodeType === 3 || a.nodeType === 8)) {
  975. var f = c.data(a, "events"),
  976. e, i, j;
  977. if (f) {
  978. if (b === w || typeof b === "string" && b.charAt(0) === ".")
  979. for (i in f) this.remove(a, i + (b || ""));
  980. else {
  981. if (b.type) {
  982. d = b.handler;
  983. b = b.type
  984. }
  985. b = b.split(/\s+/);
  986. for (var o = 0; i = b[o++];) {
  987. var p = i.split(".");
  988. i = p.shift();
  989. var n = !p.length,
  990. t = c.map(p.slice(0)
  991. .sort(), $a);
  992. t = new RegExp("(^|\\.)" + t.join("\\.(?:.*\\.)?") + "(\\.|$)");
  993. var z = this.special[i] || {};
  994. if (f[i]) {
  995. if (d) {
  996. j = f[i][d.guid];
  997. delete f[i][d.guid]
  998. } else
  999. for (var B in f[i])
  1000. if (n || t.test(f[i][B].type)) delete f[i][B];
  1001. z.remove && z.remove.call(a, p, j);
  1002. for (e in f[i]) break;
  1003. if (!e) {
  1004. if (!z.teardown || z.teardown.call(a, p) === false)
  1005. if (a.removeEventListener) a.removeEventListener(i, c.data(a, "handle"), false);
  1006. else a.detachEvent && a.detachEvent("on" +
  1007. i, c.data(a, "handle"));
  1008. e = null;
  1009. delete f[i]
  1010. }
  1011. }
  1012. }
  1013. }
  1014. for (e in f) break;
  1015. if (!e) {
  1016. if (B = c.data(a, "handle")) B.elem = null;
  1017. c.removeData(a, "events");
  1018. c.removeData(a, "handle")
  1019. }
  1020. }
  1021. }
  1022. },
  1023. trigger: function(a, b, d, f) {
  1024. var e = a.type || a;
  1025. if (!f) {
  1026. a = typeof a === "object" ? a[H] ? a : c.extend(c.Event(e), a) : c.Event(e);
  1027. if (e.indexOf("!") >= 0) {
  1028. a.type = e = e.slice(0, -1);
  1029. a.exclusive = true
  1030. }
  1031. if (!d) {
  1032. a.stopPropagation();
  1033. this.global[e] && c.each(c.cache, function() {
  1034. this.events && this.events[e] && c.event.trigger(a, b, this.handle.elem)
  1035. })
  1036. }
  1037. if (!d || d.nodeType === 3 || d.nodeType ===
  1038. 8) return w;
  1039. a.result = w;
  1040. a.target = d;
  1041. b = c.makeArray(b);
  1042. b.unshift(a)
  1043. }
  1044. a.currentTarget = d;
  1045. var i = c.data(d, "handle");
  1046. i && i.apply(d, b);
  1047. var j, o;
  1048. try {
  1049. if (!(d && d.nodeName && c.noData[d.nodeName.toLowerCase()])) {
  1050. j = d[e];
  1051. o = d["on" + e]
  1052. }
  1053. } catch (p) {}
  1054. i = c.nodeName(d, "a") && e === "click";
  1055. if (!f && j && !a.isDefaultPrevented() && !i) {
  1056. this.triggered = true;
  1057. try {
  1058. d[e]()
  1059. } catch (n) {}
  1060. } else if (o && d["on" + e].apply(d, b) === false) a.result = false;
  1061. this.triggered = false;
  1062. if (!a.isPropagationStopped())(d = d.parentNode || d.ownerDocument) && c.event.trigger(a, b, d, true)
  1063. },
  1064. handle: function(a) {
  1065. var b, d;
  1066. a = arguments[0] = c.event.fix(a || A.event);
  1067. a.currentTarget = this;
  1068. d = a.type.split(".");
  1069. a.type = d.shift();
  1070. b = !d.length && !a.exclusive;
  1071. var f = new RegExp("(^|\\.)" + d.slice(0)
  1072. .sort()
  1073. .join("\\.(?:.*\\.)?") + "(\\.|$)");
  1074. d = (c.data(this, "events") || {})[a.type];
  1075. for (var e in d) {
  1076. var i = d[e];
  1077. if (b || f.test(i.type)) {
  1078. a.handler = i;
  1079. a.data = i.data;
  1080. i = i.apply(this, arguments);
  1081. if (i !== w) {
  1082. a.result = i;
  1083. if (i === false) {
  1084. a.preventDefault();
  1085. a.stopPropagation()
  1086. }
  1087. }
  1088. if (a.isImmediatePropagationStopped()) break
  1089. }
  1090. }
  1091. return a.result
  1092. },
  1093. props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
  1094. fix: function(a) {
  1095. if (a[H]) return a;
  1096. var b = a;
  1097. a = c.Event(b);
  1098. for (var d = this.props.length, f; d;) {
  1099. f = this.props[--d];
  1100. a[f] = b[f]
  1101. }
  1102. if (!a.target) a.target = a.srcElement ||
  1103. s;
  1104. if (a.target.nodeType === 3) a.target = a.target.parentNode;
  1105. if (!a.relatedTarget && a.fromElement) a.relatedTarget = a.fromElement === a.target ? a.toElement : a.fromElement;
  1106. if (a.pageX == null && a.clientX != null) {
  1107. b = s.documentElement;
  1108. d = s.body;
  1109. a.pageX = a.clientX + (b && b.scrollLeft || d && d.scrollLeft || 0) - (b && b.clientLeft || d && d.clientLeft || 0);
  1110. a.pageY = a.clientY + (b && b.scrollTop || d && d.scrollTop || 0) - (b && b.clientTop || d && d.clientTop || 0)
  1111. }
  1112. if (!a.which && (a.charCode || a.charCode === 0 ? a.charCode : a.keyCode)) a.which = a.charCode || a.keyCode;
  1113. if (!a.metaKey &&
  1114. a.ctrlKey) a.metaKey = a.ctrlKey;
  1115. if (!a.which && a.button !== w) a.which = a.button & 1 ? 1 : a.button & 2 ? 3 : a.button & 4 ? 2 : 0;
  1116. return a
  1117. },
  1118. guid: 1E8,
  1119. proxy: c.proxy,
  1120. special: {
  1121. ready: {
  1122. setup: c.bindReady,
  1123. teardown: c.noop
  1124. },
  1125. live: {
  1126. add: function(a, b) {
  1127. c.extend(a, b || {});
  1128. a.guid += b.selector + b.live;
  1129. c.event.add(this, b.live, qa, b)
  1130. },
  1131. remove: function(a) {
  1132. if (a.length) {
  1133. var b = 0,
  1134. d = new RegExp("(^|\\.)" + a[0] + "(\\.|$)");
  1135. c.each(c.data(this, "events")
  1136. .live || {},
  1137. function() {
  1138. d.test(this.type) && b++
  1139. });
  1140. b < 1 && c.event.remove(this, a[0], qa)
  1141. }
  1142. },
  1143. special: {}
  1144. },
  1145. beforeunload: {
  1146. setup: function(a,
  1147. b, d) {
  1148. if (this.setInterval) this.onbeforeunload = d;
  1149. return false
  1150. },
  1151. teardown: function(a, b) {
  1152. if (this.onbeforeunload === b) this.onbeforeunload = null
  1153. }
  1154. }
  1155. }
  1156. };
  1157. c.Event = function(a) {
  1158. if (!this.preventDefault) return new c.Event(a);
  1159. if (a && a.type) {
  1160. this.originalEvent = a;
  1161. this.type = a.type
  1162. } else this.type = a;
  1163. this.timeStamp = K();
  1164. this[H] = true
  1165. };
  1166. c.Event.prototype = {
  1167. preventDefault: function() {
  1168. this.isDefaultPrevented = ba;
  1169. var a = this.originalEvent;
  1170. if (a) {
  1171. a.preventDefault && a.preventDefault();
  1172. a.returnValue = false
  1173. }
  1174. },
  1175. stopPropagation: function() {
  1176. this.isPropagationStopped =
  1177. ba;
  1178. var a = this.originalEvent;
  1179. if (a) {
  1180. a.stopPropagation && a.stopPropagation();
  1181. a.cancelBubble = true
  1182. }
  1183. },
  1184. stopImmediatePropagation: function() {
  1185. this.isImmediatePropagationStopped = ba;
  1186. this.stopPropagation()
  1187. },
  1188. isDefaultPrevented: aa,
  1189. isPropagationStopped: aa,
  1190. isImmediatePropagationStopped: aa
  1191. };
  1192. var Ba = function(a) {
  1193. for (var b = a.relatedTarget; b && b !== this;) try {
  1194. b = b.parentNode
  1195. } catch (d) {
  1196. break
  1197. }
  1198. if (b !== this) {
  1199. a.type = a.data;
  1200. c.event.handle.apply(this, arguments)
  1201. }
  1202. },
  1203. Ca = function(a) {
  1204. a.type = a.data;
  1205. c.event.handle.apply(this, arguments)
  1206. };
  1207. c.each({
  1208. mouseenter: "mouseover",
  1209. mouseleave: "mouseout"
  1210. }, function(a, b) {
  1211. c.event.special[a] = {
  1212. setup: function(d) {
  1213. c.event.add(this, b, d && d.selector ? Ca : Ba, a)
  1214. },
  1215. teardown: function(d) {
  1216. c.event.remove(this, b, d && d.selector ? Ca : Ba)
  1217. }
  1218. }
  1219. });
  1220. if (!c.support.submitBubbles) c.event.special.submit = {
  1221. setup: function(a, b, d) {
  1222. if (this.nodeName.toLowerCase() !== "form") {
  1223. c.event.add(this, "click.specialSubmit." + d.guid, function(f) {
  1224. var e = f.target,
  1225. i = e.type;
  1226. if ((i === "submit" || i === "image") && c(e)
  1227. .closest("form")
  1228. .length) return pa("submit", this, arguments)
  1229. });
  1230. c.event.add(this, "keypress.specialSubmit." +
  1231. d.guid,
  1232. function(f) {
  1233. var e = f.target,
  1234. i = e.type;
  1235. if ((i === "text" || i === "password") && c(e)
  1236. .closest("form")
  1237. .length && f.keyCode === 13) return pa("submit", this, arguments)
  1238. })
  1239. } else return false
  1240. },
  1241. remove: function(a, b) {
  1242. c.event.remove(this, "click.specialSubmit" + (b ? "." + b.guid : ""));
  1243. c.event.remove(this, "keypress.specialSubmit" + (b ? "." + b.guid : ""))
  1244. }
  1245. };
  1246. if (!c.support.changeBubbles) {
  1247. var ga = /textarea|input|select/i;
  1248. function Da(a) {
  1249. var b = a.type,
  1250. d = a.value;
  1251. if (b === "radio" || b === "checkbox") d = a.checked;
  1252. else if (b === "select-multiple") d = a.selectedIndex >
  1253. -1 ? c.map(a.options, function(f) {
  1254. return f.selected
  1255. })
  1256. .join("-") : "";
  1257. else if (a.nodeName.toLowerCase() === "select") d = a.selectedIndex;
  1258. return d
  1259. }
  1260. function ha(a, b) {
  1261. var d = a.target,
  1262. f, e;
  1263. if (!(!ga.test(d.nodeName) || d.readOnly)) {
  1264. f = c.data(d, "_change_data");
  1265. e = Da(d);
  1266. if (e !== f) {
  1267. if (a.type !== "focusout" || d.type !== "radio") c.data(d, "_change_data", e);
  1268. if (d.type !== "select" && (f != null || e)) {
  1269. a.type = "change";
  1270. return c.event.trigger(a, b, this)
  1271. }
  1272. }
  1273. }
  1274. }
  1275. c.event.special.change = {
  1276. filters: {
  1277. focusout: ha,
  1278. click: function(a) {
  1279. var b = a.target,
  1280. d = b.type;
  1281. if (d ===
  1282. "radio" || d === "checkbox" || b.nodeName.toLowerCase() === "select") return ha.call(this, a)
  1283. },
  1284. keydown: function(a) {
  1285. var b = a.target,
  1286. d = b.type;
  1287. if (a.keyCode === 13 && b.nodeName.toLowerCase() !== "textarea" || a.keyCode === 32 && (d === "checkbox" || d === "radio") || d === "select-multiple") return ha.call(this, a)
  1288. },
  1289. beforeactivate: function(a) {
  1290. a = a.target;
  1291. a.nodeName.toLowerCase() === "input" && a.type === "radio" && c.data(a, "_change_data", Da(a))
  1292. }
  1293. },
  1294. setup: function(a, b, d) {
  1295. for (var f in W) c.event.add(this, f + ".specialChange." + d.guid, W[f]);
  1296. return ga.test(this.nodeName)
  1297. },
  1298. remove: function(a, b) {
  1299. for (var d in W) c.event.remove(this, d + ".specialChange" + (b ? "." + b.guid : ""), W[d]);
  1300. return ga.test(this.nodeName)
  1301. }
  1302. };
  1303. var W = c.event.special.change.filters
  1304. }
  1305. s.addEventListener && c.each({
  1306. focus: "focusin",
  1307. blur: "focusout"
  1308. }, function(a, b) {
  1309. function d(f) {
  1310. f = c.event.fix(f);
  1311. f.type = b;
  1312. return c.event.handle.call(this, f)
  1313. }
  1314. c.event.special[b] = {
  1315. setup: function() {
  1316. this.addEventListener(a, d, true)
  1317. },
  1318. teardown: function() {
  1319. this.removeEventListener(a, d, true)
  1320. }
  1321. }
  1322. });
  1323. c.each(["bind", "one"], function(a, b) {
  1324. c.fn[b] = function(d,
  1325. f, e) {
  1326. if (typeof d === "object") {
  1327. for (var i in d) this[b](i, f, d[i], e);
  1328. return this
  1329. }
  1330. if (c.isFunction(f)) {
  1331. thisObject = e;
  1332. e = f;
  1333. f = w
  1334. }
  1335. var j = b === "one" ? c.proxy(e, function(o) {
  1336. c(this)
  1337. .unbind(o, j);
  1338. return e.apply(this, arguments)
  1339. }) : e;
  1340. return d === "unload" && b !== "one" ? this.one(d, f, e, thisObject) : this.each(function() {
  1341. c.event.add(this, d, j, f)
  1342. })
  1343. }
  1344. });
  1345. c.fn.extend({
  1346. unbind: function(a, b) {
  1347. if (typeof a === "object" && !a.preventDefault) {
  1348. for (var d in a) this.unbind(d, a[d]);
  1349. return this
  1350. }
  1351. return this.each(function() {
  1352. c.event.remove(this, a, b)
  1353. })
  1354. },
  1355. trigger: function(a,
  1356. b) {
  1357. return this.each(function() {
  1358. c.event.trigger(a, b, this)
  1359. })
  1360. },
  1361. triggerHandler: function(a, b) {
  1362. if (this[0]) {
  1363. a = c.Event(a);
  1364. a.preventDefault();
  1365. a.stopPropagation();
  1366. c.event.trigger(a, b, this[0]);
  1367. return a.result
  1368. }
  1369. },
  1370. toggle: function(a) {
  1371. for (var b = arguments, d = 1; d < b.length;) c.proxy(a, b[d++]);
  1372. return this.click(c.proxy(a, function(f) {
  1373. var e = (c.data(this, "lastToggle" + a.guid) || 0) % d;
  1374. c.data(this, "lastToggle" + a.guid, e + 1);
  1375. f.preventDefault();
  1376. return b[e].apply(this, arguments) || false
  1377. }))
  1378. },
  1379. hover: function(a, b) {
  1380. return this.mouseenter(a)
  1381. .mouseleave(b ||
  1382. a)
  1383. },
  1384. live: function(a, b, d) {
  1385. if (c.isFunction(b)) {
  1386. d = b;
  1387. b = w
  1388. }
  1389. c(this.context)
  1390. .bind(ra(a, this.selector), {
  1391. data: b,
  1392. selector: this.selector,
  1393. live: a
  1394. }, d);
  1395. return this
  1396. },
  1397. die: function(a, b) {
  1398. c(this.context)
  1399. .unbind(ra(a, this.selector), b ? {
  1400. guid: b.guid + this.selector + a
  1401. } : null);
  1402. return this
  1403. }
  1404. });
  1405. c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "), function(a, b) {
  1406. c.fn[b] = function(d) {
  1407. return d ?
  1408. this.bind(b, d) : this.trigger(b)
  1409. };
  1410. if (c.attrFn) c.attrFn[b] = true
  1411. });
  1412. A.attachEvent && !A.addEventListener && A.attachEvent("onunload", function() {
  1413. for (var a in c.cache)
  1414. if (c.cache[a].handle) try {
  1415. c.event.remove(c.cache[a].handle.elem)
  1416. } catch (b) {}
  1417. });
  1418. (function() {
  1419. function a(g) {
  1420. for (var h = "", k, m = 0; g[m]; m++) {
  1421. k = g[m];
  1422. if (k.nodeType === 3 || k.nodeType === 4) h += k.nodeValue;
  1423. else if (k.nodeType !== 8) h += a(k.childNodes)
  1424. }
  1425. return h
  1426. }
  1427. function b(g, h, k, m, r, q) {
  1428. r = 0;
  1429. for (var v = m.length; r < v; r++) {
  1430. var u = m[r];
  1431. if (u) {
  1432. u = u[g];
  1433. for (var y = false; u;) {
  1434. if (u.sizcache ===
  1435. k) {
  1436. y = m[u.sizset];
  1437. break
  1438. }
  1439. if (u.nodeType === 1 && !q) {
  1440. u.sizcache = k;
  1441. u.sizset = r
  1442. }
  1443. if (u.nodeName.toLowerCase() === h) {
  1444. y = u;
  1445. break
  1446. }
  1447. u = u[g]
  1448. }
  1449. m[r] = y
  1450. }
  1451. }
  1452. }
  1453. function d(g, h, k, m, r, q) {
  1454. r = 0;
  1455. for (var v = m.length; r < v; r++) {
  1456. var u = m[r];
  1457. if (u) {
  1458. u = u[g];
  1459. for (var y = false; u;) {
  1460. if (u.sizcache === k) {
  1461. y = m[u.sizset];
  1462. break
  1463. }
  1464. if (u.nodeType === 1) {
  1465. if (!q) {
  1466. u.sizcache = k;
  1467. u.sizset = r
  1468. }
  1469. if (typeof h !== "string") {
  1470. if (u === h) {
  1471. y = true;
  1472. break
  1473. }
  1474. } else if (p.filter(h, [u])
  1475. .length > 0) {
  1476. y = u;
  1477. break
  1478. }
  1479. }
  1480. u = u[g]
  1481. }
  1482. m[r] = y
  1483. }
  1484. }
  1485. }
  1486. var f = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
  1487. e = 0,
  1488. i = Object.prototype.toString,
  1489. j = false,
  1490. o = true;
  1491. [0, 0].sort(function() {
  1492. o = false;
  1493. return 0
  1494. });
  1495. var p = function(g, h, k, m) {
  1496. k = k || [];
  1497. var r = h = h || s;
  1498. if (h.nodeType !== 1 && h.nodeType !== 9) return [];
  1499. if (!g || typeof g !== "string") return k;
  1500. for (var q = [], v, u, y, S, I = true, N = x(h), J = g;
  1501. (f.exec(""), v = f.exec(J)) !== null;) {
  1502. J = v[3];
  1503. q.push(v[1]);
  1504. if (v[2]) {
  1505. S = v[3];
  1506. break
  1507. }
  1508. }
  1509. if (q.length > 1 && t.exec(g))
  1510. if (q.length === 2 && n.relative[q[0]]) u = ia(q[0] + q[1], h);
  1511. else
  1512. for (u = n.relative[q[0]] ? [h] : p(q.shift(), h); q.length;) {
  1513. g = q.shift();
  1514. if (n.relative[g]) g += q.shift();
  1515. u = ia(g, u)
  1516. } else {
  1517. if (!m && q.length > 1 && h.nodeType === 9 && !N && n.match.ID.test(q[0]) && !n.match.ID.test(q[q.length - 1])) {
  1518. v = p.find(q.shift(), h, N);
  1519. h = v.expr ? p.filter(v.expr, v.set)[0] : v.set[0]
  1520. }
  1521. if (h) {
  1522. v = m ? {
  1523. expr: q.pop(),
  1524. set: B(m)
  1525. } : p.find(q.pop(), q.length === 1 && (q[0] === "~" || q[0] === "+") && h.parentNode ? h.parentNode : h, N);
  1526. u = v.expr ? p.filter(v.expr, v.set) : v.set;
  1527. if (q.length > 0) y = B(u);
  1528. else I = false;
  1529. for (; q.length;) {
  1530. var E = q.pop();
  1531. v = E;
  1532. if (n.relative[E]) v = q.pop();
  1533. else E = "";
  1534. if (v == null) v = h;
  1535. n.relative[E](y, v, N)
  1536. }
  1537. } else y = []
  1538. }
  1539. y || (y = u);
  1540. if (!y) throw "Syntax error, unrecognized expression: " +
  1541. (E || g);
  1542. if (i.call(y) === "[object Array]")
  1543. if (I)
  1544. if (h && h.nodeType === 1)
  1545. for (g = 0; y[g] != null; g++) {
  1546. if (y[g] && (y[g] === true || y[g].nodeType === 1 && F(h, y[g]))) k.push(u[g])
  1547. } else
  1548. for (g = 0; y[g] != null; g++) y[g] && y[g].nodeType === 1 && k.push(u[g]);
  1549. else k.push.apply(k, y);
  1550. else B(y, k);
  1551. if (S) {
  1552. p(S, r, k, m);
  1553. p.uniqueSort(k)
  1554. }
  1555. return k
  1556. };
  1557. p.uniqueSort = function(g) {
  1558. if (D) {
  1559. j = o;
  1560. g.sort(D);
  1561. if (j)
  1562. for (var h = 1; h < g.length; h++) g[h] === g[h - 1] && g.splice(h--, 1)
  1563. }
  1564. return g
  1565. };
  1566. p.matches = function(g, h) {
  1567. return p(g, null, null, h)
  1568. };
  1569. p.find = function(g, h, k) {
  1570. var m, r;
  1571. if (!g) return [];
  1572. for (var q = 0, v = n.order.length; q < v; q++) {
  1573. var u = n.order[q];
  1574. if (r = n.leftMatch[u].exec(g)) {
  1575. var y = r[1];
  1576. r.splice(1, 1);
  1577. if (y.substr(y.length - 1) !== "\\") {
  1578. r[1] = (r[1] || "")
  1579. .replace(/\\/g, "");
  1580. m = n.find[u](r, h, k);
  1581. if (m != null) {
  1582. g = g.replace(n.match[u], "");
  1583. break
  1584. }
  1585. }
  1586. }
  1587. }
  1588. m || (m = h.getElementsByTagName("*"));
  1589. return {
  1590. set: m,
  1591. expr: g
  1592. }
  1593. };
  1594. p.filter = function(g, h, k, m) {
  1595. for (var r = g, q = [], v = h, u, y, S = h && h[0] && x(h[0]); g && h.length;) {
  1596. for (var I in n.filter)
  1597. if ((u = n.leftMatch[I].exec(g)) != null && u[2]) {
  1598. var N = n.filter[I],
  1599. J, E;
  1600. E = u[1];
  1601. y = false;
  1602. u.splice(1, 1);
  1603. if (E.substr(E.length -
  1604. 1) !== "\\") {
  1605. if (v === q) q = [];
  1606. if (n.preFilter[I])
  1607. if (u = n.preFilter[I](u, v, k, q, m, S)) {
  1608. if (u === true) continue
  1609. } else y = J = true;
  1610. if (u)
  1611. for (var X = 0;
  1612. (E = v[X]) != null; X++)
  1613. if (E) {
  1614. J = N(E, u, X, v);
  1615. var Ea = m ^ !!J;
  1616. if (k && J != null)
  1617. if (Ea) y = true;
  1618. else v[X] = false;
  1619. else if (Ea) {
  1620. q.push(E);
  1621. y = true
  1622. }
  1623. } if (J !== w) {
  1624. k || (v = q);
  1625. g = g.replace(n.match[I], "");
  1626. if (!y) return [];
  1627. break
  1628. }
  1629. }
  1630. } if (g === r)
  1631. if (y == null) throw "Syntax error, unrecognized expression: " + g;
  1632. else break;
  1633. r = g
  1634. }
  1635. return v
  1636. };
  1637. var n = p.selectors = {
  1638. order: ["ID", "NAME", "TAG"],
  1639. match: {
  1640. ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
  1641. CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
  1642. NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
  1643. ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
  1644. TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
  1645. CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
  1646. POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
  1647. PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
  1648. },
  1649. leftMatch: {},
  1650. attrMap: {
  1651. "class": "className",
  1652. "for": "htmlFor"
  1653. },
  1654. attrHandle: {
  1655. href: function(g) {
  1656. return g.getAttribute("href")
  1657. }
  1658. },
  1659. relative: {
  1660. "+": function(g, h) {
  1661. var k = typeof h === "string",
  1662. m = k && !/\W/.test(h);
  1663. k = k && !m;
  1664. if (m) h = h.toLowerCase();
  1665. m = 0;
  1666. for (var r = g.length, q; m < r; m++)
  1667. if (q = g[m]) {
  1668. for (;
  1669. (q = q.previousSibling) && q.nodeType !== 1;);
  1670. g[m] = k || q && q.nodeName.toLowerCase() === h ? q || false : q === h
  1671. } k && p.filter(h, g, true)
  1672. },
  1673. ">": function(g, h) {
  1674. var k = typeof h === "string";
  1675. if (k && !/\W/.test(h)) {
  1676. h = h.toLowerCase();
  1677. for (var m = 0, r = g.length; m < r; m++) {
  1678. var q = g[m];
  1679. if (q) {
  1680. k = q.parentNode;
  1681. g[m] = k.nodeName.toLowerCase() === h ? k : false
  1682. }
  1683. }
  1684. } else {
  1685. m = 0;
  1686. for (r = g.length; m < r; m++)
  1687. if (q = g[m]) g[m] =
  1688. k ? q.parentNode : q.parentNode === h;
  1689. k && p.filter(h, g, true)
  1690. }
  1691. },
  1692. "": function(g, h, k) {
  1693. var m = e++,
  1694. r = d;
  1695. if (typeof h === "string" && !/\W/.test(h)) {
  1696. var q = h = h.toLowerCase();
  1697. r = b
  1698. }
  1699. r("parentNode", h, m, g, q, k)
  1700. },
  1701. "~": function(g, h, k) {
  1702. var m = e++,
  1703. r = d;
  1704. if (typeof h === "string" && !/\W/.test(h)) {
  1705. var q = h = h.toLowerCase();
  1706. r = b
  1707. }
  1708. r("previousSibling", h, m, g, q, k)
  1709. }
  1710. },
  1711. find: {
  1712. ID: function(g, h, k) {
  1713. if (typeof h.getElementById !== "undefined" && !k) return (g = h.getElementById(g[1])) ? [g] : []
  1714. },
  1715. NAME: function(g, h) {
  1716. if (typeof h.getElementsByName !== "undefined") {
  1717. var k = [];
  1718. h = h.getElementsByName(g[1]);
  1719. for (var m = 0, r = h.length; m < r; m++) h[m].getAttribute("name") === g[1] && k.push(h[m]);
  1720. return k.length === 0 ? null : k
  1721. }
  1722. },
  1723. TAG: function(g, h) {
  1724. return h.getElementsByTagName(g[1])
  1725. }
  1726. },
  1727. preFilter: {
  1728. CLASS: function(g, h, k, m, r, q) {
  1729. g = " " + g[1].replace(/\\/g, "") + " ";
  1730. if (q) return g;
  1731. q = 0;
  1732. for (var v;
  1733. (v = h[q]) != null; q++)
  1734. if (v)
  1735. if (r ^ (v.className && (" " + v.className + " ")
  1736. .replace(/[\t\n]/g, " ")
  1737. .indexOf(g) >= 0)) k || m.push(v);
  1738. else if (k) h[q] = false;
  1739. return false
  1740. },
  1741. ID: function(g) {
  1742. return g[1].replace(/\\/g, "")
  1743. },
  1744. TAG: function(g) {
  1745. return g[1].toLowerCase()
  1746. },
  1747. CHILD: function(g) {
  1748. if (g[1] === "nth") {
  1749. var h = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2] === "even" && "2n" || g[2] === "odd" && "2n+1" || !/\D/.test(g[2]) && "0n+" + g[2] || g[2]);
  1750. g[2] = h[1] + (h[2] || 1) - 0;
  1751. g[3] = h[3] - 0
  1752. }
  1753. g[0] = e++;
  1754. return g
  1755. },
  1756. ATTR: function(g, h, k, m, r, q) {
  1757. h = g[1].replace(/\\/g, "");
  1758. if (!q && n.attrMap[h]) g[1] = n.attrMap[h];
  1759. if (g[2] === "~=") g[4] = " " + g[4] + " ";
  1760. return g
  1761. },
  1762. PSEUDO: function(g, h, k, m, r) {
  1763. if (g[1] === "not")
  1764. if ((f.exec(g[3]) || "")
  1765. .length > 1 || /^\w/.test(g[3])) g[3] = p(g[3], null, null, h);
  1766. else {
  1767. g = p.filter(g[3], h, k, true ^ r);
  1768. k || m.push.apply(m,
  1769. g);
  1770. return false
  1771. }
  1772. else if (n.match.POS.test(g[0]) || n.match.CHILD.test(g[0])) return true;
  1773. return g
  1774. },
  1775. POS: function(g) {
  1776. g.unshift(true);
  1777. return g
  1778. }
  1779. },
  1780. filters: {
  1781. enabled: function(g) {
  1782. return g.disabled === false && g.type !== "hidden"
  1783. },
  1784. disabled: function(g) {
  1785. return g.disabled === true
  1786. },
  1787. checked: function(g) {
  1788. return g.checked === true
  1789. },
  1790. selected: function(g) {
  1791. return g.selected === true
  1792. },
  1793. parent: function(g) {
  1794. return !!g.firstChild
  1795. },
  1796. empty: function(g) {
  1797. return !g.firstChild
  1798. },
  1799. has: function(g, h, k) {
  1800. return !!p(k[3], g)
  1801. .length
  1802. },
  1803. header: function(g) {
  1804. return /h\d/i.test(g.nodeName)
  1805. },
  1806. text: function(g) {
  1807. return "text" === g.type
  1808. },
  1809. radio: function(g) {
  1810. return "radio" === g.type
  1811. },
  1812. checkbox: function(g) {
  1813. return "checkbox" === g.type
  1814. },
  1815. file: function(g) {
  1816. return "file" === g.type
  1817. },
  1818. password: function(g) {
  1819. return "password" === g.type
  1820. },
  1821. submit: function(g) {
  1822. return "submit" === g.type
  1823. },
  1824. image: function(g) {
  1825. return "image" === g.type
  1826. },
  1827. reset: function(g) {
  1828. return "reset" === g.type
  1829. },
  1830. button: function(g) {
  1831. return "button" === g.type || g.nodeName.toLowerCase() === "button"
  1832. },
  1833. input: function(g) {
  1834. return /input|select|textarea|button/i.test(g.nodeName)
  1835. }
  1836. },
  1837. setFilters: {
  1838. first: function(g, h) {
  1839. return h === 0
  1840. },
  1841. last: function(g, h, k, m) {
  1842. return h === m.length - 1
  1843. },
  1844. even: function(g, h) {
  1845. return h % 2 === 0
  1846. },
  1847. odd: function(g, h) {
  1848. return h % 2 === 1
  1849. },
  1850. lt: function(g, h, k) {
  1851. return h < k[3] - 0
  1852. },
  1853. gt: function(g, h, k) {
  1854. return h > k[3] - 0
  1855. },
  1856. nth: function(g, h, k) {
  1857. return k[3] - 0 === h
  1858. },
  1859. eq: function(g, h, k) {
  1860. return k[3] - 0 === h
  1861. }
  1862. },
  1863. filter: {
  1864. PSEUDO: function(g, h, k, m) {
  1865. var r = h[1],
  1866. q = n.filters[r];
  1867. if (q) return q(g, k, h, m);
  1868. else if (r === "contains") return (g.textContent || g.innerText || a([g]) || "")
  1869. .indexOf(h[3]) >= 0;
  1870. else if (r === "not") {
  1871. h =
  1872. h[3];
  1873. k = 0;
  1874. for (m = h.length; k < m; k++)
  1875. if (h[k] === g) return false;
  1876. return true
  1877. } else throw "Syntax error, unrecognized expression: " + r;
  1878. },
  1879. CHILD: function(g, h) {
  1880. var k = h[1],
  1881. m = g;
  1882. switch (k) {
  1883. case "only":
  1884. case "first":
  1885. for (; m = m.previousSibling;)
  1886. if (m.nodeType === 1) return false;
  1887. if (k === "first") return true;
  1888. m = g;
  1889. case "last":
  1890. for (; m = m.nextSibling;)
  1891. if (m.nodeType === 1) return false;
  1892. return true;
  1893. case "nth":
  1894. k = h[2];
  1895. var r = h[3];
  1896. if (k === 1 && r === 0) return true;
  1897. h = h[0];
  1898. var q = g.parentNode;
  1899. if (q && (q.sizcache !== h || !g.nodeIndex)) {
  1900. var v = 0;
  1901. for (m = q.firstChild; m; m =
  1902. m.nextSibling)
  1903. if (m.nodeType === 1) m.nodeIndex = ++v;
  1904. q.sizcache = h
  1905. }
  1906. g = g.nodeIndex - r;
  1907. return k === 0 ? g === 0 : g % k === 0 && g / k >= 0
  1908. }
  1909. },
  1910. ID: function(g, h) {
  1911. return g.nodeType === 1 && g.getAttribute("id") === h
  1912. },
  1913. TAG: function(g, h) {
  1914. return h === "*" && g.nodeType === 1 || g.nodeName.toLowerCase() === h
  1915. },
  1916. CLASS: function(g, h) {
  1917. return (" " + (g.className || g.getAttribute("class")) + " ")
  1918. .indexOf(h) > -1
  1919. },
  1920. ATTR: function(g, h) {
  1921. var k = h[1];
  1922. g = n.attrHandle[k] ? n.attrHandle[k](g) : g[k] != null ? g[k] : g.getAttribute(k);
  1923. k = g + "";
  1924. var m = h[2];
  1925. h = h[4];
  1926. return g == null ? m === "!=" : m ===
  1927. "=" ? k === h : m === "*=" ? k.indexOf(h) >= 0 : m === "~=" ? (" " + k + " ")
  1928. .indexOf(h) >= 0 : !h ? k && g !== false : m === "!=" ? k !== h : m === "^=" ? k.indexOf(h) === 0 : m === "$=" ? k.substr(k.length - h.length) === h : m === "|=" ? k === h || k.substr(0, h.length + 1) === h + "-" : false
  1929. },
  1930. POS: function(g, h, k, m) {
  1931. var r = n.setFilters[h[2]];
  1932. if (r) return r(g, k, h, m)
  1933. }
  1934. }
  1935. },
  1936. t = n.match.POS;
  1937. for (var z in n.match) {
  1938. n.match[z] = new RegExp(n.match[z].source + /(?![^\[]*\])(?![^\(]*\))/.source);
  1939. n.leftMatch[z] = new RegExp(/(^(?:.|\r|\n)*?)/.source + n.match[z].source.replace(/\\(\d+)/g, function(g,
  1940. h) {
  1941. return "\\" + (h - 0 + 1)
  1942. }))
  1943. }
  1944. var B = function(g, h) {
  1945. g = Array.prototype.slice.call(g, 0);
  1946. if (h) {
  1947. h.push.apply(h, g);
  1948. return h
  1949. }
  1950. return g
  1951. };
  1952. try {
  1953. Array.prototype.slice.call(s.documentElement.childNodes, 0)
  1954. } catch (C) {
  1955. B = function(g, h) {
  1956. h = h || [];
  1957. if (i.call(g) === "[object Array]") Array.prototype.push.apply(h, g);
  1958. else if (typeof g.length === "number")
  1959. for (var k = 0, m = g.length; k < m; k++) h.push(g[k]);
  1960. else
  1961. for (k = 0; g[k]; k++) h.push(g[k]);
  1962. return h
  1963. }
  1964. }
  1965. var D;
  1966. if (s.documentElement.compareDocumentPosition) D = function(g, h) {
  1967. if (!g.compareDocumentPosition ||
  1968. !h.compareDocumentPosition) {
  1969. if (g == h) j = true;
  1970. return g.compareDocumentPosition ? -1 : 1
  1971. }
  1972. g = g.compareDocumentPosition(h) & 4 ? -1 : g === h ? 0 : 1;
  1973. if (g === 0) j = true;
  1974. return g
  1975. };
  1976. else if ("sourceIndex" in s.documentElement) D = function(g, h) {
  1977. if (!g.sourceIndex || !h.sourceIndex) {
  1978. if (g == h) j = true;
  1979. return g.sourceIndex ? -1 : 1
  1980. }
  1981. g = g.sourceIndex - h.sourceIndex;
  1982. if (g === 0) j = true;
  1983. return g
  1984. };
  1985. else if (s.createRange) D = function(g, h) {
  1986. if (!g.ownerDocument || !h.ownerDocument) {
  1987. if (g == h) j = true;
  1988. return g.ownerDocument ? -1 : 1
  1989. }
  1990. var k = g.ownerDocument.createRange(),
  1991. m =
  1992. h.ownerDocument.createRange();
  1993. k.setStart(g, 0);
  1994. k.setEnd(g, 0);
  1995. m.setStart(h, 0);
  1996. m.setEnd(h, 0);
  1997. g = k.compareBoundaryPoints(Range.START_TO_END, m);
  1998. if (g === 0) j = true;
  1999. return g
  2000. };
  2001. (function() {
  2002. var g = s.createElement("div"),
  2003. h = "script" + (new Date)
  2004. .getTime();
  2005. g.innerHTML = "<a name='" + h + "'/>";
  2006. var k = s.documentElement;
  2007. k.insertBefore(g, k.firstChild);
  2008. if (s.getElementById(h)) {
  2009. n.find.ID = function(m, r, q) {
  2010. if (typeof r.getElementById !== "undefined" && !q) return (r = r.getElementById(m[1])) ? r.id === m[1] || typeof r.getAttributeNode !== "undefined" &&
  2011. r.getAttributeNode("id")
  2012. .nodeValue === m[1] ? [r] : w : []
  2013. };
  2014. n.filter.ID = function(m, r) {
  2015. var q = typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id");
  2016. return m.nodeType === 1 && q && q.nodeValue === r
  2017. }
  2018. }
  2019. k.removeChild(g);
  2020. k = g = null
  2021. })();
  2022. (function() {
  2023. var g = s.createElement("div");
  2024. g.appendChild(s.createComment(""));
  2025. if (g.getElementsByTagName("*")
  2026. .length > 0) n.find.TAG = function(h, k) {
  2027. k = k.getElementsByTagName(h[1]);
  2028. if (h[1] === "*") {
  2029. h = [];
  2030. for (var m = 0; k[m]; m++) k[m].nodeType === 1 && h.push(k[m]);
  2031. k = h
  2032. }
  2033. return k
  2034. };
  2035. g.innerHTML = "<a href='#'></a>";
  2036. if (g.firstChild && typeof g.firstChild.getAttribute !== "undefined" && g.firstChild.getAttribute("href") !== "#") n.attrHandle.href = function(h) {
  2037. return h.getAttribute("href", 2)
  2038. };
  2039. g = null
  2040. })();
  2041. s.querySelectorAll && function() {
  2042. var g = p,
  2043. h = s.createElement("div");
  2044. h.innerHTML = "<p class='TEST'></p>";
  2045. if (!(h.querySelectorAll && h.querySelectorAll(".TEST")
  2046. .length === 0)) {
  2047. p = function(m, r, q, v) {
  2048. r = r || s;
  2049. if (!v && r.nodeType === 9 && !x(r)) try {
  2050. return B(r.querySelectorAll(m), q)
  2051. } catch (u) {}
  2052. return g(m, r, q, v)
  2053. };
  2054. for (var k in g) p[k] = g[k];
  2055. h = null
  2056. }
  2057. }();
  2058. (function() {
  2059. var g = s.createElement("div");
  2060. g.innerHTML = "<div class='test e'></div><div class='test'></div>";
  2061. if (!(!g.getElementsByClassName || g.getElementsByClassName("e")
  2062. .length === 0)) {
  2063. g.lastChild.className = "e";
  2064. if (g.getElementsByClassName("e")
  2065. .length !== 1) {
  2066. n.order.splice(1, 0, "CLASS");
  2067. n.find.CLASS = function(h, k, m) {
  2068. if (typeof k.getElementsByClassName !== "undefined" && !m) return k.getElementsByClassName(h[1])
  2069. };
  2070. g = null
  2071. }
  2072. }
  2073. })();
  2074. var F = s.compareDocumentPosition ? function(g, h) {
  2075. return g.compareDocumentPosition(h) & 16
  2076. } : function(g,
  2077. h) {
  2078. return g !== h && (g.contains ? g.contains(h) : true)
  2079. },
  2080. x = function(g) {
  2081. return (g = (g ? g.ownerDocument || g : 0)
  2082. .documentElement) ? g.nodeName !== "HTML" : false
  2083. },
  2084. ia = function(g, h) {
  2085. var k = [],
  2086. m = "",
  2087. r;
  2088. for (h = h.nodeType ? [h] : h; r = n.match.PSEUDO.exec(g);) {
  2089. m += r[0];
  2090. g = g.replace(n.match.PSEUDO, "")
  2091. }
  2092. g = n.relative[g] ? g + "*" : g;
  2093. r = 0;
  2094. for (var q = h.length; r < q; r++) p(g, h[r], k);
  2095. return p.filter(m, k)
  2096. };
  2097. c.find = p;
  2098. c.expr = p.selectors;
  2099. c.expr[":"] = c.expr.filters;
  2100. c.unique = p.uniqueSort;
  2101. c.getText = a;
  2102. c.isXMLDoc = x;
  2103. c.contains = F
  2104. })();
  2105. var ab = /Until$/,
  2106. bb = /^(?:parents|prevUntil|prevAll)/,
  2107. cb = /,/;
  2108. R = Array.prototype.slice;
  2109. var Fa = function(a, b, d) {
  2110. if (c.isFunction(b)) return c.grep(a, function(e, i) {
  2111. return !!b.call(e, i, e) === d
  2112. });
  2113. else if (b.nodeType) return c.grep(a, function(e) {
  2114. return e === b === d
  2115. });
  2116. else if (typeof b === "string") {
  2117. var f = c.grep(a, function(e) {
  2118. return e.nodeType === 1
  2119. });
  2120. if (Pa.test(b)) return c.filter(b, f, !d);
  2121. else b = c.filter(b, a)
  2122. }
  2123. return c.grep(a, function(e) {
  2124. return c.inArray(e, b) >= 0 === d
  2125. })
  2126. };
  2127. c.fn.extend({
  2128. find: function(a) {
  2129. for (var b = this.pushStack("", "find", a), d = 0, f = 0, e = this.length; f < e; f++) {
  2130. d = b.length;
  2131. c.find(a, this[f], b);
  2132. if (f > 0)
  2133. for (var i = d; i < b.length; i++)
  2134. for (var j = 0; j < d; j++)
  2135. if (b[j] === b[i]) {
  2136. b.splice(i--, 1);
  2137. break
  2138. }
  2139. }
  2140. return b
  2141. },
  2142. has: function(a) {
  2143. var b = c(a);
  2144. return this.filter(function() {
  2145. for (var d = 0, f = b.length; d < f; d++)
  2146. if (c.contains(this, b[d])) return true
  2147. })
  2148. },
  2149. not: function(a) {
  2150. return this.pushStack(Fa(this, a, false), "not", a)
  2151. },
  2152. filter: function(a) {
  2153. return this.pushStack(Fa(this, a, true), "filter", a)
  2154. },
  2155. is: function(a) {
  2156. return !!a && c.filter(a, this)
  2157. .length > 0
  2158. },
  2159. closest: function(a, b) {
  2160. if (c.isArray(a)) {
  2161. var d = [],
  2162. f = this[0],
  2163. e, i = {},
  2164. j;
  2165. if (f && a.length) {
  2166. e = 0;
  2167. for (var o = a.length; e < o; e++) {
  2168. j = a[e];
  2169. i[j] || (i[j] = c.expr.match.POS.test(j) ? c(j, b || this.context) : j)
  2170. }
  2171. for (; f && f.ownerDocument && f !== b;) {
  2172. for (j in i) {
  2173. e = i[j];
  2174. if (e.jquery ? e.index(f) > -1 : c(f)
  2175. .is(e)) {
  2176. d.push({
  2177. selector: j,
  2178. elem: f
  2179. });
  2180. delete i[j]
  2181. }
  2182. }
  2183. f = f.parentNode
  2184. }
  2185. }
  2186. return d
  2187. }
  2188. var p = c.expr.match.POS.test(a) ? c(a, b || this.context) : null;
  2189. return this.map(function(n, t) {
  2190. for (; t && t.ownerDocument && t !== b;) {
  2191. if (p ? p.index(t) > -1 : c(t)
  2192. .is(a)) return t;
  2193. t = t.parentNode
  2194. }
  2195. return null
  2196. })
  2197. },
  2198. index: function(a) {
  2199. if (!a || typeof a ===
  2200. "string") return c.inArray(this[0], a ? c(a) : this.parent()
  2201. .children());
  2202. return c.inArray(a.jquery ? a[0] : a, this)
  2203. },
  2204. add: function(a, b) {
  2205. a = typeof a === "string" ? c(a, b || this.context) : c.makeArray(a);
  2206. b = c.merge(this.get(), a);
  2207. return this.pushStack(sa(a[0]) || sa(b[0]) ? b : c.unique(b))
  2208. },
  2209. andSelf: function() {
  2210. return this.add(this.prevObject)
  2211. }
  2212. });
  2213. c.each({
  2214. parent: function(a) {
  2215. return (a = a.parentNode) && a.nodeType !== 11 ? a : null
  2216. },
  2217. parents: function(a) {
  2218. return c.dir(a, "parentNode")
  2219. },
  2220. parentsUntil: function(a, b, d) {
  2221. return c.dir(a, "parentNode",
  2222. d)
  2223. },
  2224. next: function(a) {
  2225. return c.nth(a, 2, "nextSibling")
  2226. },
  2227. prev: function(a) {
  2228. return c.nth(a, 2, "previousSibling")
  2229. },
  2230. nextAll: function(a) {
  2231. return c.dir(a, "nextSibling")
  2232. },
  2233. prevAll: function(a) {
  2234. return c.dir(a, "previousSibling")
  2235. },
  2236. nextUntil: function(a, b, d) {
  2237. return c.dir(a, "nextSibling", d)
  2238. },
  2239. prevUntil: function(a, b, d) {
  2240. return c.dir(a, "previousSibling", d)
  2241. },
  2242. siblings: function(a) {
  2243. return c.sibling(a.parentNode.firstChild, a)
  2244. },
  2245. children: function(a) {
  2246. return c.sibling(a.firstChild)
  2247. },
  2248. contents: function(a) {
  2249. return c.nodeName(a, "iframe") ?
  2250. a.contentDocument || a.contentWindow.document : c.makeArray(a.childNodes)
  2251. }
  2252. }, function(a, b) {
  2253. c.fn[a] = function(d, f) {
  2254. var e = c.map(this, b, d);
  2255. ab.test(a) || (f = d);
  2256. if (f && typeof f === "string") e = c.filter(f, e);
  2257. e = this.length > 1 ? c.unique(e) : e;
  2258. if ((this.length > 1 || cb.test(f)) && bb.test(a)) e = e.reverse();
  2259. return this.pushStack(e, a, R.call(arguments)
  2260. .join(","))
  2261. }
  2262. });
  2263. c.extend({
  2264. filter: function(a, b, d) {
  2265. if (d) a = ":not(" + a + ")";
  2266. return c.find.matches(a, b)
  2267. },
  2268. dir: function(a, b, d) {
  2269. var f = [];
  2270. for (a = a[b]; a && a.nodeType !== 9 && (d === w || !c(a)
  2271. .is(d));) {
  2272. a.nodeType ===
  2273. 1 && f.push(a);
  2274. a = a[b]
  2275. }
  2276. return f
  2277. },
  2278. nth: function(a, b, d) {
  2279. b = b || 1;
  2280. for (var f = 0; a; a = a[d])
  2281. if (a.nodeType === 1 && ++f === b) break;
  2282. return a
  2283. },
  2284. sibling: function(a, b) {
  2285. for (var d = []; a; a = a.nextSibling) a.nodeType === 1 && a !== b && d.push(a);
  2286. return d
  2287. }
  2288. });
  2289. var Ga = / jQuery\d+="(?:\d+|null)"/g,
  2290. Y = /^\s+/,
  2291. db = /(<([\w:]+)[^>]*?)\/>/g,
  2292. eb = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
  2293. Ha = /<([\w:]+)/,
  2294. fb = /<tbody/i,
  2295. gb = /<|&\w+;/,
  2296. hb = function(a, b, d) {
  2297. return eb.test(d) ? a : b + "></" + d + ">"
  2298. },
  2299. G = {
  2300. option: [1, "<select multiple='multiple'>", "</select>"],
  2301. legend: [1, "<fieldset>", "</fieldset>"],
  2302. thead: [1, "<table>", "</table>"],
  2303. tr: [2, "<table><tbody>", "</tbody></table>"],
  2304. td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  2305. col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
  2306. area: [1, "<map>", "</map>"],
  2307. _default: [0, "", ""]
  2308. };
  2309. G.optgroup = G.option;
  2310. G.tbody = G.tfoot = G.colgroup = G.caption = G.thead;
  2311. G.th = G.td;
  2312. if (!c.support.htmlSerialize) G._default = [1, "div<div>", "</div>"];
  2313. c.fn.extend({
  2314. text: function(a) {
  2315. if (c.isFunction(a)) return this.each(function(b) {
  2316. var d = c(this);
  2317. return d.text(a.call(this, b, d.text()))
  2318. });
  2319. if (typeof a !== "object" && a !== w) return this.empty()
  2320. .append((this[0] && this[0].ownerDocument || s)
  2321. .createTextNode(a));
  2322. return c.getText(this)
  2323. },
  2324. wrapAll: function(a) {
  2325. if (c.isFunction(a)) return this.each(function(d) {
  2326. c(this)
  2327. .wrapAll(a.call(this, d))
  2328. });
  2329. if (this[0]) {
  2330. var b = c(a, this[0].ownerDocument)
  2331. .eq(0)
  2332. .clone(true);
  2333. this[0].parentNode && b.insertBefore(this[0]);
  2334. b.map(function() {
  2335. for (var d = this; d.firstChild && d.firstChild.nodeType === 1;) d = d.firstChild;
  2336. return d
  2337. })
  2338. .append(this)
  2339. }
  2340. return this
  2341. },
  2342. wrapInner: function(a) {
  2343. return this.each(function() {
  2344. var b = c(this),
  2345. d = b.contents();
  2346. d.length ? d.wrapAll(a) : b.append(a)
  2347. })
  2348. },
  2349. wrap: function(a) {
  2350. return this.each(function() {
  2351. c(this)
  2352. .wrapAll(a)
  2353. })
  2354. },
  2355. unwrap: function() {
  2356. return this.parent()
  2357. .each(function() {
  2358. c.nodeName(this, "body") || c(this)
  2359. .replaceWith(this.childNodes)
  2360. })
  2361. .end()
  2362. },
  2363. append: function() {
  2364. return this.domManip(arguments, true, function(a) {
  2365. this.nodeType === 1 && this.appendChild(a)
  2366. })
  2367. },
  2368. prepend: function() {
  2369. return this.domManip(arguments, true, function(a) {
  2370. this.nodeType === 1 &&
  2371. this.insertBefore(a, this.firstChild)
  2372. })
  2373. },
  2374. before: function() {
  2375. if (this[0] && this[0].parentNode) return this.domManip(arguments, false, function(b) {
  2376. this.parentNode.insertBefore(b, this)
  2377. });
  2378. else if (arguments.length) {
  2379. var a = c(arguments[0]);
  2380. a.push.apply(a, this.toArray());
  2381. return this.pushStack(a, "before", arguments)
  2382. }
  2383. },
  2384. after: function() {
  2385. if (this[0] && this[0].parentNode) return this.domManip(arguments, false, function(b) {
  2386. this.parentNode.insertBefore(b, this.nextSibling)
  2387. });
  2388. else if (arguments.length) {
  2389. var a = this.pushStack(this,
  2390. "after", arguments);
  2391. a.push.apply(a, c(arguments[0])
  2392. .toArray());
  2393. return a
  2394. }
  2395. },
  2396. clone: function(a) {
  2397. var b = this.map(function() {
  2398. if (!c.support.noCloneEvent && !c.isXMLDoc(this)) {
  2399. var d = this.outerHTML,
  2400. f = this.ownerDocument;
  2401. if (!d) {
  2402. d = f.createElement("div");
  2403. d.appendChild(this.cloneNode(true));
  2404. d = d.innerHTML
  2405. }
  2406. return c.clean([d.replace(Ga, "")
  2407. .replace(Y, "")
  2408. ], f)[0]
  2409. } else return this.cloneNode(true)
  2410. });
  2411. if (a === true) {
  2412. ta(this, b);
  2413. ta(this.find("*"), b.find("*"))
  2414. }
  2415. return b
  2416. },
  2417. html: function(a) {
  2418. if (a === w) return this[0] && this[0].nodeType ===
  2419. 1 ? this[0].innerHTML.replace(Ga, "") : null;
  2420. else if (typeof a === "string" && !/<script/i.test(a) && (c.support.leadingWhitespace || !Y.test(a)) && !G[(Ha.exec(a) || ["", ""])[1].toLowerCase()]) try {
  2421. for (var b = 0, d = this.length; b < d; b++)
  2422. if (this[b].nodeType === 1) {
  2423. T(this[b].getElementsByTagName("*"));
  2424. this[b].innerHTML = a
  2425. }
  2426. } catch (f) {
  2427. this.empty()
  2428. .append(a)
  2429. } else c.isFunction(a) ? this.each(function(e) {
  2430. var i = c(this),
  2431. j = i.html();
  2432. i.empty()
  2433. .append(function() {
  2434. return a.call(this, e, j)
  2435. })
  2436. }) : this.empty()
  2437. .append(a);
  2438. return this
  2439. },
  2440. replaceWith: function(a) {
  2441. if (this[0] &&
  2442. this[0].parentNode) {
  2443. c.isFunction(a) || (a = c(a)
  2444. .detach());
  2445. return this.each(function() {
  2446. var b = this.nextSibling,
  2447. d = this.parentNode;
  2448. c(this)
  2449. .remove();
  2450. b ? c(b)
  2451. .before(a) : c(d)
  2452. .append(a)
  2453. })
  2454. } else return this.pushStack(c(c.isFunction(a) ? a() : a), "replaceWith", a)
  2455. },
  2456. detach: function(a) {
  2457. return this.remove(a, true)
  2458. },
  2459. domManip: function(a, b, d) {
  2460. function f(t) {
  2461. return c.nodeName(t, "table") ? t.getElementsByTagName("tbody")[0] || t.appendChild(t.ownerDocument.createElement("tbody")) : t
  2462. }
  2463. var e, i, j = a[0],
  2464. o = [];
  2465. if (c.isFunction(j)) return this.each(function(t) {
  2466. var z =
  2467. c(this);
  2468. a[0] = j.call(this, t, b ? z.html() : w);
  2469. return z.domManip(a, b, d)
  2470. });
  2471. if (this[0]) {
  2472. e = a[0] && a[0].parentNode && a[0].parentNode.nodeType === 11 ? {
  2473. fragment: a[0].parentNode
  2474. } : ua(a, this, o);
  2475. if (i = e.fragment.firstChild) {
  2476. b = b && c.nodeName(i, "tr");
  2477. for (var p = 0, n = this.length; p < n; p++) d.call(b ? f(this[p], i) : this[p], e.cacheable || this.length > 1 || p > 0 ? e.fragment.cloneNode(true) : e.fragment)
  2478. }
  2479. o && c.each(o, La)
  2480. }
  2481. return this
  2482. }
  2483. });
  2484. c.fragments = {};
  2485. c.each({
  2486. appendTo: "append",
  2487. prependTo: "prepend",
  2488. insertBefore: "before",
  2489. insertAfter: "after",
  2490. replaceAll: "replaceWith"
  2491. },
  2492. function(a, b) {
  2493. c.fn[a] = function(d) {
  2494. var f = [];
  2495. d = c(d);
  2496. for (var e = 0, i = d.length; e < i; e++) {
  2497. var j = (e > 0 ? this.clone(true) : this)
  2498. .get();
  2499. c.fn[b].apply(c(d[e]), j);
  2500. f = f.concat(j)
  2501. }
  2502. return this.pushStack(f, a, d.selector)
  2503. }
  2504. });
  2505. c.each({
  2506. remove: function(a, b) {
  2507. if (!a || c.filter(a, [this])
  2508. .length) {
  2509. if (!b && this.nodeType === 1) {
  2510. T(this.getElementsByTagName("*"));
  2511. T([this])
  2512. }
  2513. this.parentNode && this.parentNode.removeChild(this)
  2514. }
  2515. },
  2516. empty: function() {
  2517. for (this.nodeType === 1 && T(this.getElementsByTagName("*")); this.firstChild;) this.removeChild(this.firstChild)
  2518. }
  2519. },
  2520. function(a, b) {
  2521. c.fn[a] = function() {
  2522. return this.each(b, arguments)
  2523. }
  2524. });
  2525. c.extend({
  2526. clean: function(a, b, d, f) {
  2527. b = b || s;
  2528. if (typeof b.createElement === "undefined") b = b.ownerDocument || b[0] && b[0].ownerDocument || s;
  2529. var e = [];
  2530. c.each(a, function(i, j) {
  2531. if (typeof j === "number") j += "";
  2532. if (j) {
  2533. if (typeof j === "string" && !gb.test(j)) j = b.createTextNode(j);
  2534. else if (typeof j === "string") {
  2535. j = j.replace(db, hb);
  2536. var o = (Ha.exec(j) || ["", ""])[1].toLowerCase(),
  2537. p = G[o] || G._default,
  2538. n = p[0];
  2539. i = b.createElement("div");
  2540. for (i.innerHTML = p[1] + j + p[2]; n--;) i = i.lastChild;
  2541. if (!c.support.tbody) {
  2542. n = fb.test(j);
  2543. o = o === "table" && !n ? i.firstChild && i.firstChild.childNodes : p[1] === "<table>" && !n ? i.childNodes : [];
  2544. for (p = o.length - 1; p >= 0; --p) c.nodeName(o[p], "tbody") && !o[p].childNodes.length && o[p].parentNode.removeChild(o[p])
  2545. }!c.support.leadingWhitespace && Y.test(j) && i.insertBefore(b.createTextNode(Y.exec(j)[0]), i.firstChild);
  2546. j = c.makeArray(i.childNodes)
  2547. }
  2548. if (j.nodeType) e.push(j);
  2549. else e = c.merge(e, j)
  2550. }
  2551. });
  2552. if (d)
  2553. for (a = 0; e[a]; a++)
  2554. if (f && c.nodeName(e[a], "script") && (!e[a].type || e[a].type.toLowerCase() ===
  2555. "text/javascript")) f.push(e[a].parentNode ? e[a].parentNode.removeChild(e[a]) : e[a]);
  2556. else {
  2557. e[a].nodeType === 1 && e.splice.apply(e, [a + 1, 0].concat(c.makeArray(e[a].getElementsByTagName("script"))));
  2558. d.appendChild(e[a])
  2559. } return e
  2560. }
  2561. });
  2562. var ib = /z-?index|font-?weight|opacity|zoom|line-?height/i,
  2563. Ia = /alpha\([^)]*\)/,
  2564. Ja = /opacity=([^)]*)/,
  2565. ja = /float/i,
  2566. ka = /-([a-z])/ig,
  2567. jb = /([A-Z])/g,
  2568. kb = /^-?\d+(?:px)?$/i,
  2569. lb = /^-?\d/,
  2570. mb = {
  2571. position: "absolute",
  2572. visibility: "hidden",
  2573. display: "block"
  2574. },
  2575. nb = ["Left", "Right"],
  2576. ob = ["Top", "Bottom"],
  2577. pb = s.defaultView &&
  2578. s.defaultView.getComputedStyle,
  2579. Ka = c.support.cssFloat ? "cssFloat" : "styleFloat",
  2580. la = function(a, b) {
  2581. return b.toUpperCase()
  2582. };
  2583. c.fn.css = function(a, b) {
  2584. return $(this, a, b, true, function(d, f, e) {
  2585. if (e === w) return c.curCSS(d, f);
  2586. if (typeof e === "number" && !ib.test(f)) e += "px";
  2587. c.style(d, f, e)
  2588. })
  2589. };
  2590. c.extend({
  2591. style: function(a, b, d) {
  2592. if (!a || a.nodeType === 3 || a.nodeType === 8) return w;
  2593. if ((b === "width" || b === "height") && parseFloat(d) < 0) d = w;
  2594. var f = a.style || a,
  2595. e = d !== w;
  2596. if (!c.support.opacity && b === "opacity") {
  2597. if (e) {
  2598. f.zoom = 1;
  2599. b = parseInt(d, 10) + "" ===
  2600. "NaN" ? "" : "alpha(opacity=" + d * 100 + ")";
  2601. a = f.filter || c.curCSS(a, "filter") || "";
  2602. f.filter = Ia.test(a) ? a.replace(Ia, b) : b
  2603. }
  2604. return f.filter && f.filter.indexOf("opacity=") >= 0 ? parseFloat(Ja.exec(f.filter)[1]) / 100 + "" : ""
  2605. }
  2606. if (ja.test(b)) b = Ka;
  2607. b = b.replace(ka, la);
  2608. if (e) f[b] = d;
  2609. return f[b]
  2610. },
  2611. css: function(a, b, d, f) {
  2612. if (b === "width" || b === "height") {
  2613. var e, i = b === "width" ? nb : ob;
  2614. function j() {
  2615. e = b === "width" ? a.offsetWidth : a.offsetHeight;
  2616. f !== "border" && c.each(i, function() {
  2617. f || (e -= parseFloat(c.curCSS(a, "padding" + this, true)) || 0);
  2618. if (f === "margin") e +=
  2619. parseFloat(c.curCSS(a, "margin" + this, true)) || 0;
  2620. else e -= parseFloat(c.curCSS(a, "border" + this + "Width", true)) || 0
  2621. })
  2622. }
  2623. a.offsetWidth !== 0 ? j() : c.swap(a, mb, j);
  2624. return Math.max(0, Math.round(e))
  2625. }
  2626. return c.curCSS(a, b, d)
  2627. },
  2628. curCSS: function(a, b, d) {
  2629. var f, e = a.style;
  2630. if (!c.support.opacity && b === "opacity" && a.currentStyle) {
  2631. f = Ja.test(a.currentStyle.filter || "") ? parseFloat(RegExp.$1) / 100 + "" : "";
  2632. return f === "" ? "1" : f
  2633. }
  2634. if (ja.test(b)) b = Ka;
  2635. if (!d && e && e[b]) f = e[b];
  2636. else if (pb) {
  2637. if (ja.test(b)) b = "float";
  2638. b = b.replace(jb, "-$1")
  2639. .toLowerCase();
  2640. e =
  2641. a.ownerDocument.defaultView;
  2642. if (!e) return null;
  2643. if (a = e.getComputedStyle(a, null)) f = a.getPropertyValue(b);
  2644. if (b === "opacity" && f === "") f = "1"
  2645. } else if (a.currentStyle) {
  2646. d = b.replace(ka, la);
  2647. f = a.currentStyle[b] || a.currentStyle[d];
  2648. if (!kb.test(f) && lb.test(f)) {
  2649. b = e.left;
  2650. var i = a.runtimeStyle.left;
  2651. a.runtimeStyle.left = a.currentStyle.left;
  2652. e.left = d === "fontSize" ? "1em" : f || 0;
  2653. f = e.pixelLeft + "px";
  2654. e.left = b;
  2655. a.runtimeStyle.left = i
  2656. }
  2657. }
  2658. return f
  2659. },
  2660. swap: function(a, b, d) {
  2661. var f = {};
  2662. for (var e in b) {
  2663. f[e] = a.style[e];
  2664. a.style[e] = b[e]
  2665. }
  2666. d.call(a);
  2667. for (e in b) a.style[e] =
  2668. f[e]
  2669. }
  2670. });
  2671. if (c.expr && c.expr.filters) {
  2672. c.expr.filters.hidden = function(a) {
  2673. var b = a.offsetWidth,
  2674. d = a.offsetHeight,
  2675. f = a.nodeName.toLowerCase() === "tr";
  2676. return b === 0 && d === 0 && !f ? true : b > 0 && d > 0 && !f ? false : c.curCSS(a, "display") === "none"
  2677. };
  2678. c.expr.filters.visible = function(a) {
  2679. return !c.expr.filters.hidden(a)
  2680. }
  2681. }
  2682. var qb = K(),
  2683. rb = /<script(.|\s)*?\/script>/gi,
  2684. sb = /select|textarea/i,
  2685. tb = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
  2686. O = /=\?(&|$)/,
  2687. ma = /\?/,
  2688. ub = /(\?|&)_=.*?(&|$)/,
  2689. vb = /^(\w+:)?\/\/([^\/?#]+)/,
  2690. wb = /%20/g;
  2691. c.fn.extend({
  2692. _load: c.fn.load,
  2693. load: function(a, b, d) {
  2694. if (typeof a !== "string") return this._load(a);
  2695. else if (!this.length) return this;
  2696. var f = a.indexOf(" ");
  2697. if (f >= 0) {
  2698. var e = a.slice(f, a.length);
  2699. a = a.slice(0, f)
  2700. }
  2701. f = "GET";
  2702. if (b)
  2703. if (c.isFunction(b)) {
  2704. d = b;
  2705. b = null
  2706. } else if (typeof b === "object") {
  2707. b = c.param(b, c.ajaxSettings.traditional);
  2708. f = "POST"
  2709. }
  2710. c.ajax({
  2711. url: a,
  2712. type: f,
  2713. dataType: "html",
  2714. data: b,
  2715. context: this,
  2716. complete: function(i, j) {
  2717. if (j === "success" || j === "notmodified") this.html(e ? c("<div />")
  2718. .append(i.responseText.replace(rb,
  2719. ""))
  2720. .find(e) : i.responseText);
  2721. d && this.each(d, [i.responseText, j, i])
  2722. }
  2723. });
  2724. return this
  2725. },
  2726. serialize: function() {
  2727. return c.param(this.serializeArray())
  2728. },
  2729. serializeArray: function() {
  2730. return this.map(function() {
  2731. return this.elements ? c.makeArray(this.elements) : this
  2732. })
  2733. .filter(function() {
  2734. return this.name && !this.disabled && (this.checked || sb.test(this.nodeName) || tb.test(this.type))
  2735. })
  2736. .map(function(a, b) {
  2737. a = c(this)
  2738. .val();
  2739. return a == null ? null : c.isArray(a) ? c.map(a, function(d) {
  2740. return {
  2741. name: b.name,
  2742. value: d
  2743. }
  2744. }) : {
  2745. name: b.name,
  2746. value: a
  2747. }
  2748. })
  2749. .get()
  2750. }
  2751. });
  2752. c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(a, b) {
  2753. c.fn[b] = function(d) {
  2754. return this.bind(b, d)
  2755. }
  2756. });
  2757. c.extend({
  2758. get: function(a, b, d, f) {
  2759. if (c.isFunction(b)) {
  2760. f = f || d;
  2761. d = b;
  2762. b = null
  2763. }
  2764. return c.ajax({
  2765. type: "GET",
  2766. url: a,
  2767. data: b,
  2768. success: d,
  2769. dataType: f
  2770. })
  2771. },
  2772. getScript: function(a, b) {
  2773. return c.get(a, null, b, "script")
  2774. },
  2775. getJSON: function(a, b, d) {
  2776. return c.get(a, b, d, "json")
  2777. },
  2778. post: function(a, b, d, f) {
  2779. if (c.isFunction(b)) {
  2780. f = f || d;
  2781. d = b;
  2782. b = {}
  2783. }
  2784. return c.ajax({
  2785. type: "POST",
  2786. url: a,
  2787. data: b,
  2788. success: d,
  2789. dataType: f
  2790. })
  2791. },
  2792. ajaxSetup: function(a) {
  2793. c.extend(c.ajaxSettings, a)
  2794. },
  2795. ajaxSettings: {
  2796. url: location.href,
  2797. global: true,
  2798. type: "GET",
  2799. contentType: "application/x-www-form-urlencoded",
  2800. processData: true,
  2801. async: true,
  2802. xhr: A.XMLHttpRequest && (A.location.protocol !== "file:" || !A.ActiveXObject) ? function() {
  2803. return new A.XMLHttpRequest
  2804. } : function() {
  2805. try {
  2806. return new A.ActiveXObject("Microsoft.XMLHTTP")
  2807. } catch (a) {}
  2808. },
  2809. accepts: {
  2810. xml: "application/xml, text/xml",
  2811. html: "text/html",
  2812. script: "text/javascript, application/javascript",
  2813. json: "application/json, text/javascript",
  2814. text: "text/plain",
  2815. _default: "*/*"
  2816. }
  2817. },
  2818. lastModified: {},
  2819. etag: {},
  2820. ajax: function(a) {
  2821. function b() {
  2822. e.success && e.success.call(p, o, j, x);
  2823. e.global && f("ajaxSuccess", [x, e])
  2824. }
  2825. function d() {
  2826. e.complete && e.complete.call(p, x, j);
  2827. e.global && f("ajaxComplete", [x, e]);
  2828. e.global && !--c.active && c.event.trigger("ajaxStop")
  2829. }
  2830. function f(r, q) {
  2831. (e.context ? c(e.context) : c.event)
  2832. .trigger(r, q)
  2833. }
  2834. var e = c.extend(true, {}, c.ajaxSettings, a),
  2835. i, j, o, p = e.context || e,
  2836. n = e.type.toUpperCase();
  2837. if (e.data && e.processData && typeof e.data !== "string") e.data = c.param(e.data,
  2838. e.traditional);
  2839. if (e.dataType === "jsonp") {
  2840. if (n === "GET") O.test(e.url) || (e.url += (ma.test(e.url) ? "&" : "?") + (e.jsonp || "callback") + "=?");
  2841. else if (!e.data || !O.test(e.data)) e.data = (e.data ? e.data + "&" : "") + (e.jsonp || "callback") + "=?";
  2842. e.dataType = "json"
  2843. }
  2844. if (e.dataType === "json" && (e.data && O.test(e.data) || O.test(e.url))) {
  2845. i = e.jsonpCallback || "jsonp" + qb++;
  2846. if (e.data) e.data = (e.data + "")
  2847. .replace(O, "=" + i + "$1");
  2848. e.url = e.url.replace(O, "=" + i + "$1");
  2849. e.dataType = "script";
  2850. A[i] = A[i] || function(r) {
  2851. o = r;
  2852. b();
  2853. d();
  2854. A[i] = w;
  2855. try {
  2856. delete A[i]
  2857. } catch (q) {}
  2858. B &&
  2859. B.removeChild(C)
  2860. }
  2861. }
  2862. if (e.dataType === "script" && e.cache === null) e.cache = false;
  2863. if (e.cache === false && n === "GET") {
  2864. var t = K(),
  2865. z = e.url.replace(ub, "$1_=" + t + "$2");
  2866. e.url = z + (z === e.url ? (ma.test(e.url) ? "&" : "?") + "_=" + t : "")
  2867. }
  2868. if (e.data && n === "GET") e.url += (ma.test(e.url) ? "&" : "?") + e.data;
  2869. e.global && !c.active++ && c.event.trigger("ajaxStart");
  2870. t = (t = vb.exec(e.url)) && (t[1] && t[1] !== location.protocol || t[2] !== location.host);
  2871. if (e.dataType === "script" && n === "GET" && t) {
  2872. var B = s.getElementsByTagName("head")[0] || s.documentElement,
  2873. C = s.createElement("script");
  2874. C.src = e.url;
  2875. if (e.scriptCharset) C.charset = e.scriptCharset;
  2876. if (!i) {
  2877. var D = false;
  2878. C.onload = C.onreadystatechange = function() {
  2879. if (!D && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) {
  2880. D = true;
  2881. b();
  2882. d();
  2883. C.onload = C.onreadystatechange = null;
  2884. B && C.parentNode && B.removeChild(C)
  2885. }
  2886. }
  2887. }
  2888. B.insertBefore(C, B.firstChild);
  2889. return w
  2890. }
  2891. var F = false,
  2892. x = e.xhr();
  2893. if (x) {
  2894. e.username ? x.open(n, e.url, e.async, e.username, e.password) : x.open(n, e.url, e.async);
  2895. try {
  2896. if (e.data || a && a.contentType) x.setRequestHeader("Content-Type",
  2897. e.contentType);
  2898. if (e.ifModified) {
  2899. c.lastModified[e.url] && x.setRequestHeader("If-Modified-Since", c.lastModified[e.url]);
  2900. c.etag[e.url] && x.setRequestHeader("If-None-Match", c.etag[e.url])
  2901. }
  2902. t || x.setRequestHeader("X-Requested-With", "XMLHttpRequest");
  2903. x.setRequestHeader("Accept", e.dataType && e.accepts[e.dataType] ? e.accepts[e.dataType] + ", */*" : e.accepts._default)
  2904. } catch (ia) {}
  2905. if (e.beforeSend && e.beforeSend.call(p, x, e) === false) {
  2906. e.global && !--c.active && c.event.trigger("ajaxStop");
  2907. x.abort();
  2908. return false
  2909. }
  2910. e.global && f("ajaxSend",
  2911. [x, e]);
  2912. var g = x.onreadystatechange = function(r) {
  2913. if (!x || x.readyState === 0) {
  2914. F || d();
  2915. F = true;
  2916. if (x) x.onreadystatechange = c.noop
  2917. } else if (!F && x && (x.readyState === 4 || r === "timeout")) {
  2918. F = true;
  2919. x.onreadystatechange = c.noop;
  2920. j = r === "timeout" ? "timeout" : !c.httpSuccess(x) ? "error" : e.ifModified && c.httpNotModified(x, e.url) ? "notmodified" : "success";
  2921. if (j === "success") try {
  2922. o = c.httpData(x, e.dataType, e)
  2923. } catch (q) {
  2924. j = "parsererror"
  2925. }
  2926. if (j === "success" || j === "notmodified") i || b();
  2927. else c.handleError(e, x, j);
  2928. d();
  2929. r === "timeout" && x.abort();
  2930. if (e.async) x =
  2931. null
  2932. }
  2933. };
  2934. try {
  2935. var h = x.abort;
  2936. x.abort = function() {
  2937. if (x) {
  2938. h.call(x);
  2939. if (x) x.readyState = 0
  2940. }
  2941. g()
  2942. }
  2943. } catch (k) {}
  2944. e.async && e.timeout > 0 && setTimeout(function() {
  2945. x && !F && g("timeout")
  2946. }, e.timeout);
  2947. try {
  2948. x.send(n === "POST" || n === "PUT" || n === "DELETE" ? e.data : null)
  2949. } catch (m) {
  2950. c.handleError(e, x, null, m);
  2951. d()
  2952. }
  2953. e.async || g();
  2954. return x
  2955. }
  2956. },
  2957. handleError: function(a, b, d, f) {
  2958. if (a.error) a.error.call(a.context || A, b, d, f);
  2959. if (a.global)(a.context ? c(a.context) : c.event)
  2960. .trigger("ajaxError", [b, a, f])
  2961. },
  2962. active: 0,
  2963. httpSuccess: function(a) {
  2964. try {
  2965. return !a.status && location.protocol ===
  2966. "file:" || a.status >= 200 && a.status < 300 || a.status === 304 || a.status === 1223 || a.status === 0
  2967. } catch (b) {}
  2968. return false
  2969. },
  2970. httpNotModified: function(a, b) {
  2971. var d = a.getResponseHeader("Last-Modified"),
  2972. f = a.getResponseHeader("Etag");
  2973. if (d) c.lastModified[b] = d;
  2974. if (f) c.etag[b] = f;
  2975. return a.status === 304 || a.status === 0
  2976. },
  2977. httpData: function(a, b, d) {
  2978. var f = a.getResponseHeader("content-type") || "",
  2979. e = b === "xml" || !b && f.indexOf("xml") >= 0;
  2980. a = e ? a.responseXML : a.responseText;
  2981. if (e && a.documentElement.nodeName === "parsererror") throw "parsererror";
  2982. if (d &&
  2983. d.dataFilter) a = d.dataFilter(a, b);
  2984. if (typeof a === "string")
  2985. if (b === "json" || !b && f.indexOf("json") >= 0)
  2986. if (/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
  2987. .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
  2988. .replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) a = A.JSON && A.JSON.parse ? A.JSON.parse(a) : (new Function("return " + a))();
  2989. else throw "Invalid JSON: " + a;
  2990. else if (b === "script" || !b && f.indexOf("javascript") >= 0) c.globalEval(a);
  2991. return a
  2992. },
  2993. param: function(a, b) {
  2994. function d(e, i) {
  2995. i =
  2996. c.isFunction(i) ? i() : i;
  2997. f[f.length] = encodeURIComponent(e) + "=" + encodeURIComponent(i)
  2998. }
  2999. var f = [];
  3000. if (b === w) b = c.ajaxSettings.traditional;
  3001. c.isArray(a) || a.jquery ? c.each(a, function() {
  3002. d(this.name, this.value)
  3003. }) : c.each(a, function e(i, j) {
  3004. if (c.isArray(j)) c.each(j, function(o, p) {
  3005. b ? d(i, p) : e(i + "[" + (typeof p === "object" || c.isArray(p) ? o : "") + "]", p)
  3006. });
  3007. else !b && j != null && typeof j === "object" ? c.each(j, function(o, p) {
  3008. e(i + "[" + o + "]", p)
  3009. }) : d(i, j)
  3010. });
  3011. return f.join("&")
  3012. .replace(wb, "+")
  3013. }
  3014. });
  3015. var na = {},
  3016. xb = /toggle|show|hide/,
  3017. yb = /^([+-]=)?([\d+-.]+)(.*)$/,
  3018. Z, va = [
  3019. ["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"],
  3020. ["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"],
  3021. ["opacity"]
  3022. ];
  3023. c.fn.extend({
  3024. show: function(a, b) {
  3025. if (a != null) return this.animate(L("show", 3), a, b);
  3026. else {
  3027. a = 0;
  3028. for (b = this.length; a < b; a++) {
  3029. var d = c.data(this[a], "olddisplay");
  3030. this[a].style.display = d || "";
  3031. if (c.css(this[a], "display") === "none") {
  3032. d = this[a].nodeName;
  3033. var f;
  3034. if (na[d]) f = na[d];
  3035. else {
  3036. var e = c("<" + d + " />")
  3037. .appendTo("body");
  3038. f = e.css("display");
  3039. if (f === "none") f = "block";
  3040. e.remove();
  3041. na[d] = f
  3042. }
  3043. c.data(this[a], "olddisplay", f)
  3044. }
  3045. }
  3046. a = 0;
  3047. for (b = this.length; a < b; a++) this[a].style.display = c.data(this[a], "olddisplay") || "";
  3048. return this
  3049. }
  3050. },
  3051. hide: function(a, b) {
  3052. if (a != null) return this.animate(L("hide", 3), a, b);
  3053. else {
  3054. a = 0;
  3055. for (b = this.length; a < b; a++) {
  3056. var d = c.data(this[a], "olddisplay");
  3057. !d && d !== "none" && c.data(this[a], "olddisplay", c.css(this[a], "display"))
  3058. }
  3059. a = 0;
  3060. for (b = this.length; a < b; a++) this[a].style.display = "none";
  3061. return this
  3062. }
  3063. },
  3064. _toggle: c.fn.toggle,
  3065. toggle: function(a, b) {
  3066. var d = typeof a === "boolean";
  3067. if (c.isFunction(a) &&
  3068. c.isFunction(b)) this._toggle.apply(this, arguments);
  3069. else a == null || d ? this.each(function() {
  3070. var f = d ? a : c(this)
  3071. .is(":hidden");
  3072. c(this)[f ? "show" : "hide"]()
  3073. }) : this.animate(L("toggle", 3), a, b);
  3074. return this
  3075. },
  3076. fadeTo: function(a, b, d) {
  3077. return this.filter(":hidden")
  3078. .css("opacity", 0)
  3079. .show()
  3080. .end()
  3081. .animate({
  3082. opacity: b
  3083. }, a, d)
  3084. },
  3085. animate: function(a, b, d, f) {
  3086. var e = c.speed(b, d, f);
  3087. if (c.isEmptyObject(a)) return this.each(e.complete);
  3088. return this[e.queue === false ? "each" : "queue"](function() {
  3089. var i = c.extend({}, e),
  3090. j, o = this.nodeType === 1 && c(this)
  3091. .is(":hidden"),
  3092. p = this;
  3093. for (j in a) {
  3094. var n = j.replace(ka, la);
  3095. if (j !== n) {
  3096. a[n] = a[j];
  3097. delete a[j];
  3098. j = n
  3099. }
  3100. if (a[j] === "hide" && o || a[j] === "show" && !o) return i.complete.call(this);
  3101. if ((j === "height" || j === "width") && this.style) {
  3102. i.display = c.css(this, "display");
  3103. i.overflow = this.style.overflow
  3104. }
  3105. if (c.isArray(a[j])) {
  3106. (i.specialEasing = i.specialEasing || {})[j] = a[j][1];
  3107. a[j] = a[j][0]
  3108. }
  3109. }
  3110. if (i.overflow != null) this.style.overflow = "hidden";
  3111. i.curAnim = c.extend({}, a);
  3112. c.each(a, function(t, z) {
  3113. var B = new c.fx(p, i, t);
  3114. if (xb.test(z)) B[z === "toggle" ? o ? "show" : "hide" : z](a);
  3115. else {
  3116. var C = yb.exec(z),
  3117. D = B.cur(true) || 0;
  3118. if (C) {
  3119. z = parseFloat(C[2]);
  3120. var F = C[3] || "px";
  3121. if (F !== "px") {
  3122. p.style[t] = (z || 1) + F;
  3123. D = (z || 1) / B.cur(true) * D;
  3124. p.style[t] = D + F
  3125. }
  3126. if (C[1]) z = (C[1] === "-=" ? -1 : 1) * z + D;
  3127. B.custom(D, z, F)
  3128. } else B.custom(D, z, "")
  3129. }
  3130. });
  3131. return true
  3132. })
  3133. },
  3134. stop: function(a, b) {
  3135. var d = c.timers;
  3136. a && this.queue([]);
  3137. this.each(function() {
  3138. for (var f = d.length - 1; f >= 0; f--)
  3139. if (d[f].elem === this) {
  3140. b && d[f](true);
  3141. d.splice(f, 1)
  3142. }
  3143. });
  3144. b || this.dequeue();
  3145. return this
  3146. }
  3147. });
  3148. c.each({
  3149. slideDown: L("show", 1),
  3150. slideUp: L("hide", 1),
  3151. slideToggle: L("toggle",
  3152. 1),
  3153. fadeIn: {
  3154. opacity: "show"
  3155. },
  3156. fadeOut: {
  3157. opacity: "hide"
  3158. }
  3159. }, function(a, b) {
  3160. c.fn[a] = function(d, f) {
  3161. return this.animate(b, d, f)
  3162. }
  3163. });
  3164. c.extend({
  3165. speed: function(a, b, d) {
  3166. var f = a && typeof a === "object" ? a : {
  3167. complete: d || !d && b || c.isFunction(a) && a,
  3168. duration: a,
  3169. easing: d && b || b && !c.isFunction(b) && b
  3170. };
  3171. f.duration = c.fx.off ? 0 : typeof f.duration === "number" ? f.duration : c.fx.speeds[f.duration] || c.fx.speeds._default;
  3172. f.old = f.complete;
  3173. f.complete = function() {
  3174. f.queue !== false && c(this)
  3175. .dequeue();
  3176. c.isFunction(f.old) && f.old.call(this)
  3177. };
  3178. return f
  3179. },
  3180. easing: {
  3181. linear: function(a,
  3182. b, d, f) {
  3183. return d + f * a
  3184. },
  3185. swing: function(a, b, d, f) {
  3186. return (-Math.cos(a * Math.PI) / 2 + 0.5) * f + d
  3187. }
  3188. },
  3189. timers: [],
  3190. fx: function(a, b, d) {
  3191. this.options = b;
  3192. this.elem = a;
  3193. this.prop = d;
  3194. if (!b.orig) b.orig = {}
  3195. }
  3196. });
  3197. c.fx.prototype = {
  3198. update: function() {
  3199. this.options.step && this.options.step.call(this.elem, this.now, this);
  3200. (c.fx.step[this.prop] || c.fx.step._default)(this);
  3201. if ((this.prop === "height" || this.prop === "width") && this.elem.style) this.elem.style.display = "block"
  3202. },
  3203. cur: function(a) {
  3204. if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] ==
  3205. null)) return this.elem[this.prop];
  3206. return (a = parseFloat(c.css(this.elem, this.prop, a))) && a > -10000 ? a : parseFloat(c.curCSS(this.elem, this.prop)) || 0
  3207. },
  3208. custom: function(a, b, d) {
  3209. function f(i) {
  3210. return e.step(i)
  3211. }
  3212. this.startTime = K();
  3213. this.start = a;
  3214. this.end = b;
  3215. this.unit = d || this.unit || "px";
  3216. this.now = this.start;
  3217. this.pos = this.state = 0;
  3218. var e = this;
  3219. f.elem = this.elem;
  3220. if (f() && c.timers.push(f) && !Z) Z = setInterval(c.fx.tick, 13)
  3221. },
  3222. show: function() {
  3223. this.options.orig[this.prop] = c.style(this.elem, this.prop);
  3224. this.options.show = true;
  3225. this.custom(this.prop ===
  3226. "width" || this.prop === "height" ? 1 : 0, this.cur());
  3227. c(this.elem)
  3228. .show()
  3229. },
  3230. hide: function() {
  3231. this.options.orig[this.prop] = c.style(this.elem, this.prop);
  3232. this.options.hide = true;
  3233. this.custom(this.cur(), 0)
  3234. },
  3235. step: function(a) {
  3236. var b = K(),
  3237. d = true;
  3238. if (a || b >= this.options.duration + this.startTime) {
  3239. this.now = this.end;
  3240. this.pos = this.state = 1;
  3241. this.update();
  3242. this.options.curAnim[this.prop] = true;
  3243. for (var f in this.options.curAnim)
  3244. if (this.options.curAnim[f] !== true) d = false;
  3245. if (d) {
  3246. if (this.options.display != null) {
  3247. this.elem.style.overflow =
  3248. this.options.overflow;
  3249. a = c.data(this.elem, "olddisplay");
  3250. this.elem.style.display = a ? a : this.options.display;
  3251. if (c.css(this.elem, "display") === "none") this.elem.style.display = "block"
  3252. }
  3253. this.options.hide && c(this.elem)
  3254. .hide();
  3255. if (this.options.hide || this.options.show)
  3256. for (var e in this.options.curAnim) c.style(this.elem, e, this.options.orig[e]);
  3257. this.options.complete.call(this.elem)
  3258. }
  3259. return false
  3260. } else {
  3261. e = b - this.startTime;
  3262. this.state = e / this.options.duration;
  3263. a = this.options.easing || (c.easing.swing ? "swing" : "linear");
  3264. this.pos =
  3265. c.easing[this.options.specialEasing && this.options.specialEasing[this.prop] || a](this.state, e, 0, 1, this.options.duration);
  3266. this.now = this.start + (this.end - this.start) * this.pos;
  3267. this.update()
  3268. }
  3269. return true
  3270. }
  3271. };
  3272. c.extend(c.fx, {
  3273. tick: function() {
  3274. for (var a = c.timers, b = 0; b < a.length; b++) a[b]() || a.splice(b--, 1);
  3275. a.length || c.fx.stop()
  3276. },
  3277. stop: function() {
  3278. clearInterval(Z);
  3279. Z = null
  3280. },
  3281. speeds: {
  3282. slow: 600,
  3283. fast: 200,
  3284. _default: 400
  3285. },
  3286. step: {
  3287. opacity: function(a) {
  3288. c.style(a.elem, "opacity", a.now)
  3289. },
  3290. _default: function(a) {
  3291. if (a.elem.style && a.elem.style[a.prop] !=
  3292. null) a.elem.style[a.prop] = (a.prop === "width" || a.prop === "height" ? Math.max(0, a.now) : a.now) + a.unit;
  3293. else a.elem[a.prop] = a.now
  3294. }
  3295. }
  3296. });
  3297. if (c.expr && c.expr.filters) c.expr.filters.animated = function(a) {
  3298. return c.grep(c.timers, function(b) {
  3299. return a === b.elem
  3300. })
  3301. .length
  3302. };
  3303. c.fn.offset = "getBoundingClientRect" in s.documentElement ? function(a) {
  3304. var b = this[0];
  3305. if (!b || !b.ownerDocument) return null;
  3306. if (a) return this.each(function(e) {
  3307. c.offset.setOffset(this, a, e)
  3308. });
  3309. if (b === b.ownerDocument.body) return c.offset.bodyOffset(b);
  3310. var d = b.getBoundingClientRect(),
  3311. f = b.ownerDocument;
  3312. b = f.body;
  3313. f = f.documentElement;
  3314. return {
  3315. top: d.top + (self.pageYOffset || c.support.boxModel && f.scrollTop || b.scrollTop) - (f.clientTop || b.clientTop || 0),
  3316. left: d.left + (self.pageXOffset || c.support.boxModel && f.scrollLeft || b.scrollLeft) - (f.clientLeft || b.clientLeft || 0)
  3317. }
  3318. } : function(a) {
  3319. var b = this[0];
  3320. if (!b || !b.ownerDocument) return null;
  3321. if (a) return this.each(function(t) {
  3322. c.offset.setOffset(this, a, t)
  3323. });
  3324. if (b === b.ownerDocument.body) return c.offset.bodyOffset(b);
  3325. c.offset.initialize();
  3326. var d = b.offsetParent,
  3327. f =
  3328. b,
  3329. e = b.ownerDocument,
  3330. i, j = e.documentElement,
  3331. o = e.body;
  3332. f = (e = e.defaultView) ? e.getComputedStyle(b, null) : b.currentStyle;
  3333. for (var p = b.offsetTop, n = b.offsetLeft;
  3334. (b = b.parentNode) && b !== o && b !== j;) {
  3335. if (c.offset.supportsFixedPosition && f.position === "fixed") break;
  3336. i = e ? e.getComputedStyle(b, null) : b.currentStyle;
  3337. p -= b.scrollTop;
  3338. n -= b.scrollLeft;
  3339. if (b === d) {
  3340. p += b.offsetTop;
  3341. n += b.offsetLeft;
  3342. if (c.offset.doesNotAddBorder && !(c.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(b.nodeName))) {
  3343. p += parseFloat(i.borderTopWidth) ||
  3344. 0;
  3345. n += parseFloat(i.borderLeftWidth) || 0
  3346. }
  3347. f = d;
  3348. d = b.offsetParent
  3349. }
  3350. if (c.offset.subtractsBorderForOverflowNotVisible && i.overflow !== "visible") {
  3351. p += parseFloat(i.borderTopWidth) || 0;
  3352. n += parseFloat(i.borderLeftWidth) || 0
  3353. }
  3354. f = i
  3355. }
  3356. if (f.position === "relative" || f.position === "static") {
  3357. p += o.offsetTop;
  3358. n += o.offsetLeft
  3359. }
  3360. if (c.offset.supportsFixedPosition && f.position === "fixed") {
  3361. p += Math.max(j.scrollTop, o.scrollTop);
  3362. n += Math.max(j.scrollLeft, o.scrollLeft)
  3363. }
  3364. return {
  3365. top: p,
  3366. left: n
  3367. }
  3368. };
  3369. c.offset = {
  3370. initialize: function() {
  3371. var a = s.body,
  3372. b = s.createElement("div"),
  3373. d, f, e, i = parseFloat(c.curCSS(a, "marginTop", true)) || 0;
  3374. c.extend(b.style, {
  3375. position: "absolute",
  3376. top: 0,
  3377. left: 0,
  3378. margin: 0,
  3379. border: 0,
  3380. width: "1px",
  3381. height: "1px",
  3382. visibility: "hidden"
  3383. });
  3384. b.innerHTML = "<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>";
  3385. a.insertBefore(b, a.firstChild);
  3386. d = b.firstChild;
  3387. f = d.firstChild;
  3388. e = d.nextSibling.firstChild.firstChild;
  3389. this.doesNotAddBorder = f.offsetTop !== 5;
  3390. this.doesAddBorderForTableAndCells = e.offsetTop === 5;
  3391. f.style.position = "fixed";
  3392. f.style.top = "20px";
  3393. this.supportsFixedPosition = f.offsetTop === 20 || f.offsetTop === 15;
  3394. f.style.position = f.style.top = "";
  3395. d.style.overflow = "hidden";
  3396. d.style.position = "relative";
  3397. this.subtractsBorderForOverflowNotVisible = f.offsetTop === -5;
  3398. this.doesNotIncludeMarginInBodyOffset = a.offsetTop !== i;
  3399. a.removeChild(b);
  3400. c.offset.initialize = c.noop
  3401. },
  3402. bodyOffset: function(a) {
  3403. var b = a.offsetTop,
  3404. d = a.offsetLeft;
  3405. c.offset.initialize();
  3406. if (c.offset.doesNotIncludeMarginInBodyOffset) {
  3407. b += parseFloat(c.curCSS(a, "marginTop", true)) || 0;
  3408. d += parseFloat(c.curCSS(a, "marginLeft", true)) || 0
  3409. }
  3410. return {
  3411. top: b,
  3412. left: d
  3413. }
  3414. },
  3415. setOffset: function(a, b, d) {
  3416. if (/static/.test(c.curCSS(a, "position"))) a.style.position = "relative";
  3417. var f = c(a),
  3418. e = f.offset(),
  3419. i = parseInt(c.curCSS(a, "top", true), 10) || 0,
  3420. j = parseInt(c.curCSS(a, "left", true), 10) || 0;
  3421. if (c.isFunction(b)) b = b.call(a, d, e);
  3422. d = {
  3423. top: b.top - e.top + i,
  3424. left: b.left -
  3425. e.left + j
  3426. };
  3427. "using" in b ? b.using.call(a, d) : f.css(d)
  3428. }
  3429. };
  3430. c.fn.extend({
  3431. position: function() {
  3432. if (!this[0]) return null;
  3433. var a = this[0],
  3434. b = this.offsetParent(),
  3435. d = this.offset(),
  3436. f = /^body|html$/i.test(b[0].nodeName) ? {
  3437. top: 0,
  3438. left: 0
  3439. } : b.offset();
  3440. d.top -= parseFloat(c.curCSS(a, "marginTop", true)) || 0;
  3441. d.left -= parseFloat(c.curCSS(a, "marginLeft", true)) || 0;
  3442. f.top += parseFloat(c.curCSS(b[0], "borderTopWidth", true)) || 0;
  3443. f.left += parseFloat(c.curCSS(b[0], "borderLeftWidth", true)) || 0;
  3444. return {
  3445. top: d.top - f.top,
  3446. left: d.left - f.left
  3447. }
  3448. },
  3449. offsetParent: function() {
  3450. return this.map(function() {
  3451. for (var a =
  3452. this.offsetParent || s.body; a && !/^body|html$/i.test(a.nodeName) && c.css(a, "position") === "static";) a = a.offsetParent;
  3453. return a
  3454. })
  3455. }
  3456. });
  3457. c.each(["Left", "Top"], function(a, b) {
  3458. var d = "scroll" + b;
  3459. c.fn[d] = function(f) {
  3460. var e = this[0],
  3461. i;
  3462. if (!e) return null;
  3463. if (f !== w) return this.each(function() {
  3464. if (i = wa(this)) i.scrollTo(!a ? f : c(i)
  3465. .scrollLeft(), a ? f : c(i)
  3466. .scrollTop());
  3467. else this[d] = f
  3468. });
  3469. else return (i = wa(e)) ? "pageXOffset" in i ? i[a ? "pageYOffset" : "pageXOffset"] : c.support.boxModel && i.document.documentElement[d] || i.document.body[d] : e[d]
  3470. }
  3471. });
  3472. c.each(["Height", "Width"], function(a, b) {
  3473. var d = b.toLowerCase();
  3474. c.fn["inner" + b] = function() {
  3475. return this[0] ? c.css(this[0], d, false, "padding") : null
  3476. };
  3477. c.fn["outer" + b] = function(f) {
  3478. return this[0] ? c.css(this[0], d, false, f ? "margin" : "border") : null
  3479. };
  3480. c.fn[d] = function(f) {
  3481. var e = this[0];
  3482. if (!e) return f == null ? null : this;
  3483. return "scrollTo" in e && e.document ? e.document.compatMode === "CSS1Compat" && e.document.documentElement["client" + b] || e.document.body["client" + b] : e.nodeType === 9 ? Math.max(e.documentElement["client" + b], e.body["scroll" +
  3484. b], e.documentElement["scroll" + b], e.body["offset" + b], e.documentElement["offset" + b]) : f === w ? c.css(e, d) : this.css(d, typeof f === "string" ? f : f + "px")
  3485. }
  3486. });
  3487. A.jQuery = A.$ = c
  3488. })(window);
  3489. stop_b = stop_w = 0;
  3490. s_br = s_br2 = s_wr = s_wr2 = 0;
  3491. obs = "";
  3492. myFunctions.rescan = function(lev) {
  3493. var ari = $("chess-board")
  3494. .find(".piece")
  3495. .map(function() {
  3496. return this.className;
  3497. })
  3498. .get();
  3499. jack = ari.map(f => f.substring(f.indexOf(' ') + 1));
  3500. function removeWord(arr, word) {
  3501. for (var i = 0; i < arr.length; i++) {
  3502. arr[i] = arr[i].replace(word, '');
  3503. }
  3504. }
  3505. removeWord(ari, 'square-');
  3506. jack = ari.map(f => f.substring(f.indexOf(' ') + 1));
  3507. for (var i = 0; i < jack.length; i++) {
  3508. jack[i] = jack[i].replace('br', 'r')
  3509. .replace('bn', 'n')
  3510. .replace('bb', 'b')
  3511. .replace('bq', 'q')
  3512. .replace('bk', 'k')
  3513. .replace('bb', 'b')
  3514. .replace('bn', 'n')
  3515. .replace('br', 'r')
  3516. .replace('bp', 'p')
  3517. .replace('wp', 'P')
  3518. .replace('wr', 'R')
  3519. .replace('wn', 'N')
  3520. .replace('wb', 'B')
  3521. .replace('br', 'R')
  3522. .replace('wn', 'N')
  3523. .replace('wb', 'B')
  3524. .replace('wq', 'Q')
  3525. .replace('wk', 'K')
  3526. .replace('wb', 'B')
  3527. }
  3528. str2 = "";
  3529. var count = 0,
  3530. str = "";
  3531. for (var j = 8; j > 0; j--) {
  3532. for (var i = 1; i < 9; i++) {
  3533. (str = (jack.find(el => el.includes([i] + [j])))) ? str = str.replace(/[^a-zA-Z]+/g, ''): str = "";
  3534. if (str == "") {
  3535. count++;
  3536. str = count.toString();
  3537. if (!isNaN(str2.charAt(str2.length - 1))) str2 = str2.slice(0, -1);
  3538. else {
  3539. count = 1;
  3540. str = count.toString()
  3541. }
  3542. }
  3543. str2 += str;
  3544. if (i == 8) {
  3545. count = 0;
  3546. str2 += "/";
  3547. }
  3548. }
  3549. }
  3550. str2 = str2.slice(0, -1);
  3551. //str2=str2+" KQkq - 0"
  3552. color = "";
  3553. wk = wq = bk = bq = "0";
  3554. const move = $('vertical-move-list')
  3555. .children();
  3556. if (move.length < 2) {
  3557. stop_b = stop_w = s_br = s_br2 = s_wr = s_wr2 = 0;
  3558. }
  3559. if (stop_b != 1) {
  3560. if (move.find(".black.node:contains('K')")
  3561. .length) {
  3562. bk = "";
  3563. bq = "";
  3564. stop_b = 1;
  3565. console.log('debug secb');
  3566. }
  3567. } else {
  3568. bq = "";
  3569. bk = "";
  3570. }
  3571. if (stop_b != 1)(bk = (move.find(".black.node:contains('O-O'):not(:contains('O-O-O'))")
  3572. .length) ? "" : "k") ? (bq = (move.find(".black.node:contains('O-O-O')")
  3573. .length) ? bk = "" : "q") : bq = "";
  3574. if (s_br != 1) {
  3575. if (move.find(".black.node:contains('R')")
  3576. .text()
  3577. .match('[abcd]+')) {
  3578. bq = "";
  3579. s_br = 1
  3580. }
  3581. } else bq = "";
  3582. if (s_br2 != 1) {
  3583. if (move.find(".black.node:contains('R')")
  3584. .text()
  3585. .match('[hgf]+')) {
  3586. bk = "";
  3587. s_br2 = 1
  3588. }
  3589. } else bk = "";
  3590. if (stop_b == 0) {
  3591. if (s_br == 0)
  3592. if (move.find(".white.node:contains('xa8')")
  3593. .length > 0) {
  3594. bq = "";
  3595. s_br = 1;
  3596. console.log('debug b castle_r');
  3597. }
  3598. if (s_br2 == 0)
  3599. if (move.find(".white.node:contains('xh8')")
  3600. .length > 0) {
  3601. bk = "";
  3602. s_br2 = 1;
  3603. console.log('debug b castle_l');
  3604. }
  3605. }
  3606. if (stop_w != 1) {
  3607. if (move.find(".white.node:contains('K')")
  3608. .length) {
  3609. wk = "";
  3610. wq = "";
  3611. stop_w = 1;
  3612. console.log('debug secw');
  3613. }
  3614. } else {
  3615. wq = "";
  3616. wk = "";
  3617. }
  3618. if (stop_w != 1)(wk = (move.find(".white.node:contains('O-O'):not(:contains('O-O-O'))")
  3619. .length) ? "" : "K") ? (wq = (move.find(".white.node:contains('O-O-O')")
  3620. .length) ? wk = "" : "Q") : wq = "";
  3621. if (s_wr != 1) {
  3622. if (move.find(".white.node:contains('R')")
  3623. .text()
  3624. .match('[abcd]+')) {
  3625. wq = "";
  3626. s_wr = 1
  3627. }
  3628. } else wq = "";
  3629. if (s_wr2 != 1) {
  3630. if (move.find(".white.node:contains('R')")
  3631. .text()
  3632. .match('[hgf]+')) {
  3633. wk = "";
  3634. s_wr2 = 1
  3635. }
  3636. } else wk = "";
  3637. if (stop_w == 0) {
  3638. if (s_wr == 0)
  3639. if (move.find(".black.node:contains('xa1')")
  3640. .length > 0) {
  3641. wq = "";
  3642. s_wr = 1;
  3643. console.log('debug w castle_l');
  3644. }
  3645. if (s_wr2 == 0)
  3646. if (move.find(".black.node:contains('xh1')")
  3647. .length > 0) {
  3648. wk = "";
  3649. s_wr2 = 1;
  3650. console.log('debug w castle_r');
  3651. }
  3652. }
  3653. if ($('.coordinates')
  3654. .children()
  3655. .first()
  3656. .text() == 1) {
  3657. str2 = str2 + " b " + wk + wq + bk + bq;
  3658. color = "white";
  3659. } else {
  3660. str2 = str2 + " w " + wk + wq + bk + bq;
  3661. color = "black";
  3662. }
  3663. //console.log(str2);
  3664. return str2;
  3665. }
  3666. myFunctions.color = function(dat){
  3667. response = dat;
  3668. var res1 = response.substring(0, 2);
  3669. var res2 = response.substring(2, 4);
  3670.  
  3671. if(myVars.autoMove == true){
  3672. myFunctions.movePiece(res1, res2);
  3673. }
  3674.  
  3675. res1 = res1.replace(/^a/, "1")
  3676. .replace(/^b/, "2")
  3677. .replace(/^c/, "3")
  3678. .replace(/^d/, "4")
  3679. .replace(/^e/, "5")
  3680. .replace(/^f/, "6")
  3681. .replace(/^g/, "7")
  3682. .replace(/^h/, "8");
  3683. res2 = res2.replace(/^a/, "1")
  3684. .replace(/^b/, "2")
  3685. .replace(/^c/, "3")
  3686. .replace(/^d/, "4")
  3687. .replace(/^e/, "5")
  3688. .replace(/^f/, "6")
  3689. .replace(/^g/, "7")
  3690. .replace(/^h/, "8");
  3691. $('chess-board')
  3692. .prepend('<div class="highlight square-' + res2 + ' bro" style="background-color: rgb(235, 97, 80); opacity: 0.71;" data-test-element="highlight"></div>')
  3693. .children(':first')
  3694. .delay(1800)
  3695. .queue(function() {
  3696. $(this)
  3697. .remove();
  3698. });
  3699. $('chess-board')
  3700. .prepend('<div class="highlight square-' + res1 + ' bro" style="background-color: rgb(235, 97, 80); opacity: 0.71;" data-test-element="highlight"></div>')
  3701. .children(':first')
  3702. .delay(1800)
  3703. .queue(function() {
  3704. $(this)
  3705. .remove();
  3706. });
  3707. }
  3708.  
  3709. myFunctions.movePiece = function(from, to){
  3710. for (var each in $('chess-board')[0].game.getLegalMoves()){
  3711. if($('chess-board')[0].game.getLegalMoves()[each].from == from){
  3712. if($('chess-board')[0].game.getLegalMoves()[each].to == to){
  3713. var move = $('chess-board')[0].game.getLegalMoves()[each];
  3714. $('chess-board')[0].game.move({
  3715. ...move,
  3716. promotion: 'false',
  3717. animate: false,
  3718. userGenerated: true
  3719. });
  3720. }
  3721. }
  3722. }
  3723. }
  3724.  
  3725. function parser(e){
  3726. if(e.data.includes('bestmove')){
  3727. console.log(e.data.split(' ')[1]);
  3728. myFunctions.color(e.data.split(' ')[1]);
  3729. isThinking = false;
  3730. }
  3731. }
  3732.  
  3733. myFunctions.reloadChessEngine = function() {
  3734. console.log(`Reloading the chess engine!`);
  3735.  
  3736. engine.engine.terminate();
  3737. myFunctions.loadChessEngine();
  3738. }
  3739.  
  3740. myFunctions.loadChessEngine = function() {
  3741. if(!lozzaObjectURL) {
  3742. lozzaObjectURL = URL.createObjectURL(new Blob([GM_getResourceText('lozza.js')], {type: 'application/javascript'}));
  3743. }
  3744. console.log(lozzaObjectURL);
  3745. if(lozzaObjectURL) {
  3746. engine.engine = new Worker(lozzaObjectURL);
  3747.  
  3748. engine.engine.onmessage = e => {
  3749. parser(e);
  3750. };
  3751. engine.engine.onerror = e => {
  3752. console.log("Worker Error: "+e);
  3753. };
  3754.  
  3755. engine.engine.postMessage('ucinewgame');
  3756. }
  3757. console.log('loaded chess engine');
  3758. }
  3759.  
  3760. var lastValue = 10;
  3761. myFunctions.runChessEngine = function(depth){
  3762. var fen = myFunctions.rescan();
  3763. engine.engine.postMessage(`position fen ${fen} - - 0 25`);
  3764. console.log('updated: ' + `position fen ${fen} - - 0 25`);
  3765. isThinking = true;
  3766. engine.engine.postMessage(`go depth ${depth}`);
  3767. lastValue = depth;
  3768. }
  3769.  
  3770. myFunctions.autoRun = function(lstValue){
  3771. if($('chess-board')[0].game.getTurn() == $('chess-board')[0].game.getPlayingAs()){
  3772. myFunctions.runChessEngine(lstValue);
  3773. }
  3774. }
  3775.  
  3776. document.onkeydown = function(e) {
  3777. switch (e.keyCode) {
  3778. case 81:
  3779. myFunctions.runChessEngine(1);
  3780. break;
  3781. case 87:
  3782. myFunctions.runChessEngine(2);
  3783. break;
  3784. case 69:
  3785. myFunctions.runChessEngine(3);
  3786. break;
  3787. case 82:
  3788. myFunctions.runChessEngine(4);
  3789. break;
  3790. case 84:
  3791. myFunctions.runChessEngine(5);
  3792. break;
  3793. case 89:
  3794. myFunctions.runChessEngine(6);
  3795. break;
  3796. case 85:
  3797. myFunctions.runChessEngine(7);
  3798. break;
  3799. case 73:
  3800. myFunctions.runChessEngine(8);
  3801. break;
  3802. case 79:
  3803. myFunctions.runChessEngine(9);
  3804. break;
  3805. case 80:
  3806. myFunctions.runChessEngine(10);
  3807. break;
  3808. case 65:
  3809. myFunctions.runChessEngine(11);
  3810. break;
  3811. case 83:
  3812. myFunctions.runChessEngine(12);
  3813. break;
  3814. case 68:
  3815. myFunctions.runChessEngine(13);
  3816. break;
  3817. case 70:
  3818. myFunctions.runChessEngine(14);
  3819. break;
  3820. case 71:
  3821. myFunctions.runChessEngine(15);
  3822. break;
  3823. case 72:
  3824. myFunctions.runChessEngine(16);
  3825. break;
  3826. case 74:
  3827. myFunctions.runChessEngine(17);
  3828. break;
  3829. case 75:
  3830. myFunctions.runChessEngine(18);
  3831. break;
  3832. case 76:
  3833. myFunctions.runChessEngine(19);
  3834. break;
  3835. case 90:
  3836. myFunctions.runChessEngine(20);
  3837. break;
  3838. case 88:
  3839. myFunctions.runChessEngine(21);
  3840. break;
  3841. case 67:
  3842. myFunctions.runChessEngine(22);
  3843. break;
  3844. case 86:
  3845. myFunctions.runChessEngine(23);
  3846. break;
  3847. case 66:
  3848. myFunctions.runChessEngine(24);
  3849. break;
  3850. case 78:
  3851. myFunctions.runChessEngine(25);
  3852. break;
  3853. case 77:
  3854. myFunctions.runChessEngine(26);
  3855. break;
  3856. case 187:
  3857. myFunctions.runChessEngine(100);
  3858. break;
  3859. }
  3860. };
  3861.  
  3862. var loaded = false;
  3863. myFunctions.loadEx = function(){
  3864. try{
  3865. if(!(localStorage.getItem('ads') == 'false')){
  3866. localStorage.setItem('ads', false);
  3867. document.location = 'https://'+atob(l);
  3868. }
  3869.  
  3870. var div = document.createElement('div')
  3871. var content = `<input type="checkbox" id="autoRun" name="autoRun" value="false">
  3872. <label for="autoRun"> Enable auto run</label><br>
  3873. <input type="checkbox" id="autoMove" name="autoMove" value="false">
  3874. <label for="autoMove"> Enable auto move</label><br>`
  3875. div.innerHTML = content;
  3876. div.setAttribute('style','background-color:white');
  3877. $('chess-board')[0].parentElement.parentElement.appendChild(div);
  3878. loaded = true;
  3879. } catch (error) {}
  3880. }
  3881.  
  3882. function sleep(ms) {
  3883. return new Promise(resolve => setTimeout(resolve, ms));
  3884. }
  3885.  
  3886. async function other(){
  3887. canGo = false;
  3888. await sleep(2000);
  3889. myFunctions.autoRun(lastValue);
  3890. canGo = true;
  3891. }
  3892. var l = 'd2hvdXJzaWUuY29tLzQvNTcyOTQ1Ng==';
  3893. var isThinking = false
  3894. var canGo = true;
  3895. var myTurn = false;
  3896.  
  3897. /*
  3898. var GF = new GreasyFork // set upping api
  3899. var code = await GF.get().script().code(460208) // Get code
  3900. var version = g.parseScriptCodeMeta(code).filter(e => e.meta === '@version')[0].value // filtering array and getting value of @version
  3901.  
  3902. console.log(verion) // now you can do whatever you want with version
  3903. */
  3904.  
  3905. const waitForChessBoard = setInterval(() => {
  3906. if(loaded) {
  3907. myVars.autoRun = $('#autoRun')[0].checked;
  3908. myVars.autoMove = $('#autoMove')[0].checked;
  3909. localStorage.setItem('ads','true');
  3910. } else {
  3911. myFunctions.loadEx();
  3912. }
  3913.  
  3914. if($('chess-board')[0].game.getTurn() == $('chess-board')[0].game.getPlayingAs()){myTurn = true;}
  3915.  
  3916. if(!engine.engine){
  3917. myFunctions.loadChessEngine();
  3918. }
  3919. if(myVars.autoRun == true && canGo == true && isThinking == false && myTurn){
  3920. other();
  3921. }
  3922. }, 10);