· 9 years ago · Jan 21, 2017, 07:26 PM
1 </script>
2
3</head>
4
5<body class="
6 dark-theme fixed"
7 data-dnsme-update-flag="">
8
9
10
11
12
13
14<div class="body-wrap-2"><div class="body-wrap-3">
15
16
17
18<div id="page">
19 <div class="page-outer-left"><!-- --></div>
20 <div class="page-outer-right"><!-- --></div>
21 <div id="page-wrap">
22 <div class="fixed_height_elem" id="above-site"><!-- --></div>
23 <div id="site-body">
24
25 <div class="fixed_height_elem"><table class="section-collection"><tr class="top">
26 <td class="section-border"><div class="decorator-box"></div></td>
27 <td id="section-header"
28 class="section-holder section-width-large"
29 style=""
30 data-width="1030"
31 >
32 <div class="section">
33<div id='enjin-bar'>
34
35 <div class='right'>
36
37
38 <!-- Login / Register -->
39 <a href="/login" rel="nofollow">Login</a>
40 <span class='divider'>|</span><a href='/login/do/register' rel='nofollow'>Register</a>
41
42
43 </div>
44
45 <div class='left'>
46
47 <!-- Site name -->
48 <a href='/'></a>
49
50 <!-- Voice -->
51
52 <!-- Site info -->
53 <span class='divider'>|</span><a href='/page/207770'>Site Info</a>
54 <!-- Admin dropdown / Upgrade site -->
55
56 <!-- Social -->
57 <div id='enjin-bar-likes'>
58
59 <!-- Enjin forums / All other websites -->
60 <span class="fb-like-site"><fb:like href="http://www.facebook.com/" send="false" layout="button_count" width="100" show_faces="false"></fb:like></span><span class="gplus-like-site"><g:plusone size="medium" href=""></g:plusone></span><a href="https://twitter.com/d7craft" class="twitter-follow-button" data-show-count="true"></a><a href="" class="twitter-share-button twitter-like-site" data-url=""></a> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
61
62 <!-- Site likes -->
63
64 </div>
65
66 </div>
67</div> <div class=" container_spacer last">
68 <div class="left"><!-- --></div>
69 <div class="right"><!-- --></div>
70 <div class="middle"><!-- --></div>
71 </div>
72 <div class='clearing'><!-- --></div>
73 </div><!-- .section -->
74 </td>
75 <td class="section-border"><div class="decorator-box"></div></td>
76 </tr>
77</table><!-- .section-collection -->
78</div><!-- -->
79 <div class=""><table class="section-collection"><tr class="top">
80 <td class="section-border"><div class="decorator-box"></div></td>
81 <td id="section-main"
82 class="section-holder section-width-large"
83 style=""
84 data-width="1030"
85 >
86 <div class="section"> <div class="fixed_height_elem container_spacer first">
87 <div class="left"><!-- --></div>
88 <div class="right"><!-- --></div>
89 </div><div class='clearing'><!-- --></div>
90
91 <div class="special_container first last"><div class='m_html' style='padding: 0px; margin-bottom: -1px;'><style type="text/css">@charset "utf-8";
92@import url(http://fonts.googleapis.com/css?family=Lato:300,400,700);
93
94@font-face {
95 font-family: 'codropsicons';
96 src:url('../fonts/codropsicons/codropsicons.eot');
97 src:url('../fonts/codropsicons/codropsicons.eot?#iefix') format('embedded-opentype'),
98 url('../fonts/codropsicons/codropsicons.woff') format('woff'),
99 url('../fonts/codropsicons/codropsicons.ttf') format('truetype'),
100 url('../fonts/codropsicons/codropsicons.svg#codropsicons') format('svg');
101 font-weight: normal;
102 font-style: normal;
103}
104
105*, *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
106body, html { font-size: 15px; padding: 0; margin: 0; height: 100%;}
107
108/* Clearfix hack */
109.clearfix:before, .clearfix:after { content: " "; display: table; }
110.clearfix:after { clear: both; }
111
112body {
113 font-family: 'Lato', sans-serif;
114 color: #89867e;
115 background: #29333a;
116}
117
118a {
119 color: #333;
120 text-decoration: none;
121}
122
123a:hover {
124 color: #fff;
125}
126
127form, .section-header:hover>div {
128 display: none;
129}
130
131.section-header:hover>form {
132 display: none;
133}
134
135form, .enjin-bar:hover>div {
136 display: none;
137}
138
139.enjin-bar:hover>form {
140 display: none;
141}
142
143#enjin-bar .left {display: none;}
144#enjin-bar .right {display: none;}
145#page-footer .left {display: none;}
146#enjin-tray {display: none;}
147#buttons {display: none;}
148#enjin-tray-messaging {display: none;}
149#site-announcements {display: none;}
150#announcement-popup {display: none;}
151#announcement-canvas-separator {display: none;}
152
153.main {
154 max-width: 1200px;
155 height: 100%;
156 margin: 0 auto;
157 position: fixed;
158}
159
160
161.logo {
162 background-image: url("https://img0bm.b8cdn.com/images/logo/24/1579424_logo_1395154978.png");
163 position: fixed;
164 top: 61%;
165 left: 75%;
166 width: 123px;
167 height: 120px;
168 margin-left: -388px;
169 margin-top: -290px;
170 z-index: 200;
171}
172
173.container {
174 position: fixed;
175
176 min-width: 100%;
177 height: 100%;
178 overflow: visible;
179 z-index: 50;
180 -webkit-transition: all .6s ease-in-out;
181 -moz-transition: all .6s ease-in-out;
182 -o-transition: all .6s ease-in-out;
183 -ms-transition: all .6s ease-in-out;
184 transition: all .6s ease-in-out;
185 width: 100%;
186}
187
188.containerhover {
189 background: 0;
190 -webkit-transition: all .6s ease-in-out .2s;
191 -moz-transition: all .6s ease-in-out .2s;
192 -o-transition: all .6s ease-in-out .2s;
193 -ms-transition: all .6s ease-in-out .2s;
194 transition: all .6s ease-in-out .2s;
195}
196
197.containerdots {
198 background-image: url("http://files.enjin.com/207770/directimg/dots.png");
199 position: fixed;
200 top: 0;
201 left: 0;
202 min-width: 100%;
203 height: 100%;
204 overflow: visible;
205 z-index: 40;
206}
207
208.containerbg {
209 position: fixed;
210 top: 0;
211 left: 0;
212 min-width: 100%;
213 height: 100%;
214 overflow: visible;
215 z-index: 30;
216}
217
218.hoverbackground {
219 background-position: center top;
220 opacity: 0.0;
221 filter: alpha(opacity=0); /* For IE8 and earlier */
222 position: fixed;
223 top: 0;
224 left: 0;
225 min-width: 100%;
226 height: 100%;
227 overflow: visible;
228 z-index: 30;
229 -webkit-transition: all .6s ease-in-out, background-position .1s ease-in .6s;
230 -moz-transition: all .6s ease-in-out, background-position .1s ease-in .6s;
231 -o-transition: all .6s ease-in-out, background-position .1s ease-in .6s;
232 -ms-transition: all .6s ease-in-out, background-position .1s ease-in .6s;
233 transition: all .6s ease-in-out, background-position .1s ease-in .6s;
234}
235
236.hoverbackground1 {
237 background-image: url("https://arma3.com/assets/img/wallpapers/apex/1/Arma-3-Apex_wallpaper_1920x1200.jpg");
238}
239
240.hoverbackground2 {
241 background: center top url("https://arma3.com/assets/img/wallpapers/apex/1/Arma-3-Apex_wallpaper_1920x1200.jpg");
242}
243
244.hoverbackground3 {
245 background: center top url("http://www.dayztv.com/wp-content/uploads/2014/01/dayz-standalone-wallpaper-1.jpg");
246}
247
248.hoverbackground4 {
249 background: center top url("https://analogaddiction.files.wordpress.com/2013/12/arma-3-screenshot-wy-55-hellcat.jpg");
250}
251
252.hoverbackground5 {
253 background: center top url("http://www.dayztv.com/wp-content/uploads/2014/01/dayz-standalone-wallpaper-1.jpg");
254}
255
256.hoverbackground6 {
257 background: center top url("https://analogaddiction.files.wordpress.com/2013/12/arma-3-screenshot-wy-55-hellcat.jpg");
258}
259
260.hoverbackgroundEasterEgg {
261 background: center top url("http://www.dayztv.com/wp-content/uploads/2014/01/dayz-standalone-wallpaper-1.jpg");
262}
263
264
265.hoverbackground1h {
266 background-position: center bottom;
267 opacity: 1.0;
268 filter: alpha(opacity=100); /* For IE8 and earlier */
269 -webkit-transition: all .6s ease-in-out, background-position 4s ease-out;
270 -moz-transition: all .6s ease-in-out, background-position 4s ease-out;
271 -o-transition: all .6s ease-in-out, background-position 4s ease-out;
272 -ms-transition: all .6s ease-in-out, background-position 4s ease-out;
273 transition: all .6s ease-in-out, background-position 4s ease-out;
274}
275
276.hoverbackground2h {
277 background-position: center bottom;
278 opacity: 1.0;
279 filter: alpha(opacity=100); /* For IE8 and earlier */
280 -webkit-transition: all .6s ease-in-out, background-position 4s ease-out;
281 -moz-transition: all .6s ease-in-out, background-position 4s ease-out;
282 -o-transition: all .6s ease-in-out, background-position 4s ease-out;
283 -ms-transition: all .6s ease-in-out, background-position 4s ease-out;
284 transition: all .6s ease-in-out, background-position 4s ease-out;
285}
286
287.hoverbackground3h {
288 background-position: center bottom;
289 opacity: 1.0;
290 filter: alpha(opacity=100); /* For IE8 and earlier */
291 -webkit-transition: all .6s ease-in-out, background-position 4s ease-out;
292 -moz-transition: all .6s ease-in-out, background-position 4s ease-out;
293 -o-transition: all .6s ease-in-out, background-position 4s ease-out;
294 -ms-transition: all .6s ease-in-out, background-position 4s ease-out;
295 transition: all .6s ease-in-out, background-position 4s ease-out;
296}
297.hoverbackground4h {
298 background-position: center bottom;
299 opacity: 1.0;
300 filter: alpha(opacity=100); /* For IE8 and earlier */
301 -webkit-transition: all .6s ease-in-out, background-position 4s ease-out;
302 -moz-transition: all .6s ease-in-out, background-position 4s ease-out;
303 -o-transition: all .6s ease-in-out, background-position 4s ease-out;
304 -ms-transition: all .6s ease-in-out, background-position 4s ease-out;
305 transition: all .6s ease-in-out, background-position 4s ease-out;
306}
307.hoverbackground5h {
308 background-position: center bottom;
309 opacity: 1.0;
310 filter: alpha(opacity=100); /* For IE8 and earlier */
311 -webkit-transition: all .6s ease-in-out, background-position 4s ease-out;
312 -moz-transition: all .6s ease-in-out, background-position 4s ease-out;
313 -o-transition: all .6s ease-in-out, background-position 4s ease-out;
314 -ms-transition: all .6s ease-in-out, background-position 4s ease-out;
315 transition: all .6s ease-in-out, background-position 4s ease-out;
316}
317.hoverbackground6h {
318 background-position: center bottom;
319 opacity: 1.0;
320 filter: alpha(opacity=100); /* For IE8 and earlier */
321 -webkit-transition: all .6s ease-in-out, background-position 4s ease-out;
322 -moz-transition: all .6s ease-in-out, background-position 4s ease-out;
323 -o-transition: all .6s ease-in-out, background-position 4s ease-out;
324 -ms-transition: all .6s ease-in-out, background-position 4s ease-out;
325 transition: all .6s ease-in-out, background-position 4s ease-out;
326}
327
328.hoverbackgroundEasterEggh {
329 background-position: center bottom;
330 overflow: hidden;
331 opacity: 1.0;
332 filter: alpha(opacity=100); /* For IE8 and earlier */
333 -webkit-transition: all .6s ease-in-out, background-position 4s ease-out;
334 -moz-transition: all .6s ease-in-out, background-position 4s ease-out;
335 -o-transition: all .6s ease-in-out, background-position 4s ease-out;
336 -ms-transition: all .6s ease-in-out, background-position 4s ease-out;
337 transition: all .6s ease-in-out, background-position 4s ease-out;
338}
339/* ---------------------------------------- NAV ---------------------------------------- */
340
341.nav {
342 align: center;
343 z-index: 100;
344 position: fixed;
345 top: 51%;
346 left: 16.5%;
347}
348
349.nav2 {
350 z-index: 100;
351 font-family: 'Lato', sans-serif;
352 font-weight: 300;
353 position: fixed;
354 top: 61%;
355 left: -25%;
356 right: 0%;
357 margin: 0 auto;
358 text-align: center;
359 word-wrap:normal;
360}
361
362.nav3 {
363 z-index: 100;
364 font-family: 'Lato', sans-serif;
365 font-weight: 300;
366 position: fixed;
367 top: 61%;
368 left: 0%;
369 right: 0%;
370 margin: 0 auto;
371 text-align: center;
372 word-wrap:normal;
373}
374
375.nav4 {
376 z-index: 100;
377 font-family: 'Lato', sans-serif;
378 font-weight: 300;
379 position: fixed;
380 top: 61%;
381 left: 25%;
382 right: 0%;
383 margin: 0 auto;
384 text-align: center;
385 word-wrap:normal;
386}
387
388.nav5 {
389 z-index: 100;
390 font-family: 'Lato', sans-serif;
391 font-weight: 300;
392 position: fixed;
393 top: 61%;
394 left: 38%;
395 right: 0%;
396 margin: 0 auto;
397 text-align: center;
398 word-wrap:normal;
399}
400
401.nav ul {
402 align: center;
403 max-width: 1200px;
404 height: 100%;
405 margin: 0;
406 padding: 0;
407 list-style: none;
408 font-size: 20px;
409 font-weight: 800;
410 text-shadow: 2px 3px 0px rgba(0,0,0,0.33);
411}
412
413.nav li {
414 float:left ;
415 width: 16.66666666666667%;
416 max-width: 200px;
417 height: 100%;
418 text-align: center;
419}
420
421.nav li span {
422 display: block;
423}
424
425.nav a {
426 display: block;
427 width: auto;
428 color: rgba(239, 239, 239, .9);
429 vertical-align: bottom;
430 padding-left: 1px;
431 padding-top: 40px;
432 padding-bottom: 40px;
433 margin-top: -40px;
434 letter-spacing: 1px;
435 text-decoration: none;
436 -webkit-transition: padding-left .4s ease, letter-spacing .4s ease;
437 -moz-transition: padding-left .2s ease, letter-spacing .2s ease;
438 -o-transition: padding-left .2s ease, letter-spacing .2s ease;
439 -ms-transition: padding-left .2s ease, letter-spacing .2s ease;
440 transition: padding-left .2s ease, letter-spacing .2s ease;
441}
442
443.nav i{
444 /* Make the font smoother for Chrome */
445 -webkit-transform: translate3d(0, 0, 0);
446 -moz-transform: translate3d(0, 0, 0);
447 -o-transform: translate3d(0, 0, 0);
448 -ms-transform: translate3d(0, 0, 0);
449 transform: translate3d(0, 0, 0);
450}
451
452/* ---------------------------------------- NAV LINK HOVER ---------------------------------------- */
453
454.nav li a:hover,
455.nav li a:active{
456 color: rgba(249, 249, 249, .9);
457 padding-left: 6px;
458 letter-spacing: 6px;
459 -webkit-transition: padding-left .2s ease, letter-spacing .2s ease;
460 -moz-transition: padding-left .2s ease, letter-spacing .2s ease;
461 -o-transition: padding-left .2s ease, letter-spacing .2s ease;
462 -ms-transition: padding-left .2s ease, letter-spacing .2s ease;
463 transition: padding-left .2s ease, letter-spacing .2s ease;
464}
465
466/* ---------------------------------------- NAV BG ---------------------------------------- */
467
468.sub {
469 position: relative;
470 max-width: 1200px;
471 height: 100%;
472 left: 0;
473 z-index: 90;
474}
475
476.navbg {
477 top: 0;
478 left: 0;
479 height: 100%;
480 align: center;
481 z-index: 100;
482 position: relative;
483 top: 8%;
484 left: 16.5%;
485}
486
487.navbg ul {
488 position: relative;
489 line-height: 0%;
490 max-width: 1200px;
491 height: 100%;
492 margin: 0;
493 padding: 0;
494 list-style: none;
495
496}
497
498.navbg li {
499 position: fixed;
500 top: 0;
501 width: 16.66666666666667%;
502 max-width: 200px;
503 height: 100%;
504 text-align: center;
505}
506
507/* ---------------------------------------- NAV Hover ---------------------------------------- */
508
509.navbgs1 {
510 position: relative;
511 left: 100%;
512 top: 0;
513 margin: 0 auto;
514 height: 100%;
515 width: 0px;
516 opacity: 0.0;
517 filter: alpha(opacity=0); /* For IE8 and earlier */
518 -moz-box-sizing: border-box;
519 -webkit-box-sizing: border-box;
520 box-sizing: border-box;
521 border-left: 0px solid rgba(47,127,225,1);
522 border-right: 0px solid rgba(47,127,225,1);
523 background: rgb(42,86,142); /* Old browsers */
524 background: -moz-linear-gradient(-45deg, rgba(54,142,42,1) 0%, rgba(71,225,47,1) 52%, rgba(62,201,42,1) 52%, rgba(73,225,51,1) 100%); /* FF3.6+ */
525 background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(54,142,42,1)), color-stop(52%,rgba(71,225,47,1)), color-stop(52%,rgba(62,201,42,1)), color-stop(100%,rgba(73,225,51,1))); /* Chrome,Safari4+ */
526 background: -webkit-linear-gradient(-45deg, rgba(54,142,42,1) 0%,rgba(71,225,47,1) 52%,rgba(62,201,42,1) 52%,rgba(73,225,51,1) 100%); /* Chrome10+,Safari5.1+ */
527 background: -o-linear-gradient(-45deg, rgba(54,142,42,1) 0%,rgba(71,225,47,1) 52%,rgba(62,201,42,1) 52%,rgba(73,225,51,1) 100%); /* Opera 11.10+ */
528 background: -ms-linear-gradient(-45deg, rgba(54,142,42,1) 0%,rgba(71,225,47,1) 52%,rgba(62,201,42,1) 52%,rgba(73,225,51,1) 100%); /* IE10+ */
529 background: linear-gradient(135deg, rgba(54,142,42,1) 0%,rgba(71,225,47,1) 52%,rgba(62,201,42,1) 52%,rgba(73,225,51,1) 100%); /* W3C */
530 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2a568e', endColorstr='#3381e1',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
531 -webkit-transition: all .4s ease-in-out;
532 -moz-transition: all .4s ease-in-out;
533 -o-transition: all .4s ease-in-out;
534 -ms-transition: all .4s ease-in-out;
535 transition: all .4s ease-in-out;
536}
537.navbgs1h {
538 opacity: 0.9;
539 filter: alpha(opacity=9); /* For IE8 and earlier */
540 width: 100%;
541 border-left: 4px solid rgba(0,0,0,0.25);
542 border-right: 4px solid rgba(0,0,0,0.25);
543 -webkit-transition: all .4s ease-in-out;
544 -moz-transition: all .4s ease-in-out;
545 -o-transition: all .4s ease-in-out;
546 -ms-transition: all .4s ease-in-out;
547 transition: all .4s ease-in-out;
548}
549
550.navbgs2 {
551 position: fixed;
552 top: 0;
553 left: 31%;
554 margin: 0 auto;
555 height: 100%;
556 width: 0px;
557 opacity: 0.0;
558 filter: alpha(opacity=0); /* For IE8 and earlier */
559 -moz-box-sizing: border-box;
560 -webkit-box-sizing: border-box;
561 box-sizing: border-box;
562 border-left: 0px solid rgba(47,127,225,1);
563 border-right: 0px solid rgba(47,127,225,1);
564 background: rgb(42,86,142); /* Old browsers */
565 background: -moz-linear-gradient(-45deg, rgba(42,86,142,1) 0%, rgba(47,127,225,1) 52%, rgba(42,113,201,1) 52%, rgba(51,129,225,1) 100%); /* FF3.6+ */
566 background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(42,86,142,1)), color-stop(52%,rgba(47,127,225,1)), color-stop(52%,rgba(42,113,201,1)), color-stop(100%,rgba(51,129,225,1))); /* Chrome,Safari4+ */
567 background: -webkit-linear-gradient(-45deg, rgba(42,86,142,1) 0%,rgba(47,127,225,1) 52%,rgba(42,113,201,1) 52%,rgba(51,129,225,1) 100%); /* Chrome10+,Safari5.1+ */
568 background: -o-linear-gradient(-45deg, rgba(42,86,142,1) 0%,rgba(47,127,225,1) 52%,rgba(42,113,201,1) 52%,rgba(51,129,225,1) 100%); /* Opera 11.10+ */
569 background: -ms-linear-gradient(-45deg, rgba(42,86,142,1) 0%,rgba(47,127,225,1) 52%,rgba(42,113,201,1) 52%,rgba(51,129,225,1) 100%); /* IE10+ */
570 background: linear-gradient(135deg, rgba(42,86,142,1) 0%,rgba(47,127,225,1) 52%,rgba(42,113,201,1) 52%,rgba(51,129,225,1) 100%); /* W3C */
571 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2a568e', endColorstr='#3381e1',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
572 -webkit-transition: all .4s ease-in-out;
573 -moz-transition: all .4s ease-in-out;
574 -o-transition: all .4s ease-in-out;
575 -ms-transition: all .4s ease-in-out;
576 transition: all .4s ease-in-out;
577
578}
579
580.navbgs2h {
581 position: fixed;
582 opacity: 0.9;
583 filter: alpha(opacity=9); /* For IE8 and earlier */
584 left: 31.5%;
585 width: 12%;
586 border-left: 4px solid rgba(0,0,0,0.25);
587 border-right: 4px solid rgba(0,0,0,0.25);
588 -webkit-transition: all .4s ease-in-out;
589 -moz-transition: all .4s ease-in-out;
590 -o-transition: all .4s ease-in-out;
591 -ms-transition: all .4s ease-in-out;
592 transition: all .4s ease-in-out;
593}
594
595.navbgs3 {
596 position: fixed;
597 top: 0;
598 left: 45%;
599 margin: 0 auto;
600 height: 100%;
601 width: 0px;
602 opacity: 0.0;
603 filter: alpha(opacity=0); /* For IE8 and earlier */
604 -moz-box-sizing: border-box;
605 -webkit-box-sizing: border-box;
606 box-sizing: border-box;
607 border-left: 0px solid rgba(47,127,225,1);
608 border-right: 0px solid rgba(47,127,225,1);
609 background: rgb(54,142,42); /* Old browsers */
610 background: -moz-linear-gradient(-45deg, rgba(225,0,30,1) 0%, rgba(242,113,35,1) 52%, rgba(233,109,30,1) 52%, rgba(244,113,39,1) 100%); /* FF3.6+ */
611 background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(225,0,30,1)), color-stop(52%,rgba(242,113,35,1)), color-stop(52%,rgba(233,109,30,1)), color-stop(100%,rgba(244,113,39,1,1))); /* Chrome,Safari4+ */
612 background: -webkit-linear-gradient(-45deg, rgba(225,0,30,1) 0%,rgba(242,113,35,1) 52%,rgba(233,109,30,1) 52%,rgba(244,113,39,1) 100%); /* Chrome10+,Safari5.1+ */
613 background: -o-linear-gradient(-45deg, rgba(225,0,30,1) 0%,rgba(242,113,35,1) 52%,rgba(233,109,30,1) 52%,rgba(244,113,39,1) 100%); /* Opera 11.10+ */
614 background: -ms-linear-gradient(-45deg, rgba(225,0,30,1) 0%,rgba(242,113,35,1) 52%,rgba(233,109,30,1) 52%,rgba(244,113,39,1) 100%); /* IE10+ */
615 background: linear-gradient(135deg, rgba(225,0,30,1) 0%,rgba(242,113,35,1) 52%,rgba(233,109,30,1) 52%,rgba(244,113,39,1) 100%); /* W3C */
616 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#368e2a', endColorstr='#49e133',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
617 -webkit-transition: all .4s ease-in-out;
618 -moz-transition: all .4s ease-in-out;
619 -o-transition: all .4s ease-in-out;
620 -ms-transition: all .4s ease-in-out;
621 transition: all .4s ease-in-out;
622}
623.navbgs3h {
624 position: fixed;
625 left: 44%;
626 opacity: 0.9;
627 filter: alpha(opacity=9); /* For IE8 and earlier */
628 width: 12%;
629 border-left: 4px solid rgba(0,0,0,0.25);
630 border-right: 4px solid rgba(0,0,0,0.25);
631 -webkit-transition: all .4s ease-in-out;
632 -moz-transition: all .4s ease-in-out;
633 -o-transition: all .4s ease-in-out;
634 -ms-transition: all .4s ease-in-out;
635 transition: all .4s ease-in-out;
636}
637
638.navbgs4 {
639 position: fixed;
640 left: 57%;
641 top: 0;
642 margin: 0 auto;
643 height: 100%;
644 width: 0px;
645 opacity: 0.0;
646 filter: alpha(opacity=0); /* For IE8 and earlier */
647 -moz-box-sizing: border-box;
648 -webkit-box-sizing: border-box;
649 box-sizing: border-box;
650 border-left: 0px solid rgba(47,127,225,1);
651 border-right: 0px solid rgba(47,127,225,1);
652 background: rgb(54,142,42); /* Old browsers */
653 background: -moz-linear-gradient(-45deg, rgba(254,142,42,1) 0%, rgba(271,225,47,1) 52%, rgba(262,201,42,1) 52%, rgba(273,225,51,1) 100%); /* FF3.6+ */
654 background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(254,142,42,1)), color-stop(52%,rgba(271,225,47,1)), color-stop(52%,rgba(262,201,42,1)), color-stop(100%,rgba(273,225,51,1))); /* Chrome,Safari4+ */
655 background: -webkit-linear-gradient(-45deg, rgba(254,142,42,1) 0%,rgba(271,225,47,1) 52%,rgba(262,201,42,1) 52%,rgba(273,225,51,1) 100%); /* Chrome10+,Safari5.1+ */
656 background: -o-linear-gradient(-45deg, rgba(254,142,42,1) 0%,rgba(271,225,47,1) 52%,rgba(262,201,42,1) 52%,rgba(273,225,51,1) 100%); /* Opera 11.10+ */
657 background: -ms-linear-gradient(-45deg, rgba(254,142,42,1) 0%,rgba(271,225,47,1) 52%,rgba(262,201,42,1) 52%,rgba(273,225,51,1) 100%); /* IE10+ */
658 background: linear-gradient(135deg, rgba(254,142,42,1) 0%,rgba(271,225,47,1) 52%,rgba(262,201,42,1) 52%,rgba(273,225,51,1) 100%); /* W3C */
659 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#368e2a', endColorstr='#49e133',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
660 -webkit-transition: all .4s ease-in-out;
661 -moz-transition: all .4s ease-in-out;
662 -o-transition: all .4s ease-in-out;
663 -ms-transition: all .4s ease-in-out;
664 transition: all .4s ease-in-out;
665}
666.navbgs4h {
667 position: fixed;
668 left: 56.5%;
669 opacity: 0.9;
670 filter: alpha(opacity=9); /* For IE8 and earlier */
671 width: 12%;
672 border-left: 4px solid rgba(0,0,0,0.25);
673 border-right: 4px solid rgba(0,0,0,0.25);
674 -webkit-transition: all .4s ease-in-out;
675 -moz-transition: all .4s ease-in-out;
676 -o-transition: all .4s ease-in-out;
677 -ms-transition: all .4s ease-in-out;
678 transition: all .4s ease-in-out;
679}
680
681.navbgs5 {
682 position: fixed;
683 left: 70%;
684 top: 0;
685 margin: 0 auto;
686 height: 100%;
687 width: 0px;
688 opacity: 0.0;
689 filter: alpha(opacity=0); /* For IE8 and earlier */
690 -moz-box-sizing: border-box;
691 -webkit-box-sizing: border-box;
692 box-sizing: border-box;
693 border-left: 0px solid rgba(47,127,225,1);
694 border-right: 0px solid rgba(47,127,225,1);
695 background: rgb(54,142,42); /* Old browsers */
696 background: -moz-linear-gradient(-45deg, rgba(242,86,142,1) 0%, rgba(247,127,225,1) 52%, rgba(242,113,201,1) 52%, rgba(251,129,225,1) 100%); /* FF3.6+ */
697 background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(242,86,142,1)), color-stop(52%,rgba(247,127,225,1)), color-stop(52%,rgba(242,113,201,1)), color-stop(100%,rgba(251,129,225,1))); /* Chrome,Safari4+ */
698 background: -webkit-linear-gradient(-45deg, rgba(242,86,142,1) 0%,rgba(247,127,225,1) 52%,rgba(242,113,201,1) 52%,rgba(251,129,225,1) 100%); /* Chrome10+,Safari5.1+ */
699 background: -o-linear-gradient(-45deg, rgba(242,86,142,1) 0%,rgba(247,127,225,1) 52%,rgba(242,113,201,1) 52%,rgba(251,129,225,1) 100%); /* Opera 11.10+ */
700 background: -ms-linear-gradient(-45deg, rgba(242,86,142,1) 0%,rgba(247,127,225,1) 52%,rgba(242,113,201,1) 52%,rgba(251,129,225,1) 100%); /* IE10+ */
701 background: linear-gradient(135deg, rgba(242,86,142,1) 0%,rgba(247,127,225,1) 52%,rgba(242,113,201,1) 52%,rgba(251,129,225,1) 100%); /* W3C */
702 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#368e2a', endColorstr='#49e133',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
703 -webkit-transition: all .4s ease-in-out;
704 -moz-transition: all .4s ease-in-out;
705 -o-transition: all .4s ease-in-out;
706 -ms-transition: all .4s ease-in-out;
707 transition: all .4s ease-in-out;
708}
709.navbgs5h {
710 position: fixed;
711 left: 63%;
712 opacity: 0.9;
713 filter: alpha(opacity=9); /* For IE8 and earlier */
714 width: 12%;
715 border-left: 4px solid rgba(0,0,0,0.25);
716 border-right: 4px solid rgba(0,0,0,0.25);
717 -webkit-transition: all .4s ease-in-out;
718 -moz-transition: all .4s ease-in-out;
719 -o-transition: all .4s ease-in-out;
720 -ms-transition: all .4s ease-in-out;
721 transition: all .4s ease-in-out;
722}
723
724.navbgs6 {
725 position: relative;
726 top: 0;
727 margin: 0 auto;
728 height: 100%;
729 width: 0px;
730 opacity: 0.0;
731 filter: alpha(opacity=0); /* For IE8 and earlier */
732 -moz-box-sizing: border-box;
733 -webkit-box-sizing: border-box;
734 box-sizing: border-box;
735 border-left: 0px solid rgba(47,127,225,1);
736 border-right: 0px solid rgba(47,127,225,1);
737 background: rgb(42,86,142); /* Old browsers */
738 background: -moz-linear-gradient(-45deg, rgba(42,186,142,1) 0%, rgba(47,227,225,1) 52%, rgba(42,213,201,1) 52%, rgba(51,229,225,1) 100%); /* FF3.6+ */
739 background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(42,186,142,1)), color-stop(52%,rgba(47,227,225,1)), color-stop(52%,rgba(42,213,201,1)), color-stop(100%,rgba(51,229,225,1))); /* Chrome,Safari4+ */
740 background: -webkit-linear-gradient(-45deg, rgba(42,186,142,1) 0%,rgba(47,227,225,1) 52%,rgba(42,213,201,1) 52%,rgba(51,229,225,1) 100%); /* Chrome10+,Safari5.1+ */
741 background: -o-linear-gradient(-45deg, rgba(42,186,142,1) 0%,rgba(47,227,225,1) 52%,rgba(42,213,201,1) 52%,rgba(51,229,225,1) 100%); /* Opera 11.10+ */
742 background: -ms-linear-gradient(-45deg, rgba(42,186,142,1) 0%,rgba(47,227,225,1) 52%,rgba(42,213,201,1) 52%,rgba(51,229,225,1) 100%); /* IE10+ */
743 background: linear-gradient(135deg, rgba(42,186,142,1) 0%,rgba(47,227,225,1) 52%,rgba(42,213,201,1) 52%,rgba(51,229,225,1) 100%); /* W3C */
744 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2a568e', endColorstr='#3381e1',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
745 -webkit-transition: all .4s ease-in-out;
746 -moz-transition: all .4s ease-in-out;
747 -o-transition: all .4s ease-in-out;
748 -ms-transition: all .4s ease-in-out;
749 transition: all .4s ease-in-out;
750}
751.navbgs6h {
752 opacity: 0.9;
753 filter: alpha(opacity=9); /* For IE8 and earlier */
754 width: 100%;
755 border-left: 4px solid rgba(0,0,0,0.25);
756 border-right: 4px solid rgba(0,0,0,0.25);
757 -webkit-transition: all .4s ease-in-out;
758 -moz-transition: all .4s ease-in-out;
759 -o-transition: all .4s ease-in-out;
760 -ms-transition: all .4s ease-in-out;
761 transition: all .4s ease-in-out;
762}
763
764
765.navEasterEgg{
766 width: 14%;
767 margin-left: 43%;
768 font-family: inherit;
769}
770
771
772.social {
773 text-align: center;
774 color: white !important;
775 z-index: 100;
776}
777
778.social a {
779 color: white !important;
780 font-size: 25pt;
781 display: inline-block;
782 margin: 0px 0px;
783}
784
785.social a p {
786 font-size: 9pt;
787 margin-top: -2px;
788 font-family: 'Open Sans', sans-serif;
789}
790.social {
791 margin-top: 10%;
792}
793.social a {
794 text-decoration: none;
795}
796.social {
797 position: fixed;
798 bottom: 0;
799 left: 0;0:b;
800 background: rgba(0, 0, 0, 0.12);
801 right: 0;
802 padding: 10px;
803 padding-top: 15px !important;
804}
805.social a {
806 opacity: 0.7;
807}
808
809.social:hover a {
810 opacity: 1;
811}
812p.copyright {
813 font-size: 9pt;
814 margin-top: 5px !important;
815 border-top: 2px solid rgba(195, 228, 220, 0.08);
816 display: block;
817 max-width: 300px;
818 padding-top: 5px;
819 margin: 0 auto;
820}
821
822p.copyright {
823 font-family: 'Open Sans', sans-serif;
824 opacity: 1;
825 text-transform: uppercase;
826}
827.social a:hover {
828 color: #1299BC !important;
829}
830
831/* Remove the blue Webkit background when element is tapped */
832
833a, button {
834 -webkit-tap-highlight-color: rgba(0,0,0,0);
835}/* CSS Document */
836
837
838
839/* Start of Snow Effect*/
840#snowflakeContainer {
841 position: absolute;
842 left: 0px;
843 top: 0px;
844}
845.snowflake {
846 padding-left: 15px;
847 font-family: Cambria, Georgia, serif;
848 font-size: 14px;
849 line-height: 24px;
850 color: #FFFFFF;
851 user-select: none;
852 z-index: 1000;
853}
854.snowflake:hover {
855 cursor: default;
856}
857/* End of Snow Effect */</style><script type="text/javascript">/*!
858 * jQuery JavaScript Library v1.10.1
859 * http://jquery.com/
860 *
861 * Includes Sizzle.js
862 * http://sizzlejs.com/
863 *
864 * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
865 * Released under the MIT license
866 * http://jquery.org/license
867 *
868 * Date: 2013-05-30T21:49Z
869 */
870(function( window, undefined ) {
871
872// Can't do this because several apps including ASP.NET trace
873// the stack via arguments.caller.callee and Firefox dies if
874// you try to trace through "use strict" call chains. (#13335)
875// Support: Firefox 18+
876//"use strict";
877var
878 // The deferred used on DOM ready
879 readyList,
880
881 // A central reference to the root jQuery(document)
882 rootjQuery,
883
884 // Support: IE<10
885 // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined`
886 core_strundefined = typeof undefined,
887
888 // Use the correct document accordingly with window argument (sandbox)
889 location = window.location,
890 document = window.document,
891 docElem = document.documentElement,
892
893 // Map over jQuery in case of overwrite
894 _jQuery = window.jQuery,
895
896 // Map over the $ in case of overwrite
897 _$ = window.$,
898
899 // [[Class]] -> type pairs
900 class2type = {},
901
902 // List of deleted data cache ids, so we can reuse them
903 core_deletedIds = [],
904
905 core_version = "1.10.1",
906
907 // Save a reference to some core methods
908 core_concat = core_deletedIds.concat,
909 core_push = core_deletedIds.push,
910 core_slice = core_deletedIds.slice,
911 core_indexOf = core_deletedIds.indexOf,
912 core_toString = class2type.toString,
913 core_hasOwn = class2type.hasOwnProperty,
914 core_trim = core_version.trim,
915
916 // Define a local copy of jQuery
917 jQuery = function( selector, context ) {
918 // The jQuery object is actually just the init constructor 'enhanced'
919 return new jQuery.fn.init( selector, context, rootjQuery );
920 },
921
922 // Used for matching numbers
923 core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
924
925 // Used for splitting on whitespace
926 core_rnotwhite = /\S+/g,
927
928 // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
929 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
930
931 // A simple way to check for HTML strings
932 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
933 // Strict HTML recognition (#11290: must start with <)
934 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
935
936 // Match a standalone tag
937 rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
938
939 // JSON RegExp
940 rvalidchars = /^[\],:{}\s]*$/,
941 rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
942 rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
943 rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
944
945 // Matches dashed string for camelizing
946 rmsPrefix = /^-ms-/,
947 rdashAlpha = /-([\da-z])/gi,
948
949 // Used by jQuery.camelCase as callback to replace()
950 fcamelCase = function( all, letter ) {
951 return letter.toUpperCase();
952 },
953
954 // The ready event handler
955 completed = function( event ) {
956
957 // readyState === "complete" is good enough for us to call the dom ready in oldIE
958 if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
959 detach();
960 jQuery.ready();
961 }
962 },
963 // Clean-up method for dom ready events
964 detach = function() {
965 if ( document.addEventListener ) {
966 document.removeEventListener( "DOMContentLoaded", completed, false );
967 window.removeEventListener( "load", completed, false );
968
969 } else {
970 document.detachEvent( "onreadystatechange", completed );
971 window.detachEvent( "onload", completed );
972 }
973 };
974
975jQuery.fn = jQuery.prototype = {
976 // The current version of jQuery being used
977 jquery: core_version,
978
979 constructor: jQuery,
980 init: function( selector, context, rootjQuery ) {
981 var match, elem;
982
983 // HANDLE: $(""), $(null), $(undefined), $(false)
984 if ( !selector ) {
985 return this;
986 }
987
988 // Handle HTML strings
989 if ( typeof selector === "string" ) {
990 if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
991 // Assume that strings that start and end with <> are HTML and skip the regex check
992 match = [ null, selector, null ];
993
994 } else {
995 match = rquickExpr.exec( selector );
996 }
997
998 // Match html or make sure no context is specified for #id
999 if ( match && (match[1] || !context) ) {
1000
1001 // HANDLE: $(html) -> $(array)
1002 if ( match[1] ) {
1003 context = context instanceof jQuery ? context[0] : context;
1004
1005 // scripts is true for back-compat
1006 jQuery.merge( this, jQuery.parseHTML(
1007 match[1],
1008 context && context.nodeType ? context.ownerDocument || context : document,
1009 true
1010 ) );
1011
1012 // HANDLE: $(html, props)
1013 if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
1014 for ( match in context ) {
1015 // Properties of context are called as methods if possible
1016 if ( jQuery.isFunction( this[ match ] ) ) {
1017 this[ match ]( context[ match ] );
1018
1019 // ...and otherwise set as attributes
1020 } else {
1021 this.attr( match, context[ match ] );
1022 }
1023 }
1024 }
1025
1026 return this;
1027
1028 // HANDLE: $(#id)
1029 } else {
1030 elem = document.getElementById( match[2] );
1031
1032 // Check parentNode to catch when Blackberry 4.6 returns
1033 // nodes that are no longer in the document #6963
1034 if ( elem && elem.parentNode ) {
1035 // Handle the case where IE and Opera return items
1036 // by name instead of ID
1037 if ( elem.id !== match[2] ) {
1038 return rootjQuery.find( selector );
1039 }
1040
1041 // Otherwise, we inject the element directly into the jQuery object
1042 this.length = 1;
1043 this[0] = elem;
1044 }
1045
1046 this.context = document;
1047 this.selector = selector;
1048 return this;
1049 }
1050
1051 // HANDLE: $(expr, $(...))
1052 } else if ( !context || context.jquery ) {
1053 return ( context || rootjQuery ).find( selector );
1054
1055 // HANDLE: $(expr, context)
1056 // (which is just equivalent to: $(context).find(expr)
1057 } else {
1058 return this.constructor( context ).find( selector );
1059 }
1060
1061 // HANDLE: $(DOMElement)
1062 } else if ( selector.nodeType ) {
1063 this.context = this[0] = selector;
1064 this.length = 1;
1065 return this;
1066
1067 // HANDLE: $(function)
1068 // Shortcut for document ready
1069 } else if ( jQuery.isFunction( selector ) ) {
1070 return rootjQuery.ready( selector );
1071 }
1072
1073 if ( selector.selector !== undefined ) {
1074 this.selector = selector.selector;
1075 this.context = selector.context;
1076 }
1077
1078 return jQuery.makeArray( selector, this );
1079 },
1080
1081 // Start with an empty selector
1082 selector: "",
1083
1084 // The default length of a jQuery object is 0
1085 length: 0,
1086
1087 toArray: function() {
1088 return core_slice.call( this );
1089 },
1090
1091 // Get the Nth element in the matched element set OR
1092 // Get the whole matched element set as a clean array
1093 get: function( num ) {
1094 return num == null ?
1095
1096 // Return a 'clean' array
1097 this.toArray() :
1098
1099 // Return just the object
1100 ( num < 0 ? this[ this.length + num ] : this[ num ] );
1101 },
1102
1103 // Take an array of elements and push it onto the stack
1104 // (returning the new matched element set)
1105 pushStack: function( elems ) {
1106
1107 // Build a new jQuery matched element set
1108 var ret = jQuery.merge( this.constructor(), elems );
1109
1110 // Add the old object onto the stack (as a reference)
1111 ret.prevObject = this;
1112 ret.context = this.context;
1113
1114 // Return the newly-formed element set
1115 return ret;
1116 },
1117
1118 // Execute a callback for every element in the matched set.
1119 // (You can seed the arguments with an array of args, but this is
1120 // only used internally.)
1121 each: function( callback, args ) {
1122 return jQuery.each( this, callback, args );
1123 },
1124
1125 ready: function( fn ) {
1126 // Add the callback
1127 jQuery.ready.promise().done( fn );
1128
1129 return this;
1130 },
1131
1132 slice: function() {
1133 return this.pushStack( core_slice.apply( this, arguments ) );
1134 },
1135
1136 first: function() {
1137 return this.eq( 0 );
1138 },
1139
1140 last: function() {
1141 return this.eq( -1 );
1142 },
1143
1144 eq: function( i ) {
1145 var len = this.length,
1146 j = +i + ( i < 0 ? len : 0 );
1147 return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
1148 },
1149
1150 map: function( callback ) {
1151 return this.pushStack( jQuery.map(this, function( elem, i ) {
1152 return callback.call( elem, i, elem );
1153 }));
1154 },
1155
1156 end: function() {
1157 return this.prevObject || this.constructor(null);
1158 },
1159
1160 // For internal use only.
1161 // Behaves like an Array's method, not like a jQuery method.
1162 push: core_push,
1163 sort: [].sort,
1164 splice: [].splice
1165};
1166
1167// Give the init function the jQuery prototype for later instantiation
1168jQuery.fn.init.prototype = jQuery.fn;
1169
1170jQuery.extend = jQuery.fn.extend = function() {
1171 var src, copyIsArray, copy, name, options, clone,
1172 target = arguments[0] || {},
1173 i = 1,
1174 length = arguments.length,
1175 deep = false;
1176
1177 // Handle a deep copy situation
1178 if ( typeof target === "boolean" ) {
1179 deep = target;
1180 target = arguments[1] || {};
1181 // skip the boolean and the target
1182 i = 2;
1183 }
1184
1185 // Handle case when target is a string or something (possible in deep copy)
1186 if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
1187 target = {};
1188 }
1189
1190 // extend jQuery itself if only one argument is passed
1191 if ( length === i ) {
1192 target = this;
1193 --i;
1194 }
1195
1196 for ( ; i < length; i++ ) {
1197 // Only deal with non-null/undefined values
1198 if ( (options = arguments[ i ]) != null ) {
1199 // Extend the base object
1200 for ( name in options ) {
1201 src = target[ name ];
1202 copy = options[ name ];
1203
1204 // Prevent never-ending loop
1205 if ( target === copy ) {
1206 continue;
1207 }
1208
1209 // Recurse if we're merging plain objects or arrays
1210 if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
1211 if ( copyIsArray ) {
1212 copyIsArray = false;
1213 clone = src && jQuery.isArray(src) ? src : [];
1214
1215 } else {
1216 clone = src && jQuery.isPlainObject(src) ? src : {};
1217 }
1218
1219 // Never move original objects, clone them
1220 target[ name ] = jQuery.extend( deep, clone, copy );
1221
1222 // Don't bring in undefined values
1223 } else if ( copy !== undefined ) {
1224 target[ name ] = copy;
1225 }
1226 }
1227 }
1228 }
1229
1230 // Return the modified object
1231 return target;
1232};
1233
1234jQuery.extend({
1235 // Unique for each copy of jQuery on the page
1236 // Non-digits removed to match rinlinejQuery
1237 expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
1238
1239 noConflict: function( deep ) {
1240 if ( window.$ === jQuery ) {
1241 window.$ = _$;
1242 }
1243
1244 if ( deep && window.jQuery === jQuery ) {
1245 window.jQuery = _jQuery;
1246 }
1247
1248 return jQuery;
1249 },
1250
1251 // Is the DOM ready to be used? Set to true once it occurs.
1252 isReady: false,
1253
1254 // A counter to track how many items to wait for before
1255 // the ready event fires. See #6781
1256 readyWait: 1,
1257
1258 // Hold (or release) the ready event
1259 holdReady: function( hold ) {
1260 if ( hold ) {
1261 jQuery.readyWait++;
1262 } else {
1263 jQuery.ready( true );
1264 }
1265 },
1266
1267 // Handle when the DOM is ready
1268 ready: function( wait ) {
1269
1270 // Abort if there are pending holds or we're already ready
1271 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
1272 return;
1273 }
1274
1275 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
1276 if ( !document.body ) {
1277 return setTimeout( jQuery.ready );
1278 }
1279
1280 // Remember that the DOM is ready
1281 jQuery.isReady = true;
1282
1283 // If a normal DOM Ready event fired, decrement, and wait if need be
1284 if ( wait !== true && --jQuery.readyWait > 0 ) {
1285 return;
1286 }
1287
1288 // If there are functions bound, to execute
1289 readyList.resolveWith( document, [ jQuery ] );
1290
1291 // Trigger any bound ready events
1292 if ( jQuery.fn.trigger ) {
1293 jQuery( document ).trigger("ready").off("ready");
1294 }
1295 },
1296
1297 // See test/unit/core.js for details concerning isFunction.
1298 // Since version 1.3, DOM methods and functions like alert
1299 // aren't supported. They return false on IE (#2968).
1300 isFunction: function( obj ) {
1301 return jQuery.type(obj) === "function";
1302 },
1303
1304 isArray: Array.isArray || function( obj ) {
1305 return jQuery.type(obj) === "array";
1306 },
1307
1308 isWindow: function( obj ) {
1309 /* jshint eqeqeq: false */
1310 return obj != null && obj == obj.window;
1311 },
1312
1313 isNumeric: function( obj ) {
1314 return !isNaN( parseFloat(obj) ) && isFinite( obj );
1315 },
1316
1317 type: function( obj ) {
1318 if ( obj == null ) {
1319 return String( obj );
1320 }
1321 return typeof obj === "object" || typeof obj === "function" ?
1322 class2type[ core_toString.call(obj) ] || "object" :
1323 typeof obj;
1324 },
1325
1326 isPlainObject: function( obj ) {
1327 var key;
1328
1329 // Must be an Object.
1330 // Because of IE, we also have to check the presence of the constructor property.
1331 // Make sure that DOM nodes and window objects don't pass through, as well
1332 if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
1333 return false;
1334 }
1335
1336 try {
1337 // Not own constructor property must be Object
1338 if ( obj.constructor &&
1339 !core_hasOwn.call(obj, "constructor") &&
1340 !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
1341 return false;
1342 }
1343 } catch ( e ) {
1344 // IE8,9 Will throw exceptions on certain host objects #9897
1345 return false;
1346 }
1347
1348 // Support: IE<9
1349 // Handle iteration over inherited properties before own properties.
1350 if ( jQuery.support.ownLast ) {
1351 for ( key in obj ) {
1352 return core_hasOwn.call( obj, key );
1353 }
1354 }
1355
1356 // Own properties are enumerated firstly, so to speed up,
1357 // if last one is own, then all properties are own.
1358 for ( key in obj ) {}
1359
1360 return key === undefined || core_hasOwn.call( obj, key );
1361 },
1362
1363 isEmptyObject: function( obj ) {
1364 var name;
1365 for ( name in obj ) {
1366 return false;
1367 }
1368 return true;
1369 },
1370
1371 error: function( msg ) {
1372 throw new Error( msg );
1373 },
1374
1375 // data: string of html
1376 // context (optional): If specified, the fragment will be created in this context, defaults to document
1377 // keepScripts (optional): If true, will include scripts passed in the html string
1378 parseHTML: function( data, context, keepScripts ) {
1379 if ( !data || typeof data !== "string" ) {
1380 return null;
1381 }
1382 if ( typeof context === "boolean" ) {
1383 keepScripts = context;
1384 context = false;
1385 }
1386 context = context || document;
1387
1388 var parsed = rsingleTag.exec( data ),
1389 scripts = !keepScripts && [];
1390
1391 // Single tag
1392 if ( parsed ) {
1393 return [ context.createElement( parsed[1] ) ];
1394 }
1395
1396 parsed = jQuery.buildFragment( [ data ], context, scripts );
1397 if ( scripts ) {
1398 jQuery( scripts ).remove();
1399 }
1400 return jQuery.merge( [], parsed.childNodes );
1401 },
1402
1403 parseJSON: function( data ) {
1404 // Attempt to parse using the native JSON parser first
1405 if ( window.JSON && window.JSON.parse ) {
1406 return window.JSON.parse( data );
1407 }
1408
1409 if ( data === null ) {
1410 return data;
1411 }
1412
1413 if ( typeof data === "string" ) {
1414
1415 // Make sure leading/trailing whitespace is removed (IE can't handle it)
1416 data = jQuery.trim( data );
1417
1418 if ( data ) {
1419 // Make sure the incoming data is actual JSON
1420 // Logic borrowed from http://json.org/json2.js
1421 if ( rvalidchars.test( data.replace( rvalidescape, "@" )
1422 .replace( rvalidtokens, "]" )
1423 .replace( rvalidbraces, "")) ) {
1424
1425 return ( new Function( "return " + data ) )();
1426 }
1427 }
1428 }
1429
1430 jQuery.error( "Invalid JSON: " + data );
1431 },
1432
1433 // Cross-browser xml parsing
1434 parseXML: function( data ) {
1435 var xml, tmp;
1436 if ( !data || typeof data !== "string" ) {
1437 return null;
1438 }
1439 try {
1440 if ( window.DOMParser ) { // Standard
1441 tmp = new DOMParser();
1442 xml = tmp.parseFromString( data , "text/xml" );
1443 } else { // IE
1444 xml = new ActiveXObject( "Microsoft.XMLDOM" );
1445 xml.async = "false";
1446 xml.loadXML( data );
1447 }
1448 } catch( e ) {
1449 xml = undefined;
1450 }
1451 if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
1452 jQuery.error( "Invalid XML: " + data );
1453 }
1454 return xml;
1455 },
1456
1457 noop: function() {},
1458
1459 // Evaluates a script in a global context
1460 // Workarounds based on findings by Jim Driscoll
1461 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
1462 globalEval: function( data ) {
1463 if ( data && jQuery.trim( data ) ) {
1464 // We use execScript on Internet Explorer
1465 // We use an anonymous function so that context is window
1466 // rather than jQuery in Firefox
1467 ( window.execScript || function( data ) {
1468 window[ "eval" ].call( window, data );
1469 } )( data );
1470 }
1471 },
1472
1473 // Convert dashed to camelCase; used by the css and data modules
1474 // Microsoft forgot to hump their vendor prefix (#9572)
1475 camelCase: function( string ) {
1476 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
1477 },
1478
1479 nodeName: function( elem, name ) {
1480 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
1481 },
1482
1483 // args is for internal usage only
1484 each: function( obj, callback, args ) {
1485 var value,
1486 i = 0,
1487 length = obj.length,
1488 isArray = isArraylike( obj );
1489
1490 if ( args ) {
1491 if ( isArray ) {
1492 for ( ; i < length; i++ ) {
1493 value = callback.apply( obj[ i ], args );
1494
1495 if ( value === false ) {
1496 break;
1497 }
1498 }
1499 } else {
1500 for ( i in obj ) {
1501 value = callback.apply( obj[ i ], args );
1502
1503 if ( value === false ) {
1504 break;
1505 }
1506 }
1507 }
1508
1509 // A special, fast, case for the most common use of each
1510 } else {
1511 if ( isArray ) {
1512 for ( ; i < length; i++ ) {
1513 value = callback.call( obj[ i ], i, obj[ i ] );
1514
1515 if ( value === false ) {
1516 break;
1517 }
1518 }
1519 } else {
1520 for ( i in obj ) {
1521 value = callback.call( obj[ i ], i, obj[ i ] );
1522
1523 if ( value === false ) {
1524 break;
1525 }
1526 }
1527 }
1528 }
1529
1530 return obj;
1531 },
1532
1533 // Use native String.trim function wherever possible
1534 trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
1535 function( text ) {
1536 return text == null ?
1537 "" :
1538 core_trim.call( text );
1539 } :
1540
1541 // Otherwise use our own trimming functionality
1542 function( text ) {
1543 return text == null ?
1544 "" :
1545 ( text + "" ).replace( rtrim, "" );
1546 },
1547
1548 // results is for internal usage only
1549 makeArray: function( arr, results ) {
1550 var ret = results || [];
1551
1552 if ( arr != null ) {
1553 if ( isArraylike( Object(arr) ) ) {
1554 jQuery.merge( ret,
1555 typeof arr === "string" ?
1556 [ arr ] : arr
1557 );
1558 } else {
1559 core_push.call( ret, arr );
1560 }
1561 }
1562
1563 return ret;
1564 },
1565
1566 inArray: function( elem, arr, i ) {
1567 var len;
1568
1569 if ( arr ) {
1570 if ( core_indexOf ) {
1571 return core_indexOf.call( arr, elem, i );
1572 }
1573
1574 len = arr.length;
1575 i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
1576
1577 for ( ; i < len; i++ ) {
1578 // Skip accessing in sparse arrays
1579 if ( i in arr && arr[ i ] === elem ) {
1580 return i;
1581 }
1582 }
1583 }
1584
1585 return -1;
1586 },
1587
1588 merge: function( first, second ) {
1589 var l = second.length,
1590 i = first.length,
1591 j = 0;
1592
1593 if ( typeof l === "number" ) {
1594 for ( ; j < l; j++ ) {
1595 first[ i++ ] = second[ j ];
1596 }
1597 } else {
1598 while ( second[j] !== undefined ) {
1599 first[ i++ ] = second[ j++ ];
1600 }
1601 }
1602
1603 first.length = i;
1604
1605 return first;
1606 },
1607
1608 grep: function( elems, callback, inv ) {
1609 var retVal,
1610 ret = [],
1611 i = 0,
1612 length = elems.length;
1613 inv = !!inv;
1614
1615 // Go through the array, only saving the items
1616 // that pass the validator function
1617 for ( ; i < length; i++ ) {
1618 retVal = !!callback( elems[ i ], i );
1619 if ( inv !== retVal ) {
1620 ret.push( elems[ i ] );
1621 }
1622 }
1623
1624 return ret;
1625 },
1626
1627 // arg is for internal usage only
1628 map: function( elems, callback, arg ) {
1629 var value,
1630 i = 0,
1631 length = elems.length,
1632 isArray = isArraylike( elems ),
1633 ret = [];
1634
1635 // Go through the array, translating each of the items to their
1636 if ( isArray ) {
1637 for ( ; i < length; i++ ) {
1638 value = callback( elems[ i ], i, arg );
1639
1640 if ( value != null ) {
1641 ret[ ret.length ] = value;
1642 }
1643 }
1644
1645 // Go through every key on the object,
1646 } else {
1647 for ( i in elems ) {
1648 value = callback( elems[ i ], i, arg );
1649
1650 if ( value != null ) {
1651 ret[ ret.length ] = value;
1652 }
1653 }
1654 }
1655
1656 // Flatten any nested arrays
1657 return core_concat.apply( [], ret );
1658 },
1659
1660 // A global GUID counter for objects
1661 guid: 1,
1662
1663 // Bind a function to a context, optionally partially applying any
1664 // arguments.
1665 proxy: function( fn, context ) {
1666 var args, proxy, tmp;
1667
1668 if ( typeof context === "string" ) {
1669 tmp = fn[ context ];
1670 context = fn;
1671 fn = tmp;
1672 }
1673
1674 // Quick check to determine if target is callable, in the spec
1675 // this throws a TypeError, but we will just return undefined.
1676 if ( !jQuery.isFunction( fn ) ) {
1677 return undefined;
1678 }
1679
1680 // Simulated bind
1681 args = core_slice.call( arguments, 2 );
1682 proxy = function() {
1683 return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
1684 };
1685
1686 // Set the guid of unique handler to the same of original handler, so it can be removed
1687 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
1688
1689 return proxy;
1690 },
1691
1692 // Multifunctional method to get and set values of a collection
1693 // The value/s can optionally be executed if it's a function
1694 access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
1695 var i = 0,
1696 length = elems.length,
1697 bulk = key == null;
1698
1699 // Sets many values
1700 if ( jQuery.type( key ) === "object" ) {
1701 chainable = true;
1702 for ( i in key ) {
1703 jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
1704 }
1705
1706 // Sets one value
1707 } else if ( value !== undefined ) {
1708 chainable = true;
1709
1710 if ( !jQuery.isFunction( value ) ) {
1711 raw = true;
1712 }
1713
1714 if ( bulk ) {
1715 // Bulk operations run against the entire set
1716 if ( raw ) {
1717 fn.call( elems, value );
1718 fn = null;
1719
1720 // ...except when executing function values
1721 } else {
1722 bulk = fn;
1723 fn = function( elem, key, value ) {
1724 return bulk.call( jQuery( elem ), value );
1725 };
1726 }
1727 }
1728
1729 if ( fn ) {
1730 for ( ; i < length; i++ ) {
1731 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
1732 }
1733 }
1734 }
1735
1736 return chainable ?
1737 elems :
1738
1739 // Gets
1740 bulk ?
1741 fn.call( elems ) :
1742 length ? fn( elems[0], key ) : emptyGet;
1743 },
1744
1745 now: function() {
1746 return ( new Date() ).getTime();
1747 },
1748
1749 // A method for quickly swapping in/out CSS properties to get correct calculations.
1750 // Note: this method belongs to the css module but it's needed here for the support module.
1751 // If support gets modularized, this method should be moved back to the css module.
1752 swap: function( elem, options, callback, args ) {
1753 var ret, name,
1754 old = {};
1755
1756 // Remember the old values, and insert the new ones
1757 for ( name in options ) {
1758 old[ name ] = elem.style[ name ];
1759 elem.style[ name ] = options[ name ];
1760 }
1761
1762 ret = callback.apply( elem, args || [] );
1763
1764 // Revert the old values
1765 for ( name in options ) {
1766 elem.style[ name ] = old[ name ];
1767 }
1768
1769 return ret;
1770 }
1771});
1772
1773jQuery.ready.promise = function( obj ) {
1774 if ( !readyList ) {
1775
1776 readyList = jQuery.Deferred();
1777
1778 // Catch cases where $(document).ready() is called after the browser event has already occurred.
1779 // we once tried to use readyState "interactive" here, but it caused issues like the one
1780 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
1781 if ( document.readyState === "complete" ) {
1782 // Handle it asynchronously to allow scripts the opportunity to delay ready
1783 setTimeout( jQuery.ready );
1784
1785 // Standards-based browsers support DOMContentLoaded
1786 } else if ( document.addEventListener ) {
1787 // Use the handy event callback
1788 document.addEventListener( "DOMContentLoaded", completed, false );
1789
1790 // A fallback to window.onload, that will always work
1791 window.addEventListener( "load", completed, false );
1792
1793 // If IE event model is used
1794 } else {
1795 // Ensure firing before onload, maybe late but safe also for iframes
1796 document.attachEvent( "onreadystatechange", completed );
1797
1798 // A fallback to window.onload, that will always work
1799 window.attachEvent( "onload", completed );
1800
1801 // If IE and not a frame
1802 // continually check to see if the document is ready
1803 var top = false;
1804
1805 try {
1806 top = window.frameElement == null && document.documentElement;
1807 } catch(e) {}
1808
1809 if ( top && top.doScroll ) {
1810 (function doScrollCheck() {
1811 if ( !jQuery.isReady ) {
1812
1813 try {
1814 // Use the trick by Diego Perini
1815 // http://javascript.nwbox.com/IEContentLoaded/
1816 top.doScroll("left");
1817 } catch(e) {
1818 return setTimeout( doScrollCheck, 50 );
1819 }
1820
1821 // detach all dom ready events
1822 detach();
1823
1824 // and execute any waiting functions
1825 jQuery.ready();
1826 }
1827 })();
1828 }
1829 }
1830 }
1831 return readyList.promise( obj );
1832};
1833
1834// Populate the class2type map
1835jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
1836 class2type[ "[object " + name + "]" ] = name.toLowerCase();
1837});
1838
1839function isArraylike( obj ) {
1840 var length = obj.length,
1841 type = jQuery.type( obj );
1842
1843 if ( jQuery.isWindow( obj ) ) {
1844 return false;
1845 }
1846
1847 if ( obj.nodeType === 1 && length ) {
1848 return true;
1849 }
1850
1851 return type === "array" || type !== "function" &&
1852 ( length === 0 ||
1853 typeof length === "number" && length > 0 && ( length - 1 ) in obj );
1854}
1855
1856// All jQuery objects should point back to these
1857rootjQuery = jQuery(document);
1858/*!
1859 * Sizzle CSS Selector Engine v1.9.4-pre
1860 * http://sizzlejs.com/
1861 *
1862 * Copyright 2013 jQuery Foundation, Inc. and other contributors
1863 * Released under the MIT license
1864 * http://jquery.org/license
1865 *
1866 * Date: 2013-05-27
1867 */
1868(function( window, undefined ) {
1869
1870var i,
1871 support,
1872 cachedruns,
1873 Expr,
1874 getText,
1875 isXML,
1876 compile,
1877 outermostContext,
1878 sortInput,
1879
1880 // Local document vars
1881 setDocument,
1882 document,
1883 docElem,
1884 documentIsHTML,
1885 rbuggyQSA,
1886 rbuggyMatches,
1887 matches,
1888 contains,
1889
1890 // Instance-specific data
1891 expando = "sizzle" + -(new Date()),
1892 preferredDoc = window.document,
1893 dirruns = 0,
1894 done = 0,
1895 classCache = createCache(),
1896 tokenCache = createCache(),
1897 compilerCache = createCache(),
1898 hasDuplicate = false,
1899 sortOrder = function() { return 0; },
1900
1901 // General-purpose constants
1902 strundefined = typeof undefined,
1903 MAX_NEGATIVE = 1 << 31,
1904
1905 // Instance methods
1906 hasOwn = ({}).hasOwnProperty,
1907 arr = [],
1908 pop = arr.pop,
1909 push_native = arr.push,
1910 push = arr.push,
1911 slice = arr.slice,
1912 // Use a stripped-down indexOf if we can't use a native one
1913 indexOf = arr.indexOf || function( elem ) {
1914 var i = 0,
1915 len = this.length;
1916 for ( ; i < len; i++ ) {
1917 if ( this[i] === elem ) {
1918 return i;
1919 }
1920 }
1921 return -1;
1922 },
1923
1924 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
1925
1926 // Regular expressions
1927
1928 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
1929 whitespace = "[\\x20\\t\\r\\n\\f]",
1930 // http://www.w3.org/TR/css3-syntax/#characters
1931 characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
1932
1933 // Loosely modeled on CSS identifier characters
1934 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
1935 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
1936 identifier = characterEncoding.replace( "w", "w#" ),
1937
1938 // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
1939 attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
1940 "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
1941
1942 // Prefer arguments quoted,
1943 // then not containing pseudos/brackets,
1944 // then attribute selectors/non-parenthetical expressions,
1945 // then anything else
1946 // These preferences are here to reduce the number of selectors
1947 // needing tokenize in the PSEUDO preFilter
1948 pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
1949
1950 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
1951 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
1952
1953 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
1954 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
1955
1956 rsibling = new RegExp( whitespace + "*[+~]" ),
1957 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),
1958
1959 rpseudo = new RegExp( pseudos ),
1960 ridentifier = new RegExp( "^" + identifier + "$" ),
1961
1962 matchExpr = {
1963 "ID": new RegExp( "^#(" + characterEncoding + ")" ),
1964 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
1965 "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
1966 "ATTR": new RegExp( "^" + attributes ),
1967 "PSEUDO": new RegExp( "^" + pseudos ),
1968 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
1969 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
1970 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
1971 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
1972 // For use in libraries implementing .is()
1973 // We use this for POS matching in `select`
1974 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
1975 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
1976 },
1977
1978 rnative = /^[^{]+\{\s*\[native \w/,
1979
1980 // Easily-parseable/retrievable ID or TAG or CLASS selectors
1981 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
1982
1983 rinputs = /^(?:input|select|textarea|button)$/i,
1984 rheader = /^h\d$/i,
1985
1986 rescape = /'|\\/g,
1987
1988 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
1989 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
1990 funescape = function( _, escaped, escapedWhitespace ) {
1991 var high = "0x" + escaped - 0x10000;
1992 // NaN means non-codepoint
1993 // Support: Firefox
1994 // Workaround erroneous numeric interpretation of +"0x"
1995 return high !== high || escapedWhitespace ?
1996 escaped :
1997 // BMP codepoint
1998 high < 0 ?
1999 String.fromCharCode( high + 0x10000 ) :
2000 // Supplemental Plane codepoint (surrogate pair)
2001 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
2002 };
2003
2004// Optimize for push.apply( _, NodeList )
2005try {
2006 push.apply(
2007 (arr = slice.call( preferredDoc.childNodes )),
2008 preferredDoc.childNodes
2009 );
2010 // Support: Android<4.0
2011 // Detect silently failing push.apply
2012 arr[ preferredDoc.childNodes.length ].nodeType;
2013} catch ( e ) {
2014 push = { apply: arr.length ?
2015
2016 // Leverage slice if possible
2017 function( target, els ) {
2018 push_native.apply( target, slice.call(els) );
2019 } :
2020
2021 // Support: IE<9
2022 // Otherwise append directly
2023 function( target, els ) {
2024 var j = target.length,
2025 i = 0;
2026 // Can't trust NodeList.length
2027 while ( (target[j++] = els[i++]) ) {}
2028 target.length = j - 1;
2029 }
2030 };
2031}
2032
2033function Sizzle( selector, context, results, seed ) {
2034 var match, elem, m, nodeType,
2035 // QSA vars
2036 i, groups, old, nid, newContext, newSelector;
2037
2038 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
2039 setDocument( context );
2040 }
2041
2042 context = context || document;
2043 results = results || [];
2044
2045 if ( !selector || typeof selector !== "string" ) {
2046 return results;
2047 }
2048
2049 if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
2050 return [];
2051 }
2052
2053 if ( documentIsHTML && !seed ) {
2054
2055 // Shortcuts
2056 if ( (match = rquickExpr.exec( selector )) ) {
2057 // Speed-up: Sizzle("#ID")
2058 if ( (m = match[1]) ) {
2059 if ( nodeType === 9 ) {
2060 elem = context.getElementById( m );
2061 // Check parentNode to catch when Blackberry 4.6 returns
2062 // nodes that are no longer in the document #6963
2063 if ( elem && elem.parentNode ) {
2064 // Handle the case where IE, Opera, and Webkit return items
2065 // by name instead of ID
2066 if ( elem.id === m ) {
2067 results.push( elem );
2068 return results;
2069 }
2070 } else {
2071 return results;
2072 }
2073 } else {
2074 // Context is not a document
2075 if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
2076 contains( context, elem ) && elem.id === m ) {
2077 results.push( elem );
2078 return results;
2079 }
2080 }
2081
2082 // Speed-up: Sizzle("TAG")
2083 } else if ( match[2] ) {
2084 push.apply( results, context.getElementsByTagName( selector ) );
2085 return results;
2086
2087 // Speed-up: Sizzle(".CLASS")
2088 } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
2089 push.apply( results, context.getElementsByClassName( m ) );
2090 return results;
2091 }
2092 }
2093
2094 // QSA path
2095 if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
2096 nid = old = expando;
2097 newContext = context;
2098 newSelector = nodeType === 9 && selector;
2099
2100 // qSA works strangely on Element-rooted queries
2101 // We can work around this by specifying an extra ID on the root
2102 // and working up from there (Thanks to Andrew Dupont for the technique)
2103 // IE 8 doesn't work on object elements
2104 if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
2105 groups = tokenize( selector );
2106
2107 if ( (old = context.getAttribute("id")) ) {
2108 nid = old.replace( rescape, "\\$&" );
2109 } else {
2110 context.setAttribute( "id", nid );
2111 }
2112 nid = "[id='" + nid + "'] ";
2113
2114 i = groups.length;
2115 while ( i-- ) {
2116 groups[i] = nid + toSelector( groups[i] );
2117 }
2118 newContext = rsibling.test( selector ) && context.parentNode || context;
2119 newSelector = groups.join(",");
2120 }
2121
2122 if ( newSelector ) {
2123 try {
2124 push.apply( results,
2125 newContext.querySelectorAll( newSelector )
2126 );
2127 return results;
2128 } catch(qsaError) {
2129 } finally {
2130 if ( !old ) {
2131 context.removeAttribute("id");
2132 }
2133 }
2134 }
2135 }
2136 }
2137
2138 // All others
2139 return select( selector.replace( rtrim, "$1" ), context, results, seed );
2140}
2141
2142/**
2143 * For feature detection
2144 * @param {Function} fn The function to test for native support
2145 */
2146function isNative( fn ) {
2147 return rnative.test( fn + "" );
2148}
2149
2150/**
2151 * Create key-value caches of limited size
2152 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
2153 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
2154 * deleting the oldest entry
2155 */
2156function createCache() {
2157 var keys = [];
2158
2159 function cache( key, value ) {
2160 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
2161 if ( keys.push( key += " " ) > Expr.cacheLength ) {
2162 // Only keep the most recent entries
2163 delete cache[ keys.shift() ];
2164 }
2165 return (cache[ key ] = value);
2166 }
2167 return cache;
2168}
2169
2170/**
2171 * Mark a function for special use by Sizzle
2172 * @param {Function} fn The function to mark
2173 */
2174function markFunction( fn ) {
2175 fn[ expando ] = true;
2176 return fn;
2177}
2178
2179/**
2180 * Support testing using an element
2181 * @param {Function} fn Passed the created div and expects a boolean result
2182 */
2183function assert( fn ) {
2184 var div = document.createElement("div");
2185
2186 try {
2187 return !!fn( div );
2188 } catch (e) {
2189 return false;
2190 } finally {
2191 // Remove from its parent by default
2192 if ( div.parentNode ) {
2193 div.parentNode.removeChild( div );
2194 }
2195 // release memory in IE
2196 div = null;
2197 }
2198}
2199
2200/**
2201 * Adds the same handler for all of the specified attrs
2202 * @param {String} attrs Pipe-separated list of attributes
2203 * @param {Function} handler The method that will be applied if the test fails
2204 * @param {Boolean} test The result of a test. If true, null will be set as the handler in leiu of the specified handler
2205 */
2206function addHandle( attrs, handler, test ) {
2207 attrs = attrs.split("|");
2208 var current,
2209 i = attrs.length,
2210 setHandle = test ? null : handler;
2211
2212 while ( i-- ) {
2213 // Don't override a user's handler
2214 if ( !(current = Expr.attrHandle[ attrs[i] ]) || current === handler ) {
2215 Expr.attrHandle[ attrs[i] ] = setHandle;
2216 }
2217 }
2218}
2219
2220/**
2221 * Fetches boolean attributes by node
2222 * @param {Element} elem
2223 * @param {String} name
2224 */
2225function boolHandler( elem, name ) {
2226 // XML does not need to be checked as this will not be assigned for XML documents
2227 var val = elem.getAttributeNode( name );
2228 return val && val.specified ?
2229 val.value :
2230 elem[ name ] === true ? name.toLowerCase() : null;
2231}
2232
2233/**
2234 * Fetches attributes without interpolation
2235 * http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2236 * @param {Element} elem
2237 * @param {String} name
2238 */
2239function interpolationHandler( elem, name ) {
2240 // XML does not need to be checked as this will not be assigned for XML documents
2241 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2242}
2243
2244/**
2245 * Uses defaultValue to retrieve value in IE6/7
2246 * @param {Element} elem
2247 * @param {String} name
2248 */
2249function valueHandler( elem ) {
2250 // Ignore the value *property* on inputs by using defaultValue
2251 // Fallback to Sizzle.attr by returning undefined where appropriate
2252 // XML does not need to be checked as this will not be assigned for XML documents
2253 if ( elem.nodeName.toLowerCase() === "input" ) {
2254 return elem.defaultValue;
2255 }
2256}
2257
2258/**
2259 * Checks document order of two siblings
2260 * @param {Element} a
2261 * @param {Element} b
2262 * @returns Returns -1 if a precedes b, 1 if a follows b
2263 */
2264function siblingCheck( a, b ) {
2265 var cur = b && a,
2266 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
2267 ( ~b.sourceIndex || MAX_NEGATIVE ) -
2268 ( ~a.sourceIndex || MAX_NEGATIVE );
2269
2270 // Use IE sourceIndex if available on both nodes
2271 if ( diff ) {
2272 return diff;
2273 }
2274
2275 // Check if b follows a
2276 if ( cur ) {
2277 while ( (cur = cur.nextSibling) ) {
2278 if ( cur === b ) {
2279 return -1;
2280 }
2281 }
2282 }
2283
2284 return a ? 1 : -1;
2285}
2286
2287/**
2288 * Returns a function to use in pseudos for input types
2289 * @param {String} type
2290 */
2291function createInputPseudo( type ) {
2292 return function( elem ) {
2293 var name = elem.nodeName.toLowerCase();
2294 return name === "input" && elem.type === type;
2295 };
2296}
2297
2298/**
2299 * Returns a function to use in pseudos for buttons
2300 * @param {String} type
2301 */
2302function createButtonPseudo( type ) {
2303 return function( elem ) {
2304 var name = elem.nodeName.toLowerCase();
2305 return (name === "input" || name === "button") && elem.type === type;
2306 };
2307}
2308
2309/**
2310 * Returns a function to use in pseudos for positionals
2311 * @param {Function} fn
2312 */
2313function createPositionalPseudo( fn ) {
2314 return markFunction(function( argument ) {
2315 argument = +argument;
2316 return markFunction(function( seed, matches ) {
2317 var j,
2318 matchIndexes = fn( [], seed.length, argument ),
2319 i = matchIndexes.length;
2320
2321 // Match elements found at the specified indexes
2322 while ( i-- ) {
2323 if ( seed[ (j = matchIndexes[i]) ] ) {
2324 seed[j] = !(matches[j] = seed[j]);
2325 }
2326 }
2327 });
2328 });
2329}
2330
2331/**
2332 * Detect xml
2333 * @param {Element|Object} elem An element or a document
2334 */
2335isXML = Sizzle.isXML = function( elem ) {
2336 // documentElement is verified for cases where it doesn't yet exist
2337 // (such as loading iframes in IE - #4833)
2338 var documentElement = elem && (elem.ownerDocument || elem).documentElement;
2339 return documentElement ? documentElement.nodeName !== "HTML" : false;
2340};
2341
2342// Expose support vars for convenience
2343support = Sizzle.support = {};
2344
2345/**
2346 * Sets document-related variables once based on the current document
2347 * @param {Element|Object} [doc] An element or document object to use to set the document
2348 * @returns {Object} Returns the current document
2349 */
2350setDocument = Sizzle.setDocument = function( node ) {
2351 var doc = node ? node.ownerDocument || node : preferredDoc,
2352 parent = doc.parentWindow;
2353
2354 // If no document and documentElement is available, return
2355 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
2356 return document;
2357 }
2358
2359 // Set our document
2360 document = doc;
2361 docElem = doc.documentElement;
2362
2363 // Support tests
2364 documentIsHTML = !isXML( doc );
2365
2366 // Support: IE>8
2367 // If iframe document is assigned to "document" variable and if iframe has been reloaded,
2368 // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
2369 if ( parent && parent.frameElement ) {
2370 parent.attachEvent( "onbeforeunload", function() {
2371 setDocument();
2372 });
2373 }
2374
2375 /* Attributes
2376 ---------------------------------------------------------------------- */
2377
2378 // Support: IE<8
2379 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
2380 support.attributes = assert(function( div ) {
2381
2382 // Support: IE<8
2383 // Prevent attribute/property "interpolation"
2384 div.innerHTML = "<a href='#'></a>";
2385 addHandle( "type|href|height|width", interpolationHandler, div.firstChild.getAttribute("href") === "#" );
2386
2387 // Support: IE<9
2388 // Use getAttributeNode to fetch booleans when getAttribute lies
2389 addHandle( booleans, boolHandler, div.getAttribute("disabled") == null );
2390
2391 div.className = "i";
2392 return !div.getAttribute("className");
2393 });
2394
2395 // Support: IE<9
2396 // Retrieving value should defer to defaultValue
2397 support.input = assert(function( div ) {
2398 div.innerHTML = "<input>";
2399 div.firstChild.setAttribute( "value", "" );
2400 return div.firstChild.getAttribute( "value" ) === "";
2401 });
2402
2403 // IE6/7 still return empty string for value,
2404 // but are actually retrieving the property
2405 addHandle( "value", valueHandler, support.attributes && support.input );
2406
2407 /* getElement(s)By*
2408 ---------------------------------------------------------------------- */
2409
2410 // Check if getElementsByTagName("*") returns only elements
2411 support.getElementsByTagName = assert(function( div ) {
2412 div.appendChild( doc.createComment("") );
2413 return !div.getElementsByTagName("*").length;
2414 });
2415
2416 // Check if getElementsByClassName can be trusted
2417 support.getElementsByClassName = assert(function( div ) {
2418 div.innerHTML = "<div class='a'></div><div class='a i'></div>";
2419
2420 // Support: Safari<4
2421 // Catch class over-caching
2422 div.firstChild.className = "i";
2423 // Support: Opera<10
2424 // Catch gEBCN failure to find non-leading classes
2425 return div.getElementsByClassName("i").length === 2;
2426 });
2427
2428 // Support: IE<10
2429 // Check if getElementById returns elements by name
2430 // The broken getElementById methods don't pick up programatically-set names,
2431 // so use a roundabout getElementsByName test
2432 support.getById = assert(function( div ) {
2433 docElem.appendChild( div ).id = expando;
2434 return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
2435 });
2436
2437 // ID find and filter
2438 if ( support.getById ) {
2439 Expr.find["ID"] = function( id, context ) {
2440 if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
2441 var m = context.getElementById( id );
2442 // Check parentNode to catch when Blackberry 4.6 returns
2443 // nodes that are no longer in the document #6963
2444 return m && m.parentNode ? [m] : [];
2445 }
2446 };
2447 Expr.filter["ID"] = function( id ) {
2448 var attrId = id.replace( runescape, funescape );
2449 return function( elem ) {
2450 return elem.getAttribute("id") === attrId;
2451 };
2452 };
2453 } else {
2454 // Support: IE6/7
2455 // getElementById is not reliable as a find shortcut
2456 delete Expr.find["ID"];
2457
2458 Expr.filter["ID"] = function( id ) {
2459 var attrId = id.replace( runescape, funescape );
2460 return function( elem ) {
2461 var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
2462 return node && node.value === attrId;
2463 };
2464 };
2465 }
2466
2467 // Tag
2468 Expr.find["TAG"] = support.getElementsByTagName ?
2469 function( tag, context ) {
2470 if ( typeof context.getElementsByTagName !== strundefined ) {
2471 return context.getElementsByTagName( tag );
2472 }
2473 } :
2474 function( tag, context ) {
2475 var elem,
2476 tmp = [],
2477 i = 0,
2478 results = context.getElementsByTagName( tag );
2479
2480 // Filter out possible comments
2481 if ( tag === "*" ) {
2482 while ( (elem = results[i++]) ) {
2483 if ( elem.nodeType === 1 ) {
2484 tmp.push( elem );
2485 }
2486 }
2487
2488 return tmp;
2489 }
2490 return results;
2491 };
2492
2493 // Class
2494 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
2495 if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
2496 return context.getElementsByClassName( className );
2497 }
2498 };
2499
2500 /* QSA/matchesSelector
2501 ---------------------------------------------------------------------- */
2502
2503 // QSA and matchesSelector support
2504
2505 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
2506 rbuggyMatches = [];
2507
2508 // qSa(:focus) reports false when true (Chrome 21)
2509 // We allow this because of a bug in IE8/9 that throws an error
2510 // whenever `document.activeElement` is accessed on an iframe
2511 // So, we allow :focus to pass through QSA all the time to avoid the IE error
2512 // See http://bugs.jquery.com/ticket/13378
2513 rbuggyQSA = [];
2514
2515 if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
2516 // Build QSA regex
2517 // Regex strategy adopted from Diego Perini
2518 assert(function( div ) {
2519 // Select is set to empty string on purpose
2520 // This is to test IE's treatment of not explicitly
2521 // setting a boolean content attribute,
2522 // since its presence should be enough
2523 // http://bugs.jquery.com/ticket/12359
2524 div.innerHTML = "<select><option selected=''></option></select>";
2525
2526 // Support: IE8
2527 // Boolean attributes and "value" are not treated correctly
2528 if ( !div.querySelectorAll("[selected]").length ) {
2529 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
2530 }
2531
2532 // Webkit/Opera - :checked should return selected option elements
2533 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
2534 // IE8 throws error here and will not see later tests
2535 if ( !div.querySelectorAll(":checked").length ) {
2536 rbuggyQSA.push(":checked");
2537 }
2538 });
2539
2540 assert(function( div ) {
2541
2542 // Support: Opera 10-12/IE8
2543 // ^= $= *= and empty values
2544 // Should not select anything
2545 // Support: Windows 8 Native Apps
2546 // The type attribute is restricted during .innerHTML assignment
2547 var input = doc.createElement("input");
2548 input.setAttribute( "type", "hidden" );
2549 div.appendChild( input ).setAttribute( "t", "" );
2550
2551 if ( div.querySelectorAll("[t^='']").length ) {
2552 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
2553 }
2554
2555 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
2556 // IE8 throws error here and will not see later tests
2557 if ( !div.querySelectorAll(":enabled").length ) {
2558 rbuggyQSA.push( ":enabled", ":disabled" );
2559 }
2560
2561 // Opera 10-11 does not throw on post-comma invalid pseudos
2562 div.querySelectorAll("*,:x");
2563 rbuggyQSA.push(",.*:");
2564 });
2565 }
2566
2567 if ( (support.matchesSelector = isNative( (matches = docElem.webkitMatchesSelector ||
2568 docElem.mozMatchesSelector ||
2569 docElem.oMatchesSelector ||
2570 docElem.msMatchesSelector) )) ) {
2571
2572 assert(function( div ) {
2573 // Check to see if it's possible to do matchesSelector
2574 // on a disconnected node (IE 9)
2575 support.disconnectedMatch = matches.call( div, "div" );
2576
2577 // This should fail with an exception
2578 // Gecko does not error, returns false instead
2579 matches.call( div, "[s!='']:x" );
2580 rbuggyMatches.push( "!=", pseudos );
2581 });
2582 }
2583
2584 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
2585 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
2586
2587 /* Contains
2588 ---------------------------------------------------------------------- */
2589
2590 // Element contains another
2591 // Purposefully does not implement inclusive descendent
2592 // As in, an element does not contain itself
2593 contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
2594 function( a, b ) {
2595 var adown = a.nodeType === 9 ? a.documentElement : a,
2596 bup = b && b.parentNode;
2597 return a === bup || !!( bup && bup.nodeType === 1 && (
2598 adown.contains ?
2599 adown.contains( bup ) :
2600 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
2601 ));
2602 } :
2603 function( a, b ) {
2604 if ( b ) {
2605 while ( (b = b.parentNode) ) {
2606 if ( b === a ) {
2607 return true;
2608 }
2609 }
2610 }
2611 return false;
2612 };
2613
2614 /* Sorting
2615 ---------------------------------------------------------------------- */
2616
2617 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2618 // Detached nodes confoundingly follow *each other*
2619 support.sortDetached = assert(function( div1 ) {
2620 // Should return 1, but returns 4 (following)
2621 return div1.compareDocumentPosition( doc.createElement("div") ) & 1;
2622 });
2623
2624 // Document order sorting
2625 sortOrder = docElem.compareDocumentPosition ?
2626 function( a, b ) {
2627
2628 // Flag for duplicate removal
2629 if ( a === b ) {
2630 hasDuplicate = true;
2631 return 0;
2632 }
2633
2634 var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b );
2635
2636 if ( compare ) {
2637 // Disconnected nodes
2638 if ( compare & 1 ||
2639 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
2640
2641 // Choose the first element that is related to our preferred document
2642 if ( a === doc || contains(preferredDoc, a) ) {
2643 return -1;
2644 }
2645 if ( b === doc || contains(preferredDoc, b) ) {
2646 return 1;
2647 }
2648
2649 // Maintain original order
2650 return sortInput ?
2651 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
2652 0;
2653 }
2654
2655 return compare & 4 ? -1 : 1;
2656 }
2657
2658 // Not directly comparable, sort on existence of method
2659 return a.compareDocumentPosition ? -1 : 1;
2660 } :
2661 function( a, b ) {
2662 var cur,
2663 i = 0,
2664 aup = a.parentNode,
2665 bup = b.parentNode,
2666 ap = [ a ],
2667 bp = [ b ];
2668
2669 // Exit early if the nodes are identical
2670 if ( a === b ) {
2671 hasDuplicate = true;
2672 return 0;
2673
2674 // Parentless nodes are either documents or disconnected
2675 } else if ( !aup || !bup ) {
2676 return a === doc ? -1 :
2677 b === doc ? 1 :
2678 aup ? -1 :
2679 bup ? 1 :
2680 sortInput ?
2681 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
2682 0;
2683
2684 // If the nodes are siblings, we can do a quick check
2685 } else if ( aup === bup ) {
2686 return siblingCheck( a, b );
2687 }
2688
2689 // Otherwise we need full lists of their ancestors for comparison
2690 cur = a;
2691 while ( (cur = cur.parentNode) ) {
2692 ap.unshift( cur );
2693 }
2694 cur = b;
2695 while ( (cur = cur.parentNode) ) {
2696 bp.unshift( cur );
2697 }
2698
2699 // Walk down the tree looking for a discrepancy
2700 while ( ap[i] === bp[i] ) {
2701 i++;
2702 }
2703
2704 return i ?
2705 // Do a sibling check if the nodes have a common ancestor
2706 siblingCheck( ap[i], bp[i] ) :
2707
2708 // Otherwise nodes in our document sort first
2709 ap[i] === preferredDoc ? -1 :
2710 bp[i] === preferredDoc ? 1 :
2711 0;
2712 };
2713
2714 return doc;
2715};
2716
2717Sizzle.matches = function( expr, elements ) {
2718 return Sizzle( expr, null, null, elements );
2719};
2720
2721Sizzle.matchesSelector = function( elem, expr ) {
2722 // Set document vars if needed
2723 if ( ( elem.ownerDocument || elem ) !== document ) {
2724 setDocument( elem );
2725 }
2726
2727 // Make sure that attribute selectors are quoted
2728 expr = expr.replace( rattributeQuotes, "='$1']" );
2729
2730 if ( support.matchesSelector && documentIsHTML &&
2731 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
2732 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
2733
2734 try {
2735 var ret = matches.call( elem, expr );
2736
2737 // IE 9's matchesSelector returns false on disconnected nodes
2738 if ( ret || support.disconnectedMatch ||
2739 // As well, disconnected nodes are said to be in a document
2740 // fragment in IE 9
2741 elem.document && elem.document.nodeType !== 11 ) {
2742 return ret;
2743 }
2744 } catch(e) {}
2745 }
2746
2747 return Sizzle( expr, document, null, [elem] ).length > 0;
2748};
2749
2750Sizzle.contains = function( context, elem ) {
2751 // Set document vars if needed
2752 if ( ( context.ownerDocument || context ) !== document ) {
2753 setDocument( context );
2754 }
2755 return contains( context, elem );
2756};
2757
2758Sizzle.attr = function( elem, name ) {
2759 // Set document vars if needed
2760 if ( ( elem.ownerDocument || elem ) !== document ) {
2761 setDocument( elem );
2762 }
2763
2764 var fn = Expr.attrHandle[ name.toLowerCase() ],
2765 // Don't get fooled by Object.prototype properties (jQuery #13807)
2766 val = ( fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
2767 fn( elem, name, !documentIsHTML ) :
2768 undefined );
2769
2770 return val === undefined ?
2771 support.attributes || !documentIsHTML ?
2772 elem.getAttribute( name ) :
2773 (val = elem.getAttributeNode(name)) && val.specified ?
2774 val.value :
2775 null :
2776 val;
2777};
2778
2779Sizzle.error = function( msg ) {
2780 throw new Error( "Syntax error, unrecognized expression: " + msg );
2781};
2782
2783/**
2784 * Document sorting and removing duplicates
2785 * @param {ArrayLike} results
2786 */
2787Sizzle.uniqueSort = function( results ) {
2788 var elem,
2789 duplicates = [],
2790 j = 0,
2791 i = 0;
2792
2793 // Unless we *know* we can detect duplicates, assume their presence
2794 hasDuplicate = !support.detectDuplicates;
2795 sortInput = !support.sortStable && results.slice( 0 );
2796 results.sort( sortOrder );
2797
2798 if ( hasDuplicate ) {
2799 while ( (elem = results[i++]) ) {
2800 if ( elem === results[ i ] ) {
2801 j = duplicates.push( i );
2802 }
2803 }
2804 while ( j-- ) {
2805 results.splice( duplicates[ j ], 1 );
2806 }
2807 }
2808
2809 return results;
2810};
2811
2812/**
2813 * Utility function for retrieving the text value of an array of DOM nodes
2814 * @param {Array|Element} elem
2815 */
2816getText = Sizzle.getText = function( elem ) {
2817 var node,
2818 ret = "",
2819 i = 0,
2820 nodeType = elem.nodeType;
2821
2822 if ( !nodeType ) {
2823 // If no nodeType, this is expected to be an array
2824 for ( ; (node = elem[i]); i++ ) {
2825 // Do not traverse comment nodes
2826 ret += getText( node );
2827 }
2828 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
2829 // Use textContent for elements
2830 // innerText usage removed for consistency of new lines (see #11153)
2831 if ( typeof elem.textContent === "string" ) {
2832 return elem.textContent;
2833 } else {
2834 // Traverse its children
2835 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
2836 ret += getText( elem );
2837 }
2838 }
2839 } else if ( nodeType === 3 || nodeType === 4 ) {
2840 return elem.nodeValue;
2841 }
2842 // Do not include comment or processing instruction nodes
2843
2844 return ret;
2845};
2846
2847Expr = Sizzle.selectors = {
2848
2849 // Can be adjusted by the user
2850 cacheLength: 50,
2851
2852 createPseudo: markFunction,
2853
2854 match: matchExpr,
2855
2856 attrHandle: {},
2857
2858 find: {},
2859
2860 relative: {
2861 ">": { dir: "parentNode", first: true },
2862 " ": { dir: "parentNode" },
2863 "+": { dir: "previousSibling", first: true },
2864 "~": { dir: "previousSibling" }
2865 },
2866
2867 preFilter: {
2868 "ATTR": function( match ) {
2869 match[1] = match[1].replace( runescape, funescape );
2870
2871 // Move the given value to match[3] whether quoted or unquoted
2872 match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
2873
2874 if ( match[2] === "~=" ) {
2875 match[3] = " " + match[3] + " ";
2876 }
2877
2878 return match.slice( 0, 4 );
2879 },
2880
2881 "CHILD": function( match ) {
2882 /* matches from matchExpr["CHILD"]
2883 1 type (only|nth|...)
2884 2 what (child|of-type)
2885 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
2886 4 xn-component of xn+y argument ([+-]?\d*n|)
2887 5 sign of xn-component
2888 6 x of xn-component
2889 7 sign of y-component
2890 8 y of y-component
2891 */
2892 match[1] = match[1].toLowerCase();
2893
2894 if ( match[1].slice( 0, 3 ) === "nth" ) {
2895 // nth-* requires argument
2896 if ( !match[3] ) {
2897 Sizzle.error( match[0] );
2898 }
2899
2900 // numeric x and y parameters for Expr.filter.CHILD
2901 // remember that false/true cast respectively to 0/1
2902 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
2903 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
2904
2905 // other types prohibit arguments
2906 } else if ( match[3] ) {
2907 Sizzle.error( match[0] );
2908 }
2909
2910 return match;
2911 },
2912
2913 "PSEUDO": function( match ) {
2914 var excess,
2915 unquoted = !match[5] && match[2];
2916
2917 if ( matchExpr["CHILD"].test( match[0] ) ) {
2918 return null;
2919 }
2920
2921 // Accept quoted arguments as-is
2922 if ( match[3] && match[4] !== undefined ) {
2923 match[2] = match[4];
2924
2925 // Strip excess characters from unquoted arguments
2926 } else if ( unquoted && rpseudo.test( unquoted ) &&
2927 // Get excess from tokenize (recursively)
2928 (excess = tokenize( unquoted, true )) &&
2929 // advance to the next closing parenthesis
2930 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
2931
2932 // excess is a negative index
2933 match[0] = match[0].slice( 0, excess );
2934 match[2] = unquoted.slice( 0, excess );
2935 }
2936
2937 // Return only captures needed by the pseudo filter method (type and argument)
2938 return match.slice( 0, 3 );
2939 }
2940 },
2941
2942 filter: {
2943
2944 "TAG": function( nodeNameSelector ) {
2945 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
2946 return nodeNameSelector === "*" ?
2947 function() { return true; } :
2948 function( elem ) {
2949 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
2950 };
2951 },
2952
2953 "CLASS": function( className ) {
2954 var pattern = classCache[ className + " " ];
2955
2956 return pattern ||
2957 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
2958 classCache( className, function( elem ) {
2959 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
2960 });
2961 },
2962
2963 "ATTR": function( name, operator, check ) {
2964 return function( elem ) {
2965 var result = Sizzle.attr( elem, name );
2966
2967 if ( result == null ) {
2968 return operator === "!=";
2969 }
2970 if ( !operator ) {
2971 return true;
2972 }
2973
2974 result += "";
2975
2976 return operator === "=" ? result === check :
2977 operator === "!=" ? result !== check :
2978 operator === "^=" ? check && result.indexOf( check ) === 0 :
2979 operator === "*=" ? check && result.indexOf( check ) > -1 :
2980 operator === "$=" ? check && result.slice( -check.length ) === check :
2981 operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
2982 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
2983 false;
2984 };
2985 },
2986
2987 "CHILD": function( type, what, argument, first, last ) {
2988 var simple = type.slice( 0, 3 ) !== "nth",
2989 forward = type.slice( -4 ) !== "last",
2990 ofType = what === "of-type";
2991
2992 return first === 1 && last === 0 ?
2993
2994 // Shortcut for :nth-*(n)
2995 function( elem ) {
2996 return !!elem.parentNode;
2997 } :
2998
2999 function( elem, context, xml ) {
3000 var cache, outerCache, node, diff, nodeIndex, start,
3001 dir = simple !== forward ? "nextSibling" : "previousSibling",
3002 parent = elem.parentNode,
3003 name = ofType && elem.nodeName.toLowerCase(),
3004 useCache = !xml && !ofType;
3005
3006 if ( parent ) {
3007
3008 // :(first|last|only)-(child|of-type)
3009 if ( simple ) {
3010 while ( dir ) {
3011 node = elem;
3012 while ( (node = node[ dir ]) ) {
3013 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
3014 return false;
3015 }
3016 }
3017 // Reverse direction for :only-* (if we haven't yet done so)
3018 start = dir = type === "only" && !start && "nextSibling";
3019 }
3020 return true;
3021 }
3022
3023 start = [ forward ? parent.firstChild : parent.lastChild ];
3024
3025 // non-xml :nth-child(...) stores cache data on `parent`
3026 if ( forward && useCache ) {
3027 // Seek `elem` from a previously-cached index
3028 outerCache = parent[ expando ] || (parent[ expando ] = {});
3029 cache = outerCache[ type ] || [];
3030 nodeIndex = cache[0] === dirruns && cache[1];
3031 diff = cache[0] === dirruns && cache[2];
3032 node = nodeIndex && parent.childNodes[ nodeIndex ];
3033
3034 while ( (node = ++nodeIndex && node && node[ dir ] ||
3035
3036 // Fallback to seeking `elem` from the start
3037 (diff = nodeIndex = 0) || start.pop()) ) {
3038
3039 // When found, cache indexes on `parent` and break
3040 if ( node.nodeType === 1 && ++diff && node === elem ) {
3041 outerCache[ type ] = [ dirruns, nodeIndex, diff ];
3042 break;
3043 }
3044 }
3045
3046 // Use previously-cached element index if available
3047 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
3048 diff = cache[1];
3049
3050 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
3051 } else {
3052 // Use the same loop as above to seek `elem` from the start
3053 while ( (node = ++nodeIndex && node && node[ dir ] ||
3054 (diff = nodeIndex = 0) || start.pop()) ) {
3055
3056 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
3057 // Cache the index of each encountered element
3058 if ( useCache ) {
3059 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
3060 }
3061
3062 if ( node === elem ) {
3063 break;
3064 }
3065 }
3066 }
3067 }
3068
3069 // Incorporate the offset, then check against cycle size
3070 diff -= last;
3071 return diff === first || ( diff % first === 0 && diff / first >= 0 );
3072 }
3073 };
3074 },
3075
3076 "PSEUDO": function( pseudo, argument ) {
3077 // pseudo-class names are case-insensitive
3078 // http://www.w3.org/TR/selectors/#pseudo-classes
3079 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
3080 // Remember that setFilters inherits from pseudos
3081 var args,
3082 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
3083 Sizzle.error( "unsupported pseudo: " + pseudo );
3084
3085 // The user may use createPseudo to indicate that
3086 // arguments are needed to create the filter function
3087 // just as Sizzle does
3088 if ( fn[ expando ] ) {
3089 return fn( argument );
3090 }
3091
3092 // But maintain support for old signatures
3093 if ( fn.length > 1 ) {
3094 args = [ pseudo, pseudo, "", argument ];
3095 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
3096 markFunction(function( seed, matches ) {
3097 var idx,
3098 matched = fn( seed, argument ),
3099 i = matched.length;
3100 while ( i-- ) {
3101 idx = indexOf.call( seed, matched[i] );
3102 seed[ idx ] = !( matches[ idx ] = matched[i] );
3103 }
3104 }) :
3105 function( elem ) {
3106 return fn( elem, 0, args );
3107 };
3108 }
3109
3110 return fn;
3111 }
3112 },
3113
3114 pseudos: {
3115 // Potentially complex pseudos
3116 "not": markFunction(function( selector ) {
3117 // Trim the selector passed to compile
3118 // to avoid treating leading and trailing
3119 // spaces as combinators
3120 var input = [],
3121 results = [],
3122 matcher = compile( selector.replace( rtrim, "$1" ) );
3123
3124 return matcher[ expando ] ?
3125 markFunction(function( seed, matches, context, xml ) {
3126 var elem,
3127 unmatched = matcher( seed, null, xml, [] ),
3128 i = seed.length;
3129
3130 // Match elements unmatched by `matcher`
3131 while ( i-- ) {
3132 if ( (elem = unmatched[i]) ) {
3133 seed[i] = !(matches[i] = elem);
3134 }
3135 }
3136 }) :
3137 function( elem, context, xml ) {
3138 input[0] = elem;
3139 matcher( input, null, xml, results );
3140 return !results.pop();
3141 };
3142 }),
3143
3144 "has": markFunction(function( selector ) {
3145 return function( elem ) {
3146 return Sizzle( selector, elem ).length > 0;
3147 };
3148 }),
3149
3150 "contains": markFunction(function( text ) {
3151 return function( elem ) {
3152 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
3153 };
3154 }),
3155
3156 // "Whether an element is represented by a :lang() selector
3157 // is based solely on the element's language value
3158 // being equal to the identifier C,
3159 // or beginning with the identifier C immediately followed by "-".
3160 // The matching of C against the element's language value is performed case-insensitively.
3161 // The identifier C does not have to be a valid language name."
3162 // http://www.w3.org/TR/selectors/#lang-pseudo
3163 "lang": markFunction( function( lang ) {
3164 // lang value must be a valid identifier
3165 if ( !ridentifier.test(lang || "") ) {
3166 Sizzle.error( "unsupported lang: " + lang );
3167 }
3168 lang = lang.replace( runescape, funescape ).toLowerCase();
3169 return function( elem ) {
3170 var elemLang;
3171 do {
3172 if ( (elemLang = documentIsHTML ?
3173 elem.lang :
3174 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
3175
3176 elemLang = elemLang.toLowerCase();
3177 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
3178 }
3179 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
3180 return false;
3181 };
3182 }),
3183
3184 // Miscellaneous
3185 "target": function( elem ) {
3186 var hash = window.location && window.location.hash;
3187 return hash && hash.slice( 1 ) === elem.id;
3188 },
3189
3190 "root": function( elem ) {
3191 return elem === docElem;
3192 },
3193
3194 "focus": function( elem ) {
3195 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
3196 },
3197
3198 // Boolean properties
3199 "enabled": function( elem ) {
3200 return elem.disabled === false;
3201 },
3202
3203 "disabled": function( elem ) {
3204 return elem.disabled === true;
3205 },
3206
3207 "checked": function( elem ) {
3208 // In CSS3, :checked should return both checked and selected elements
3209 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
3210 var nodeName = elem.nodeName.toLowerCase();
3211 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
3212 },
3213
3214 "selected": function( elem ) {
3215 // Accessing this property makes selected-by-default
3216 // options in Safari work properly
3217 if ( elem.parentNode ) {
3218 elem.parentNode.selectedIndex;
3219 }
3220
3221 return elem.selected === true;
3222 },
3223
3224 // Contents
3225 "empty": function( elem ) {
3226 // http://www.w3.org/TR/selectors/#empty-pseudo
3227 // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
3228 // not comment, processing instructions, or others
3229 // Thanks to Diego Perini for the nodeName shortcut
3230 // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
3231 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
3232 if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
3233 return false;
3234 }
3235 }
3236 return true;
3237 },
3238
3239 "parent": function( elem ) {
3240 return !Expr.pseudos["empty"]( elem );
3241 },
3242
3243 // Element/input types
3244 "header": function( elem ) {
3245 return rheader.test( elem.nodeName );
3246 },
3247
3248 "input": function( elem ) {
3249 return rinputs.test( elem.nodeName );
3250 },
3251
3252 "button": function( elem ) {
3253 var name = elem.nodeName.toLowerCase();
3254 return name === "input" && elem.type === "button" || name === "button";
3255 },
3256
3257 "text": function( elem ) {
3258 var attr;
3259 // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
3260 // use getAttribute instead to test this case
3261 return elem.nodeName.toLowerCase() === "input" &&
3262 elem.type === "text" &&
3263 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
3264 },
3265
3266 // Position-in-collection
3267 "first": createPositionalPseudo(function() {
3268 return [ 0 ];
3269 }),
3270
3271 "last": createPositionalPseudo(function( matchIndexes, length ) {
3272 return [ length - 1 ];
3273 }),
3274
3275 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
3276 return [ argument < 0 ? argument + length : argument ];
3277 }),
3278
3279 "even": createPositionalPseudo(function( matchIndexes, length ) {
3280 var i = 0;
3281 for ( ; i < length; i += 2 ) {
3282 matchIndexes.push( i );
3283 }
3284 return matchIndexes;
3285 }),
3286
3287 "odd": createPositionalPseudo(function( matchIndexes, length ) {
3288 var i = 1;
3289 for ( ; i < length; i += 2 ) {
3290 matchIndexes.push( i );
3291 }
3292 return matchIndexes;
3293 }),
3294
3295 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
3296 var i = argument < 0 ? argument + length : argument;
3297 for ( ; --i >= 0; ) {
3298 matchIndexes.push( i );
3299 }
3300 return matchIndexes;
3301 }),
3302
3303 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
3304 var i = argument < 0 ? argument + length : argument;
3305 for ( ; ++i < length; ) {
3306 matchIndexes.push( i );
3307 }
3308 return matchIndexes;
3309 })
3310 }
3311};
3312
3313// Add button/input type pseudos
3314for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
3315 Expr.pseudos[ i ] = createInputPseudo( i );
3316}
3317for ( i in { submit: true, reset: true } ) {
3318 Expr.pseudos[ i ] = createButtonPseudo( i );
3319}
3320
3321function tokenize( selector, parseOnly ) {
3322 var matched, match, tokens, type,
3323 soFar, groups, preFilters,
3324 cached = tokenCache[ selector + " " ];
3325
3326 if ( cached ) {
3327 return parseOnly ? 0 : cached.slice( 0 );
3328 }
3329
3330 soFar = selector;
3331 groups = [];
3332 preFilters = Expr.preFilter;
3333
3334 while ( soFar ) {
3335
3336 // Comma and first run
3337 if ( !matched || (match = rcomma.exec( soFar )) ) {
3338 if ( match ) {
3339 // Don't consume trailing commas as valid
3340 soFar = soFar.slice( match[0].length ) || soFar;
3341 }
3342 groups.push( tokens = [] );
3343 }
3344
3345 matched = false;
3346
3347 // Combinators
3348 if ( (match = rcombinators.exec( soFar )) ) {
3349 matched = match.shift();
3350 tokens.push({
3351 value: matched,
3352 // Cast descendant combinators to space
3353 type: match[0].replace( rtrim, " " )
3354 });
3355 soFar = soFar.slice( matched.length );
3356 }
3357
3358 // Filters
3359 for ( type in Expr.filter ) {
3360 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
3361 (match = preFilters[ type ]( match ))) ) {
3362 matched = match.shift();
3363 tokens.push({
3364 value: matched,
3365 type: type,
3366 matches: match
3367 });
3368 soFar = soFar.slice( matched.length );
3369 }
3370 }
3371
3372 if ( !matched ) {
3373 break;
3374 }
3375 }
3376
3377 // Return the length of the invalid excess
3378 // if we're just parsing
3379 // Otherwise, throw an error or return tokens
3380 return parseOnly ?
3381 soFar.length :
3382 soFar ?
3383 Sizzle.error( selector ) :
3384 // Cache the tokens
3385 tokenCache( selector, groups ).slice( 0 );
3386}
3387
3388function toSelector( tokens ) {
3389 var i = 0,
3390 len = tokens.length,
3391 selector = "";
3392 for ( ; i < len; i++ ) {
3393 selector += tokens[i].value;
3394 }
3395 return selector;
3396}
3397
3398function addCombinator( matcher, combinator, base ) {
3399 var dir = combinator.dir,
3400 checkNonElements = base && dir === "parentNode",
3401 doneName = done++;
3402
3403 return combinator.first ?
3404 // Check against closest ancestor/preceding element
3405 function( elem, context, xml ) {
3406 while ( (elem = elem[ dir ]) ) {
3407 if ( elem.nodeType === 1 || checkNonElements ) {
3408 return matcher( elem, context, xml );
3409 }
3410 }
3411 } :
3412
3413 // Check against all ancestor/preceding elements
3414 function( elem, context, xml ) {
3415 var data, cache, outerCache,
3416 dirkey = dirruns + " " + doneName;
3417
3418 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
3419 if ( xml ) {
3420 while ( (elem = elem[ dir ]) ) {
3421 if ( elem.nodeType === 1 || checkNonElements ) {
3422 if ( matcher( elem, context, xml ) ) {
3423 return true;
3424 }
3425 }
3426 }
3427 } else {
3428 while ( (elem = elem[ dir ]) ) {
3429 if ( elem.nodeType === 1 || checkNonElements ) {
3430 outerCache = elem[ expando ] || (elem[ expando ] = {});
3431 if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
3432 if ( (data = cache[1]) === true || data === cachedruns ) {
3433 return data === true;
3434 }
3435 } else {
3436 cache = outerCache[ dir ] = [ dirkey ];
3437 cache[1] = matcher( elem, context, xml ) || cachedruns;
3438 if ( cache[1] === true ) {
3439 return true;
3440 }
3441 }
3442 }
3443 }
3444 }
3445 };
3446}
3447
3448function elementMatcher( matchers ) {
3449 return matchers.length > 1 ?
3450 function( elem, context, xml ) {
3451 var i = matchers.length;
3452 while ( i-- ) {
3453 if ( !matchers[i]( elem, context, xml ) ) {
3454 return false;
3455 }
3456 }
3457 return true;
3458 } :
3459 matchers[0];
3460}
3461
3462function condense( unmatched, map, filter, context, xml ) {
3463 var elem,
3464 newUnmatched = [],
3465 i = 0,
3466 len = unmatched.length,
3467 mapped = map != null;
3468
3469 for ( ; i < len; i++ ) {
3470 if ( (elem = unmatched[i]) ) {
3471 if ( !filter || filter( elem, context, xml ) ) {
3472 newUnmatched.push( elem );
3473 if ( mapped ) {
3474 map.push( i );
3475 }
3476 }
3477 }
3478 }
3479
3480 return newUnmatched;
3481}
3482
3483function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
3484 if ( postFilter && !postFilter[ expando ] ) {
3485 postFilter = setMatcher( postFilter );
3486 }
3487 if ( postFinder && !postFinder[ expando ] ) {
3488 postFinder = setMatcher( postFinder, postSelector );
3489 }
3490 return markFunction(function( seed, results, context, xml ) {
3491 var temp, i, elem,
3492 preMap = [],
3493 postMap = [],
3494 preexisting = results.length,
3495
3496 // Get initial elements from seed or context
3497 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
3498
3499 // Prefilter to get matcher input, preserving a map for seed-results synchronization
3500 matcherIn = preFilter && ( seed || !selector ) ?
3501 condense( elems, preMap, preFilter, context, xml ) :
3502 elems,
3503
3504 matcherOut = matcher ?
3505 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
3506 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
3507
3508 // ...intermediate processing is necessary
3509 [] :
3510
3511 // ...otherwise use results directly
3512 results :
3513 matcherIn;
3514
3515 // Find primary matches
3516 if ( matcher ) {
3517 matcher( matcherIn, matcherOut, context, xml );
3518 }
3519
3520 // Apply postFilter
3521 if ( postFilter ) {
3522 temp = condense( matcherOut, postMap );
3523 postFilter( temp, [], context, xml );
3524
3525 // Un-match failing elements by moving them back to matcherIn
3526 i = temp.length;
3527 while ( i-- ) {
3528 if ( (elem = temp[i]) ) {
3529 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
3530 }
3531 }
3532 }
3533
3534 if ( seed ) {
3535 if ( postFinder || preFilter ) {
3536 if ( postFinder ) {
3537 // Get the final matcherOut by condensing this intermediate into postFinder contexts
3538 temp = [];
3539 i = matcherOut.length;
3540 while ( i-- ) {
3541 if ( (elem = matcherOut[i]) ) {
3542 // Restore matcherIn since elem is not yet a final match
3543 temp.push( (matcherIn[i] = elem) );
3544 }
3545 }
3546 postFinder( null, (matcherOut = []), temp, xml );
3547 }
3548
3549 // Move matched elements from seed to results to keep them synchronized
3550 i = matcherOut.length;
3551 while ( i-- ) {
3552 if ( (elem = matcherOut[i]) &&
3553 (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
3554
3555 seed[temp] = !(results[temp] = elem);
3556 }
3557 }
3558 }
3559
3560 // Add elements to results, through postFinder if defined
3561 } else {
3562 matcherOut = condense(
3563 matcherOut === results ?
3564 matcherOut.splice( preexisting, matcherOut.length ) :
3565 matcherOut
3566 );
3567 if ( postFinder ) {
3568 postFinder( null, results, matcherOut, xml );
3569 } else {
3570 push.apply( results, matcherOut );
3571 }
3572 }
3573 });
3574}
3575
3576function matcherFromTokens( tokens ) {
3577 var checkContext, matcher, j,
3578 len = tokens.length,
3579 leadingRelative = Expr.relative[ tokens[0].type ],
3580 implicitRelative = leadingRelative || Expr.relative[" "],
3581 i = leadingRelative ? 1 : 0,
3582
3583 // The foundational matcher ensures that elements are reachable from top-level context(s)
3584 matchContext = addCombinator( function( elem ) {
3585 return elem === checkContext;
3586 }, implicitRelative, true ),
3587 matchAnyContext = addCombinator( function( elem ) {
3588 return indexOf.call( checkContext, elem ) > -1;
3589 }, implicitRelative, true ),
3590 matchers = [ function( elem, context, xml ) {
3591 return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
3592 (checkContext = context).nodeType ?
3593 matchContext( elem, context, xml ) :
3594 matchAnyContext( elem, context, xml ) );
3595 } ];
3596
3597 for ( ; i < len; i++ ) {
3598 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
3599 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
3600 } else {
3601 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
3602
3603 // Return special upon seeing a positional matcher
3604 if ( matcher[ expando ] ) {
3605 // Find the next relative operator (if any) for proper handling
3606 j = ++i;
3607 for ( ; j < len; j++ ) {
3608 if ( Expr.relative[ tokens[j].type ] ) {
3609 break;
3610 }
3611 }
3612 return setMatcher(
3613 i > 1 && elementMatcher( matchers ),
3614 i > 1 && toSelector(
3615 // If the preceding token was a descendant combinator, insert an implicit any-element `*`
3616 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
3617 ).replace( rtrim, "$1" ),
3618 matcher,
3619 i < j && matcherFromTokens( tokens.slice( i, j ) ),
3620 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
3621 j < len && toSelector( tokens )
3622 );
3623 }
3624 matchers.push( matcher );
3625 }
3626 }
3627
3628 return elementMatcher( matchers );
3629}
3630
3631function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
3632 // A counter to specify which element is currently being matched
3633 var matcherCachedRuns = 0,
3634 bySet = setMatchers.length > 0,
3635 byElement = elementMatchers.length > 0,
3636 superMatcher = function( seed, context, xml, results, expandContext ) {
3637 var elem, j, matcher,
3638 setMatched = [],
3639 matchedCount = 0,
3640 i = "0",
3641 unmatched = seed && [],
3642 outermost = expandContext != null,
3643 contextBackup = outermostContext,
3644 // We must always have either seed elements or context
3645 elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
3646 // Use integer dirruns iff this is the outermost matcher
3647 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
3648
3649 if ( outermost ) {
3650 outermostContext = context !== document && context;
3651 cachedruns = matcherCachedRuns;
3652 }
3653
3654 // Add elements passing elementMatchers directly to results
3655 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
3656 for ( ; (elem = elems[i]) != null; i++ ) {
3657 if ( byElement && elem ) {
3658 j = 0;
3659 while ( (matcher = elementMatchers[j++]) ) {
3660 if ( matcher( elem, context, xml ) ) {
3661 results.push( elem );
3662 break;
3663 }
3664 }
3665 if ( outermost ) {
3666 dirruns = dirrunsUnique;
3667 cachedruns = ++matcherCachedRuns;
3668 }
3669 }
3670
3671 // Track unmatched elements for set filters
3672 if ( bySet ) {
3673 // They will have gone through all possible matchers
3674 if ( (elem = !matcher && elem) ) {
3675 matchedCount--;
3676 }
3677
3678 // Lengthen the array for every element, matched or not
3679 if ( seed ) {
3680 unmatched.push( elem );
3681 }
3682 }
3683 }
3684
3685 // Apply set filters to unmatched elements
3686 matchedCount += i;
3687 if ( bySet && i !== matchedCount ) {
3688 j = 0;
3689 while ( (matcher = setMatchers[j++]) ) {
3690 matcher( unmatched, setMatched, context, xml );
3691 }
3692
3693 if ( seed ) {
3694 // Reintegrate element matches to eliminate the need for sorting
3695 if ( matchedCount > 0 ) {
3696 while ( i-- ) {
3697 if ( !(unmatched[i] || setMatched[i]) ) {
3698 setMatched[i] = pop.call( results );
3699 }
3700 }
3701 }
3702
3703 // Discard index placeholder values to get only actual matches
3704 setMatched = condense( setMatched );
3705 }
3706
3707 // Add matches to results
3708 push.apply( results, setMatched );
3709
3710 // Seedless set matches succeeding multiple successful matchers stipulate sorting
3711 if ( outermost && !seed && setMatched.length > 0 &&
3712 ( matchedCount + setMatchers.length ) > 1 ) {
3713
3714 Sizzle.uniqueSort( results );
3715 }
3716 }
3717
3718 // Override manipulation of globals by nested matchers
3719 if ( outermost ) {
3720 dirruns = dirrunsUnique;
3721 outermostContext = contextBackup;
3722 }
3723
3724 return unmatched;
3725 };
3726
3727 return bySet ?
3728 markFunction( superMatcher ) :
3729 superMatcher;
3730}
3731
3732compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
3733 var i,
3734 setMatchers = [],
3735 elementMatchers = [],
3736 cached = compilerCache[ selector + " " ];
3737
3738 if ( !cached ) {
3739 // Generate a function of recursive functions that can be used to check each element
3740 if ( !group ) {
3741 group = tokenize( selector );
3742 }
3743 i = group.length;
3744 while ( i-- ) {
3745 cached = matcherFromTokens( group[i] );
3746 if ( cached[ expando ] ) {
3747 setMatchers.push( cached );
3748 } else {
3749 elementMatchers.push( cached );
3750 }
3751 }
3752
3753 // Cache the compiled function
3754 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
3755 }
3756 return cached;
3757};
3758
3759function multipleContexts( selector, contexts, results ) {
3760 var i = 0,
3761 len = contexts.length;
3762 for ( ; i < len; i++ ) {
3763 Sizzle( selector, contexts[i], results );
3764 }
3765 return results;
3766}
3767
3768function select( selector, context, results, seed ) {
3769 var i, tokens, token, type, find,
3770 match = tokenize( selector );
3771
3772 if ( !seed ) {
3773 // Try to minimize operations if there is only one group
3774 if ( match.length === 1 ) {
3775
3776 // Take a shortcut and set the context if the root selector is an ID
3777 tokens = match[0] = match[0].slice( 0 );
3778 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
3779 support.getById && context.nodeType === 9 && documentIsHTML &&
3780 Expr.relative[ tokens[1].type ] ) {
3781
3782 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
3783 if ( !context ) {
3784 return results;
3785 }
3786 selector = selector.slice( tokens.shift().value.length );
3787 }
3788
3789 // Fetch a seed set for right-to-left matching
3790 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
3791 while ( i-- ) {
3792 token = tokens[i];
3793
3794 // Abort if we hit a combinator
3795 if ( Expr.relative[ (type = token.type) ] ) {
3796 break;
3797 }
3798 if ( (find = Expr.find[ type ]) ) {
3799 // Search, expanding context for leading sibling combinators
3800 if ( (seed = find(
3801 token.matches[0].replace( runescape, funescape ),
3802 rsibling.test( tokens[0].type ) && context.parentNode || context
3803 )) ) {
3804
3805 // If seed is empty or no tokens remain, we can return early
3806 tokens.splice( i, 1 );
3807 selector = seed.length && toSelector( tokens );
3808 if ( !selector ) {
3809 push.apply( results, seed );
3810 return results;
3811 }
3812
3813 break;
3814 }
3815 }
3816 }
3817 }
3818 }
3819
3820 // Compile and execute a filtering function
3821 // Provide `match` to avoid retokenization if we modified the selector above
3822 compile( selector, match )(
3823 seed,
3824 context,
3825 !documentIsHTML,
3826 results,
3827 rsibling.test( selector )
3828 );
3829 return results;
3830}
3831
3832// Deprecated
3833Expr.pseudos["nth"] = Expr.pseudos["eq"];
3834
3835// Easy API for creating new setFilters
3836function setFilters() {}
3837setFilters.prototype = Expr.filters = Expr.pseudos;
3838Expr.setFilters = new setFilters();
3839
3840// One-time assignments
3841
3842// Sort stability
3843support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
3844
3845// Initialize against the default document
3846setDocument();
3847
3848// Support: Chrome<<14
3849// Always assume duplicates if they aren't passed to the comparison function
3850[0, 0].sort( sortOrder );
3851support.detectDuplicates = hasDuplicate;
3852
3853jQuery.find = Sizzle;
3854jQuery.expr = Sizzle.selectors;
3855jQuery.expr[":"] = jQuery.expr.pseudos;
3856jQuery.unique = Sizzle.uniqueSort;
3857jQuery.text = Sizzle.getText;
3858jQuery.isXMLDoc = Sizzle.isXML;
3859jQuery.contains = Sizzle.contains;
3860
3861
3862})( window );
3863// String to Object options format cache
3864var optionsCache = {};
3865
3866// Convert String-formatted options into Object-formatted ones and store in cache
3867function createOptions( options ) {
3868 var object = optionsCache[ options ] = {};
3869 jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
3870 object[ flag ] = true;
3871 });
3872 return object;
3873}
3874
3875/*
3876 * Create a callback list using the following parameters:
3877 *
3878 * options: an optional list of space-separated options that will change how
3879 * the callback list behaves or a more traditional option object
3880 *
3881 * By default a callback list will act like an event callback list and can be
3882 * "fired" multiple times.
3883 *
3884 * Possible options:
3885 *
3886 * once: will ensure the callback list can only be fired once (like a Deferred)
3887 *
3888 * memory: will keep track of previous values and will call any callback added
3889 * after the list has been fired right away with the latest "memorized"
3890 * values (like a Deferred)
3891 *
3892 * unique: will ensure a callback can only be added once (no duplicate in the list)
3893 *
3894 * stopOnFalse: interrupt callings when a callback returns false
3895 *
3896 */
3897jQuery.Callbacks = function( options ) {
3898
3899 // Convert options from String-formatted to Object-formatted if needed
3900 // (we check in cache first)
3901 options = typeof options === "string" ?
3902 ( optionsCache[ options ] || createOptions( options ) ) :
3903 jQuery.extend( {}, options );
3904
3905 var // Flag to know if list is currently firing
3906 firing,
3907 // Last fire value (for non-forgettable lists)
3908 memory,
3909 // Flag to know if list was already fired
3910 fired,
3911 // End of the loop when firing
3912 firingLength,
3913 // Index of currently firing callback (modified by remove if needed)
3914 firingIndex,
3915 // First callback to fire (used internally by add and fireWith)
3916 firingStart,
3917 // Actual callback list
3918 list = [],
3919 // Stack of fire calls for repeatable lists
3920 stack = !options.once && [],
3921 // Fire callbacks
3922 fire = function( data ) {
3923 memory = options.memory && data;
3924 fired = true;
3925 firingIndex = firingStart || 0;
3926 firingStart = 0;
3927 firingLength = list.length;
3928 firing = true;
3929 for ( ; list && firingIndex < firingLength; firingIndex++ ) {
3930 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
3931 memory = false; // To prevent further calls using add
3932 break;
3933 }
3934 }
3935 firing = false;
3936 if ( list ) {
3937 if ( stack ) {
3938 if ( stack.length ) {
3939 fire( stack.shift() );
3940 }
3941 } else if ( memory ) {
3942 list = [];
3943 } else {
3944 self.disable();
3945 }
3946 }
3947 },
3948 // Actual Callbacks object
3949 self = {
3950 // Add a callback or a collection of callbacks to the list
3951 add: function() {
3952 if ( list ) {
3953 // First, we save the current length
3954 var start = list.length;
3955 (function add( args ) {
3956 jQuery.each( args, function( _, arg ) {
3957 var type = jQuery.type( arg );
3958 if ( type === "function" ) {
3959 if ( !options.unique || !self.has( arg ) ) {
3960 list.push( arg );
3961 }
3962 } else if ( arg && arg.length && type !== "string" ) {
3963 // Inspect recursively
3964 add( arg );
3965 }
3966 });
3967 })( arguments );
3968 // Do we need to add the callbacks to the
3969 // current firing batch?
3970 if ( firing ) {
3971 firingLength = list.length;
3972 // With memory, if we're not firing then
3973 // we should call right away
3974 } else if ( memory ) {
3975 firingStart = start;
3976 fire( memory );
3977 }
3978 }
3979 return this;
3980 },
3981 // Remove a callback from the list
3982 remove: function() {
3983 if ( list ) {
3984 jQuery.each( arguments, function( _, arg ) {
3985 var index;
3986 while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3987 list.splice( index, 1 );
3988 // Handle firing indexes
3989 if ( firing ) {
3990 if ( index <= firingLength ) {
3991 firingLength--;
3992 }
3993 if ( index <= firingIndex ) {
3994 firingIndex--;
3995 }
3996 }
3997 }
3998 });
3999 }
4000 return this;
4001 },
4002 // Check if a given callback is in the list.
4003 // If no argument is given, return whether or not list has callbacks attached.
4004 has: function( fn ) {
4005 return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
4006 },
4007 // Remove all callbacks from the list
4008 empty: function() {
4009 list = [];
4010 firingLength = 0;
4011 return this;
4012 },
4013 // Have the list do nothing anymore
4014 disable: function() {
4015 list = stack = memory = undefined;
4016 return this;
4017 },
4018 // Is it disabled?
4019 disabled: function() {
4020 return !list;
4021 },
4022 // Lock the list in its current state
4023 lock: function() {
4024 stack = undefined;
4025 if ( !memory ) {
4026 self.disable();
4027 }
4028 return this;
4029 },
4030 // Is it locked?
4031 locked: function() {
4032 return !stack;
4033 },
4034 // Call all callbacks with the given context and arguments
4035 fireWith: function( context, args ) {
4036 args = args || [];
4037 args = [ context, args.slice ? args.slice() : args ];
4038 if ( list && ( !fired || stack ) ) {
4039 if ( firing ) {
4040 stack.push( args );
4041 } else {
4042 fire( args );
4043 }
4044 }
4045 return this;
4046 },
4047 // Call all the callbacks with the given arguments
4048 fire: function() {
4049 self.fireWith( this, arguments );
4050 return this;
4051 },
4052 // To know if the callbacks have already been called at least once
4053 fired: function() {
4054 return !!fired;
4055 }
4056 };
4057
4058 return self;
4059};
4060jQuery.extend({
4061
4062 Deferred: function( func ) {
4063 var tuples = [
4064 // action, add listener, listener list, final state
4065 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
4066 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
4067 [ "notify", "progress", jQuery.Callbacks("memory") ]
4068 ],
4069 state = "pending",
4070 promise = {
4071 state: function() {
4072 return state;
4073 },
4074 always: function() {
4075 deferred.done( arguments ).fail( arguments );
4076 return this;
4077 },
4078 then: function( /* fnDone, fnFail, fnProgress */ ) {
4079 var fns = arguments;
4080 return jQuery.Deferred(function( newDefer ) {
4081 jQuery.each( tuples, function( i, tuple ) {
4082 var action = tuple[ 0 ],
4083 fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
4084 // deferred[ done | fail | progress ] for forwarding actions to newDefer
4085 deferred[ tuple[1] ](function() {
4086 var returned = fn && fn.apply( this, arguments );
4087 if ( returned && jQuery.isFunction( returned.promise ) ) {
4088 returned.promise()
4089 .done( newDefer.resolve )
4090 .fail( newDefer.reject )
4091 .progress( newDefer.notify );
4092 } else {
4093 newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
4094 }
4095 });
4096 });
4097 fns = null;
4098 }).promise();
4099 },
4100 // Get a promise for this deferred
4101 // If obj is provided, the promise aspect is added to the object
4102 promise: function( obj ) {
4103 return obj != null ? jQuery.extend( obj, promise ) : promise;
4104 }
4105 },
4106 deferred = {};
4107
4108 // Keep pipe for back-compat
4109 promise.pipe = promise.then;
4110
4111 // Add list-specific methods
4112 jQuery.each( tuples, function( i, tuple ) {
4113 var list = tuple[ 2 ],
4114 stateString = tuple[ 3 ];
4115
4116 // promise[ done | fail | progress ] = list.add
4117 promise[ tuple[1] ] = list.add;
4118
4119 // Handle state
4120 if ( stateString ) {
4121 list.add(function() {
4122 // state = [ resolved | rejected ]
4123 state = stateString;
4124
4125 // [ reject_list | resolve_list ].disable; progress_list.lock
4126 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
4127 }
4128
4129 // deferred[ resolve | reject | notify ]
4130 deferred[ tuple[0] ] = function() {
4131 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
4132 return this;
4133 };
4134 deferred[ tuple[0] + "With" ] = list.fireWith;
4135 });
4136
4137 // Make the deferred a promise
4138 promise.promise( deferred );
4139
4140 // Call given func if any
4141 if ( func ) {
4142 func.call( deferred, deferred );
4143 }
4144
4145 // All done!
4146 return deferred;
4147 },
4148
4149 // Deferred helper
4150 when: function( subordinate /* , ..., subordinateN */ ) {
4151 var i = 0,
4152 resolveValues = core_slice.call( arguments ),
4153 length = resolveValues.length,
4154
4155 // the count of uncompleted subordinates
4156 remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
4157
4158 // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
4159 deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
4160
4161 // Update function for both resolve and progress values
4162 updateFunc = function( i, contexts, values ) {
4163 return function( value ) {
4164 contexts[ i ] = this;
4165 values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
4166 if( values === progressValues ) {
4167 deferred.notifyWith( contexts, values );
4168 } else if ( !( --remaining ) ) {
4169 deferred.resolveWith( contexts, values );
4170 }
4171 };
4172 },
4173
4174 progressValues, progressContexts, resolveContexts;
4175
4176 // add listeners to Deferred subordinates; treat others as resolved
4177 if ( length > 1 ) {
4178 progressValues = new Array( length );
4179 progressContexts = new Array( length );
4180 resolveContexts = new Array( length );
4181 for ( ; i < length; i++ ) {
4182 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
4183 resolveValues[ i ].promise()
4184 .done( updateFunc( i, resolveContexts, resolveValues ) )
4185 .fail( deferred.reject )
4186 .progress( updateFunc( i, progressContexts, progressValues ) );
4187 } else {
4188 --remaining;
4189 }
4190 }
4191 }
4192
4193 // if we're not waiting on anything, resolve the master
4194 if ( !remaining ) {
4195 deferred.resolveWith( resolveContexts, resolveValues );
4196 }
4197
4198 return deferred.promise();
4199 }
4200});
4201jQuery.support = (function( support ) {
4202
4203 var all, a, input, select, fragment, opt, eventName, isSupported, i,
4204 div = document.createElement("div");
4205
4206 // Setup
4207 div.setAttribute( "className", "t" );
4208 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
4209
4210 // Finish early in limited (non-browser) environments
4211 all = div.getElementsByTagName("*") || [];
4212 a = div.getElementsByTagName("a")[ 0 ];
4213 if ( !a || !a.style || !all.length ) {
4214 return support;
4215 }
4216
4217 // First batch of tests
4218 select = document.createElement("select");
4219 opt = select.appendChild( document.createElement("option") );
4220 input = div.getElementsByTagName("input")[ 0 ];
4221
4222 a.style.cssText = "top:1px;float:left;opacity:.5";
4223
4224 // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
4225 support.getSetAttribute = div.className !== "t";
4226
4227 // IE strips leading whitespace when .innerHTML is used
4228 support.leadingWhitespace = div.firstChild.nodeType === 3;
4229
4230 // Make sure that tbody elements aren't automatically inserted
4231 // IE will insert them into empty tables
4232 support.tbody = !div.getElementsByTagName("tbody").length;
4233
4234 // Make sure that link elements get serialized correctly by innerHTML
4235 // This requires a wrapper element in IE
4236 support.htmlSerialize = !!div.getElementsByTagName("link").length;
4237
4238 // Get the style information from getAttribute
4239 // (IE uses .cssText instead)
4240 support.style = /top/.test( a.getAttribute("style") );
4241
4242 // Make sure that URLs aren't manipulated
4243 // (IE normalizes it by default)
4244 support.hrefNormalized = a.getAttribute("href") === "/a";
4245
4246 // Make sure that element opacity exists
4247 // (IE uses filter instead)
4248 // Use a regex to work around a WebKit issue. See #5145
4249 support.opacity = /^0.5/.test( a.style.opacity );
4250
4251 // Verify style float existence
4252 // (IE uses styleFloat instead of cssFloat)
4253 support.cssFloat = !!a.style.cssFloat;
4254
4255 // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
4256 support.checkOn = !!input.value;
4257
4258 // Make sure that a selected-by-default option has a working selected property.
4259 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
4260 support.optSelected = opt.selected;
4261
4262 // Tests for enctype support on a form (#6743)
4263 support.enctype = !!document.createElement("form").enctype;
4264
4265 // Makes sure cloning an html5 element does not cause problems
4266 // Where outerHTML is undefined, this still works
4267 support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>";
4268
4269 // Will be defined later
4270 support.inlineBlockNeedsLayout = false;
4271 support.shrinkWrapBlocks = false;
4272 support.pixelPosition = false;
4273 support.deleteExpando = true;
4274 support.noCloneEvent = true;
4275 support.reliableMarginRight = true;
4276 support.boxSizingReliable = true;
4277
4278 // Make sure checked status is properly cloned
4279 input.checked = true;
4280 support.noCloneChecked = input.cloneNode( true ).checked;
4281
4282 // Make sure that the options inside disabled selects aren't marked as disabled
4283 // (WebKit marks them as disabled)
4284 select.disabled = true;
4285 support.optDisabled = !opt.disabled;
4286
4287 // Support: IE<9
4288 try {
4289 delete div.test;
4290 } catch( e ) {
4291 support.deleteExpando = false;
4292 }
4293
4294 // Check if we can trust getAttribute("value")
4295 input = document.createElement("input");
4296 input.setAttribute( "value", "" );
4297 support.input = input.getAttribute( "value" ) === "";
4298
4299 // Check if an input maintains its value after becoming a radio
4300 input.value = "t";
4301 input.setAttribute( "type", "radio" );
4302 support.radioValue = input.value === "t";
4303
4304 // #11217 - WebKit loses check when the name is after the checked attribute
4305 input.setAttribute( "checked", "t" );
4306 input.setAttribute( "name", "t" );
4307
4308 fragment = document.createDocumentFragment();
4309 fragment.appendChild( input );
4310
4311 // Check if a disconnected checkbox will retain its checked
4312 // value of true after appended to the DOM (IE6/7)
4313 support.appendChecked = input.checked;
4314
4315 // WebKit doesn't clone checked state correctly in fragments
4316 support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
4317
4318 // Support: IE<9
4319 // Opera does not clone events (and typeof div.attachEvent === undefined).
4320 // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
4321 if ( div.attachEvent ) {
4322 div.attachEvent( "onclick", function() {
4323 support.noCloneEvent = false;
4324 });
4325
4326 div.cloneNode( true ).click();
4327 }
4328
4329 // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
4330 // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
4331 for ( i in { submit: true, change: true, focusin: true }) {
4332 div.setAttribute( eventName = "on" + i, "t" );
4333
4334 support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
4335 }
4336
4337 div.style.backgroundClip = "content-box";
4338 div.cloneNode( true ).style.backgroundClip = "";
4339 support.clearCloneStyle = div.style.backgroundClip === "content-box";
4340
4341 // Support: IE<9
4342 // Iteration over object's inherited properties before its own.
4343 for ( i in jQuery( support ) ) {
4344 break;
4345 }
4346 support.ownLast = i !== "0";
4347
4348 // Run tests that need a body at doc ready
4349 jQuery(function() {
4350 var container, marginDiv, tds,
4351 divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
4352 body = document.getElementsByTagName("body")[0];
4353
4354 if ( !body ) {
4355 // Return for frameset docs that don't have a body
4356 return;
4357 }
4358
4359 container = document.createElement("div");
4360 container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
4361
4362 body.appendChild( container ).appendChild( div );
4363
4364 // Support: IE8
4365 // Check if table cells still have offsetWidth/Height when they are set
4366 // to display:none and there are still other visible table cells in a
4367 // table row; if so, offsetWidth/Height are not reliable for use when
4368 // determining if an element has been hidden directly using
4369 // display:none (it is still safe to use offsets if a parent element is
4370 // hidden; don safety goggles and see bug #4512 for more information).
4371 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
4372 tds = div.getElementsByTagName("td");
4373 tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
4374 isSupported = ( tds[ 0 ].offsetHeight === 0 );
4375
4376 tds[ 0 ].style.display = "";
4377 tds[ 1 ].style.display = "none";
4378
4379 // Support: IE8
4380 // Check if empty table cells still have offsetWidth/Height
4381 support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
4382
4383 // Check box-sizing and margin behavior.
4384 div.innerHTML = "";
4385 div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
4386
4387 // Workaround failing boxSizing test due to offsetWidth returning wrong value
4388 // with some non-1 values of body zoom, ticket #13543
4389 jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() {
4390 support.boxSizing = div.offsetWidth === 4;
4391 });
4392
4393 // Use window.getComputedStyle because jsdom on node.js will break without it.
4394 if ( window.getComputedStyle ) {
4395 support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
4396 support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
4397
4398 // Check if div with explicit width and no margin-right incorrectly
4399 // gets computed margin-right based on width of container. (#3333)
4400 // Fails in WebKit before Feb 2011 nightlies
4401 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
4402 marginDiv = div.appendChild( document.createElement("div") );
4403 marginDiv.style.cssText = div.style.cssText = divReset;
4404 marginDiv.style.marginRight = marginDiv.style.width = "0";
4405 div.style.width = "1px";
4406
4407 support.reliableMarginRight =
4408 !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
4409 }
4410
4411 if ( typeof div.style.zoom !== core_strundefined ) {
4412 // Support: IE<8
4413 // Check if natively block-level elements act like inline-block
4414 // elements when setting their display to 'inline' and giving
4415 // them layout
4416 div.innerHTML = "";
4417 div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
4418 support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
4419
4420 // Support: IE6
4421 // Check if elements with layout shrink-wrap their children
4422 div.style.display = "block";
4423 div.innerHTML = "<div></div>";
4424 div.firstChild.style.width = "5px";
4425 support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
4426
4427 if ( support.inlineBlockNeedsLayout ) {
4428 // Prevent IE 6 from affecting layout for positioned elements #11048
4429 // Prevent IE from shrinking the body in IE 7 mode #12869
4430 // Support: IE<8
4431 body.style.zoom = 1;
4432 }
4433 }
4434
4435 body.removeChild( container );
4436
4437 // Null elements to avoid leaks in IE
4438 container = div = tds = marginDiv = null;
4439 });
4440
4441 // Null elements to avoid leaks in IE
4442 all = select = fragment = opt = a = input = null;
4443
4444 return support;
4445})({});
4446
4447var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
4448 rmultiDash = /([A-Z])/g;
4449
4450function internalData( elem, name, data, pvt /* Internal Use Only */ ){
4451 if ( !jQuery.acceptData( elem ) ) {
4452 return;
4453 }
4454
4455 var ret, thisCache,
4456 internalKey = jQuery.expando,
4457
4458 // We have to handle DOM nodes and JS objects differently because IE6-7
4459 // can't GC object references properly across the DOM-JS boundary
4460 isNode = elem.nodeType,
4461
4462 // Only DOM nodes need the global jQuery cache; JS object data is
4463 // attached directly to the object so GC can occur automatically
4464 cache = isNode ? jQuery.cache : elem,
4465
4466 // Only defining an ID for JS objects if its cache already exists allows
4467 // the code to shortcut on the same path as a DOM node with no cache
4468 id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
4469
4470 // Avoid doing any more work than we need to when trying to get data on an
4471 // object that has no data at all
4472 if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
4473 return;
4474 }
4475
4476 if ( !id ) {
4477 // Only DOM nodes need a new unique ID for each element since their data
4478 // ends up in the global cache
4479 if ( isNode ) {
4480 id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++;
4481 } else {
4482 id = internalKey;
4483 }
4484 }
4485
4486 if ( !cache[ id ] ) {
4487 // Avoid exposing jQuery metadata on plain JS objects when the object
4488 // is serialized using JSON.stringify
4489 cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
4490 }
4491
4492 // An object can be passed to jQuery.data instead of a key/value pair; this gets
4493 // shallow copied over onto the existing cache
4494 if ( typeof name === "object" || typeof name === "function" ) {
4495 if ( pvt ) {
4496 cache[ id ] = jQuery.extend( cache[ id ], name );
4497 } else {
4498 cache[ id ].data = jQuery.extend( cache[ id ].data, name );
4499 }
4500 }
4501
4502 thisCache = cache[ id ];
4503
4504 // jQuery data() is stored in a separate object inside the object's internal data
4505 // cache in order to avoid key collisions between internal data and user-defined
4506 // data.
4507 if ( !pvt ) {
4508 if ( !thisCache.data ) {
4509 thisCache.data = {};
4510 }
4511
4512 thisCache = thisCache.data;
4513 }
4514
4515 if ( data !== undefined ) {
4516 thisCache[ jQuery.camelCase( name ) ] = data;
4517 }
4518
4519 // Check for both converted-to-camel and non-converted data property names
4520 // If a data property was specified
4521 if ( typeof name === "string" ) {
4522
4523 // First Try to find as-is property data
4524 ret = thisCache[ name ];
4525
4526 // Test for null|undefined property data
4527 if ( ret == null ) {
4528
4529 // Try to find the camelCased property
4530 ret = thisCache[ jQuery.camelCase( name ) ];
4531 }
4532 } else {
4533 ret = thisCache;
4534 }
4535
4536 return ret;
4537}
4538
4539function internalRemoveData( elem, name, pvt ) {
4540 if ( !jQuery.acceptData( elem ) ) {
4541 return;
4542 }
4543
4544 var thisCache, i,
4545 isNode = elem.nodeType,
4546
4547 // See jQuery.data for more information
4548 cache = isNode ? jQuery.cache : elem,
4549 id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
4550
4551 // If there is already no cache entry for this object, there is no
4552 // purpose in continuing
4553 if ( !cache[ id ] ) {
4554 return;
4555 }
4556
4557 if ( name ) {
4558
4559 thisCache = pvt ? cache[ id ] : cache[ id ].data;
4560
4561 if ( thisCache ) {
4562
4563 // Support array or space separated string names for data keys
4564 if ( !jQuery.isArray( name ) ) {
4565
4566 // try the string as a key before any manipulation
4567 if ( name in thisCache ) {
4568 name = [ name ];
4569 } else {
4570
4571 // split the camel cased version by spaces unless a key with the spaces exists
4572 name = jQuery.camelCase( name );
4573 if ( name in thisCache ) {
4574 name = [ name ];
4575 } else {
4576 name = name.split(" ");
4577 }
4578 }
4579 } else {
4580 // If "name" is an array of keys...
4581 // When data is initially created, via ("key", "val") signature,
4582 // keys will be converted to camelCase.
4583 // Since there is no way to tell _how_ a key was added, remove
4584 // both plain key and camelCase key. #12786
4585 // This will only penalize the array argument path.
4586 name = name.concat( jQuery.map( name, jQuery.camelCase ) );
4587 }
4588
4589 i = name.length;
4590 while ( i-- ) {
4591 delete thisCache[ name[i] ];
4592 }
4593
4594 // If there is no data left in the cache, we want to continue
4595 // and let the cache object itself get destroyed
4596 if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
4597 return;
4598 }
4599 }
4600 }
4601
4602 // See jQuery.data for more information
4603 if ( !pvt ) {
4604 delete cache[ id ].data;
4605
4606 // Don't destroy the parent cache unless the internal data object
4607 // had been the only thing left in it
4608 if ( !isEmptyDataObject( cache[ id ] ) ) {
4609 return;
4610 }
4611 }
4612
4613 // Destroy the cache
4614 if ( isNode ) {
4615 jQuery.cleanData( [ elem ], true );
4616
4617 // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
4618 /* jshint eqeqeq: false */
4619 } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
4620 /* jshint eqeqeq: true */
4621 delete cache[ id ];
4622
4623 // When all else fails, null
4624 } else {
4625 cache[ id ] = null;
4626 }
4627}
4628
4629jQuery.extend({
4630 cache: {},
4631
4632 // The following elements throw uncatchable exceptions if you
4633 // attempt to add expando properties to them.
4634 noData: {
4635 "applet": true,
4636 "embed": true,
4637 // Ban all objects except for Flash (which handle expandos)
4638 "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
4639 },
4640
4641 hasData: function( elem ) {
4642 elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
4643 return !!elem && !isEmptyDataObject( elem );
4644 },
4645
4646 data: function( elem, name, data ) {
4647 return internalData( elem, name, data );
4648 },
4649
4650 removeData: function( elem, name ) {
4651 return internalRemoveData( elem, name );
4652 },
4653
4654 // For internal use only.
4655 _data: function( elem, name, data ) {
4656 return internalData( elem, name, data, true );
4657 },
4658
4659 _removeData: function( elem, name ) {
4660 return internalRemoveData( elem, name, true );
4661 },
4662
4663 // A method for determining if a DOM node can handle the data expando
4664 acceptData: function( elem ) {
4665 // Do not set data on non-element because it will not be cleared (#8335).
4666 if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
4667 return false;
4668 }
4669
4670 var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
4671
4672 // nodes accept data unless otherwise specified; rejection can be conditional
4673 return !noData || noData !== true && elem.getAttribute("classid") === noData;
4674 }
4675});
4676
4677jQuery.fn.extend({
4678 data: function( key, value ) {
4679 var attrs, name,
4680 data = null,
4681 i = 0,
4682 elem = this[0];
4683
4684 // Special expections of .data basically thwart jQuery.access,
4685 // so implement the relevant behavior ourselves
4686
4687 // Gets all values
4688 if ( key === undefined ) {
4689 if ( this.length ) {
4690 data = jQuery.data( elem );
4691
4692 if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
4693 attrs = elem.attributes;
4694 for ( ; i < attrs.length; i++ ) {
4695 name = attrs[i].name;
4696
4697 if ( name.indexOf("data-") === 0 ) {
4698 name = jQuery.camelCase( name.slice(5) );
4699
4700 dataAttr( elem, name, data[ name ] );
4701 }
4702 }
4703 jQuery._data( elem, "parsedAttrs", true );
4704 }
4705 }
4706
4707 return data;
4708 }
4709
4710 // Sets multiple values
4711 if ( typeof key === "object" ) {
4712 return this.each(function() {
4713 jQuery.data( this, key );
4714 });
4715 }
4716
4717 return arguments.length > 1 ?
4718
4719 // Sets one value
4720 this.each(function() {
4721 jQuery.data( this, key, value );
4722 }) :
4723
4724 // Gets one value
4725 // Try to fetch any internally stored data first
4726 elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
4727 },
4728
4729 removeData: function( key ) {
4730 return this.each(function() {
4731 jQuery.removeData( this, key );
4732 });
4733 }
4734});
4735
4736function dataAttr( elem, key, data ) {
4737 // If nothing was found internally, try to fetch any
4738 // data from the HTML5 data-* attribute
4739 if ( data === undefined && elem.nodeType === 1 ) {
4740
4741 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
4742
4743 data = elem.getAttribute( name );
4744
4745 if ( typeof data === "string" ) {
4746 try {
4747 data = data === "true" ? true :
4748 data === "false" ? false :
4749 data === "null" ? null :
4750 // Only convert to a number if it doesn't change the string
4751 +data + "" === data ? +data :
4752 rbrace.test( data ) ? jQuery.parseJSON( data ) :
4753 data;
4754 } catch( e ) {}
4755
4756 // Make sure we set the data so it isn't changed later
4757 jQuery.data( elem, key, data );
4758
4759 } else {
4760 data = undefined;
4761 }
4762 }
4763
4764 return data;
4765}
4766
4767// checks a cache object for emptiness
4768function isEmptyDataObject( obj ) {
4769 var name;
4770 for ( name in obj ) {
4771
4772 // if the public data object is empty, the private is still empty
4773 if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
4774 continue;
4775 }
4776 if ( name !== "toJSON" ) {
4777 return false;
4778 }
4779 }
4780
4781 return true;
4782}
4783jQuery.extend({
4784 queue: function( elem, type, data ) {
4785 var queue;
4786
4787 if ( elem ) {
4788 type = ( type || "fx" ) + "queue";
4789 queue = jQuery._data( elem, type );
4790
4791 // Speed up dequeue by getting out quickly if this is just a lookup
4792 if ( data ) {
4793 if ( !queue || jQuery.isArray(data) ) {
4794 queue = jQuery._data( elem, type, jQuery.makeArray(data) );
4795 } else {
4796 queue.push( data );
4797 }
4798 }
4799 return queue || [];
4800 }
4801 },
4802
4803 dequeue: function( elem, type ) {
4804 type = type || "fx";
4805
4806 var queue = jQuery.queue( elem, type ),
4807 startLength = queue.length,
4808 fn = queue.shift(),
4809 hooks = jQuery._queueHooks( elem, type ),
4810 next = function() {
4811 jQuery.dequeue( elem, type );
4812 };
4813
4814 // If the fx queue is dequeued, always remove the progress sentinel
4815 if ( fn === "inprogress" ) {
4816 fn = queue.shift();
4817 startLength--;
4818 }
4819
4820 if ( fn ) {
4821
4822 // Add a progress sentinel to prevent the fx queue from being
4823 // automatically dequeued
4824 if ( type === "fx" ) {
4825 queue.unshift( "inprogress" );
4826 }
4827
4828 // clear up the last queue stop function
4829 delete hooks.stop;
4830 fn.call( elem, next, hooks );
4831 }
4832
4833 if ( !startLength && hooks ) {
4834 hooks.empty.fire();
4835 }
4836 },
4837
4838 // not intended for public consumption - generates a queueHooks object, or returns the current one
4839 _queueHooks: function( elem, type ) {
4840 var key = type + "queueHooks";
4841 return jQuery._data( elem, key ) || jQuery._data( elem, key, {
4842 empty: jQuery.Callbacks("once memory").add(function() {
4843 jQuery._removeData( elem, type + "queue" );
4844 jQuery._removeData( elem, key );
4845 })
4846 });
4847 }
4848});
4849
4850jQuery.fn.extend({
4851 queue: function( type, data ) {
4852 var setter = 2;
4853
4854 if ( typeof type !== "string" ) {
4855 data = type;
4856 type = "fx";
4857 setter--;
4858 }
4859
4860 if ( arguments.length < setter ) {
4861 return jQuery.queue( this[0], type );
4862 }
4863
4864 return data === undefined ?
4865 this :
4866 this.each(function() {
4867 var queue = jQuery.queue( this, type, data );
4868
4869 // ensure a hooks for this queue
4870 jQuery._queueHooks( this, type );
4871
4872 if ( type === "fx" && queue[0] !== "inprogress" ) {
4873 jQuery.dequeue( this, type );
4874 }
4875 });
4876 },
4877 dequeue: function( type ) {
4878 return this.each(function() {
4879 jQuery.dequeue( this, type );
4880 });
4881 },
4882 // Based off of the plugin by Clint Helfers, with permission.
4883 // http://blindsignals.com/index.php/2009/07/jquery-delay/
4884 delay: function( time, type ) {
4885 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
4886 type = type || "fx";
4887
4888 return this.queue( type, function( next, hooks ) {
4889 var timeout = setTimeout( next, time );
4890 hooks.stop = function() {
4891 clearTimeout( timeout );
4892 };
4893 });
4894 },
4895 clearQueue: function( type ) {
4896 return this.queue( type || "fx", [] );
4897 },
4898 // Get a promise resolved when queues of a certain type
4899 // are emptied (fx is the type by default)
4900 promise: function( type, obj ) {
4901 var tmp,
4902 count = 1,
4903 defer = jQuery.Deferred(),
4904 elements = this,
4905 i = this.length,
4906 resolve = function() {
4907 if ( !( --count ) ) {
4908 defer.resolveWith( elements, [ elements ] );
4909 }
4910 };
4911
4912 if ( typeof type !== "string" ) {
4913 obj = type;
4914 type = undefined;
4915 }
4916 type = type || "fx";
4917
4918 while( i-- ) {
4919 tmp = jQuery._data( elements[ i ], type + "queueHooks" );
4920 if ( tmp && tmp.empty ) {
4921 count++;
4922 tmp.empty.add( resolve );
4923 }
4924 }
4925 resolve();
4926 return defer.promise( obj );
4927 }
4928});
4929var nodeHook, boolHook,
4930 rclass = /[\t\r\n\f]/g,
4931 rreturn = /\r/g,
4932 rfocusable = /^(?:input|select|textarea|button|object)$/i,
4933 rclickable = /^(?:a|area)$/i,
4934 ruseDefault = /^(?:checked|selected)$/i,
4935 getSetAttribute = jQuery.support.getSetAttribute,
4936 getSetInput = jQuery.support.input;
4937
4938jQuery.fn.extend({
4939 attr: function( name, value ) {
4940 return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
4941 },
4942
4943 removeAttr: function( name ) {
4944 return this.each(function() {
4945 jQuery.removeAttr( this, name );
4946 });
4947 },
4948
4949 prop: function( name, value ) {
4950 return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
4951 },
4952
4953 removeProp: function( name ) {
4954 name = jQuery.propFix[ name ] || name;
4955 return this.each(function() {
4956 // try/catch handles cases where IE balks (such as removing a property on window)
4957 try {
4958 this[ name ] = undefined;
4959 delete this[ name ];
4960 } catch( e ) {}
4961 });
4962 },
4963
4964 addClass: function( value ) {
4965 var classes, elem, cur, clazz, j,
4966 i = 0,
4967 len = this.length,
4968 proceed = typeof value === "string" && value;
4969
4970 if ( jQuery.isFunction( value ) ) {
4971 return this.each(function( j ) {
4972 jQuery( this ).addClass( value.call( this, j, this.className ) );
4973 });
4974 }
4975
4976 if ( proceed ) {
4977 // The disjunction here is for better compressibility (see removeClass)
4978 classes = ( value || "" ).match( core_rnotwhite ) || [];
4979
4980 for ( ; i < len; i++ ) {
4981 elem = this[ i ];
4982 cur = elem.nodeType === 1 && ( elem.className ?
4983 ( " " + elem.className + " " ).replace( rclass, " " ) :
4984 " "
4985 );
4986
4987 if ( cur ) {
4988 j = 0;
4989 while ( (clazz = classes[j++]) ) {
4990 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
4991 cur += clazz + " ";
4992 }
4993 }
4994 elem.className = jQuery.trim( cur );
4995
4996 }
4997 }
4998 }
4999
5000 return this;
5001 },
5002
5003 removeClass: function( value ) {
5004 var classes, elem, cur, clazz, j,
5005 i = 0,
5006 len = this.length,
5007 proceed = arguments.length === 0 || typeof value === "string" && value;
5008
5009 if ( jQuery.isFunction( value ) ) {
5010 return this.each(function( j ) {
5011 jQuery( this ).removeClass( value.call( this, j, this.className ) );
5012 });
5013 }
5014 if ( proceed ) {
5015 classes = ( value || "" ).match( core_rnotwhite ) || [];
5016
5017 for ( ; i < len; i++ ) {
5018 elem = this[ i ];
5019 // This expression is here for better compressibility (see addClass)
5020 cur = elem.nodeType === 1 && ( elem.className ?
5021 ( " " + elem.className + " " ).replace( rclass, " " ) :
5022 ""
5023 );
5024
5025 if ( cur ) {
5026 j = 0;
5027 while ( (clazz = classes[j++]) ) {
5028 // Remove *all* instances
5029 while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
5030 cur = cur.replace( " " + clazz + " ", " " );
5031 }
5032 }
5033 elem.className = value ? jQuery.trim( cur ) : "";
5034 }
5035 }
5036 }
5037
5038 return this;
5039 },
5040
5041 toggleClass: function( value, stateVal ) {
5042 var type = typeof value,
5043 isBool = typeof stateVal === "boolean";
5044
5045 if ( jQuery.isFunction( value ) ) {
5046 return this.each(function( i ) {
5047 jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
5048 });
5049 }
5050
5051 return this.each(function() {
5052 if ( type === "string" ) {
5053 // toggle individual class names
5054 var className,
5055 i = 0,
5056 self = jQuery( this ),
5057 state = stateVal,
5058 classNames = value.match( core_rnotwhite ) || [];
5059
5060 while ( (className = classNames[ i++ ]) ) {
5061 // check each className given, space separated list
5062 state = isBool ? state : !self.hasClass( className );
5063 self[ state ? "addClass" : "removeClass" ]( className );
5064 }
5065
5066 // Toggle whole class name
5067 } else if ( type === core_strundefined || type === "boolean" ) {
5068 if ( this.className ) {
5069 // store className if set
5070 jQuery._data( this, "__className__", this.className );
5071 }
5072
5073 // If the element has a class name or if we're passed "false",
5074 // then remove the whole classname (if there was one, the above saved it).
5075 // Otherwise bring back whatever was previously saved (if anything),
5076 // falling back to the empty string if nothing was stored.
5077 this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
5078 }
5079 });
5080 },
5081
5082 hasClass: function( selector ) {
5083 var className = " " + selector + " ",
5084 i = 0,
5085 l = this.length;
5086 for ( ; i < l; i++ ) {
5087 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
5088 return true;
5089 }
5090 }
5091
5092 return false;
5093 },
5094
5095 val: function( value ) {
5096 var ret, hooks, isFunction,
5097 elem = this[0];
5098
5099 if ( !arguments.length ) {
5100 if ( elem ) {
5101 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
5102
5103 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
5104 return ret;
5105 }
5106
5107 ret = elem.value;
5108
5109 return typeof ret === "string" ?
5110 // handle most common string cases
5111 ret.replace(rreturn, "") :
5112 // handle cases where value is null/undef or number
5113 ret == null ? "" : ret;
5114 }
5115
5116 return;
5117 }
5118
5119 isFunction = jQuery.isFunction( value );
5120
5121 return this.each(function( i ) {
5122 var val;
5123
5124 if ( this.nodeType !== 1 ) {
5125 return;
5126 }
5127
5128 if ( isFunction ) {
5129 val = value.call( this, i, jQuery( this ).val() );
5130 } else {
5131 val = value;
5132 }
5133
5134 // Treat null/undefined as ""; convert numbers to string
5135 if ( val == null ) {
5136 val = "";
5137 } else if ( typeof val === "number" ) {
5138 val += "";
5139 } else if ( jQuery.isArray( val ) ) {
5140 val = jQuery.map(val, function ( value ) {
5141 return value == null ? "" : value + "";
5142 });
5143 }
5144
5145 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
5146
5147 // If set returns undefined, fall back to normal setting
5148 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
5149 this.value = val;
5150 }
5151 });
5152 }
5153});
5154
5155jQuery.extend({
5156 valHooks: {
5157 option: {
5158 get: function( elem ) {
5159 // Use proper attribute retrieval(#6932, #12072)
5160 var val = jQuery.find.attr( elem, "value" );
5161 return val != null ?
5162 val :
5163 elem.text;
5164 }
5165 },
5166 select: {
5167 get: function( elem ) {
5168 var value, option,
5169 options = elem.options,
5170 index = elem.selectedIndex,
5171 one = elem.type === "select-one" || index < 0,
5172 values = one ? null : [],
5173 max = one ? index + 1 : options.length,
5174 i = index < 0 ?
5175 max :
5176 one ? index : 0;
5177
5178 // Loop through all the selected options
5179 for ( ; i < max; i++ ) {
5180 option = options[ i ];
5181
5182 // oldIE doesn't update selected after form reset (#2551)
5183 if ( ( option.selected || i === index ) &&
5184 // Don't return options that are disabled or in a disabled optgroup
5185 ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
5186 ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
5187
5188 // Get the specific value for the option
5189 value = jQuery( option ).val();
5190
5191 // We don't need an array for one selects
5192 if ( one ) {
5193 return value;
5194 }
5195
5196 // Multi-Selects return an array
5197 values.push( value );
5198 }
5199 }
5200
5201 return values;
5202 },
5203
5204 set: function( elem, value ) {
5205 var optionSet, option,
5206 options = elem.options,
5207 values = jQuery.makeArray( value ),
5208 i = options.length;
5209
5210 while ( i-- ) {
5211 option = options[ i ];
5212 if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) {
5213 optionSet = true;
5214 }
5215 }
5216
5217 // force browsers to behave consistently when non-matching value is set
5218 if ( !optionSet ) {
5219 elem.selectedIndex = -1;
5220 }
5221 return values;
5222 }
5223 }
5224 },
5225
5226 attr: function( elem, name, value ) {
5227 var hooks, ret,
5228 nType = elem.nodeType;
5229
5230 // don't get/set attributes on text, comment and attribute nodes
5231 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
5232 return;
5233 }
5234
5235 // Fallback to prop when attributes are not supported
5236 if ( typeof elem.getAttribute === core_strundefined ) {
5237 return jQuery.prop( elem, name, value );
5238 }
5239
5240 // All attributes are lowercase
5241 // Grab necessary hook if one is defined
5242 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
5243 name = name.toLowerCase();
5244 hooks = jQuery.attrHooks[ name ] ||
5245 ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
5246 }
5247
5248 if ( value !== undefined ) {
5249
5250 if ( value === null ) {
5251 jQuery.removeAttr( elem, name );
5252
5253 } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
5254 return ret;
5255
5256 } else {
5257 elem.setAttribute( name, value + "" );
5258 return value;
5259 }
5260
5261 } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
5262 return ret;
5263
5264 } else {
5265 ret = jQuery.find.attr( elem, name );
5266
5267 // Non-existent attributes return null, we normalize to undefined
5268 return ret == null ?
5269 undefined :
5270 ret;
5271 }
5272 },
5273
5274 removeAttr: function( elem, value ) {
5275 var name, propName,
5276 i = 0,
5277 attrNames = value && value.match( core_rnotwhite );
5278
5279 if ( attrNames && elem.nodeType === 1 ) {
5280 while ( (name = attrNames[i++]) ) {
5281 propName = jQuery.propFix[ name ] || name;
5282
5283 // Boolean attributes get special treatment (#10870)
5284 if ( jQuery.expr.match.bool.test( name ) ) {
5285 // Set corresponding property to false
5286 if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
5287 elem[ propName ] = false;
5288 // Support: IE<9
5289 // Also clear defaultChecked/defaultSelected (if appropriate)
5290 } else {
5291 elem[ jQuery.camelCase( "default-" + name ) ] =
5292 elem[ propName ] = false;
5293 }
5294
5295 // See #9699 for explanation of this approach (setting first, then removal)
5296 } else {
5297 jQuery.attr( elem, name, "" );
5298 }
5299
5300 elem.removeAttribute( getSetAttribute ? name : propName );
5301 }
5302 }
5303 },
5304
5305 attrHooks: {
5306 type: {
5307 set: function( elem, value ) {
5308 if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
5309 // Setting the type on a radio button after the value resets the value in IE6-9
5310 // Reset value to default in case type is set after value during creation
5311 var val = elem.value;
5312 elem.setAttribute( "type", value );
5313 if ( val ) {
5314 elem.value = val;
5315 }
5316 return value;
5317 }
5318 }
5319 }
5320 },
5321
5322 propFix: {
5323 "for": "htmlFor",
5324 "class": "className"
5325 },
5326
5327 prop: function( elem, name, value ) {
5328 var ret, hooks, notxml,
5329 nType = elem.nodeType;
5330
5331 // don't get/set properties on text, comment and attribute nodes
5332 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
5333 return;
5334 }
5335
5336 notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
5337
5338 if ( notxml ) {
5339 // Fix name and attach hooks
5340 name = jQuery.propFix[ name ] || name;
5341 hooks = jQuery.propHooks[ name ];
5342 }
5343
5344 if ( value !== undefined ) {
5345 return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
5346 ret :
5347 ( elem[ name ] = value );
5348
5349 } else {
5350 return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
5351 ret :
5352 elem[ name ];
5353 }
5354 },
5355
5356 propHooks: {
5357 tabIndex: {
5358 get: function( elem ) {
5359 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
5360 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
5361 // Use proper attribute retrieval(#12072)
5362 var tabindex = jQuery.find.attr( elem, "tabindex" );
5363
5364 return tabindex ?
5365 parseInt( tabindex, 10 ) :
5366 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
5367 0 :
5368 -1;
5369 }
5370 }
5371 }
5372});
5373
5374// Hooks for boolean attributes
5375boolHook = {
5376 set: function( elem, value, name ) {
5377 if ( value === false ) {
5378 // Remove boolean attributes when set to false
5379 jQuery.removeAttr( elem, name );
5380 } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
5381 // IE<8 needs the *property* name
5382 elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
5383
5384 // Use defaultChecked and defaultSelected for oldIE
5385 } else {
5386 elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
5387 }
5388
5389 return name;
5390 }
5391};
5392jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
5393 var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr;
5394
5395 jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
5396 function( elem, name, isXML ) {
5397 var fn = jQuery.expr.attrHandle[ name ],
5398 ret = isXML ?
5399 undefined :
5400 /* jshint eqeqeq: false */
5401 (jQuery.expr.attrHandle[ name ] = undefined) !=
5402 getter( elem, name, isXML ) ?
5403
5404 name.toLowerCase() :
5405 null;
5406 jQuery.expr.attrHandle[ name ] = fn;
5407 return ret;
5408 } :
5409 function( elem, name, isXML ) {
5410 return isXML ?
5411 undefined :
5412 elem[ jQuery.camelCase( "default-" + name ) ] ?
5413 name.toLowerCase() :
5414 null;
5415 };
5416});
5417
5418// fix oldIE attroperties
5419if ( !getSetInput || !getSetAttribute ) {
5420 jQuery.attrHooks.value = {
5421 set: function( elem, value, name ) {
5422 if ( jQuery.nodeName( elem, "input" ) ) {
5423 // Does not return so that setAttribute is also used
5424 elem.defaultValue = value;
5425 } else {
5426 // Use nodeHook if defined (#1954); otherwise setAttribute is fine
5427 return nodeHook && nodeHook.set( elem, value, name );
5428 }
5429 }
5430 };
5431}
5432
5433// IE6/7 do not support getting/setting some attributes with get/setAttribute
5434if ( !getSetAttribute ) {
5435
5436 // Use this for any attribute in IE6/7
5437 // This fixes almost every IE6/7 issue
5438 nodeHook = {
5439 set: function( elem, value, name ) {
5440 // Set the existing or create a new attribute node
5441 var ret = elem.getAttributeNode( name );
5442 if ( !ret ) {
5443 elem.setAttributeNode(
5444 (ret = elem.ownerDocument.createAttribute( name ))
5445 );
5446 }
5447
5448 ret.value = value += "";
5449
5450 // Break association with cloned elements by also using setAttribute (#9646)
5451 return name === "value" || value === elem.getAttribute( name ) ?
5452 value :
5453 undefined;
5454 }
5455 };
5456 jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords =
5457 // Some attributes are constructed with empty-string values when not defined
5458 function( elem, name, isXML ) {
5459 var ret;
5460 return isXML ?
5461 undefined :
5462 (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
5463 ret.value :
5464 null;
5465 };
5466 jQuery.valHooks.button = {
5467 get: function( elem, name ) {
5468 var ret = elem.getAttributeNode( name );
5469 return ret && ret.specified ?
5470 ret.value :
5471 undefined;
5472 },
5473 set: nodeHook.set
5474 };
5475
5476 // Set contenteditable to false on removals(#10429)
5477 // Setting to empty string throws an error as an invalid value
5478 jQuery.attrHooks.contenteditable = {
5479 set: function( elem, value, name ) {
5480 nodeHook.set( elem, value === "" ? false : value, name );
5481 }
5482 };
5483
5484 // Set width and height to auto instead of 0 on empty string( Bug #8150 )
5485 // This is for removals
5486 jQuery.each([ "width", "height" ], function( i, name ) {
5487 jQuery.attrHooks[ name ] = {
5488 set: function( elem, value ) {
5489 if ( value === "" ) {
5490 elem.setAttribute( name, "auto" );
5491 return value;
5492 }
5493 }
5494 };
5495 });
5496}
5497
5498
5499// Some attributes require a special call on IE
5500// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
5501if ( !jQuery.support.hrefNormalized ) {
5502 // href/src property should get the full normalized URL (#10299/#12915)
5503 jQuery.each([ "href", "src" ], function( i, name ) {
5504 jQuery.propHooks[ name ] = {
5505 get: function( elem ) {
5506 return elem.getAttribute( name, 4 );
5507 }
5508 };
5509 });
5510}
5511
5512if ( !jQuery.support.style ) {
5513 jQuery.attrHooks.style = {
5514 get: function( elem ) {
5515 // Return undefined in the case of empty string
5516 // Note: IE uppercases css property names, but if we were to .toLowerCase()
5517 // .cssText, that would destroy case senstitivity in URL's, like in "background"
5518 return elem.style.cssText || undefined;
5519 },
5520 set: function( elem, value ) {
5521 return ( elem.style.cssText = value + "" );
5522 }
5523 };
5524}
5525
5526// Safari mis-reports the default selected property of an option
5527// Accessing the parent's selectedIndex property fixes it
5528if ( !jQuery.support.optSelected ) {
5529 jQuery.propHooks.selected = {
5530 get: function( elem ) {
5531 var parent = elem.parentNode;
5532
5533 if ( parent ) {
5534 parent.selectedIndex;
5535
5536 // Make sure that it also works with optgroups, see #5701
5537 if ( parent.parentNode ) {
5538 parent.parentNode.selectedIndex;
5539 }
5540 }
5541 return null;
5542 }
5543 };
5544}
5545
5546jQuery.each([
5547 "tabIndex",
5548 "readOnly",
5549 "maxLength",
5550 "cellSpacing",
5551 "cellPadding",
5552 "rowSpan",
5553 "colSpan",
5554 "useMap",
5555 "frameBorder",
5556 "contentEditable"
5557], function() {
5558 jQuery.propFix[ this.toLowerCase() ] = this;
5559});
5560
5561// IE6/7 call enctype encoding
5562if ( !jQuery.support.enctype ) {
5563 jQuery.propFix.enctype = "encoding";
5564}
5565
5566// Radios and checkboxes getter/setter
5567jQuery.each([ "radio", "checkbox" ], function() {
5568 jQuery.valHooks[ this ] = {
5569 set: function( elem, value ) {
5570 if ( jQuery.isArray( value ) ) {
5571 return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
5572 }
5573 }
5574 };
5575 if ( !jQuery.support.checkOn ) {
5576 jQuery.valHooks[ this ].get = function( elem ) {
5577 // Support: Webkit
5578 // "" is returned instead of "on" if a value isn't specified
5579 return elem.getAttribute("value") === null ? "on" : elem.value;
5580 };
5581 }
5582});
5583var rformElems = /^(?:input|select|textarea)$/i,
5584 rkeyEvent = /^key/,
5585 rmouseEvent = /^(?:mouse|contextmenu)|click/,
5586 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
5587 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
5588
5589function returnTrue() {
5590 return true;
5591}
5592
5593function returnFalse() {
5594 return false;
5595}
5596
5597function safeActiveElement() {
5598 try {
5599 return document.activeElement;
5600 } catch ( err ) { }
5601}
5602
5603/*
5604 * Helper functions for managing events -- not part of the public interface.
5605 * Props to Dean Edwards' addEvent library for many of the ideas.
5606 */
5607jQuery.event = {
5608
5609 global: {},
5610
5611 add: function( elem, types, handler, data, selector ) {
5612 var tmp, events, t, handleObjIn,
5613 special, eventHandle, handleObj,
5614 handlers, type, namespaces, origType,
5615 elemData = jQuery._data( elem );
5616
5617 // Don't attach events to noData or text/comment nodes (but allow plain objects)
5618 if ( !elemData ) {
5619 return;
5620 }
5621
5622 // Caller can pass in an object of custom data in lieu of the handler
5623 if ( handler.handler ) {
5624 handleObjIn = handler;
5625 handler = handleObjIn.handler;
5626 selector = handleObjIn.selector;
5627 }
5628
5629 // Make sure that the handler has a unique ID, used to find/remove it later
5630 if ( !handler.guid ) {
5631 handler.guid = jQuery.guid++;
5632 }
5633
5634 // Init the element's event structure and main handler, if this is the first
5635 if ( !(events = elemData.events) ) {
5636 events = elemData.events = {};
5637 }
5638 if ( !(eventHandle = elemData.handle) ) {
5639 eventHandle = elemData.handle = function( e ) {
5640 // Discard the second event of a jQuery.event.trigger() and
5641 // when an event is called after a page has unloaded
5642 return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
5643 jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
5644 undefined;
5645 };
5646 // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
5647 eventHandle.elem = elem;
5648 }
5649
5650 // Handle multiple events separated by a space
5651 types = ( types || "" ).match( core_rnotwhite ) || [""];
5652 t = types.length;
5653 while ( t-- ) {
5654 tmp = rtypenamespace.exec( types[t] ) || [];
5655 type = origType = tmp[1];
5656 namespaces = ( tmp[2] || "" ).split( "." ).sort();
5657
5658 // There *must* be a type, no attaching namespace-only handlers
5659 if ( !type ) {
5660 continue;
5661 }
5662
5663 // If event changes its type, use the special event handlers for the changed type
5664 special = jQuery.event.special[ type ] || {};
5665
5666 // If selector defined, determine special event api type, otherwise given type
5667 type = ( selector ? special.delegateType : special.bindType ) || type;
5668
5669 // Update special based on newly reset type
5670 special = jQuery.event.special[ type ] || {};
5671
5672 // handleObj is passed to all event handlers
5673 handleObj = jQuery.extend({
5674 type: type,
5675 origType: origType,
5676 data: data,
5677 handler: handler,
5678 guid: handler.guid,
5679 selector: selector,
5680 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
5681 namespace: namespaces.join(".")
5682 }, handleObjIn );
5683
5684 // Init the event handler queue if we're the first
5685 if ( !(handlers = events[ type ]) ) {
5686 handlers = events[ type ] = [];
5687 handlers.delegateCount = 0;
5688
5689 // Only use addEventListener/attachEvent if the special events handler returns false
5690 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
5691 // Bind the global event handler to the element
5692 if ( elem.addEventListener ) {
5693 elem.addEventListener( type, eventHandle, false );
5694
5695 } else if ( elem.attachEvent ) {
5696 elem.attachEvent( "on" + type, eventHandle );
5697 }
5698 }
5699 }
5700
5701 if ( special.add ) {
5702 special.add.call( elem, handleObj );
5703
5704 if ( !handleObj.handler.guid ) {
5705 handleObj.handler.guid = handler.guid;
5706 }
5707 }
5708
5709 // Add to the element's handler list, delegates in front
5710 if ( selector ) {
5711 handlers.splice( handlers.delegateCount++, 0, handleObj );
5712 } else {
5713 handlers.push( handleObj );
5714 }
5715
5716 // Keep track of which events have ever been used, for event optimization
5717 jQuery.event.global[ type ] = true;
5718 }
5719
5720 // Nullify elem to prevent memory leaks in IE
5721 elem = null;
5722 },
5723
5724 // Detach an event or set of events from an element
5725 remove: function( elem, types, handler, selector, mappedTypes ) {
5726 var j, handleObj, tmp,
5727 origCount, t, events,
5728 special, handlers, type,
5729 namespaces, origType,
5730 elemData = jQuery.hasData( elem ) && jQuery._data( elem );
5731
5732 if ( !elemData || !(events = elemData.events) ) {
5733 return;
5734 }
5735
5736 // Once for each type.namespace in types; type may be omitted
5737 types = ( types || "" ).match( core_rnotwhite ) || [""];
5738 t = types.length;
5739 while ( t-- ) {
5740 tmp = rtypenamespace.exec( types[t] ) || [];
5741 type = origType = tmp[1];
5742 namespaces = ( tmp[2] || "" ).split( "." ).sort();
5743
5744 // Unbind all events (on this namespace, if provided) for the element
5745 if ( !type ) {
5746 for ( type in events ) {
5747 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
5748 }
5749 continue;
5750 }
5751
5752 special = jQuery.event.special[ type ] || {};
5753 type = ( selector ? special.delegateType : special.bindType ) || type;
5754 handlers = events[ type ] || [];
5755 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
5756
5757 // Remove matching events
5758 origCount = j = handlers.length;
5759 while ( j-- ) {
5760 handleObj = handlers[ j ];
5761
5762 if ( ( mappedTypes || origType === handleObj.origType ) &&
5763 ( !handler || handler.guid === handleObj.guid ) &&
5764 ( !tmp || tmp.test( handleObj.namespace ) ) &&
5765 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
5766 handlers.splice( j, 1 );
5767
5768 if ( handleObj.selector ) {
5769 handlers.delegateCount--;
5770 }
5771 if ( special.remove ) {
5772 special.remove.call( elem, handleObj );
5773 }
5774 }
5775 }
5776
5777 // Remove generic event handler if we removed something and no more handlers exist
5778 // (avoids potential for endless recursion during removal of special event handlers)
5779 if ( origCount && !handlers.length ) {
5780 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
5781 jQuery.removeEvent( elem, type, elemData.handle );
5782 }
5783
5784 delete events[ type ];
5785 }
5786 }
5787
5788 // Remove the expando if it's no longer used
5789 if ( jQuery.isEmptyObject( events ) ) {
5790 delete elemData.handle;
5791
5792 // removeData also checks for emptiness and clears the expando if empty
5793 // so use it instead of delete
5794 jQuery._removeData( elem, "events" );
5795 }
5796 },
5797
5798 trigger: function( event, data, elem, onlyHandlers ) {
5799 var handle, ontype, cur,
5800 bubbleType, special, tmp, i,
5801 eventPath = [ elem || document ],
5802 type = core_hasOwn.call( event, "type" ) ? event.type : event,
5803 namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
5804
5805 cur = tmp = elem = elem || document;
5806
5807 // Don't do events on text and comment nodes
5808 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
5809 return;
5810 }
5811
5812 // focus/blur morphs to focusin/out; ensure we're not firing them right now
5813 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
5814 return;
5815 }
5816
5817 if ( type.indexOf(".") >= 0 ) {
5818 // Namespaced trigger; create a regexp to match event type in handle()
5819 namespaces = type.split(".");
5820 type = namespaces.shift();
5821 namespaces.sort();
5822 }
5823 ontype = type.indexOf(":") < 0 && "on" + type;
5824
5825 // Caller can pass in a jQuery.Event object, Object, or just an event type string
5826 event = event[ jQuery.expando ] ?
5827 event :
5828 new jQuery.Event( type, typeof event === "object" && event );
5829
5830 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
5831 event.isTrigger = onlyHandlers ? 2 : 3;
5832 event.namespace = namespaces.join(".");
5833 event.namespace_re = event.namespace ?
5834 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
5835 null;
5836
5837 // Clean up the event in case it is being reused
5838 event.result = undefined;
5839 if ( !event.target ) {
5840 event.target = elem;
5841 }
5842
5843 // Clone any incoming data and prepend the event, creating the handler arg list
5844 data = data == null ?
5845 [ event ] :
5846 jQuery.makeArray( data, [ event ] );
5847
5848 // Allow special events to draw outside the lines
5849 special = jQuery.event.special[ type ] || {};
5850 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
5851 return;
5852 }
5853
5854 // Determine event propagation path in advance, per W3C events spec (#9951)
5855 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
5856 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
5857
5858 bubbleType = special.delegateType || type;
5859 if ( !rfocusMorph.test( bubbleType + type ) ) {
5860 cur = cur.parentNode;
5861 }
5862 for ( ; cur; cur = cur.parentNode ) {
5863 eventPath.push( cur );
5864 tmp = cur;
5865 }
5866
5867 // Only add window if we got to document (e.g., not plain obj or detached DOM)
5868 if ( tmp === (elem.ownerDocument || document) ) {
5869 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
5870 }
5871 }
5872
5873 // Fire handlers on the event path
5874 i = 0;
5875 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
5876
5877 event.type = i > 1 ?
5878 bubbleType :
5879 special.bindType || type;
5880
5881 // jQuery handler
5882 handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
5883 if ( handle ) {
5884 handle.apply( cur, data );
5885 }
5886
5887 // Native handler
5888 handle = ontype && cur[ ontype ];
5889 if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
5890 event.preventDefault();
5891 }
5892 }
5893 event.type = type;
5894
5895 // If nobody prevented the default action, do it now
5896 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
5897
5898 if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
5899 jQuery.acceptData( elem ) ) {
5900
5901 // Call a native DOM method on the target with the same name name as the event.
5902 // Can't use an .isFunction() check here because IE6/7 fails that test.
5903 // Don't do default actions on window, that's where global variables be (#6170)
5904 if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
5905
5906 // Don't re-trigger an onFOO event when we call its FOO() method
5907 tmp = elem[ ontype ];
5908
5909 if ( tmp ) {
5910 elem[ ontype ] = null;
5911 }
5912
5913 // Prevent re-triggering of the same event, since we already bubbled it above
5914 jQuery.event.triggered = type;
5915 try {
5916 elem[ type ]();
5917 } catch ( e ) {
5918 // IE<9 dies on focus/blur to hidden element (#1486,#12518)
5919 // only reproducible on winXP IE8 native, not IE9 in IE8 mode
5920 }
5921 jQuery.event.triggered = undefined;
5922
5923 if ( tmp ) {
5924 elem[ ontype ] = tmp;
5925 }
5926 }
5927 }
5928 }
5929
5930 return event.result;
5931 },
5932
5933 dispatch: function( event ) {
5934
5935 // Make a writable jQuery.Event from the native event object
5936 event = jQuery.event.fix( event );
5937
5938 var i, ret, handleObj, matched, j,
5939 handlerQueue = [],
5940 args = core_slice.call( arguments ),
5941 handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
5942 special = jQuery.event.special[ event.type ] || {};
5943
5944 // Use the fix-ed jQuery.Event rather than the (read-only) native event
5945 args[0] = event;
5946 event.delegateTarget = this;
5947
5948 // Call the preDispatch hook for the mapped type, and let it bail if desired
5949 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
5950 return;
5951 }
5952
5953 // Determine handlers
5954 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
5955
5956 // Run delegates first; they may want to stop propagation beneath us
5957 i = 0;
5958 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
5959 event.currentTarget = matched.elem;
5960
5961 j = 0;
5962 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
5963
5964 // Triggered event must either 1) have no namespace, or
5965 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
5966 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
5967
5968 event.handleObj = handleObj;
5969 event.data = handleObj.data;
5970
5971 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
5972 .apply( matched.elem, args );
5973
5974 if ( ret !== undefined ) {
5975 if ( (event.result = ret) === false ) {
5976 event.preventDefault();
5977 event.stopPropagation();
5978 }
5979 }
5980 }
5981 }
5982 }
5983
5984 // Call the postDispatch hook for the mapped type
5985 if ( special.postDispatch ) {
5986 special.postDispatch.call( this, event );
5987 }
5988
5989 return event.result;
5990 },
5991
5992 handlers: function( event, handlers ) {
5993 var sel, handleObj, matches, i,
5994 handlerQueue = [],
5995 delegateCount = handlers.delegateCount,
5996 cur = event.target;
5997
5998 // Find delegate handlers
5999 // Black-hole SVG <use> instance trees (#13180)
6000 // Avoid non-left-click bubbling in Firefox (#3861)
6001 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
6002
6003 /* jshint eqeqeq: false */
6004 for ( ; cur != this; cur = cur.parentNode || this ) {
6005 /* jshint eqeqeq: true */
6006
6007 // Don't check non-elements (#13208)
6008 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
6009 if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
6010 matches = [];
6011 for ( i = 0; i < delegateCount; i++ ) {
6012 handleObj = handlers[ i ];
6013
6014 // Don't conflict with Object.prototype properties (#13203)
6015 sel = handleObj.selector + " ";
6016
6017 if ( matches[ sel ] === undefined ) {
6018 matches[ sel ] = handleObj.needsContext ?
6019 jQuery( sel, this ).index( cur ) >= 0 :
6020 jQuery.find( sel, this, null, [ cur ] ).length;
6021 }
6022 if ( matches[ sel ] ) {
6023 matches.push( handleObj );
6024 }
6025 }
6026 if ( matches.length ) {
6027 handlerQueue.push({ elem: cur, handlers: matches });
6028 }
6029 }
6030 }
6031 }
6032
6033 // Add the remaining (directly-bound) handlers
6034 if ( delegateCount < handlers.length ) {
6035 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
6036 }
6037
6038 return handlerQueue;
6039 },
6040
6041 fix: function( event ) {
6042 if ( event[ jQuery.expando ] ) {
6043 return event;
6044 }
6045
6046 // Create a writable copy of the event object and normalize some properties
6047 var i, prop, copy,
6048 type = event.type,
6049 originalEvent = event,
6050 fixHook = this.fixHooks[ type ];
6051
6052 if ( !fixHook ) {
6053 this.fixHooks[ type ] = fixHook =
6054 rmouseEvent.test( type ) ? this.mouseHooks :
6055 rkeyEvent.test( type ) ? this.keyHooks :
6056 {};
6057 }
6058 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
6059
6060 event = new jQuery.Event( originalEvent );
6061
6062 i = copy.length;
6063 while ( i-- ) {
6064 prop = copy[ i ];
6065 event[ prop ] = originalEvent[ prop ];
6066 }
6067
6068 // Support: IE<9
6069 // Fix target property (#1925)
6070 if ( !event.target ) {
6071 event.target = originalEvent.srcElement || document;
6072 }
6073
6074 // Support: Chrome 23+, Safari?
6075 // Target should not be a text node (#504, #13143)
6076 if ( event.target.nodeType === 3 ) {
6077 event.target = event.target.parentNode;
6078 }
6079
6080 // Support: IE<9
6081 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
6082 event.metaKey = !!event.metaKey;
6083
6084 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
6085 },
6086
6087 // Includes some event props shared by KeyEvent and MouseEvent
6088 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
6089
6090 fixHooks: {},
6091
6092 keyHooks: {
6093 props: "char charCode key keyCode".split(" "),
6094 filter: function( event, original ) {
6095
6096 // Add which for key events
6097 if ( event.which == null ) {
6098 event.which = original.charCode != null ? original.charCode : original.keyCode;
6099 }
6100
6101 return event;
6102 }
6103 },
6104
6105 mouseHooks: {
6106 props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
6107 filter: function( event, original ) {
6108 var body, eventDoc, doc,
6109 button = original.button,
6110 fromElement = original.fromElement;
6111
6112 // Calculate pageX/Y if missing and clientX/Y available
6113 if ( event.pageX == null && original.clientX != null ) {
6114 eventDoc = event.target.ownerDocument || document;
6115 doc = eventDoc.documentElement;
6116 body = eventDoc.body;
6117
6118 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
6119 event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
6120 }
6121
6122 // Add relatedTarget, if necessary
6123 if ( !event.relatedTarget && fromElement ) {
6124 event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
6125 }
6126
6127 // Add which for click: 1 === left; 2 === middle; 3 === right
6128 // Note: button is not normalized, so don't use it
6129 if ( !event.which && button !== undefined ) {
6130 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
6131 }
6132
6133 return event;
6134 }
6135 },
6136
6137 special: {
6138 load: {
6139 // Prevent triggered image.load events from bubbling to window.load
6140 noBubble: true
6141 },
6142 focus: {
6143 // Fire native event if possible so blur/focus sequence is correct
6144 trigger: function() {
6145 if ( this !== safeActiveElement() && this.focus ) {
6146 try {
6147 this.focus();
6148 return false;
6149 } catch ( e ) {
6150 // Support: IE<9
6151 // If we error on focus to hidden element (#1486, #12518),
6152 // let .trigger() run the handlers
6153 }
6154 }
6155 },
6156 delegateType: "focusin"
6157 },
6158 blur: {
6159 trigger: function() {
6160 if ( this === safeActiveElement() && this.blur ) {
6161 this.blur();
6162 return false;
6163 }
6164 },
6165 delegateType: "focusout"
6166 },
6167 click: {
6168 // For checkbox, fire native event so checked state will be right
6169 trigger: function() {
6170 if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
6171 this.click();
6172 return false;
6173 }
6174 },
6175
6176 // For cross-browser consistency, don't fire native .click() on links
6177 _default: function( event ) {
6178 return jQuery.nodeName( event.target, "a" );
6179 }
6180 },
6181
6182 beforeunload: {
6183 postDispatch: function( event ) {
6184
6185 // Even when returnValue equals to undefined Firefox will still show alert
6186 if ( event.result !== undefined ) {
6187 event.originalEvent.returnValue = event.result;
6188 }
6189 }
6190 }
6191 },
6192
6193 simulate: function( type, elem, event, bubble ) {
6194 // Piggyback on a donor event to simulate a different one.
6195 // Fake originalEvent to avoid donor's stopPropagation, but if the
6196 // simulated event prevents default then we do the same on the donor.
6197 var e = jQuery.extend(
6198 new jQuery.Event(),
6199 event,
6200 {
6201 type: type,
6202 isSimulated: true,
6203 originalEvent: {}
6204 }
6205 );
6206 if ( bubble ) {
6207 jQuery.event.trigger( e, null, elem );
6208 } else {
6209 jQuery.event.dispatch.call( elem, e );
6210 }
6211 if ( e.isDefaultPrevented() ) {
6212 event.preventDefault();
6213 }
6214 }
6215};
6216
6217jQuery.removeEvent = document.removeEventListener ?
6218 function( elem, type, handle ) {
6219 if ( elem.removeEventListener ) {
6220 elem.removeEventListener( type, handle, false );
6221 }
6222 } :
6223 function( elem, type, handle ) {
6224 var name = "on" + type;
6225
6226 if ( elem.detachEvent ) {
6227
6228 // #8545, #7054, preventing memory leaks for custom events in IE6-8
6229 // detachEvent needed property on element, by name of that event, to properly expose it to GC
6230 if ( typeof elem[ name ] === core_strundefined ) {
6231 elem[ name ] = null;
6232 }
6233
6234 elem.detachEvent( name, handle );
6235 }
6236 };
6237
6238jQuery.Event = function( src, props ) {
6239 // Allow instantiation without the 'new' keyword
6240 if ( !(this instanceof jQuery.Event) ) {
6241 return new jQuery.Event( src, props );
6242 }
6243
6244 // Event object
6245 if ( src && src.type ) {
6246 this.originalEvent = src;
6247 this.type = src.type;
6248
6249 // Events bubbling up the document may have been marked as prevented
6250 // by a handler lower down the tree; reflect the correct value.
6251 this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
6252 src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
6253
6254 // Event type
6255 } else {
6256 this.type = src;
6257 }
6258
6259 // Put explicitly provided properties onto the event object
6260 if ( props ) {
6261 jQuery.extend( this, props );
6262 }
6263
6264 // Create a timestamp if incoming event doesn't have one
6265 this.timeStamp = src && src.timeStamp || jQuery.now();
6266
6267 // Mark it as fixed
6268 this[ jQuery.expando ] = true;
6269};
6270
6271// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
6272// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
6273jQuery.Event.prototype = {
6274 isDefaultPrevented: returnFalse,
6275 isPropagationStopped: returnFalse,
6276 isImmediatePropagationStopped: returnFalse,
6277
6278 preventDefault: function() {
6279 var e = this.originalEvent;
6280
6281 this.isDefaultPrevented = returnTrue;
6282 if ( !e ) {
6283 return;
6284 }
6285
6286 // If preventDefault exists, run it on the original event
6287 if ( e.preventDefault ) {
6288 e.preventDefault();
6289
6290 // Support: IE
6291 // Otherwise set the returnValue property of the original event to false
6292 } else {
6293 e.returnValue = false;
6294 }
6295 },
6296 stopPropagation: function() {
6297 var e = this.originalEvent;
6298
6299 this.isPropagationStopped = returnTrue;
6300 if ( !e ) {
6301 return;
6302 }
6303 // If stopPropagation exists, run it on the original event
6304 if ( e.stopPropagation ) {
6305 e.stopPropagation();
6306 }
6307
6308 // Support: IE
6309 // Set the cancelBubble property of the original event to true
6310 e.cancelBubble = true;
6311 },
6312 stopImmediatePropagation: function() {
6313 this.isImmediatePropagationStopped = returnTrue;
6314 this.stopPropagation();
6315 }
6316};
6317
6318// Create mouseenter/leave events using mouseover/out and event-time checks
6319jQuery.each({
6320 mouseenter: "mouseover",
6321 mouseleave: "mouseout"
6322}, function( orig, fix ) {
6323 jQuery.event.special[ orig ] = {
6324 delegateType: fix,
6325 bindType: fix,
6326
6327 handle: function( event ) {
6328 var ret,
6329 target = this,
6330 related = event.relatedTarget,
6331 handleObj = event.handleObj;
6332
6333 // For mousenter/leave call the handler if related is outside the target.
6334 // NB: No relatedTarget if the mouse left/entered the browser window
6335 if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
6336 event.type = handleObj.origType;
6337 ret = handleObj.handler.apply( this, arguments );
6338 event.type = fix;
6339 }
6340 return ret;
6341 }
6342 };
6343});
6344
6345// IE submit delegation
6346if ( !jQuery.support.submitBubbles ) {
6347
6348 jQuery.event.special.submit = {
6349 setup: function() {
6350 // Only need this for delegated form submit events
6351 if ( jQuery.nodeName( this, "form" ) ) {
6352 return false;
6353 }
6354
6355 // Lazy-add a submit handler when a descendant form may potentially be submitted
6356 jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
6357 // Node name check avoids a VML-related crash in IE (#9807)
6358 var elem = e.target,
6359 form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
6360 if ( form && !jQuery._data( form, "submitBubbles" ) ) {
6361 jQuery.event.add( form, "submit._submit", function( event ) {
6362 event._submit_bubble = true;
6363 });
6364 jQuery._data( form, "submitBubbles", true );
6365 }
6366 });
6367 // return undefined since we don't need an event listener
6368 },
6369
6370 postDispatch: function( event ) {
6371 // If form was submitted by the user, bubble the event up the tree
6372 if ( event._submit_bubble ) {
6373 delete event._submit_bubble;
6374 if ( this.parentNode && !event.isTrigger ) {
6375 jQuery.event.simulate( "submit", this.parentNode, event, true );
6376 }
6377 }
6378 },
6379
6380 teardown: function() {
6381 // Only need this for delegated form submit events
6382 if ( jQuery.nodeName( this, "form" ) ) {
6383 return false;
6384 }
6385
6386 // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
6387 jQuery.event.remove( this, "._submit" );
6388 }
6389 };
6390}
6391
6392// IE change delegation and checkbox/radio fix
6393if ( !jQuery.support.changeBubbles ) {
6394
6395 jQuery.event.special.change = {
6396
6397 setup: function() {
6398
6399 if ( rformElems.test( this.nodeName ) ) {
6400 // IE doesn't fire change on a check/radio until blur; trigger it on click
6401 // after a propertychange. Eat the blur-change in special.change.handle.
6402 // This still fires onchange a second time for check/radio after blur.
6403 if ( this.type === "checkbox" || this.type === "radio" ) {
6404 jQuery.event.add( this, "propertychange._change", function( event ) {
6405 if ( event.originalEvent.propertyName === "checked" ) {
6406 this._just_changed = true;
6407 }
6408 });
6409 jQuery.event.add( this, "click._change", function( event ) {
6410 if ( this._just_changed && !event.isTrigger ) {
6411 this._just_changed = false;
6412 }
6413 // Allow triggered, simulated change events (#11500)
6414 jQuery.event.simulate( "change", this, event, true );
6415 });
6416 }
6417 return false;
6418 }
6419 // Delegated event; lazy-add a change handler on descendant inputs
6420 jQuery.event.add( this, "beforeactivate._change", function( e ) {
6421 var elem = e.target;
6422
6423 if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
6424 jQuery.event.add( elem, "change._change", function( event ) {
6425 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
6426 jQuery.event.simulate( "change", this.parentNode, event, true );
6427 }
6428 });
6429 jQuery._data( elem, "changeBubbles", true );
6430 }
6431 });
6432 },
6433
6434 handle: function( event ) {
6435 var elem = event.target;
6436
6437 // Swallow native change events from checkbox/radio, we already triggered them above
6438 if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
6439 return event.handleObj.handler.apply( this, arguments );
6440 }
6441 },
6442
6443 teardown: function() {
6444 jQuery.event.remove( this, "._change" );
6445
6446 return !rformElems.test( this.nodeName );
6447 }
6448 };
6449}
6450
6451// Create "bubbling" focus and blur events
6452if ( !jQuery.support.focusinBubbles ) {
6453 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
6454
6455 // Attach a single capturing handler while someone wants focusin/focusout
6456 var attaches = 0,
6457 handler = function( event ) {
6458 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
6459 };
6460
6461 jQuery.event.special[ fix ] = {
6462 setup: function() {
6463 if ( attaches++ === 0 ) {
6464 document.addEventListener( orig, handler, true );
6465 }
6466 },
6467 teardown: function() {
6468 if ( --attaches === 0 ) {
6469 document.removeEventListener( orig, handler, true );
6470 }
6471 }
6472 };
6473 });
6474}
6475
6476jQuery.fn.extend({
6477
6478 on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
6479 var type, origFn;
6480
6481 // Types can be a map of types/handlers
6482 if ( typeof types === "object" ) {
6483 // ( types-Object, selector, data )
6484 if ( typeof selector !== "string" ) {
6485 // ( types-Object, data )
6486 data = data || selector;
6487 selector = undefined;
6488 }
6489 for ( type in types ) {
6490 this.on( type, selector, data, types[ type ], one );
6491 }
6492 return this;
6493 }
6494
6495 if ( data == null && fn == null ) {
6496 // ( types, fn )
6497 fn = selector;
6498 data = selector = undefined;
6499 } else if ( fn == null ) {
6500 if ( typeof selector === "string" ) {
6501 // ( types, selector, fn )
6502 fn = data;
6503 data = undefined;
6504 } else {
6505 // ( types, data, fn )
6506 fn = data;
6507 data = selector;
6508 selector = undefined;
6509 }
6510 }
6511 if ( fn === false ) {
6512 fn = returnFalse;
6513 } else if ( !fn ) {
6514 return this;
6515 }
6516
6517 if ( one === 1 ) {
6518 origFn = fn;
6519 fn = function( event ) {
6520 // Can use an empty set, since event contains the info
6521 jQuery().off( event );
6522 return origFn.apply( this, arguments );
6523 };
6524 // Use same guid so caller can remove using origFn
6525 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
6526 }
6527 return this.each( function() {
6528 jQuery.event.add( this, types, fn, data, selector );
6529 });
6530 },
6531 one: function( types, selector, data, fn ) {
6532 return this.on( types, selector, data, fn, 1 );
6533 },
6534 off: function( types, selector, fn ) {
6535 var handleObj, type;
6536 if ( types && types.preventDefault && types.handleObj ) {
6537 // ( event ) dispatched jQuery.Event
6538 handleObj = types.handleObj;
6539 jQuery( types.delegateTarget ).off(
6540 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
6541 handleObj.selector,
6542 handleObj.handler
6543 );
6544 return this;
6545 }
6546 if ( typeof types === "object" ) {
6547 // ( types-object [, selector] )
6548 for ( type in types ) {
6549 this.off( type, selector, types[ type ] );
6550 }
6551 return this;
6552 }
6553 if ( selector === false || typeof selector === "function" ) {
6554 // ( types [, fn] )
6555 fn = selector;
6556 selector = undefined;
6557 }
6558 if ( fn === false ) {
6559 fn = returnFalse;
6560 }
6561 return this.each(function() {
6562 jQuery.event.remove( this, types, fn, selector );
6563 });
6564 },
6565
6566 trigger: function( type, data ) {
6567 return this.each(function() {
6568 jQuery.event.trigger( type, data, this );
6569 });
6570 },
6571 triggerHandler: function( type, data ) {
6572 var elem = this[0];
6573 if ( elem ) {
6574 return jQuery.event.trigger( type, data, elem, true );
6575 }
6576 }
6577});
6578var isSimple = /^.[^:#\[\.,]*$/,
6579 rparentsprev = /^(?:parents|prev(?:Until|All))/,
6580 rneedsContext = jQuery.expr.match.needsContext,
6581 // methods guaranteed to produce a unique set when starting from a unique set
6582 guaranteedUnique = {
6583 children: true,
6584 contents: true,
6585 next: true,
6586 prev: true
6587 };
6588
6589jQuery.fn.extend({
6590 find: function( selector ) {
6591 var i,
6592 ret = [],
6593 self = this,
6594 len = self.length;
6595
6596 if ( typeof selector !== "string" ) {
6597 return this.pushStack( jQuery( selector ).filter(function() {
6598 for ( i = 0; i < len; i++ ) {
6599 if ( jQuery.contains( self[ i ], this ) ) {
6600 return true;
6601 }
6602 }
6603 }) );
6604 }
6605
6606 for ( i = 0; i < len; i++ ) {
6607 jQuery.find( selector, self[ i ], ret );
6608 }
6609
6610 // Needed because $( selector, context ) becomes $( context ).find( selector )
6611 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
6612 ret.selector = this.selector ? this.selector + " " + selector : selector;
6613 return ret;
6614 },
6615
6616 has: function( target ) {
6617 var i,
6618 targets = jQuery( target, this ),
6619 len = targets.length;
6620
6621 return this.filter(function() {
6622 for ( i = 0; i < len; i++ ) {
6623 if ( jQuery.contains( this, targets[i] ) ) {
6624 return true;
6625 }
6626 }
6627 });
6628 },
6629
6630 not: function( selector ) {
6631 return this.pushStack( winnow(this, selector || [], true) );
6632 },
6633
6634 filter: function( selector ) {
6635 return this.pushStack( winnow(this, selector || [], false) );
6636 },
6637
6638 is: function( selector ) {
6639 return !!winnow(
6640 this,
6641
6642 // If this is a positional/relative selector, check membership in the returned set
6643 // so $("p:first").is("p:last") won't return true for a doc with two "p".
6644 typeof selector === "string" && rneedsContext.test( selector ) ?
6645 jQuery( selector ) :
6646 selector || [],
6647 false
6648 ).length;
6649 },
6650
6651 closest: function( selectors, context ) {
6652 var cur,
6653 i = 0,
6654 l = this.length,
6655 ret = [],
6656 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
6657 jQuery( selectors, context || this.context ) :
6658 0;
6659
6660 for ( ; i < l; i++ ) {
6661 for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
6662 // Always skip document fragments
6663 if ( cur.nodeType < 11 && (pos ?
6664 pos.index(cur) > -1 :
6665
6666 // Don't pass non-elements to Sizzle
6667 cur.nodeType === 1 &&
6668 jQuery.find.matchesSelector(cur, selectors)) ) {
6669
6670 cur = ret.push( cur );
6671 break;
6672 }
6673 }
6674 }
6675
6676 return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
6677 },
6678
6679 // Determine the position of an element within
6680 // the matched set of elements
6681 index: function( elem ) {
6682
6683 // No argument, return index in parent
6684 if ( !elem ) {
6685 return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
6686 }
6687
6688 // index in selector
6689 if ( typeof elem === "string" ) {
6690 return jQuery.inArray( this[0], jQuery( elem ) );
6691 }
6692
6693 // Locate the position of the desired element
6694 return jQuery.inArray(
6695 // If it receives a jQuery object, the first element is used
6696 elem.jquery ? elem[0] : elem, this );
6697 },
6698
6699 add: function( selector, context ) {
6700 var set = typeof selector === "string" ?
6701 jQuery( selector, context ) :
6702 jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
6703 all = jQuery.merge( this.get(), set );
6704
6705 return this.pushStack( jQuery.unique(all) );
6706 },
6707
6708 addBack: function( selector ) {
6709 return this.add( selector == null ?
6710 this.prevObject : this.prevObject.filter(selector)
6711 );
6712 }
6713});
6714
6715function sibling( cur, dir ) {
6716 do {
6717 cur = cur[ dir ];
6718 } while ( cur && cur.nodeType !== 1 );
6719
6720 return cur;
6721}
6722
6723jQuery.each({
6724 parent: function( elem ) {
6725 var parent = elem.parentNode;
6726 return parent && parent.nodeType !== 11 ? parent : null;
6727 },
6728 parents: function( elem ) {
6729 return jQuery.dir( elem, "parentNode" );
6730 },
6731 parentsUntil: function( elem, i, until ) {
6732 return jQuery.dir( elem, "parentNode", until );
6733 },
6734 next: function( elem ) {
6735 return sibling( elem, "nextSibling" );
6736 },
6737 prev: function( elem ) {
6738 return sibling( elem, "previousSibling" );
6739 },
6740 nextAll: function( elem ) {
6741 return jQuery.dir( elem, "nextSibling" );
6742 },
6743 prevAll: function( elem ) {
6744 return jQuery.dir( elem, "previousSibling" );
6745 },
6746 nextUntil: function( elem, i, until ) {
6747 return jQuery.dir( elem, "nextSibling", until );
6748 },
6749 prevUntil: function( elem, i, until ) {
6750 return jQuery.dir( elem, "previousSibling", until );
6751 },
6752 siblings: function( elem ) {
6753 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
6754 },
6755 children: function( elem ) {
6756 return jQuery.sibling( elem.firstChild );
6757 },
6758 contents: function( elem ) {
6759 return jQuery.nodeName( elem, "iframe" ) ?
6760 elem.contentDocument || elem.contentWindow.document :
6761 jQuery.merge( [], elem.childNodes );
6762 }
6763}, function( name, fn ) {
6764 jQuery.fn[ name ] = function( until, selector ) {
6765 var ret = jQuery.map( this, fn, until );
6766
6767 if ( name.slice( -5 ) !== "Until" ) {
6768 selector = until;
6769 }
6770
6771 if ( selector && typeof selector === "string" ) {
6772 ret = jQuery.filter( selector, ret );
6773 }
6774
6775 if ( this.length > 1 ) {
6776 // Remove duplicates
6777 if ( !guaranteedUnique[ name ] ) {
6778 ret = jQuery.unique( ret );
6779 }
6780
6781 // Reverse order for parents* and prev-derivatives
6782 if ( rparentsprev.test( name ) ) {
6783 ret = ret.reverse();
6784 }
6785 }
6786
6787 return this.pushStack( ret );
6788 };
6789});
6790
6791jQuery.extend({
6792 filter: function( expr, elems, not ) {
6793 var elem = elems[ 0 ];
6794
6795 if ( not ) {
6796 expr = ":not(" + expr + ")";
6797 }
6798
6799 return elems.length === 1 && elem.nodeType === 1 ?
6800 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
6801 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
6802 return elem.nodeType === 1;
6803 }));
6804 },
6805
6806 dir: function( elem, dir, until ) {
6807 var matched = [],
6808 cur = elem[ dir ];
6809
6810 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
6811 if ( cur.nodeType === 1 ) {
6812 matched.push( cur );
6813 }
6814 cur = cur[dir];
6815 }
6816 return matched;
6817 },
6818
6819 sibling: function( n, elem ) {
6820 var r = [];
6821
6822 for ( ; n; n = n.nextSibling ) {
6823 if ( n.nodeType === 1 && n !== elem ) {
6824 r.push( n );
6825 }
6826 }
6827
6828 return r;
6829 }
6830});
6831
6832// Implement the identical functionality for filter and not
6833function winnow( elements, qualifier, not ) {
6834 if ( jQuery.isFunction( qualifier ) ) {
6835 return jQuery.grep( elements, function( elem, i ) {
6836 /* jshint -W018 */
6837 return !!qualifier.call( elem, i, elem ) !== not;
6838 });
6839
6840 }
6841
6842 if ( qualifier.nodeType ) {
6843 return jQuery.grep( elements, function( elem ) {
6844 return ( elem === qualifier ) !== not;
6845 });
6846
6847 }
6848
6849 if ( typeof qualifier === "string" ) {
6850 if ( isSimple.test( qualifier ) ) {
6851 return jQuery.filter( qualifier, elements, not );
6852 }
6853
6854 qualifier = jQuery.filter( qualifier, elements );
6855 }
6856
6857 return jQuery.grep( elements, function( elem ) {
6858 return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
6859 });
6860}
6861function createSafeFragment( document ) {
6862 var list = nodeNames.split( "|" ),
6863 safeFrag = document.createDocumentFragment();
6864
6865 if ( safeFrag.createElement ) {
6866 while ( list.length ) {
6867 safeFrag.createElement(
6868 list.pop()
6869 );
6870 }
6871 }
6872 return safeFrag;
6873}
6874
6875var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
6876 "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
6877 rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
6878 rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
6879 rleadingWhitespace = /^\s+/,
6880 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
6881 rtagName = /<([\w:]+)/,
6882 rtbody = /<tbody/i,
6883 rhtml = /<|&#?\w+;/,
6884 rnoInnerhtml = /<(?:script|style|link)/i,
6885 manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
6886 // checked="checked" or checked
6887 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
6888 rscriptType = /^$|\/(?:java|ecma)script/i,
6889 rscriptTypeMasked = /^true\/(.*)/,
6890 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
6891
6892 // We have to close these tags to support XHTML (#13200)
6893 wrapMap = {
6894 option: [ 1, "<select multiple='multiple'>", "</select>" ],
6895 legend: [ 1, "<fieldset>", "</fieldset>" ],
6896 area: [ 1, "<map>", "</map>" ],
6897 param: [ 1, "<object>", "</object>" ],
6898 thead: [ 1, "<table>", "</table>" ],
6899 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
6900 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
6901 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
6902
6903 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
6904 // unless wrapped in a div with non-breaking characters in front of it.
6905 _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
6906 },
6907 safeFragment = createSafeFragment( document ),
6908 fragmentDiv = safeFragment.appendChild( document.createElement("div") );
6909
6910wrapMap.optgroup = wrapMap.option;
6911wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
6912wrapMap.th = wrapMap.td;
6913
6914jQuery.fn.extend({
6915 text: function( value ) {
6916 return jQuery.access( this, function( value ) {
6917 return value === undefined ?
6918 jQuery.text( this ) :
6919 this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
6920 }, null, value, arguments.length );
6921 },
6922
6923 append: function() {
6924 return this.domManip( arguments, function( elem ) {
6925 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6926 var target = manipulationTarget( this, elem );
6927 target.appendChild( elem );
6928 }
6929 });
6930 },
6931
6932 prepend: function() {
6933 return this.domManip( arguments, function( elem ) {
6934 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6935 var target = manipulationTarget( this, elem );
6936 target.insertBefore( elem, target.firstChild );
6937 }
6938 });
6939 },
6940
6941 before: function() {
6942 return this.domManip( arguments, function( elem ) {
6943 if ( this.parentNode ) {
6944 this.parentNode.insertBefore( elem, this );
6945 }
6946 });
6947 },
6948
6949 after: function() {
6950 return this.domManip( arguments, function( elem ) {
6951 if ( this.parentNode ) {
6952 this.parentNode.insertBefore( elem, this.nextSibling );
6953 }
6954 });
6955 },
6956
6957 // keepData is for internal use only--do not document
6958 remove: function( selector, keepData ) {
6959 var elem,
6960 elems = selector ? jQuery.filter( selector, this ) : this,
6961 i = 0;
6962
6963 for ( ; (elem = elems[i]) != null; i++ ) {
6964
6965 if ( !keepData && elem.nodeType === 1 ) {
6966 jQuery.cleanData( getAll( elem ) );
6967 }
6968
6969 if ( elem.parentNode ) {
6970 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
6971 setGlobalEval( getAll( elem, "script" ) );
6972 }
6973 elem.parentNode.removeChild( elem );
6974 }
6975 }
6976
6977 return this;
6978 },
6979
6980 empty: function() {
6981 var elem,
6982 i = 0;
6983
6984 for ( ; (elem = this[i]) != null; i++ ) {
6985 // Remove element nodes and prevent memory leaks
6986 if ( elem.nodeType === 1 ) {
6987 jQuery.cleanData( getAll( elem, false ) );
6988 }
6989
6990 // Remove any remaining nodes
6991 while ( elem.firstChild ) {
6992 elem.removeChild( elem.firstChild );
6993 }
6994
6995 // If this is a select, ensure that it displays empty (#12336)
6996 // Support: IE<9
6997 if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
6998 elem.options.length = 0;
6999 }
7000 }
7001
7002 return this;
7003 },
7004
7005 clone: function( dataAndEvents, deepDataAndEvents ) {
7006 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
7007 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
7008
7009 return this.map( function () {
7010 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
7011 });
7012 },
7013
7014 html: function( value ) {
7015 return jQuery.access( this, function( value ) {
7016 var elem = this[0] || {},
7017 i = 0,
7018 l = this.length;
7019
7020 if ( value === undefined ) {
7021 return elem.nodeType === 1 ?
7022 elem.innerHTML.replace( rinlinejQuery, "" ) :
7023 undefined;
7024 }
7025
7026 // See if we can take a shortcut and just use innerHTML
7027 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
7028 ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
7029 ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
7030 !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
7031
7032 value = value.replace( rxhtmlTag, "<$1></$2>" );
7033
7034 try {
7035 for (; i < l; i++ ) {
7036 // Remove element nodes and prevent memory leaks
7037 elem = this[i] || {};
7038 if ( elem.nodeType === 1 ) {
7039 jQuery.cleanData( getAll( elem, false ) );
7040 elem.innerHTML = value;
7041 }
7042 }
7043
7044 elem = 0;
7045
7046 // If using innerHTML throws an exception, use the fallback method
7047 } catch(e) {}
7048 }
7049
7050 if ( elem ) {
7051 this.empty().append( value );
7052 }
7053 }, null, value, arguments.length );
7054 },
7055
7056 replaceWith: function() {
7057 var
7058 // Snapshot the DOM in case .domManip sweeps something relevant into its fragment
7059 args = jQuery.map( this, function( elem ) {
7060 return [ elem.nextSibling, elem.parentNode ];
7061 }),
7062 i = 0;
7063
7064 // Make the changes, replacing each context element with the new content
7065 this.domManip( arguments, function( elem ) {
7066 var next = args[ i++ ],
7067 parent = args[ i++ ];
7068
7069 if ( parent ) {
7070 // Don't use the snapshot next if it has moved (#13810)
7071 if ( next && next.parentNode !== parent ) {
7072 next = this.nextSibling;
7073 }
7074 jQuery( this ).remove();
7075 parent.insertBefore( elem, next );
7076 }
7077 // Allow new content to include elements from the context set
7078 }, true );
7079
7080 // Force removal if there was no new content (e.g., from empty arguments)
7081 return i ? this : this.remove();
7082 },
7083
7084 detach: function( selector ) {
7085 return this.remove( selector, true );
7086 },
7087
7088 domManip: function( args, callback, allowIntersection ) {
7089
7090 // Flatten any nested arrays
7091 args = core_concat.apply( [], args );
7092
7093 var first, node, hasScripts,
7094 scripts, doc, fragment,
7095 i = 0,
7096 l = this.length,
7097 set = this,
7098 iNoClone = l - 1,
7099 value = args[0],
7100 isFunction = jQuery.isFunction( value );
7101
7102 // We can't cloneNode fragments that contain checked, in WebKit
7103 if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
7104 return this.each(function( index ) {
7105 var self = set.eq( index );
7106 if ( isFunction ) {
7107 args[0] = value.call( this, index, self.html() );
7108 }
7109 self.domManip( args, callback, allowIntersection );
7110 });
7111 }
7112
7113 if ( l ) {
7114 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );
7115 first = fragment.firstChild;
7116
7117 if ( fragment.childNodes.length === 1 ) {
7118 fragment = first;
7119 }
7120
7121 if ( first ) {
7122 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
7123 hasScripts = scripts.length;
7124
7125 // Use the original fragment for the last item instead of the first because it can end up
7126 // being emptied incorrectly in certain situations (#8070).
7127 for ( ; i < l; i++ ) {
7128 node = fragment;
7129
7130 if ( i !== iNoClone ) {
7131 node = jQuery.clone( node, true, true );
7132
7133 // Keep references to cloned scripts for later restoration
7134 if ( hasScripts ) {
7135 jQuery.merge( scripts, getAll( node, "script" ) );
7136 }
7137 }
7138
7139 callback.call( this[i], node, i );
7140 }
7141
7142 if ( hasScripts ) {
7143 doc = scripts[ scripts.length - 1 ].ownerDocument;
7144
7145 // Reenable scripts
7146 jQuery.map( scripts, restoreScript );
7147
7148 // Evaluate executable scripts on first document insertion
7149 for ( i = 0; i < hasScripts; i++ ) {
7150 node = scripts[ i ];
7151 if ( rscriptType.test( node.type || "" ) &&
7152 !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
7153
7154 if ( node.src ) {
7155 // Hope ajax is available...
7156 jQuery._evalUrl( node.src );
7157 } else {
7158 jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
7159 }
7160 }
7161 }
7162 }
7163
7164 // Fix #11809: Avoid leaking memory
7165 fragment = first = null;
7166 }
7167 }
7168
7169 return this;
7170 }
7171});
7172
7173// Support: IE<8
7174// Manipulating tables requires a tbody
7175function manipulationTarget( elem, content ) {
7176 return jQuery.nodeName( elem, "table" ) &&
7177 jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ?
7178
7179 elem.getElementsByTagName("tbody")[0] ||
7180 elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
7181 elem;
7182}
7183
7184// Replace/restore the type attribute of script elements for safe DOM manipulation
7185function disableScript( elem ) {
7186 elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
7187 return elem;
7188}
7189function restoreScript( elem ) {
7190 var match = rscriptTypeMasked.exec( elem.type );
7191 if ( match ) {
7192 elem.type = match[1];
7193 } else {
7194 elem.removeAttribute("type");
7195 }
7196 return elem;
7197}
7198
7199// Mark scripts as having already been evaluated
7200function setGlobalEval( elems, refElements ) {
7201 var elem,
7202 i = 0;
7203 for ( ; (elem = elems[i]) != null; i++ ) {
7204 jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
7205 }
7206}
7207
7208function cloneCopyEvent( src, dest ) {
7209
7210 if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
7211 return;
7212 }
7213
7214 var type, i, l,
7215 oldData = jQuery._data( src ),
7216 curData = jQuery._data( dest, oldData ),
7217 events = oldData.events;
7218
7219 if ( events ) {
7220 delete curData.handle;
7221 curData.events = {};
7222
7223 for ( type in events ) {
7224 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
7225 jQuery.event.add( dest, type, events[ type ][ i ] );
7226 }
7227 }
7228 }
7229
7230 // make the cloned public data object a copy from the original
7231 if ( curData.data ) {
7232 curData.data = jQuery.extend( {}, curData.data );
7233 }
7234}
7235
7236function fixCloneNodeIssues( src, dest ) {
7237 var nodeName, e, data;
7238
7239 // We do not need to do anything for non-Elements
7240 if ( dest.nodeType !== 1 ) {
7241 return;
7242 }
7243
7244 nodeName = dest.nodeName.toLowerCase();
7245
7246 // IE6-8 copies events bound via attachEvent when using cloneNode.
7247 if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
7248 data = jQuery._data( dest );
7249
7250 for ( e in data.events ) {
7251 jQuery.removeEvent( dest, e, data.handle );
7252 }
7253
7254 // Event data gets referenced instead of copied if the expando gets copied too
7255 dest.removeAttribute( jQuery.expando );
7256 }
7257
7258 // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
7259 if ( nodeName === "script" && dest.text !== src.text ) {
7260 disableScript( dest ).text = src.text;
7261 restoreScript( dest );
7262
7263 // IE6-10 improperly clones children of object elements using classid.
7264 // IE10 throws NoModificationAllowedError if parent is null, #12132.
7265 } else if ( nodeName === "object" ) {
7266 if ( dest.parentNode ) {
7267 dest.outerHTML = src.outerHTML;
7268 }
7269
7270 // This path appears unavoidable for IE9. When cloning an object
7271 // element in IE9, the outerHTML strategy above is not sufficient.
7272 // If the src has innerHTML and the destination does not,
7273 // copy the src.innerHTML into the dest.innerHTML. #10324
7274 if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
7275 dest.innerHTML = src.innerHTML;
7276 }
7277
7278 } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
7279 // IE6-8 fails to persist the checked state of a cloned checkbox
7280 // or radio button. Worse, IE6-7 fail to give the cloned element
7281 // a checked appearance if the defaultChecked value isn't also set
7282
7283 dest.defaultChecked = dest.checked = src.checked;
7284
7285 // IE6-7 get confused and end up setting the value of a cloned
7286 // checkbox/radio button to an empty string instead of "on"
7287 if ( dest.value !== src.value ) {
7288 dest.value = src.value;
7289 }
7290
7291 // IE6-8 fails to return the selected option to the default selected
7292 // state when cloning options
7293 } else if ( nodeName === "option" ) {
7294 dest.defaultSelected = dest.selected = src.defaultSelected;
7295
7296 // IE6-8 fails to set the defaultValue to the correct value when
7297 // cloning other types of input fields
7298 } else if ( nodeName === "input" || nodeName === "textarea" ) {
7299 dest.defaultValue = src.defaultValue;
7300 }
7301}
7302
7303jQuery.each({
7304 appendTo: "append",
7305 prependTo: "prepend",
7306 insertBefore: "before",
7307 insertAfter: "after",
7308 replaceAll: "replaceWith"
7309}, function( name, original ) {
7310 jQuery.fn[ name ] = function( selector ) {
7311 var elems,
7312 i = 0,
7313 ret = [],
7314 insert = jQuery( selector ),
7315 last = insert.length - 1;
7316
7317 for ( ; i <= last; i++ ) {
7318 elems = i === last ? this : this.clone(true);
7319 jQuery( insert[i] )[ original ]( elems );
7320
7321 // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
7322 core_push.apply( ret, elems.get() );
7323 }
7324
7325 return this.pushStack( ret );
7326 };
7327});
7328
7329function getAll( context, tag ) {
7330 var elems, elem,
7331 i = 0,
7332 found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
7333 typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
7334 undefined;
7335
7336 if ( !found ) {
7337 for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
7338 if ( !tag || jQuery.nodeName( elem, tag ) ) {
7339 found.push( elem );
7340 } else {
7341 jQuery.merge( found, getAll( elem, tag ) );
7342 }
7343 }
7344 }
7345
7346 return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
7347 jQuery.merge( [ context ], found ) :
7348 found;
7349}
7350
7351// Used in buildFragment, fixes the defaultChecked property
7352function fixDefaultChecked( elem ) {
7353 if ( manipulation_rcheckableType.test( elem.type ) ) {
7354 elem.defaultChecked = elem.checked;
7355 }
7356}
7357
7358jQuery.extend({
7359 clone: function( elem, dataAndEvents, deepDataAndEvents ) {
7360 var destElements, node, clone, i, srcElements,
7361 inPage = jQuery.contains( elem.ownerDocument, elem );
7362
7363 if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
7364 clone = elem.cloneNode( true );
7365
7366 // IE<=8 does not properly clone detached, unknown element nodes
7367 } else {
7368 fragmentDiv.innerHTML = elem.outerHTML;
7369 fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
7370 }
7371
7372 if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
7373 (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
7374
7375 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
7376 destElements = getAll( clone );
7377 srcElements = getAll( elem );
7378
7379 // Fix all IE cloning issues
7380 for ( i = 0; (node = srcElements[i]) != null; ++i ) {
7381 // Ensure that the destination node is not null; Fixes #9587
7382 if ( destElements[i] ) {
7383 fixCloneNodeIssues( node, destElements[i] );
7384 }
7385 }
7386 }
7387
7388 // Copy the events from the original to the clone
7389 if ( dataAndEvents ) {
7390 if ( deepDataAndEvents ) {
7391 srcElements = srcElements || getAll( elem );
7392 destElements = destElements || getAll( clone );
7393
7394 for ( i = 0; (node = srcElements[i]) != null; i++ ) {
7395 cloneCopyEvent( node, destElements[i] );
7396 }
7397 } else {
7398 cloneCopyEvent( elem, clone );
7399 }
7400 }
7401
7402 // Preserve script evaluation history
7403 destElements = getAll( clone, "script" );
7404 if ( destElements.length > 0 ) {
7405 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
7406 }
7407
7408 destElements = srcElements = node = null;
7409
7410 // Return the cloned set
7411 return clone;
7412 },
7413
7414 buildFragment: function( elems, context, scripts, selection ) {
7415 var j, elem, contains,
7416 tmp, tag, tbody, wrap,
7417 l = elems.length,
7418
7419 // Ensure a safe fragment
7420 safe = createSafeFragment( context ),
7421
7422 nodes = [],
7423 i = 0;
7424
7425 for ( ; i < l; i++ ) {
7426 elem = elems[ i ];
7427
7428 if ( elem || elem === 0 ) {
7429
7430 // Add nodes directly
7431 if ( jQuery.type( elem ) === "object" ) {
7432 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
7433
7434 // Convert non-html into a text node
7435 } else if ( !rhtml.test( elem ) ) {
7436 nodes.push( context.createTextNode( elem ) );
7437
7438 // Convert html into DOM nodes
7439 } else {
7440 tmp = tmp || safe.appendChild( context.createElement("div") );
7441
7442 // Deserialize a standard representation
7443 tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
7444 wrap = wrapMap[ tag ] || wrapMap._default;
7445
7446 tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
7447
7448 // Descend through wrappers to the right content
7449 j = wrap[0];
7450 while ( j-- ) {
7451 tmp = tmp.lastChild;
7452 }
7453
7454 // Manually add leading whitespace removed by IE
7455 if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
7456 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
7457 }
7458
7459 // Remove IE's autoinserted <tbody> from table fragments
7460 if ( !jQuery.support.tbody ) {
7461
7462 // String was a <table>, *may* have spurious <tbody>
7463 elem = tag === "table" && !rtbody.test( elem ) ?
7464 tmp.firstChild :
7465
7466 // String was a bare <thead> or <tfoot>
7467 wrap[1] === "<table>" && !rtbody.test( elem ) ?
7468 tmp :
7469 0;
7470
7471 j = elem && elem.childNodes.length;
7472 while ( j-- ) {
7473 if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
7474 elem.removeChild( tbody );
7475 }
7476 }
7477 }
7478
7479 jQuery.merge( nodes, tmp.childNodes );
7480
7481 // Fix #12392 for WebKit and IE > 9
7482 tmp.textContent = "";
7483
7484 // Fix #12392 for oldIE
7485 while ( tmp.firstChild ) {
7486 tmp.removeChild( tmp.firstChild );
7487 }
7488
7489 // Remember the top-level container for proper cleanup
7490 tmp = safe.lastChild;
7491 }
7492 }
7493 }
7494
7495 // Fix #11356: Clear elements from fragment
7496 if ( tmp ) {
7497 safe.removeChild( tmp );
7498 }
7499
7500 // Reset defaultChecked for any radios and checkboxes
7501 // about to be appended to the DOM in IE 6/7 (#8060)
7502 if ( !jQuery.support.appendChecked ) {
7503 jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
7504 }
7505
7506 i = 0;
7507 while ( (elem = nodes[ i++ ]) ) {
7508
7509 // #4087 - If origin and destination elements are the same, and this is
7510 // that element, do not do anything
7511 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
7512 continue;
7513 }
7514
7515 contains = jQuery.contains( elem.ownerDocument, elem );
7516
7517 // Append to fragment
7518 tmp = getAll( safe.appendChild( elem ), "script" );
7519
7520 // Preserve script evaluation history
7521 if ( contains ) {
7522 setGlobalEval( tmp );
7523 }
7524
7525 // Capture executables
7526 if ( scripts ) {
7527 j = 0;
7528 while ( (elem = tmp[ j++ ]) ) {
7529 if ( rscriptType.test( elem.type || "" ) ) {
7530 scripts.push( elem );
7531 }
7532 }
7533 }
7534 }
7535
7536 tmp = null;
7537
7538 return safe;
7539 },
7540
7541 cleanData: function( elems, /* internal */ acceptData ) {
7542 var elem, type, id, data,
7543 i = 0,
7544 internalKey = jQuery.expando,
7545 cache = jQuery.cache,
7546 deleteExpando = jQuery.support.deleteExpando,
7547 special = jQuery.event.special;
7548
7549 for ( ; (elem = elems[i]) != null; i++ ) {
7550
7551 if ( acceptData || jQuery.acceptData( elem ) ) {
7552
7553 id = elem[ internalKey ];
7554 data = id && cache[ id ];
7555
7556 if ( data ) {
7557 if ( data.events ) {
7558 for ( type in data.events ) {
7559 if ( special[ type ] ) {
7560 jQuery.event.remove( elem, type );
7561
7562 // This is a shortcut to avoid jQuery.event.remove's overhead
7563 } else {
7564 jQuery.removeEvent( elem, type, data.handle );
7565 }
7566 }
7567 }
7568
7569 // Remove cache only if it was not already removed by jQuery.event.remove
7570 if ( cache[ id ] ) {
7571
7572 delete cache[ id ];
7573
7574 // IE does not allow us to delete expando properties from nodes,
7575 // nor does it have a removeAttribute function on Document nodes;
7576 // we must handle all of these cases
7577 if ( deleteExpando ) {
7578 delete elem[ internalKey ];
7579
7580 } else if ( typeof elem.removeAttribute !== core_strundefined ) {
7581 elem.removeAttribute( internalKey );
7582
7583 } else {
7584 elem[ internalKey ] = null;
7585 }
7586
7587 core_deletedIds.push( id );
7588 }
7589 }
7590 }
7591 }
7592 },
7593
7594 _evalUrl: function( url ) {
7595 return jQuery.ajax({
7596 url: url,
7597 type: "GET",
7598 dataType: "script",
7599 async: false,
7600 global: false,
7601 "throws": true
7602 });
7603 }
7604});
7605jQuery.fn.extend({
7606 wrapAll: function( html ) {
7607 if ( jQuery.isFunction( html ) ) {
7608 return this.each(function(i) {
7609 jQuery(this).wrapAll( html.call(this, i) );
7610 });
7611 }
7612
7613 if ( this[0] ) {
7614 // The elements to wrap the target around
7615 var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
7616
7617 if ( this[0].parentNode ) {
7618 wrap.insertBefore( this[0] );
7619 }
7620
7621 wrap.map(function() {
7622 var elem = this;
7623
7624 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
7625 elem = elem.firstChild;
7626 }
7627
7628 return elem;
7629 }).append( this );
7630 }
7631
7632 return this;
7633 },
7634
7635 wrapInner: function( html ) {
7636 if ( jQuery.isFunction( html ) ) {
7637 return this.each(function(i) {
7638 jQuery(this).wrapInner( html.call(this, i) );
7639 });
7640 }
7641
7642 return this.each(function() {
7643 var self = jQuery( this ),
7644 contents = self.contents();
7645
7646 if ( contents.length ) {
7647 contents.wrapAll( html );
7648
7649 } else {
7650 self.append( html );
7651 }
7652 });
7653 },
7654
7655 wrap: function( html ) {
7656 var isFunction = jQuery.isFunction( html );
7657
7658 return this.each(function(i) {
7659 jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
7660 });
7661 },
7662
7663 unwrap: function() {
7664 return this.parent().each(function() {
7665 if ( !jQuery.nodeName( this, "body" ) ) {
7666 jQuery( this ).replaceWith( this.childNodes );
7667 }
7668 }).end();
7669 }
7670});
7671var iframe, getStyles, curCSS,
7672 ralpha = /alpha\([^)]*\)/i,
7673 ropacity = /opacity\s*=\s*([^)]*)/,
7674 rposition = /^(top|right|bottom|left)$/,
7675 // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
7676 // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
7677 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
7678 rmargin = /^margin/,
7679 rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
7680 rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
7681 rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
7682 elemdisplay = { BODY: "block" },
7683
7684 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
7685 cssNormalTransform = {
7686 letterSpacing: 0,
7687 fontWeight: 400
7688 },
7689
7690 cssExpand = [ "Top", "Right", "Bottom", "Left" ],
7691 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
7692
7693// return a css property mapped to a potentially vendor prefixed property
7694function vendorPropName( style, name ) {
7695
7696 // shortcut for names that are not vendor prefixed
7697 if ( name in style ) {
7698 return name;
7699 }
7700
7701 // check for vendor prefixed names
7702 var capName = name.charAt(0).toUpperCase() + name.slice(1),
7703 origName = name,
7704 i = cssPrefixes.length;
7705
7706 while ( i-- ) {
7707 name = cssPrefixes[ i ] + capName;
7708 if ( name in style ) {
7709 return name;
7710 }
7711 }
7712
7713 return origName;
7714}
7715
7716function isHidden( elem, el ) {
7717 // isHidden might be called from jQuery#filter function;
7718 // in that case, element will be second argument
7719 elem = el || elem;
7720 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
7721}
7722
7723function showHide( elements, show ) {
7724 var display, elem, hidden,
7725 values = [],
7726 index = 0,
7727 length = elements.length;
7728
7729 for ( ; index < length; index++ ) {
7730 elem = elements[ index ];
7731 if ( !elem.style ) {
7732 continue;
7733 }
7734
7735 values[ index ] = jQuery._data( elem, "olddisplay" );
7736 display = elem.style.display;
7737 if ( show ) {
7738 // Reset the inline display of this element to learn if it is
7739 // being hidden by cascaded rules or not
7740 if ( !values[ index ] && display === "none" ) {
7741 elem.style.display = "";
7742 }
7743
7744 // Set elements which have been overridden with display: none
7745 // in a stylesheet to whatever the default browser style is
7746 // for such an element
7747 if ( elem.style.display === "" && isHidden( elem ) ) {
7748 values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
7749 }
7750 } else {
7751
7752 if ( !values[ index ] ) {
7753 hidden = isHidden( elem );
7754
7755 if ( display && display !== "none" || !hidden ) {
7756 jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
7757 }
7758 }
7759 }
7760 }
7761
7762 // Set the display of most of the elements in a second loop
7763 // to avoid the constant reflow
7764 for ( index = 0; index < length; index++ ) {
7765 elem = elements[ index ];
7766 if ( !elem.style ) {
7767 continue;
7768 }
7769 if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
7770 elem.style.display = show ? values[ index ] || "" : "none";
7771 }
7772 }
7773
7774 return elements;
7775}
7776
7777jQuery.fn.extend({
7778 css: function( name, value ) {
7779 return jQuery.access( this, function( elem, name, value ) {
7780 var len, styles,
7781 map = {},
7782 i = 0;
7783
7784 if ( jQuery.isArray( name ) ) {
7785 styles = getStyles( elem );
7786 len = name.length;
7787
7788 for ( ; i < len; i++ ) {
7789 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
7790 }
7791
7792 return map;
7793 }
7794
7795 return value !== undefined ?
7796 jQuery.style( elem, name, value ) :
7797 jQuery.css( elem, name );
7798 }, name, value, arguments.length > 1 );
7799 },
7800 show: function() {
7801 return showHide( this, true );
7802 },
7803 hide: function() {
7804 return showHide( this );
7805 },
7806 toggle: function( state ) {
7807 var bool = typeof state === "boolean";
7808
7809 return this.each(function() {
7810 if ( bool ? state : isHidden( this ) ) {
7811 jQuery( this ).show();
7812 } else {
7813 jQuery( this ).hide();
7814 }
7815 });
7816 }
7817});
7818
7819jQuery.extend({
7820 // Add in style property hooks for overriding the default
7821 // behavior of getting and setting a style property
7822 cssHooks: {
7823 opacity: {
7824 get: function( elem, computed ) {
7825 if ( computed ) {
7826 // We should always get a number back from opacity
7827 var ret = curCSS( elem, "opacity" );
7828 return ret === "" ? "1" : ret;
7829 }
7830 }
7831 }
7832 },
7833
7834 // Don't automatically add "px" to these possibly-unitless properties
7835 cssNumber: {
7836 "columnCount": true,
7837 "fillOpacity": true,
7838 "fontWeight": true,
7839 "lineHeight": true,
7840 "opacity": true,
7841 "orphans": true,
7842 "widows": true,
7843 "zIndex": true,
7844 "zoom": true
7845 },
7846
7847 // Add in properties whose names you wish to fix before
7848 // setting or getting the value
7849 cssProps: {
7850 // normalize float css property
7851 "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
7852 },
7853
7854 // Get and set the style property on a DOM Node
7855 style: function( elem, name, value, extra ) {
7856 // Don't set styles on text and comment nodes
7857 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
7858 return;
7859 }
7860
7861 // Make sure that we're working with the right name
7862 var ret, type, hooks,
7863 origName = jQuery.camelCase( name ),
7864 style = elem.style;
7865
7866 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
7867
7868 // gets hook for the prefixed version
7869 // followed by the unprefixed version
7870 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
7871
7872 // Check if we're setting a value
7873 if ( value !== undefined ) {
7874 type = typeof value;
7875
7876 // convert relative number strings (+= or -=) to relative numbers. #7345
7877 if ( type === "string" && (ret = rrelNum.exec( value )) ) {
7878 value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
7879 // Fixes bug #9237
7880 type = "number";
7881 }
7882
7883 // Make sure that NaN and null values aren't set. See: #7116
7884 if ( value == null || type === "number" && isNaN( value ) ) {
7885 return;
7886 }
7887
7888 // If a number was passed in, add 'px' to the (except for certain CSS properties)
7889 if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
7890 value += "px";
7891 }
7892
7893 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
7894 // but it would mean to define eight (for every problematic property) identical functions
7895 if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
7896 style[ name ] = "inherit";
7897 }
7898
7899 // If a hook was provided, use that value, otherwise just set the specified value
7900 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
7901
7902 // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
7903 // Fixes bug #5509
7904 try {
7905 style[ name ] = value;
7906 } catch(e) {}
7907 }
7908
7909 } else {
7910 // If a hook was provided get the non-computed value from there
7911 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
7912 return ret;
7913 }
7914
7915 // Otherwise just get the value from the style object
7916 return style[ name ];
7917 }
7918 },
7919
7920 css: function( elem, name, extra, styles ) {
7921 var num, val, hooks,
7922 origName = jQuery.camelCase( name );
7923
7924 // Make sure that we're working with the right name
7925 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
7926
7927 // gets hook for the prefixed version
7928 // followed by the unprefixed version
7929 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
7930
7931 // If a hook was provided get the computed value from there
7932 if ( hooks && "get" in hooks ) {
7933 val = hooks.get( elem, true, extra );
7934 }
7935
7936 // Otherwise, if a way to get the computed value exists, use that
7937 if ( val === undefined ) {
7938 val = curCSS( elem, name, styles );
7939 }
7940
7941 //convert "normal" to computed value
7942 if ( val === "normal" && name in cssNormalTransform ) {
7943 val = cssNormalTransform[ name ];
7944 }
7945
7946 // Return, converting to number if forced or a qualifier was provided and val looks numeric
7947 if ( extra === "" || extra ) {
7948 num = parseFloat( val );
7949 return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
7950 }
7951 return val;
7952 }
7953});
7954
7955// NOTE: we've included the "window" in window.getComputedStyle
7956// because jsdom on node.js will break without it.
7957if ( window.getComputedStyle ) {
7958 getStyles = function( elem ) {
7959 return window.getComputedStyle( elem, null );
7960 };
7961
7962 curCSS = function( elem, name, _computed ) {
7963 var width, minWidth, maxWidth,
7964 computed = _computed || getStyles( elem ),
7965
7966 // getPropertyValue is only needed for .css('filter') in IE9, see #12537
7967 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
7968 style = elem.style;
7969
7970 if ( computed ) {
7971
7972 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
7973 ret = jQuery.style( elem, name );
7974 }
7975
7976 // A tribute to the "awesome hack by Dean Edwards"
7977 // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
7978 // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
7979 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
7980 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
7981
7982 // Remember the original values
7983 width = style.width;
7984 minWidth = style.minWidth;
7985 maxWidth = style.maxWidth;
7986
7987 // Put in the new values to get a computed value out
7988 style.minWidth = style.maxWidth = style.width = ret;
7989 ret = computed.width;
7990
7991 // Revert the changed values
7992 style.width = width;
7993 style.minWidth = minWidth;
7994 style.maxWidth = maxWidth;
7995 }
7996 }
7997
7998 return ret;
7999 };
8000} else if ( document.documentElement.currentStyle ) {
8001 getStyles = function( elem ) {
8002 return elem.currentStyle;
8003 };
8004
8005 curCSS = function( elem, name, _computed ) {
8006 var left, rs, rsLeft,
8007 computed = _computed || getStyles( elem ),
8008 ret = computed ? computed[ name ] : undefined,
8009 style = elem.style;
8010
8011 // Avoid setting ret to empty string here
8012 // so we don't default to auto
8013 if ( ret == null && style && style[ name ] ) {
8014 ret = style[ name ];
8015 }
8016
8017 // From the awesome hack by Dean Edwards
8018 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
8019
8020 // If we're not dealing with a regular pixel number
8021 // but a number that has a weird ending, we need to convert it to pixels
8022 // but not position css attributes, as those are proportional to the parent element instead
8023 // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
8024 if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
8025
8026 // Remember the original values
8027 left = style.left;
8028 rs = elem.runtimeStyle;
8029 rsLeft = rs && rs.left;
8030
8031 // Put in the new values to get a computed value out
8032 if ( rsLeft ) {
8033 rs.left = elem.currentStyle.left;
8034 }
8035 style.left = name === "fontSize" ? "1em" : ret;
8036 ret = style.pixelLeft + "px";
8037
8038 // Revert the changed values
8039 style.left = left;
8040 if ( rsLeft ) {
8041 rs.left = rsLeft;
8042 }
8043 }
8044
8045 return ret === "" ? "auto" : ret;
8046 };
8047}
8048
8049function setPositiveNumber( elem, value, subtract ) {
8050 var matches = rnumsplit.exec( value );
8051 return matches ?
8052 // Guard against undefined "subtract", e.g., when used as in cssHooks
8053 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
8054 value;
8055}
8056
8057function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
8058 var i = extra === ( isBorderBox ? "border" : "content" ) ?
8059 // If we already have the right measurement, avoid augmentation
8060 4 :
8061 // Otherwise initialize for horizontal or vertical properties
8062 name === "width" ? 1 : 0,
8063
8064 val = 0;
8065
8066 for ( ; i < 4; i += 2 ) {
8067 // both box models exclude margin, so add it if we want it
8068 if ( extra === "margin" ) {
8069 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
8070 }
8071
8072 if ( isBorderBox ) {
8073 // border-box includes padding, so remove it if we want content
8074 if ( extra === "content" ) {
8075 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
8076 }
8077
8078 // at this point, extra isn't border nor margin, so remove border
8079 if ( extra !== "margin" ) {
8080 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
8081 }
8082 } else {
8083 // at this point, extra isn't content, so add padding
8084 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
8085
8086 // at this point, extra isn't content nor padding, so add border
8087 if ( extra !== "padding" ) {
8088 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
8089 }
8090 }
8091 }
8092
8093 return val;
8094}
8095
8096function getWidthOrHeight( elem, name, extra ) {
8097
8098 // Start with offset property, which is equivalent to the border-box value
8099 var valueIsBorderBox = true,
8100 val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
8101 styles = getStyles( elem ),
8102 isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
8103
8104 // some non-html elements return undefined for offsetWidth, so check for null/undefined
8105 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
8106 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
8107 if ( val <= 0 || val == null ) {
8108 // Fall back to computed then uncomputed css if necessary
8109 val = curCSS( elem, name, styles );
8110 if ( val < 0 || val == null ) {
8111 val = elem.style[ name ];
8112 }
8113
8114 // Computed unit is not pixels. Stop here and return.
8115 if ( rnumnonpx.test(val) ) {
8116 return val;
8117 }
8118
8119 // we need the check for style in case a browser which returns unreliable values
8120 // for getComputedStyle silently falls back to the reliable elem.style
8121 valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
8122
8123 // Normalize "", auto, and prepare for extra
8124 val = parseFloat( val ) || 0;
8125 }
8126
8127 // use the active box-sizing model to add/subtract irrelevant styles
8128 return ( val +
8129 augmentWidthOrHeight(
8130 elem,
8131 name,
8132 extra || ( isBorderBox ? "border" : "content" ),
8133 valueIsBorderBox,
8134 styles
8135 )
8136 ) + "px";
8137}
8138
8139// Try to determine the default display value of an element
8140function css_defaultDisplay( nodeName ) {
8141 var doc = document,
8142 display = elemdisplay[ nodeName ];
8143
8144 if ( !display ) {
8145 display = actualDisplay( nodeName, doc );
8146
8147 // If the simple way fails, read from inside an iframe
8148 if ( display === "none" || !display ) {
8149 // Use the already-created iframe if possible
8150 iframe = ( iframe ||
8151 jQuery("<iframe frameborder='0' width='0' height='0'/>")
8152 .css( "cssText", "display:block !important" )
8153 ).appendTo( doc.documentElement );
8154
8155 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
8156 doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
8157 doc.write("<!doctype html><html><body>");
8158 doc.close();
8159
8160 display = actualDisplay( nodeName, doc );
8161 iframe.detach();
8162 }
8163
8164 // Store the correct default display
8165 elemdisplay[ nodeName ] = display;
8166 }
8167
8168 return display;
8169}
8170
8171// Called ONLY from within css_defaultDisplay
8172function actualDisplay( name, doc ) {
8173 var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
8174 display = jQuery.css( elem[0], "display" );
8175 elem.remove();
8176 return display;
8177}
8178
8179jQuery.each([ "height", "width" ], function( i, name ) {
8180 jQuery.cssHooks[ name ] = {
8181 get: function( elem, computed, extra ) {
8182 if ( computed ) {
8183 // certain elements can have dimension info if we invisibly show them
8184 // however, it must have a current display style that would benefit from this
8185 return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
8186 jQuery.swap( elem, cssShow, function() {
8187 return getWidthOrHeight( elem, name, extra );
8188 }) :
8189 getWidthOrHeight( elem, name, extra );
8190 }
8191 },
8192
8193 set: function( elem, value, extra ) {
8194 var styles = extra && getStyles( elem );
8195 return setPositiveNumber( elem, value, extra ?
8196 augmentWidthOrHeight(
8197 elem,
8198 name,
8199 extra,
8200 jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
8201 styles
8202 ) : 0
8203 );
8204 }
8205 };
8206});
8207
8208if ( !jQuery.support.opacity ) {
8209 jQuery.cssHooks.opacity = {
8210 get: function( elem, computed ) {
8211 // IE uses filters for opacity
8212 return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
8213 ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
8214 computed ? "1" : "";
8215 },
8216
8217 set: function( elem, value ) {
8218 var style = elem.style,
8219 currentStyle = elem.currentStyle,
8220 opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
8221 filter = currentStyle && currentStyle.filter || style.filter || "";
8222
8223 // IE has trouble with opacity if it does not have layout
8224 // Force it by setting the zoom level
8225 style.zoom = 1;
8226
8227 // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
8228 // if value === "", then remove inline opacity #12685
8229 if ( ( value >= 1 || value === "" ) &&
8230 jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
8231 style.removeAttribute ) {
8232
8233 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
8234 // if "filter:" is present at all, clearType is disabled, we want to avoid this
8235 // style.removeAttribute is IE Only, but so apparently is this code path...
8236 style.removeAttribute( "filter" );
8237
8238 // if there is no filter style applied in a css rule or unset inline opacity, we are done
8239 if ( value === "" || currentStyle && !currentStyle.filter ) {
8240 return;
8241 }
8242 }
8243
8244 // otherwise, set new filter values
8245 style.filter = ralpha.test( filter ) ?
8246 filter.replace( ralpha, opacity ) :
8247 filter + " " + opacity;
8248 }
8249 };
8250}
8251
8252// These hooks cannot be added until DOM ready because the support test
8253// for it is not run until after DOM ready
8254jQuery(function() {
8255 if ( !jQuery.support.reliableMarginRight ) {
8256 jQuery.cssHooks.marginRight = {
8257 get: function( elem, computed ) {
8258 if ( computed ) {
8259 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
8260 // Work around by temporarily setting element display to inline-block
8261 return jQuery.swap( elem, { "display": "inline-block" },
8262 curCSS, [ elem, "marginRight" ] );
8263 }
8264 }
8265 };
8266 }
8267
8268 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
8269 // getComputedStyle returns percent when specified for top/left/bottom/right
8270 // rather than make the css module depend on the offset module, we just check for it here
8271 if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
8272 jQuery.each( [ "top", "left" ], function( i, prop ) {
8273 jQuery.cssHooks[ prop ] = {
8274 get: function( elem, computed ) {
8275 if ( computed ) {
8276 computed = curCSS( elem, prop );
8277 // if curCSS returns percentage, fallback to offset
8278 return rnumnonpx.test( computed ) ?
8279 jQuery( elem ).position()[ prop ] + "px" :
8280 computed;
8281 }
8282 }
8283 };
8284 });
8285 }
8286
8287});
8288
8289if ( jQuery.expr && jQuery.expr.filters ) {
8290 jQuery.expr.filters.hidden = function( elem ) {
8291 // Support: Opera <= 12.12
8292 // Opera reports offsetWidths and offsetHeights less than zero on some elements
8293 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
8294 (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
8295 };
8296
8297 jQuery.expr.filters.visible = function( elem ) {
8298 return !jQuery.expr.filters.hidden( elem );
8299 };
8300}
8301
8302// These hooks are used by animate to expand properties
8303jQuery.each({
8304 margin: "",
8305 padding: "",
8306 border: "Width"
8307}, function( prefix, suffix ) {
8308 jQuery.cssHooks[ prefix + suffix ] = {
8309 expand: function( value ) {
8310 var i = 0,
8311 expanded = {},
8312
8313 // assumes a single number if not a string
8314 parts = typeof value === "string" ? value.split(" ") : [ value ];
8315
8316 for ( ; i < 4; i++ ) {
8317 expanded[ prefix + cssExpand[ i ] + suffix ] =
8318 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
8319 }
8320
8321 return expanded;
8322 }
8323 };
8324
8325 if ( !rmargin.test( prefix ) ) {
8326 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
8327 }
8328});
8329var r20 = /%20/g,
8330 rbracket = /\[\]$/,
8331 rCRLF = /\r?\n/g,
8332 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
8333 rsubmittable = /^(?:input|select|textarea|keygen)/i;
8334
8335jQuery.fn.extend({
8336 serialize: function() {
8337 return jQuery.param( this.serializeArray() );
8338 },
8339 serializeArray: function() {
8340 return this.map(function(){
8341 // Can add propHook for "elements" to filter or add form elements
8342 var elements = jQuery.prop( this, "elements" );
8343 return elements ? jQuery.makeArray( elements ) : this;
8344 })
8345 .filter(function(){
8346 var type = this.type;
8347 // Use .is(":disabled") so that fieldset[disabled] works
8348 return this.name && !jQuery( this ).is( ":disabled" ) &&
8349 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
8350 ( this.checked || !manipulation_rcheckableType.test( type ) );
8351 })
8352 .map(function( i, elem ){
8353 var val = jQuery( this ).val();
8354
8355 return val == null ?
8356 null :
8357 jQuery.isArray( val ) ?
8358 jQuery.map( val, function( val ){
8359 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8360 }) :
8361 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8362 }).get();
8363 }
8364});
8365
8366//Serialize an array of form elements or a set of
8367//key/values into a query string
8368jQuery.param = function( a, traditional ) {
8369 var prefix,
8370 s = [],
8371 add = function( key, value ) {
8372 // If value is a function, invoke it and return its value
8373 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
8374 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
8375 };
8376
8377 // Set traditional to true for jQuery <= 1.3.2 behavior.
8378 if ( traditional === undefined ) {
8379 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
8380 }
8381
8382 // If an array was passed in, assume that it is an array of form elements.
8383 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
8384 // Serialize the form elements
8385 jQuery.each( a, function() {
8386 add( this.name, this.value );
8387 });
8388
8389 } else {
8390 // If traditional, encode the "old" way (the way 1.3.2 or older
8391 // did it), otherwise encode params recursively.
8392 for ( prefix in a ) {
8393 buildParams( prefix, a[ prefix ], traditional, add );
8394 }
8395 }
8396
8397 // Return the resulting serialization
8398 return s.join( "&" ).replace( r20, "+" );
8399};
8400
8401function buildParams( prefix, obj, traditional, add ) {
8402 var name;
8403
8404 if ( jQuery.isArray( obj ) ) {
8405 // Serialize array item.
8406 jQuery.each( obj, function( i, v ) {
8407 if ( traditional || rbracket.test( prefix ) ) {
8408 // Treat each array item as a scalar.
8409 add( prefix, v );
8410
8411 } else {
8412 // Item is non-scalar (array or object), encode its numeric index.
8413 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
8414 }
8415 });
8416
8417 } else if ( !traditional && jQuery.type( obj ) === "object" ) {
8418 // Serialize object item.
8419 for ( name in obj ) {
8420 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
8421 }
8422
8423 } else {
8424 // Serialize scalar item.
8425 add( prefix, obj );
8426 }
8427}
8428jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
8429 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
8430 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
8431
8432 // Handle event binding
8433 jQuery.fn[ name ] = function( data, fn ) {
8434 return arguments.length > 0 ?
8435 this.on( name, null, data, fn ) :
8436 this.trigger( name );
8437 };
8438});
8439
8440jQuery.fn.extend({
8441 hover: function( fnOver, fnOut ) {
8442 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
8443 },
8444
8445 bind: function( types, data, fn ) {
8446 return this.on( types, null, data, fn );
8447 },
8448 unbind: function( types, fn ) {
8449 return this.off( types, null, fn );
8450 },
8451
8452 delegate: function( selector, types, data, fn ) {
8453 return this.on( types, selector, data, fn );
8454 },
8455 undelegate: function( selector, types, fn ) {
8456 // ( namespace ) or ( selector, types [, fn] )
8457 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
8458 }
8459});
8460var
8461 // Document location
8462 ajaxLocParts,
8463 ajaxLocation,
8464 ajax_nonce = jQuery.now(),
8465
8466 ajax_rquery = /\?/,
8467 rhash = /#.*$/,
8468 rts = /([?&])_=[^&]*/,
8469 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
8470 // #7653, #8125, #8152: local protocol detection
8471 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8472 rnoContent = /^(?:GET|HEAD)$/,
8473 rprotocol = /^\/\//,
8474 rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
8475
8476 // Keep a copy of the old load method
8477 _load = jQuery.fn.load,
8478
8479 /* Prefilters
8480 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
8481 * 2) These are called:
8482 * - BEFORE asking for a transport
8483 * - AFTER param serialization (s.data is a string if s.processData is true)
8484 * 3) key is the dataType
8485 * 4) the catchall symbol "*" can be used
8486 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
8487 */
8488 prefilters = {},
8489
8490 /* Transports bindings
8491 * 1) key is the dataType
8492 * 2) the catchall symbol "*" can be used
8493 * 3) selection will start with transport dataType and THEN go to "*" if needed
8494 */
8495 transports = {},
8496
8497 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
8498 allTypes = "*/".concat("*");
8499
8500// #8138, IE may throw an exception when accessing
8501// a field from window.location if document.domain has been set
8502try {
8503 ajaxLocation = location.href;
8504} catch( e ) {
8505 // Use the href attribute of an A element
8506 // since IE will modify it given document.location
8507 ajaxLocation = document.createElement( "a" );
8508 ajaxLocation.href = "";
8509 ajaxLocation = ajaxLocation.href;
8510}
8511
8512// Segment location into parts
8513ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
8514
8515// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
8516function addToPrefiltersOrTransports( structure ) {
8517
8518 // dataTypeExpression is optional and defaults to "*"
8519 return function( dataTypeExpression, func ) {
8520
8521 if ( typeof dataTypeExpression !== "string" ) {
8522 func = dataTypeExpression;
8523 dataTypeExpression = "*";
8524 }
8525
8526 var dataType,
8527 i = 0,
8528 dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
8529
8530 if ( jQuery.isFunction( func ) ) {
8531 // For each dataType in the dataTypeExpression
8532 while ( (dataType = dataTypes[i++]) ) {
8533 // Prepend if requested
8534 if ( dataType[0] === "+" ) {
8535 dataType = dataType.slice( 1 ) || "*";
8536 (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
8537
8538 // Otherwise append
8539 } else {
8540 (structure[ dataType ] = structure[ dataType ] || []).push( func );
8541 }
8542 }
8543 }
8544 };
8545}
8546
8547// Base inspection function for prefilters and transports
8548function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
8549
8550 var inspected = {},
8551 seekingTransport = ( structure === transports );
8552
8553 function inspect( dataType ) {
8554 var selected;
8555 inspected[ dataType ] = true;
8556 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
8557 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
8558 if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
8559 options.dataTypes.unshift( dataTypeOrTransport );
8560 inspect( dataTypeOrTransport );
8561 return false;
8562 } else if ( seekingTransport ) {
8563 return !( selected = dataTypeOrTransport );
8564 }
8565 });
8566 return selected;
8567 }
8568
8569 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
8570}
8571
8572// A special extend for ajax options
8573// that takes "flat" options (not to be deep extended)
8574// Fixes #9887
8575function ajaxExtend( target, src ) {
8576 var deep, key,
8577 flatOptions = jQuery.ajaxSettings.flatOptions || {};
8578
8579 for ( key in src ) {
8580 if ( src[ key ] !== undefined ) {
8581 ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
8582 }
8583 }
8584 if ( deep ) {
8585 jQuery.extend( true, target, deep );
8586 }
8587
8588 return target;
8589}
8590
8591jQuery.fn.load = function( url, params, callback ) {
8592 if ( typeof url !== "string" && _load ) {
8593 return _load.apply( this, arguments );
8594 }
8595
8596 var selector, response, type,
8597 self = this,
8598 off = url.indexOf(" ");
8599
8600 if ( off >= 0 ) {
8601 selector = url.slice( off, url.length );
8602 url = url.slice( 0, off );
8603 }
8604
8605 // If it's a function
8606 if ( jQuery.isFunction( params ) ) {
8607
8608 // We assume that it's the callback
8609 callback = params;
8610 params = undefined;
8611
8612 // Otherwise, build a param string
8613 } else if ( params && typeof params === "object" ) {
8614 type = "POST";
8615 }
8616
8617 // If we have elements to modify, make the request
8618 if ( self.length > 0 ) {
8619 jQuery.ajax({
8620 url: url,
8621
8622 // if "type" variable is undefined, then "GET" method will be used
8623 type: type,
8624 dataType: "html",
8625 data: params
8626 }).done(function( responseText ) {
8627
8628 // Save response for use in complete callback
8629 response = arguments;
8630
8631 self.html( selector ?
8632
8633 // If a selector was specified, locate the right elements in a dummy div
8634 // Exclude scripts to avoid IE 'Permission Denied' errors
8635 jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
8636
8637 // Otherwise use the full result
8638 responseText );
8639
8640 }).complete( callback && function( jqXHR, status ) {
8641 self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
8642 });
8643 }
8644
8645 return this;
8646};
8647
8648// Attach a bunch of functions for handling common AJAX events
8649jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
8650 jQuery.fn[ type ] = function( fn ){
8651 return this.on( type, fn );
8652 };
8653});
8654
8655jQuery.extend({
8656
8657 // Counter for holding the number of active queries
8658 active: 0,
8659
8660 // Last-Modified header cache for next request
8661 lastModified: {},
8662 etag: {},
8663
8664 ajaxSettings: {
8665 url: ajaxLocation,
8666 type: "GET",
8667 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
8668 global: true,
8669 processData: true,
8670 async: true,
8671 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
8672 /*
8673 timeout: 0,
8674 data: null,
8675 dataType: null,
8676 username: null,
8677 password: null,
8678 cache: null,
8679 throws: false,
8680 traditional: false,
8681 headers: {},
8682 */
8683
8684 accepts: {
8685 "*": allTypes,
8686 text: "text/plain",
8687 html: "text/html",
8688 xml: "application/xml, text/xml",
8689 json: "application/json, text/javascript"
8690 },
8691
8692 contents: {
8693 xml: /xml/,
8694 html: /html/,
8695 json: /json/
8696 },
8697
8698 responseFields: {
8699 xml: "responseXML",
8700 text: "responseText",
8701 json: "responseJSON"
8702 },
8703
8704 // Data converters
8705 // Keys separate source (or catchall "*") and destination types with a single space
8706 converters: {
8707
8708 // Convert anything to text
8709 "* text": String,
8710
8711 // Text to html (true = no transformation)
8712 "text html": true,
8713
8714 // Evaluate text as a json expression
8715 "text json": jQuery.parseJSON,
8716
8717 // Parse text as xml
8718 "text xml": jQuery.parseXML
8719 },
8720
8721 // For options that shouldn't be deep extended:
8722 // you can add your own custom options here if
8723 // and when you create one that shouldn't be
8724 // deep extended (see ajaxExtend)
8725 flatOptions: {
8726 url: true,
8727 context: true
8728 }
8729 },
8730
8731 // Creates a full fledged settings object into target
8732 // with both ajaxSettings and settings fields.
8733 // If target is omitted, writes into ajaxSettings.
8734 ajaxSetup: function( target, settings ) {
8735 return settings ?
8736
8737 // Building a settings object
8738 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
8739
8740 // Extending ajaxSettings
8741 ajaxExtend( jQuery.ajaxSettings, target );
8742 },
8743
8744 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
8745 ajaxTransport: addToPrefiltersOrTransports( transports ),
8746
8747 // Main method
8748 ajax: function( url, options ) {
8749
8750 // If url is an object, simulate pre-1.5 signature
8751 if ( typeof url === "object" ) {
8752 options = url;
8753 url = undefined;
8754 }
8755
8756 // Force options to be an object
8757 options = options || {};
8758
8759 var // Cross-domain detection vars
8760 parts,
8761 // Loop variable
8762 i,
8763 // URL without anti-cache param
8764 cacheURL,
8765 // Response headers as string
8766 responseHeadersString,
8767 // timeout handle
8768 timeoutTimer,
8769
8770 // To know if global events are to be dispatched
8771 fireGlobals,
8772
8773 transport,
8774 // Response headers
8775 responseHeaders,
8776 // Create the final options object
8777 s = jQuery.ajaxSetup( {}, options ),
8778 // Callbacks context
8779 callbackContext = s.context || s,
8780 // Context for global events is callbackContext if it is a DOM node or jQuery collection
8781 globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
8782 jQuery( callbackContext ) :
8783 jQuery.event,
8784 // Deferreds
8785 deferred = jQuery.Deferred(),
8786 completeDeferred = jQuery.Callbacks("once memory"),
8787 // Status-dependent callbacks
8788 statusCode = s.statusCode || {},
8789 // Headers (they are sent all at once)
8790 requestHeaders = {},
8791 requestHeadersNames = {},
8792 // The jqXHR state
8793 state = 0,
8794 // Default abort message
8795 strAbort = "canceled",
8796 // Fake xhr
8797 jqXHR = {
8798 readyState: 0,
8799
8800 // Builds headers hashtable if needed
8801 getResponseHeader: function( key ) {
8802 var match;
8803 if ( state === 2 ) {
8804 if ( !responseHeaders ) {
8805 responseHeaders = {};
8806 while ( (match = rheaders.exec( responseHeadersString )) ) {
8807 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
8808 }
8809 }
8810 match = responseHeaders[ key.toLowerCase() ];
8811 }
8812 return match == null ? null : match;
8813 },
8814
8815 // Raw string
8816 getAllResponseHeaders: function() {
8817 return state === 2 ? responseHeadersString : null;
8818 },
8819
8820 // Caches the header
8821 setRequestHeader: function( name, value ) {
8822 var lname = name.toLowerCase();
8823 if ( !state ) {
8824 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
8825 requestHeaders[ name ] = value;
8826 }
8827 return this;
8828 },
8829
8830 // Overrides response content-type header
8831 overrideMimeType: function( type ) {
8832 if ( !state ) {
8833 s.mimeType = type;
8834 }
8835 return this;
8836 },
8837
8838 // Status-dependent callbacks
8839 statusCode: function( map ) {
8840 var code;
8841 if ( map ) {
8842 if ( state < 2 ) {
8843 for ( code in map ) {
8844 // Lazy-add the new callback in a way that preserves old ones
8845 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
8846 }
8847 } else {
8848 // Execute the appropriate callbacks
8849 jqXHR.always( map[ jqXHR.status ] );
8850 }
8851 }
8852 return this;
8853 },
8854
8855 // Cancel the request
8856 abort: function( statusText ) {
8857 var finalText = statusText || strAbort;
8858 if ( transport ) {
8859 transport.abort( finalText );
8860 }
8861 done( 0, finalText );
8862 return this;
8863 }
8864 };
8865
8866 // Attach deferreds
8867 deferred.promise( jqXHR ).complete = completeDeferred.add;
8868 jqXHR.success = jqXHR.done;
8869 jqXHR.error = jqXHR.fail;
8870
8871 // Remove hash character (#7531: and string promotion)
8872 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
8873 // Handle falsy url in the settings object (#10093: consistency with old signature)
8874 // We also use the url parameter if available
8875 s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
8876
8877 // Alias method option to type as per ticket #12004
8878 s.type = options.method || options.type || s.method || s.type;
8879
8880 // Extract dataTypes list
8881 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
8882
8883 // A cross-domain request is in order when we have a protocol:host:port mismatch
8884 if ( s.crossDomain == null ) {
8885 parts = rurl.exec( s.url.toLowerCase() );
8886 s.crossDomain = !!( parts &&
8887 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
8888 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
8889 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
8890 );
8891 }
8892
8893 // Convert data if not already a string
8894 if ( s.data && s.processData && typeof s.data !== "string" ) {
8895 s.data = jQuery.param( s.data, s.traditional );
8896 }
8897
8898 // Apply prefilters
8899 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
8900
8901 // If request was aborted inside a prefilter, stop there
8902 if ( state === 2 ) {
8903 return jqXHR;
8904 }
8905
8906 // We can fire global events as of now if asked to
8907 fireGlobals = s.global;
8908
8909 // Watch for a new set of requests
8910 if ( fireGlobals && jQuery.active++ === 0 ) {
8911 jQuery.event.trigger("ajaxStart");
8912 }
8913
8914 // Uppercase the type
8915 s.type = s.type.toUpperCase();
8916
8917 // Determine if request has content
8918 s.hasContent = !rnoContent.test( s.type );
8919
8920 // Save the URL in case we're toying with the If-Modified-Since
8921 // and/or If-None-Match header later on
8922 cacheURL = s.url;
8923
8924 // More options handling for requests with no content
8925 if ( !s.hasContent ) {
8926
8927 // If data is available, append data to url
8928 if ( s.data ) {
8929 cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
8930 // #9682: remove data so that it's not used in an eventual retry
8931 delete s.data;
8932 }
8933
8934 // Add anti-cache in url if needed
8935 if ( s.cache === false ) {
8936 s.url = rts.test( cacheURL ) ?
8937
8938 // If there is already a '_' parameter, set its value
8939 cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
8940
8941 // Otherwise add one to the end
8942 cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
8943 }
8944 }
8945
8946 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
8947 if ( s.ifModified ) {
8948 if ( jQuery.lastModified[ cacheURL ] ) {
8949 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
8950 }
8951 if ( jQuery.etag[ cacheURL ] ) {
8952 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
8953 }
8954 }
8955
8956 // Set the correct header, if data is being sent
8957 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
8958 jqXHR.setRequestHeader( "Content-Type", s.contentType );
8959 }
8960
8961 // Set the Accepts header for the server, depending on the dataType
8962 jqXHR.setRequestHeader(
8963 "Accept",
8964 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
8965 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
8966 s.accepts[ "*" ]
8967 );
8968
8969 // Check for headers option
8970 for ( i in s.headers ) {
8971 jqXHR.setRequestHeader( i, s.headers[ i ] );
8972 }
8973
8974 // Allow custom headers/mimetypes and early abort
8975 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
8976 // Abort if not done already and return
8977 return jqXHR.abort();
8978 }
8979
8980 // aborting is no longer a cancellation
8981 strAbort = "abort";
8982
8983 // Install callbacks on deferreds
8984 for ( i in { success: 1, error: 1, complete: 1 } ) {
8985 jqXHR[ i ]( s[ i ] );
8986 }
8987
8988 // Get transport
8989 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
8990
8991 // If no transport, we auto-abort
8992 if ( !transport ) {
8993 done( -1, "No Transport" );
8994 } else {
8995 jqXHR.readyState = 1;
8996
8997 // Send global event
8998 if ( fireGlobals ) {
8999 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
9000 }
9001 // Timeout
9002 if ( s.async && s.timeout > 0 ) {
9003 timeoutTimer = setTimeout(function() {
9004 jqXHR.abort("timeout");
9005 }, s.timeout );
9006 }
9007
9008 try {
9009 state = 1;
9010 transport.send( requestHeaders, done );
9011 } catch ( e ) {
9012 // Propagate exception as error if not done
9013 if ( state < 2 ) {
9014 done( -1, e );
9015 // Simply rethrow otherwise
9016 } else {
9017 throw e;
9018 }
9019 }
9020 }
9021
9022 // Callback for when everything is done
9023 function done( status, nativeStatusText, responses, headers ) {
9024 var isSuccess, success, error, response, modified,
9025 statusText = nativeStatusText;
9026
9027 // Called once
9028 if ( state === 2 ) {
9029 return;
9030 }
9031
9032 // State is "done" now
9033 state = 2;
9034
9035 // Clear timeout if it exists
9036 if ( timeoutTimer ) {
9037 clearTimeout( timeoutTimer );
9038 }
9039
9040 // Dereference transport for early garbage collection
9041 // (no matter how long the jqXHR object will be used)
9042 transport = undefined;
9043
9044 // Cache response headers
9045 responseHeadersString = headers || "";
9046
9047 // Set readyState
9048 jqXHR.readyState = status > 0 ? 4 : 0;
9049
9050 // Determine if successful
9051 isSuccess = status >= 200 && status < 300 || status === 304;
9052
9053 // Get response data
9054 if ( responses ) {
9055 response = ajaxHandleResponses( s, jqXHR, responses );
9056 }
9057
9058 // Convert no matter what (that way responseXXX fields are always set)
9059 response = ajaxConvert( s, response, jqXHR, isSuccess );
9060
9061 // If successful, handle type chaining
9062 if ( isSuccess ) {
9063
9064 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9065 if ( s.ifModified ) {
9066 modified = jqXHR.getResponseHeader("Last-Modified");
9067 if ( modified ) {
9068 jQuery.lastModified[ cacheURL ] = modified;
9069 }
9070 modified = jqXHR.getResponseHeader("etag");
9071 if ( modified ) {
9072 jQuery.etag[ cacheURL ] = modified;
9073 }
9074 }
9075
9076 // if no content
9077 if ( status === 204 || s.type === "HEAD" ) {
9078 statusText = "nocontent";
9079
9080 // if not modified
9081 } else if ( status === 304 ) {
9082 statusText = "notmodified";
9083
9084 // If we have data, let's convert it
9085 } else {
9086 statusText = response.state;
9087 success = response.data;
9088 error = response.error;
9089 isSuccess = !error;
9090 }
9091 } else {
9092 // We extract error from statusText
9093 // then normalize statusText and status for non-aborts
9094 error = statusText;
9095 if ( status || !statusText ) {
9096 statusText = "error";
9097 if ( status < 0 ) {
9098 status = 0;
9099 }
9100 }
9101 }
9102
9103 // Set data for the fake xhr object
9104 jqXHR.status = status;
9105 jqXHR.statusText = ( nativeStatusText || statusText ) + "";
9106
9107 // Success/Error
9108 if ( isSuccess ) {
9109 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
9110 } else {
9111 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
9112 }
9113
9114 // Status-dependent callbacks
9115 jqXHR.statusCode( statusCode );
9116 statusCode = undefined;
9117
9118 if ( fireGlobals ) {
9119 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
9120 [ jqXHR, s, isSuccess ? success : error ] );
9121 }
9122
9123 // Complete
9124 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
9125
9126 if ( fireGlobals ) {
9127 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
9128 // Handle the global AJAX counter
9129 if ( !( --jQuery.active ) ) {
9130 jQuery.event.trigger("ajaxStop");
9131 }
9132 }
9133 }
9134
9135 return jqXHR;
9136 },
9137
9138 getJSON: function( url, data, callback ) {
9139 return jQuery.get( url, data, callback, "json" );
9140 },
9141
9142 getScript: function( url, callback ) {
9143 return jQuery.get( url, undefined, callback, "script" );
9144 }
9145});
9146
9147jQuery.each( [ "get", "post" ], function( i, method ) {
9148 jQuery[ method ] = function( url, data, callback, type ) {
9149 // shift arguments if data argument was omitted
9150 if ( jQuery.isFunction( data ) ) {
9151 type = type || callback;
9152 callback = data;
9153 data = undefined;
9154 }
9155
9156 return jQuery.ajax({
9157 url: url,
9158 type: method,
9159 dataType: type,
9160 data: data,
9161 success: callback
9162 });
9163 };
9164});
9165
9166/* Handles responses to an ajax request:
9167 * - finds the right dataType (mediates between content-type and expected dataType)
9168 * - returns the corresponding response
9169 */
9170function ajaxHandleResponses( s, jqXHR, responses ) {
9171 var firstDataType, ct, finalDataType, type,
9172 contents = s.contents,
9173 dataTypes = s.dataTypes;
9174
9175 // Remove auto dataType and get content-type in the process
9176 while( dataTypes[ 0 ] === "*" ) {
9177 dataTypes.shift();
9178 if ( ct === undefined ) {
9179 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
9180 }
9181 }
9182
9183 // Check if we're dealing with a known content-type
9184 if ( ct ) {
9185 for ( type in contents ) {
9186 if ( contents[ type ] && contents[ type ].test( ct ) ) {
9187 dataTypes.unshift( type );
9188 break;
9189 }
9190 }
9191 }
9192
9193 // Check to see if we have a response for the expected dataType
9194 if ( dataTypes[ 0 ] in responses ) {
9195 finalDataType = dataTypes[ 0 ];
9196 } else {
9197 // Try convertible dataTypes
9198 for ( type in responses ) {
9199 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
9200 finalDataType = type;
9201 break;
9202 }
9203 if ( !firstDataType ) {
9204 firstDataType = type;
9205 }
9206 }
9207 // Or just use first one
9208 finalDataType = finalDataType || firstDataType;
9209 }
9210
9211 // If we found a dataType
9212 // We add the dataType to the list if needed
9213 // and return the corresponding response
9214 if ( finalDataType ) {
9215 if ( finalDataType !== dataTypes[ 0 ] ) {
9216 dataTypes.unshift( finalDataType );
9217 }
9218 return responses[ finalDataType ];
9219 }
9220}
9221
9222/* Chain conversions given the request and the original response
9223 * Also sets the responseXXX fields on the jqXHR instance
9224 */
9225function ajaxConvert( s, response, jqXHR, isSuccess ) {
9226 var conv2, current, conv, tmp, prev,
9227 converters = {},
9228 // Work with a copy of dataTypes in case we need to modify it for conversion
9229 dataTypes = s.dataTypes.slice();
9230
9231 // Create converters map with lowercased keys
9232 if ( dataTypes[ 1 ] ) {
9233 for ( conv in s.converters ) {
9234 converters[ conv.toLowerCase() ] = s.converters[ conv ];
9235 }
9236 }
9237
9238 current = dataTypes.shift();
9239
9240 // Convert to each sequential dataType
9241 while ( current ) {
9242
9243 if ( s.responseFields[ current ] ) {
9244 jqXHR[ s.responseFields[ current ] ] = response;
9245 }
9246
9247 // Apply the dataFilter if provided
9248 if ( !prev && isSuccess && s.dataFilter ) {
9249 response = s.dataFilter( response, s.dataType );
9250 }
9251
9252 prev = current;
9253 current = dataTypes.shift();
9254
9255 if ( current ) {
9256
9257 // There's only work to do if current dataType is non-auto
9258 if ( current === "*" ) {
9259
9260 current = prev;
9261
9262 // Convert response if prev dataType is non-auto and differs from current
9263 } else if ( prev !== "*" && prev !== current ) {
9264
9265 // Seek a direct converter
9266 conv = converters[ prev + " " + current ] || converters[ "* " + current ];
9267
9268 // If none found, seek a pair
9269 if ( !conv ) {
9270 for ( conv2 in converters ) {
9271
9272 // If conv2 outputs current
9273 tmp = conv2.split( " " );
9274 if ( tmp[ 1 ] === current ) {
9275
9276 // If prev can be converted to accepted input
9277 conv = converters[ prev + " " + tmp[ 0 ] ] ||
9278 converters[ "* " + tmp[ 0 ] ];
9279 if ( conv ) {
9280 // Condense equivalence converters
9281 if ( conv === true ) {
9282 conv = converters[ conv2 ];
9283
9284 // Otherwise, insert the intermediate dataType
9285 } else if ( converters[ conv2 ] !== true ) {
9286 current = tmp[ 0 ];
9287 dataTypes.unshift( tmp[ 1 ] );
9288 }
9289 break;
9290 }
9291 }
9292 }
9293 }
9294
9295 // Apply converter (if not an equivalence)
9296 if ( conv !== true ) {
9297
9298 // Unless errors are allowed to bubble, catch and return them
9299 if ( conv && s[ "throws" ] ) {
9300 response = conv( response );
9301 } else {
9302 try {
9303 response = conv( response );
9304 } catch ( e ) {
9305 return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
9306 }
9307 }
9308 }
9309 }
9310 }
9311 }
9312
9313 return { state: "success", data: response };
9314}
9315// Install script dataType
9316jQuery.ajaxSetup({
9317 accepts: {
9318 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
9319 },
9320 contents: {
9321 script: /(?:java|ecma)script/
9322 },
9323 converters: {
9324 "text script": function( text ) {
9325 jQuery.globalEval( text );
9326 return text;
9327 }
9328 }
9329});
9330
9331// Handle cache's special case and global
9332jQuery.ajaxPrefilter( "script", function( s ) {
9333 if ( s.cache === undefined ) {
9334 s.cache = false;
9335 }
9336 if ( s.crossDomain ) {
9337 s.type = "GET";
9338 s.global = false;
9339 }
9340});
9341
9342// Bind script tag hack transport
9343jQuery.ajaxTransport( "script", function(s) {
9344
9345 // This transport only deals with cross domain requests
9346 if ( s.crossDomain ) {
9347
9348 var script,
9349 head = document.head || jQuery("head")[0] || document.documentElement;
9350
9351 return {
9352
9353 send: function( _, callback ) {
9354
9355 script = document.createElement("script");
9356
9357 script.async = true;
9358
9359 if ( s.scriptCharset ) {
9360 script.charset = s.scriptCharset;
9361 }
9362
9363 script.src = s.url;
9364
9365 // Attach handlers for all browsers
9366 script.onload = script.onreadystatechange = function( _, isAbort ) {
9367
9368 if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
9369
9370 // Handle memory leak in IE
9371 script.onload = script.onreadystatechange = null;
9372
9373 // Remove the script
9374 if ( script.parentNode ) {
9375 script.parentNode.removeChild( script );
9376 }
9377
9378 // Dereference the script
9379 script = null;
9380
9381 // Callback if not abort
9382 if ( !isAbort ) {
9383 callback( 200, "success" );
9384 }
9385 }
9386 };
9387
9388 // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
9389 // Use native DOM manipulation to avoid our domManip AJAX trickery
9390 head.insertBefore( script, head.firstChild );
9391 },
9392
9393 abort: function() {
9394 if ( script ) {
9395 script.onload( undefined, true );
9396 }
9397 }
9398 };
9399 }
9400});
9401var oldCallbacks = [],
9402 rjsonp = /(=)\?(?=&|$)|\?\?/;
9403
9404// Default jsonp settings
9405jQuery.ajaxSetup({
9406 jsonp: "callback",
9407 jsonpCallback: function() {
9408 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
9409 this[ callback ] = true;
9410 return callback;
9411 }
9412});
9413
9414// Detect, normalize options and install callbacks for jsonp requests
9415jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
9416
9417 var callbackName, overwritten, responseContainer,
9418 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
9419 "url" :
9420 typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
9421 );
9422
9423 // Handle iff the expected data type is "jsonp" or we have a parameter to set
9424 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
9425
9426 // Get callback name, remembering preexisting value associated with it
9427 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
9428 s.jsonpCallback() :
9429 s.jsonpCallback;
9430
9431 // Insert callback into url or form data
9432 if ( jsonProp ) {
9433 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
9434 } else if ( s.jsonp !== false ) {
9435 s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
9436 }
9437
9438 // Use data converter to retrieve json after script execution
9439 s.converters["script json"] = function() {
9440 if ( !responseContainer ) {
9441 jQuery.error( callbackName + " was not called" );
9442 }
9443 return responseContainer[ 0 ];
9444 };
9445
9446 // force json dataType
9447 s.dataTypes[ 0 ] = "json";
9448
9449 // Install callback
9450 overwritten = window[ callbackName ];
9451 window[ callbackName ] = function() {
9452 responseContainer = arguments;
9453 };
9454
9455 // Clean-up function (fires after converters)
9456 jqXHR.always(function() {
9457 // Restore preexisting value
9458 window[ callbackName ] = overwritten;
9459
9460 // Save back as free
9461 if ( s[ callbackName ] ) {
9462 // make sure that re-using the options doesn't screw things around
9463 s.jsonpCallback = originalSettings.jsonpCallback;
9464
9465 // save the callback name for future use
9466 oldCallbacks.push( callbackName );
9467 }
9468
9469 // Call if it was a function and we have a response
9470 if ( responseContainer && jQuery.isFunction( overwritten ) ) {
9471 overwritten( responseContainer[ 0 ] );
9472 }
9473
9474 responseContainer = overwritten = undefined;
9475 });
9476
9477 // Delegate to script
9478 return "script";
9479 }
9480});
9481var xhrCallbacks, xhrSupported,
9482 xhrId = 0,
9483 // #5280: Internet Explorer will keep connections alive if we don't abort on unload
9484 xhrOnUnloadAbort = window.ActiveXObject && function() {
9485 // Abort all pending requests
9486 var key;
9487 for ( key in xhrCallbacks ) {
9488 xhrCallbacks[ key ]( undefined, true );
9489 }
9490 };
9491
9492// Functions to create xhrs
9493function createStandardXHR() {
9494 try {
9495 return new window.XMLHttpRequest();
9496 } catch( e ) {}
9497}
9498
9499function createActiveXHR() {
9500 try {
9501 return new window.ActiveXObject("Microsoft.XMLHTTP");
9502 } catch( e ) {}
9503}
9504
9505// Create the request object
9506// (This is still attached to ajaxSettings for backward compatibility)
9507jQuery.ajaxSettings.xhr = window.ActiveXObject ?
9508 /* Microsoft failed to properly
9509 * implement the XMLHttpRequest in IE7 (can't request local files),
9510 * so we use the ActiveXObject when it is available
9511 * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
9512 * we need a fallback.
9513 */
9514 function() {
9515 return !this.isLocal && createStandardXHR() || createActiveXHR();
9516 } :
9517 // For all other browsers, use the standard XMLHttpRequest object
9518 createStandardXHR;
9519
9520// Determine support properties
9521xhrSupported = jQuery.ajaxSettings.xhr();
9522jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
9523xhrSupported = jQuery.support.ajax = !!xhrSupported;
9524
9525// Create transport if the browser can provide an xhr
9526if ( xhrSupported ) {
9527
9528 jQuery.ajaxTransport(function( s ) {
9529 // Cross domain only allowed if supported through XMLHttpRequest
9530 if ( !s.crossDomain || jQuery.support.cors ) {
9531
9532 var callback;
9533
9534 return {
9535 send: function( headers, complete ) {
9536
9537 // Get a new xhr
9538 var handle, i,
9539 xhr = s.xhr();
9540
9541 // Open the socket
9542 // Passing null username, generates a login popup on Opera (#2865)
9543 if ( s.username ) {
9544 xhr.open( s.type, s.url, s.async, s.username, s.password );
9545 } else {
9546 xhr.open( s.type, s.url, s.async );
9547 }
9548
9549 // Apply custom fields if provided
9550 if ( s.xhrFields ) {
9551 for ( i in s.xhrFields ) {
9552 xhr[ i ] = s.xhrFields[ i ];
9553 }
9554 }
9555
9556 // Override mime type if needed
9557 if ( s.mimeType && xhr.overrideMimeType ) {
9558 xhr.overrideMimeType( s.mimeType );
9559 }
9560
9561 // X-Requested-With header
9562 // For cross-domain requests, seeing as conditions for a preflight are
9563 // akin to a jigsaw puzzle, we simply never set it to be sure.
9564 // (it can always be set on a per-request basis or even using ajaxSetup)
9565 // For same-domain requests, won't change header if already provided.
9566 if ( !s.crossDomain && !headers["X-Requested-With"] ) {
9567 headers["X-Requested-With"] = "XMLHttpRequest";
9568 }
9569
9570 // Need an extra try/catch for cross domain requests in Firefox 3
9571 try {
9572 for ( i in headers ) {
9573 xhr.setRequestHeader( i, headers[ i ] );
9574 }
9575 } catch( err ) {}
9576
9577 // Do send the request
9578 // This may raise an exception which is actually
9579 // handled in jQuery.ajax (so no try/catch here)
9580 xhr.send( ( s.hasContent && s.data ) || null );
9581
9582 // Listener
9583 callback = function( _, isAbort ) {
9584 var status, responseHeaders, statusText, responses;
9585
9586 // Firefox throws exceptions when accessing properties
9587 // of an xhr when a network error occurred
9588 // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
9589 try {
9590
9591 // Was never called and is aborted or complete
9592 if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
9593
9594 // Only called once
9595 callback = undefined;
9596
9597 // Do not keep as active anymore
9598 if ( handle ) {
9599 xhr.onreadystatechange = jQuery.noop;
9600 if ( xhrOnUnloadAbort ) {
9601 delete xhrCallbacks[ handle ];
9602 }
9603 }
9604
9605 // If it's an abort
9606 if ( isAbort ) {
9607 // Abort it manually if needed
9608 if ( xhr.readyState !== 4 ) {
9609 xhr.abort();
9610 }
9611 } else {
9612 responses = {};
9613 status = xhr.status;
9614 responseHeaders = xhr.getAllResponseHeaders();
9615
9616 // When requesting binary data, IE6-9 will throw an exception
9617 // on any attempt to access responseText (#11426)
9618 if ( typeof xhr.responseText === "string" ) {
9619 responses.text = xhr.responseText;
9620 }
9621
9622 // Firefox throws an exception when accessing
9623 // statusText for faulty cross-domain requests
9624 try {
9625 statusText = xhr.statusText;
9626 } catch( e ) {
9627 // We normalize with Webkit giving an empty statusText
9628 statusText = "";
9629 }
9630
9631 // Filter status for non standard behaviors
9632
9633 // If the request is local and we have data: assume a success
9634 // (success with no data won't get notified, that's the best we
9635 // can do given current implementations)
9636 if ( !status && s.isLocal && !s.crossDomain ) {
9637 status = responses.text ? 200 : 404;
9638 // IE - #1450: sometimes returns 1223 when it should be 204
9639 } else if ( status === 1223 ) {
9640 status = 204;
9641 }
9642 }
9643 }
9644 } catch( firefoxAccessException ) {
9645 if ( !isAbort ) {
9646 complete( -1, firefoxAccessException );
9647 }
9648 }
9649
9650 // Call complete if needed
9651 if ( responses ) {
9652 complete( status, statusText, responses, responseHeaders );
9653 }
9654 };
9655
9656 if ( !s.async ) {
9657 // if we're in sync mode we fire the callback
9658 callback();
9659 } else if ( xhr.readyState === 4 ) {
9660 // (IE6 & IE7) if it's in cache and has been
9661 // retrieved directly we need to fire the callback
9662 setTimeout( callback );
9663 } else {
9664 handle = ++xhrId;
9665 if ( xhrOnUnloadAbort ) {
9666 // Create the active xhrs callbacks list if needed
9667 // and attach the unload handler
9668 if ( !xhrCallbacks ) {
9669 xhrCallbacks = {};
9670 jQuery( window ).unload( xhrOnUnloadAbort );
9671 }
9672 // Add to list of active xhrs callbacks
9673 xhrCallbacks[ handle ] = callback;
9674 }
9675 xhr.onreadystatechange = callback;
9676 }
9677 },
9678
9679 abort: function() {
9680 if ( callback ) {
9681 callback( undefined, true );
9682 }
9683 }
9684 };
9685 }
9686 });
9687}
9688var fxNow, timerId,
9689 rfxtypes = /^(?:toggle|show|hide)$/,
9690 rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
9691 rrun = /queueHooks$/,
9692 animationPrefilters = [ defaultPrefilter ],
9693 tweeners = {
9694 "*": [function( prop, value ) {
9695 var tween = this.createTween( prop, value ),
9696 target = tween.cur(),
9697 parts = rfxnum.exec( value ),
9698 unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
9699
9700 // Starting value computation is required for potential unit mismatches
9701 start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
9702 rfxnum.exec( jQuery.css( tween.elem, prop ) ),
9703 scale = 1,
9704 maxIterations = 20;
9705
9706 if ( start && start[ 3 ] !== unit ) {
9707 // Trust units reported by jQuery.css
9708 unit = unit || start[ 3 ];
9709
9710 // Make sure we update the tween properties later on
9711 parts = parts || [];
9712
9713 // Iteratively approximate from a nonzero starting point
9714 start = +target || 1;
9715
9716 do {
9717 // If previous iteration zeroed out, double until we get *something*
9718 // Use a string for doubling factor so we don't accidentally see scale as unchanged below
9719 scale = scale || ".5";
9720
9721 // Adjust and apply
9722 start = start / scale;
9723 jQuery.style( tween.elem, prop, start + unit );
9724
9725 // Update scale, tolerating zero or NaN from tween.cur()
9726 // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
9727 } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
9728 }
9729
9730 // Update tween properties
9731 if ( parts ) {
9732 start = tween.start = +start || +target || 0;
9733 tween.unit = unit;
9734 // If a +=/-= token was provided, we're doing a relative animation
9735 tween.end = parts[ 1 ] ?
9736 start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
9737 +parts[ 2 ];
9738 }
9739
9740 return tween;
9741 }]
9742 };
9743
9744// Animations created synchronously will run synchronously
9745function createFxNow() {
9746 setTimeout(function() {
9747 fxNow = undefined;
9748 });
9749 return ( fxNow = jQuery.now() );
9750}
9751
9752function createTween( value, prop, animation ) {
9753 var tween,
9754 collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
9755 index = 0,
9756 length = collection.length;
9757 for ( ; index < length; index++ ) {
9758 if ( (tween = collection[ index ].call( animation, prop, value )) ) {
9759
9760 // we're done with this property
9761 return tween;
9762 }
9763 }
9764}
9765
9766function Animation( elem, properties, options ) {
9767 var result,
9768 stopped,
9769 index = 0,
9770 length = animationPrefilters.length,
9771 deferred = jQuery.Deferred().always( function() {
9772 // don't match elem in the :animated selector
9773 delete tick.elem;
9774 }),
9775 tick = function() {
9776 if ( stopped ) {
9777 return false;
9778 }
9779 var currentTime = fxNow || createFxNow(),
9780 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
9781 // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
9782 temp = remaining / animation.duration || 0,
9783 percent = 1 - temp,
9784 index = 0,
9785 length = animation.tweens.length;
9786
9787 for ( ; index < length ; index++ ) {
9788 animation.tweens[ index ].run( percent );
9789 }
9790
9791 deferred.notifyWith( elem, [ animation, percent, remaining ]);
9792
9793 if ( percent < 1 && length ) {
9794 return remaining;
9795 } else {
9796 deferred.resolveWith( elem, [ animation ] );
9797 return false;
9798 }
9799 },
9800 animation = deferred.promise({
9801 elem: elem,
9802 props: jQuery.extend( {}, properties ),
9803 opts: jQuery.extend( true, { specialEasing: {} }, options ),
9804 originalProperties: properties,
9805 originalOptions: options,
9806 startTime: fxNow || createFxNow(),
9807 duration: options.duration,
9808 tweens: [],
9809 createTween: function( prop, end ) {
9810 var tween = jQuery.Tween( elem, animation.opts, prop, end,
9811 animation.opts.specialEasing[ prop ] || animation.opts.easing );
9812 animation.tweens.push( tween );
9813 return tween;
9814 },
9815 stop: function( gotoEnd ) {
9816 var index = 0,
9817 // if we are going to the end, we want to run all the tweens
9818 // otherwise we skip this part
9819 length = gotoEnd ? animation.tweens.length : 0;
9820 if ( stopped ) {
9821 return this;
9822 }
9823 stopped = true;
9824 for ( ; index < length ; index++ ) {
9825 animation.tweens[ index ].run( 1 );
9826 }
9827
9828 // resolve when we played the last frame
9829 // otherwise, reject
9830 if ( gotoEnd ) {
9831 deferred.resolveWith( elem, [ animation, gotoEnd ] );
9832 } else {
9833 deferred.rejectWith( elem, [ animation, gotoEnd ] );
9834 }
9835 return this;
9836 }
9837 }),
9838 props = animation.props;
9839
9840 propFilter( props, animation.opts.specialEasing );
9841
9842 for ( ; index < length ; index++ ) {
9843 result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
9844 if ( result ) {
9845 return result;
9846 }
9847 }
9848
9849 jQuery.map( props, createTween, animation );
9850
9851 if ( jQuery.isFunction( animation.opts.start ) ) {
9852 animation.opts.start.call( elem, animation );
9853 }
9854
9855 jQuery.fx.timer(
9856 jQuery.extend( tick, {
9857 elem: elem,
9858 anim: animation,
9859 queue: animation.opts.queue
9860 })
9861 );
9862
9863 // attach callbacks from options
9864 return animation.progress( animation.opts.progress )
9865 .done( animation.opts.done, animation.opts.complete )
9866 .fail( animation.opts.fail )
9867 .always( animation.opts.always );
9868}
9869
9870function propFilter( props, specialEasing ) {
9871 var index, name, easing, value, hooks;
9872
9873 // camelCase, specialEasing and expand cssHook pass
9874 for ( index in props ) {
9875 name = jQuery.camelCase( index );
9876 easing = specialEasing[ name ];
9877 value = props[ index ];
9878 if ( jQuery.isArray( value ) ) {
9879 easing = value[ 1 ];
9880 value = props[ index ] = value[ 0 ];
9881 }
9882
9883 if ( index !== name ) {
9884 props[ name ] = value;
9885 delete props[ index ];
9886 }
9887
9888 hooks = jQuery.cssHooks[ name ];
9889 if ( hooks && "expand" in hooks ) {
9890 value = hooks.expand( value );
9891 delete props[ name ];
9892
9893 // not quite $.extend, this wont overwrite keys already present.
9894 // also - reusing 'index' from above because we have the correct "name"
9895 for ( index in value ) {
9896 if ( !( index in props ) ) {
9897 props[ index ] = value[ index ];
9898 specialEasing[ index ] = easing;
9899 }
9900 }
9901 } else {
9902 specialEasing[ name ] = easing;
9903 }
9904 }
9905}
9906
9907jQuery.Animation = jQuery.extend( Animation, {
9908
9909 tweener: function( props, callback ) {
9910 if ( jQuery.isFunction( props ) ) {
9911 callback = props;
9912 props = [ "*" ];
9913 } else {
9914 props = props.split(" ");
9915 }
9916
9917 var prop,
9918 index = 0,
9919 length = props.length;
9920
9921 for ( ; index < length ; index++ ) {
9922 prop = props[ index ];
9923 tweeners[ prop ] = tweeners[ prop ] || [];
9924 tweeners[ prop ].unshift( callback );
9925 }
9926 },
9927
9928 prefilter: function( callback, prepend ) {
9929 if ( prepend ) {
9930 animationPrefilters.unshift( callback );
9931 } else {
9932 animationPrefilters.push( callback );
9933 }
9934 }
9935});
9936
9937function defaultPrefilter( elem, props, opts ) {
9938 /* jshint validthis: true */
9939 var prop, value, toggle, tween, hooks, oldfire,
9940 anim = this,
9941 orig = {},
9942 style = elem.style,
9943 hidden = elem.nodeType && isHidden( elem ),
9944 dataShow = jQuery._data( elem, "fxshow" );
9945
9946 // handle queue: false promises
9947 if ( !opts.queue ) {
9948 hooks = jQuery._queueHooks( elem, "fx" );
9949 if ( hooks.unqueued == null ) {
9950 hooks.unqueued = 0;
9951 oldfire = hooks.empty.fire;
9952 hooks.empty.fire = function() {
9953 if ( !hooks.unqueued ) {
9954 oldfire();
9955 }
9956 };
9957 }
9958 hooks.unqueued++;
9959
9960 anim.always(function() {
9961 // doing this makes sure that the complete handler will be called
9962 // before this completes
9963 anim.always(function() {
9964 hooks.unqueued--;
9965 if ( !jQuery.queue( elem, "fx" ).length ) {
9966 hooks.empty.fire();
9967 }
9968 });
9969 });
9970 }
9971
9972 // height/width overflow pass
9973 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
9974 // Make sure that nothing sneaks out
9975 // Record all 3 overflow attributes because IE does not
9976 // change the overflow attribute when overflowX and
9977 // overflowY are set to the same value
9978 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
9979
9980 // Set display property to inline-block for height/width
9981 // animations on inline elements that are having width/height animated
9982 if ( jQuery.css( elem, "display" ) === "inline" &&
9983 jQuery.css( elem, "float" ) === "none" ) {
9984
9985 // inline-level elements accept inline-block;
9986 // block-level elements need to be inline with layout
9987 if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
9988 style.display = "inline-block";
9989
9990 } else {
9991 style.zoom = 1;
9992 }
9993 }
9994 }
9995
9996 if ( opts.overflow ) {
9997 style.overflow = "hidden";
9998 if ( !jQuery.support.shrinkWrapBlocks ) {
9999 anim.always(function() {
10000 style.overflow = opts.overflow[ 0 ];
10001 style.overflowX = opts.overflow[ 1 ];
10002 style.overflowY = opts.overflow[ 2 ];
10003 });
10004 }
10005 }
10006
10007
10008 // show/hide pass
10009 for ( prop in props ) {
10010 value = props[ prop ];
10011 if ( rfxtypes.exec( value ) ) {
10012 delete props[ prop ];
10013 toggle = toggle || value === "toggle";
10014 if ( value === ( hidden ? "hide" : "show" ) ) {
10015 continue;
10016 }
10017 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
10018 }
10019 }
10020
10021 if ( !jQuery.isEmptyObject( orig ) ) {
10022 if ( dataShow ) {
10023 if ( "hidden" in dataShow ) {
10024 hidden = dataShow.hidden;
10025 }
10026 } else {
10027 dataShow = jQuery._data( elem, "fxshow", {} );
10028 }
10029
10030 // store state if its toggle - enables .stop().toggle() to "reverse"
10031 if ( toggle ) {
10032 dataShow.hidden = !hidden;
10033 }
10034 if ( hidden ) {
10035 jQuery( elem ).show();
10036 } else {
10037 anim.done(function() {
10038 jQuery( elem ).hide();
10039 });
10040 }
10041 anim.done(function() {
10042 var prop;
10043 jQuery._removeData( elem, "fxshow" );
10044 for ( prop in orig ) {
10045 jQuery.style( elem, prop, orig[ prop ] );
10046 }
10047 });
10048 for ( prop in orig ) {
10049 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
10050
10051 if ( !( prop in dataShow ) ) {
10052 dataShow[ prop ] = tween.start;
10053 if ( hidden ) {
10054 tween.end = tween.start;
10055 tween.start = prop === "width" || prop === "height" ? 1 : 0;
10056 }
10057 }
10058 }
10059 }
10060}
10061
10062function Tween( elem, options, prop, end, easing ) {
10063 return new Tween.prototype.init( elem, options, prop, end, easing );
10064}
10065jQuery.Tween = Tween;
10066
10067Tween.prototype = {
10068 constructor: Tween,
10069 init: function( elem, options, prop, end, easing, unit ) {
10070 this.elem = elem;
10071 this.prop = prop;
10072 this.easing = easing || "swing";
10073 this.options = options;
10074 this.start = this.now = this.cur();
10075 this.end = end;
10076 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
10077 },
10078 cur: function() {
10079 var hooks = Tween.propHooks[ this.prop ];
10080
10081 return hooks && hooks.get ?
10082 hooks.get( this ) :
10083 Tween.propHooks._default.get( this );
10084 },
10085 run: function( percent ) {
10086 var eased,
10087 hooks = Tween.propHooks[ this.prop ];
10088
10089 if ( this.options.duration ) {
10090 this.pos = eased = jQuery.easing[ this.easing ](
10091 percent, this.options.duration * percent, 0, 1, this.options.duration
10092 );
10093 } else {
10094 this.pos = eased = percent;
10095 }
10096 this.now = ( this.end - this.start ) * eased + this.start;
10097
10098 if ( this.options.step ) {
10099 this.options.step.call( this.elem, this.now, this );
10100 }
10101
10102 if ( hooks && hooks.set ) {
10103 hooks.set( this );
10104 } else {
10105 Tween.propHooks._default.set( this );
10106 }
10107 return this;
10108 }
10109};
10110
10111Tween.prototype.init.prototype = Tween.prototype;
10112
10113Tween.propHooks = {
10114 _default: {
10115 get: function( tween ) {
10116 var result;
10117
10118 if ( tween.elem[ tween.prop ] != null &&
10119 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
10120 return tween.elem[ tween.prop ];
10121 }
10122
10123 // passing an empty string as a 3rd parameter to .css will automatically
10124 // attempt a parseFloat and fallback to a string if the parse fails
10125 // so, simple values such as "10px" are parsed to Float.
10126 // complex values such as "rotate(1rad)" are returned as is.
10127 result = jQuery.css( tween.elem, tween.prop, "" );
10128 // Empty strings, null, undefined and "auto" are converted to 0.
10129 return !result || result === "auto" ? 0 : result;
10130 },
10131 set: function( tween ) {
10132 // use step hook for back compat - use cssHook if its there - use .style if its
10133 // available and use plain properties where available
10134 if ( jQuery.fx.step[ tween.prop ] ) {
10135 jQuery.fx.step[ tween.prop ]( tween );
10136 } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
10137 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
10138 } else {
10139 tween.elem[ tween.prop ] = tween.now;
10140 }
10141 }
10142 }
10143};
10144
10145// Support: IE <=9
10146// Panic based approach to setting things on disconnected nodes
10147
10148Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
10149 set: function( tween ) {
10150 if ( tween.elem.nodeType && tween.elem.parentNode ) {
10151 tween.elem[ tween.prop ] = tween.now;
10152 }
10153 }
10154};
10155
10156jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
10157 var cssFn = jQuery.fn[ name ];
10158 jQuery.fn[ name ] = function( speed, easing, callback ) {
10159 return speed == null || typeof speed === "boolean" ?
10160 cssFn.apply( this, arguments ) :
10161 this.animate( genFx( name, true ), speed, easing, callback );
10162 };
10163});
10164
10165jQuery.fn.extend({
10166 fadeTo: function( speed, to, easing, callback ) {
10167
10168 // show any hidden elements after setting opacity to 0
10169 return this.filter( isHidden ).css( "opacity", 0 ).show()
10170
10171 // animate to the value specified
10172 .end().animate({ opacity: to }, speed, easing, callback );
10173 },
10174 animate: function( prop, speed, easing, callback ) {
10175 var empty = jQuery.isEmptyObject( prop ),
10176 optall = jQuery.speed( speed, easing, callback ),
10177 doAnimation = function() {
10178 // Operate on a copy of prop so per-property easing won't be lost
10179 var anim = Animation( this, jQuery.extend( {}, prop ), optall );
10180
10181 // Empty animations, or finishing resolves immediately
10182 if ( empty || jQuery._data( this, "finish" ) ) {
10183 anim.stop( true );
10184 }
10185 };
10186 doAnimation.finish = doAnimation;
10187
10188 return empty || optall.queue === false ?
10189 this.each( doAnimation ) :
10190 this.queue( optall.queue, doAnimation );
10191 },
10192 stop: function( type, clearQueue, gotoEnd ) {
10193 var stopQueue = function( hooks ) {
10194 var stop = hooks.stop;
10195 delete hooks.stop;
10196 stop( gotoEnd );
10197 };
10198
10199 if ( typeof type !== "string" ) {
10200 gotoEnd = clearQueue;
10201 clearQueue = type;
10202 type = undefined;
10203 }
10204 if ( clearQueue && type !== false ) {
10205 this.queue( type || "fx", [] );
10206 }
10207
10208 return this.each(function() {
10209 var dequeue = true,
10210 index = type != null && type + "queueHooks",
10211 timers = jQuery.timers,
10212 data = jQuery._data( this );
10213
10214 if ( index ) {
10215 if ( data[ index ] && data[ index ].stop ) {
10216 stopQueue( data[ index ] );
10217 }
10218 } else {
10219 for ( index in data ) {
10220 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
10221 stopQueue( data[ index ] );
10222 }
10223 }
10224 }
10225
10226 for ( index = timers.length; index--; ) {
10227 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
10228 timers[ index ].anim.stop( gotoEnd );
10229 dequeue = false;
10230 timers.splice( index, 1 );
10231 }
10232 }
10233
10234 // start the next in the queue if the last step wasn't forced
10235 // timers currently will call their complete callbacks, which will dequeue
10236 // but only if they were gotoEnd
10237 if ( dequeue || !gotoEnd ) {
10238 jQuery.dequeue( this, type );
10239 }
10240 });
10241 },
10242 finish: function( type ) {
10243 if ( type !== false ) {
10244 type = type || "fx";
10245 }
10246 return this.each(function() {
10247 var index,
10248 data = jQuery._data( this ),
10249 queue = data[ type + "queue" ],
10250 hooks = data[ type + "queueHooks" ],
10251 timers = jQuery.timers,
10252 length = queue ? queue.length : 0;
10253
10254 // enable finishing flag on private data
10255 data.finish = true;
10256
10257 // empty the queue first
10258 jQuery.queue( this, type, [] );
10259
10260 if ( hooks && hooks.stop ) {
10261 hooks.stop.call( this, true );
10262 }
10263
10264 // look for any active animations, and finish them
10265 for ( index = timers.length; index--; ) {
10266 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
10267 timers[ index ].anim.stop( true );
10268 timers.splice( index, 1 );
10269 }
10270 }
10271
10272 // look for any animations in the old queue and finish them
10273 for ( index = 0; index < length; index++ ) {
10274 if ( queue[ index ] && queue[ index ].finish ) {
10275 queue[ index ].finish.call( this );
10276 }
10277 }
10278
10279 // turn off finishing flag
10280 delete data.finish;
10281 });
10282 }
10283});
10284
10285// Generate parameters to create a standard animation
10286function genFx( type, includeWidth ) {
10287 var which,
10288 attrs = { height: type },
10289 i = 0;
10290
10291 // if we include width, step value is 1 to do all cssExpand values,
10292 // if we don't include width, step value is 2 to skip over Left and Right
10293 includeWidth = includeWidth? 1 : 0;
10294 for( ; i < 4 ; i += 2 - includeWidth ) {
10295 which = cssExpand[ i ];
10296 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
10297 }
10298
10299 if ( includeWidth ) {
10300 attrs.opacity = attrs.width = type;
10301 }
10302
10303 return attrs;
10304}
10305
10306// Generate shortcuts for custom animations
10307jQuery.each({
10308 slideDown: genFx("show"),
10309 slideUp: genFx("hide"),
10310 slideToggle: genFx("toggle"),
10311 fadeIn: { opacity: "show" },
10312 fadeOut: { opacity: "hide" },
10313 fadeToggle: { opacity: "toggle" }
10314}, function( name, props ) {
10315 jQuery.fn[ name ] = function( speed, easing, callback ) {
10316 return this.animate( props, speed, easing, callback );
10317 };
10318});
10319
10320jQuery.speed = function( speed, easing, fn ) {
10321 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
10322 complete: fn || !fn && easing ||
10323 jQuery.isFunction( speed ) && speed,
10324 duration: speed,
10325 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
10326 };
10327
10328 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
10329 opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
10330
10331 // normalize opt.queue - true/undefined/null -> "fx"
10332 if ( opt.queue == null || opt.queue === true ) {
10333 opt.queue = "fx";
10334 }
10335
10336 // Queueing
10337 opt.old = opt.complete;
10338
10339 opt.complete = function() {
10340 if ( jQuery.isFunction( opt.old ) ) {
10341 opt.old.call( this );
10342 }
10343
10344 if ( opt.queue ) {
10345 jQuery.dequeue( this, opt.queue );
10346 }
10347 };
10348
10349 return opt;
10350};
10351
10352jQuery.easing = {
10353 linear: function( p ) {
10354 return p;
10355 },
10356 swing: function( p ) {
10357 return 0.5 - Math.cos( p*Math.PI ) / 2;
10358 }
10359};
10360
10361jQuery.timers = [];
10362jQuery.fx = Tween.prototype.init;
10363jQuery.fx.tick = function() {
10364 var timer,
10365 timers = jQuery.timers,
10366 i = 0;
10367
10368 fxNow = jQuery.now();
10369
10370 for ( ; i < timers.length; i++ ) {
10371 timer = timers[ i ];
10372 // Checks the timer has not already been removed
10373 if ( !timer() && timers[ i ] === timer ) {
10374 timers.splice( i--, 1 );
10375 }
10376 }
10377
10378 if ( !timers.length ) {
10379 jQuery.fx.stop();
10380 }
10381 fxNow = undefined;
10382};
10383
10384jQuery.fx.timer = function( timer ) {
10385 if ( timer() && jQuery.timers.push( timer ) ) {
10386 jQuery.fx.start();
10387 }
10388};
10389
10390jQuery.fx.interval = 13;
10391
10392jQuery.fx.start = function() {
10393 if ( !timerId ) {
10394 timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
10395 }
10396};
10397
10398jQuery.fx.stop = function() {
10399 clearInterval( timerId );
10400 timerId = null;
10401};
10402
10403jQuery.fx.speeds = {
10404 slow: 600,
10405 fast: 200,
10406 // Default speed
10407 _default: 400
10408};
10409
10410// Back Compat <1.8 extension point
10411jQuery.fx.step = {};
10412
10413if ( jQuery.expr && jQuery.expr.filters ) {
10414 jQuery.expr.filters.animated = function( elem ) {
10415 return jQuery.grep(jQuery.timers, function( fn ) {
10416 return elem === fn.elem;
10417 }).length;
10418 };
10419}
10420jQuery.fn.offset = function( options ) {
10421 if ( arguments.length ) {
10422 return options === undefined ?
10423 this :
10424 this.each(function( i ) {
10425 jQuery.offset.setOffset( this, options, i );
10426 });
10427 }
10428
10429 var docElem, win,
10430 box = { top: 0, left: 0 },
10431 elem = this[ 0 ],
10432 doc = elem && elem.ownerDocument;
10433
10434 if ( !doc ) {
10435 return;
10436 }
10437
10438 docElem = doc.documentElement;
10439
10440 // Make sure it's not a disconnected DOM node
10441 if ( !jQuery.contains( docElem, elem ) ) {
10442 return box;
10443 }
10444
10445 // If we don't have gBCR, just use 0,0 rather than error
10446 // BlackBerry 5, iOS 3 (original iPhone)
10447 if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
10448 box = elem.getBoundingClientRect();
10449 }
10450 win = getWindow( doc );
10451 return {
10452 top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
10453 left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
10454 };
10455};
10456
10457jQuery.offset = {
10458
10459 setOffset: function( elem, options, i ) {
10460 var position = jQuery.css( elem, "position" );
10461
10462 // set position first, in-case top/left are set even on static elem
10463 if ( position === "static" ) {
10464 elem.style.position = "relative";
10465 }
10466
10467 var curElem = jQuery( elem ),
10468 curOffset = curElem.offset(),
10469 curCSSTop = jQuery.css( elem, "top" ),
10470 curCSSLeft = jQuery.css( elem, "left" ),
10471 calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
10472 props = {}, curPosition = {}, curTop, curLeft;
10473
10474 // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
10475 if ( calculatePosition ) {
10476 curPosition = curElem.position();
10477 curTop = curPosition.top;
10478 curLeft = curPosition.left;
10479 } else {
10480 curTop = parseFloat( curCSSTop ) || 0;
10481 curLeft = parseFloat( curCSSLeft ) || 0;
10482 }
10483
10484 if ( jQuery.isFunction( options ) ) {
10485 options = options.call( elem, i, curOffset );
10486 }
10487
10488 if ( options.top != null ) {
10489 props.top = ( options.top - curOffset.top ) + curTop;
10490 }
10491 if ( options.left != null ) {
10492 props.left = ( options.left - curOffset.left ) + curLeft;
10493 }
10494
10495 if ( "using" in options ) {
10496 options.using.call( elem, props );
10497 } else {
10498 curElem.css( props );
10499 }
10500 }
10501};
10502
10503
10504jQuery.fn.extend({
10505
10506 position: function() {
10507 if ( !this[ 0 ] ) {
10508 return;
10509 }
10510
10511 var offsetParent, offset,
10512 parentOffset = { top: 0, left: 0 },
10513 elem = this[ 0 ];
10514
10515 // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
10516 if ( jQuery.css( elem, "position" ) === "fixed" ) {
10517 // we assume that getBoundingClientRect is available when computed position is fixed
10518 offset = elem.getBoundingClientRect();
10519 } else {
10520 // Get *real* offsetParent
10521 offsetParent = this.offsetParent();
10522
10523 // Get correct offsets
10524 offset = this.offset();
10525 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
10526 parentOffset = offsetParent.offset();
10527 }
10528
10529 // Add offsetParent borders
10530 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
10531 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
10532 }
10533
10534 // Subtract parent offsets and element margins
10535 // note: when an element has margin: auto the offsetLeft and marginLeft
10536 // are the same in Safari causing offset.left to incorrectly be 0
10537 return {
10538 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
10539 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
10540 };
10541 },
10542
10543 offsetParent: function() {
10544 return this.map(function() {
10545 var offsetParent = this.offsetParent || docElem;
10546 while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
10547 offsetParent = offsetParent.offsetParent;
10548 }
10549 return offsetParent || docElem;
10550 });
10551 }
10552});
10553
10554
10555// Create scrollLeft and scrollTop methods
10556jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
10557 var top = /Y/.test( prop );
10558
10559 jQuery.fn[ method ] = function( val ) {
10560 return jQuery.access( this, function( elem, method, val ) {
10561 var win = getWindow( elem );
10562
10563 if ( val === undefined ) {
10564 return win ? (prop in win) ? win[ prop ] :
10565 win.document.documentElement[ method ] :
10566 elem[ method ];
10567 }
10568
10569 if ( win ) {
10570 win.scrollTo(
10571 !top ? val : jQuery( win ).scrollLeft(),
10572 top ? val : jQuery( win ).scrollTop()
10573 );
10574
10575 } else {
10576 elem[ method ] = val;
10577 }
10578 }, method, val, arguments.length, null );
10579 };
10580});
10581
10582function getWindow( elem ) {
10583 return jQuery.isWindow( elem ) ?
10584 elem :
10585 elem.nodeType === 9 ?
10586 elem.defaultView || elem.parentWindow :
10587 false;
10588}
10589// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10590jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10591 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
10592 // margin is only for outerHeight, outerWidth
10593 jQuery.fn[ funcName ] = function( margin, value ) {
10594 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
10595 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
10596
10597 return jQuery.access( this, function( elem, type, value ) {
10598 var doc;
10599
10600 if ( jQuery.isWindow( elem ) ) {
10601 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
10602 // isn't a whole lot we can do. See pull request at this URL for discussion:
10603 // https://github.com/jquery/jquery/pull/764
10604 return elem.document.documentElement[ "client" + name ];
10605 }
10606
10607 // Get document width or height
10608 if ( elem.nodeType === 9 ) {
10609 doc = elem.documentElement;
10610
10611 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
10612 // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
10613 return Math.max(
10614 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
10615 elem.body[ "offset" + name ], doc[ "offset" + name ],
10616 doc[ "client" + name ]
10617 );
10618 }
10619
10620 return value === undefined ?
10621 // Get width or height on the element, requesting but not forcing parseFloat
10622 jQuery.css( elem, type, extra ) :
10623
10624 // Set width or height on the element
10625 jQuery.style( elem, type, value, extra );
10626 }, type, chainable ? margin : undefined, chainable, null );
10627 };
10628 });
10629});
10630// Limit scope pollution from any deprecated API
10631// (function() {
10632
10633// The number of elements contained in the matched element set
10634jQuery.fn.size = function() {
10635 return this.length;
10636};
10637
10638jQuery.fn.andSelf = jQuery.fn.addBack;
10639
10640// })();
10641if ( typeof module === "object" && module && typeof module.exports === "object" ) {
10642 // Expose jQuery as module.exports in loaders that implement the Node
10643 // module pattern (including browserify). Do not create the global, since
10644 // the user will be storing it themselves locally, and globals are frowned
10645 // upon in the Node module world.
10646 module.exports = jQuery;
10647} else {
10648 // Otherwise expose jQuery to the global object as usual
10649 window.jQuery = window.$ = jQuery;
10650
10651 // Register as a named AMD module, since jQuery can be concatenated with other
10652 // files that may use define, but not via a proper concatenation script that
10653 // understands anonymous AMD modules. A named AMD is safest and most robust
10654 // way to register. Lowercase jquery is used because AMD module names are
10655 // derived from file names, and jQuery is normally delivered in a lowercase
10656 // file name. Do this after creating the global so that if an AMD module wants
10657 // to call noConflict to hide this version of jQuery, it will work.
10658 if ( typeof define === "function" && define.amd ) {
10659 define( "jquery", [], function () { return jQuery; } );
10660 }
10661}
10662
10663})( window );
10664</script><p><g class="gr_ gr_7 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" id="7" data-gr-id="7"></g></p>
10665<!-- Start of Snow Effect -->
10666<script src="http://files.enjin.com/207770/snow.js"></script>
10667<!-- End of Snow Effect -->
10668<script src="js/modernizr.custom.js"></script>
10669<div class="container">
10670<div class="social"><a href="https://twitter.com/d7craft"><i class="fa fa-twitter"></i></a> <!-- Link To WoK Twitter --> <a href="https://www.youtube.com/user/d7craft"><i class="fa fa-youtube"></i></a> <!-- Link To website' YouTube --> <a href="https://www.facebook.com//?fref=ts"><i class="fa fa-facebook"></i></a> <!-- Link To WoK Facebook -->
10671<p class="copyright">Coded By D7craft <br />Copyright © 2017 <g class="gr_ gr_8 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" id="8" data-gr-id="8"></g> </p>
10672<div class="navEasterEgg"><g class="gr_ gr_9 gr-alert gr_spell gr_run_anim ContextualSpelling ins-del multiReplace" id="9" data-gr-id="9"></g></div>
10673<!-- Copyright Message --></div>
10674<div class="logo"></div>
10675<div class="main clearfix">
10676<div id="menu" class="nav">
10677<ul>
10678<li class="nav2"><a href="/callus"> <span>Õ‘È</span> </a></li>
10679<li class="nav3"><a href="/forum">ȡ䥊Ь</a></li>
10680<li class="nav4"><a href="/home"> <span>ȡ҆î”ɼ/span> </a></li>
10681</ul>
10682</div>
10683<div class="sub clearfix">
10684<div id="menubg" class="navbg">
10685<ul>
10686<li>
10687<div class="navbgs2"></div>
10688</li>
10689<li>
10690<div class="navbgs3"></div>
10691</li>
10692<li>
10693<div class="navbgs4"></div>
10694</li>
10695</ul>
10696</div>
10697</div>
10698</div>
10699</div>
10700<div class="containerbg">
10701<div class="hoverbackground hoverbackground2"></div>
10702<div class="hoverbackground hoverbackground3"></div>
10703<div class="hoverbackground hoverbackground4"></div>
10704<div class="hoverbackground hoverbackgroundEasterEgg"></div>
10705
10706<!-- Start of Snow Effect -->
10707<div id="snowflakeContainer">
10708 <p class="snowflake">*</p>
10709</div>
10710<!-- End of Snow Effect -->
10711
10712<script>// <![CDATA[
10713 $(".nav2").hover(function(){ $(".navbgs2").toggleClass("navbgs2h"); $(".container").toggleClass("containerhover"); $(".hoverbackground2").toggleClass("hoverbackground2h"); }); $(".nav3").hover(function(){ $(".navbgs3").toggleClass("navbgs3h"); $(".container").toggleClass("containerhover"); $(".hoverbackground3").toggleClass("hoverbackground3h"); }); $(".nav4").hover(function(){ $(".navbgs4").toggleClass("navbgs4h"); $(".container").toggleClass("containerhover"); $(".hoverbackground4").toggleClass("hoverbackground4h"); }); $(".navEasterEgg").click(function(){ $(".container").toggleClass("containerhover"); $(".hoverbackgroundEasterEgg").toggleClass("hoverbackgroundEasterEggh"); });
10714// ]]></script>
10715<script>// <![CDATA[
10716 $(window).resize(function() { $('html, body').animate({ scrollTop: $(document).height() }, 0); return false; });
10717// ]]></script>
10718</div>
10719<script type="text/javascript" src="https://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js"></script>
10720<script>// <![CDATA[
10721 $(function(){ $(document).click(function() { if ($(".s_popup-canvas-separator").length){ $("body").css("overflow","hidden"); $(".s_popup-canvas-separator").css("width","100%"); } if (!$(".s_popup-canvas-separator").length){ $("body").css("overflow","auto"); } } ); }); $(document).bind("DOMNodeInserted",function(){ if ($(".s_popup-canvas-separator").length){ $("body").css("overflow","hidden"); $(".s_popup-canvas-separator").css("width","100%"); } }); $(document).bind("DOMNodeRemoved",function(){ if (!$(".s_popup-canvas-separator").length){ $("body").css("overflow","auto"); } });
10722// ]]></script></div></div>
10723
10724
10725 <div class="fixed_height_elem container_spacer last">
10726 <div class="left"><!-- --></div>
10727 <div class="right"><!-- --></div>
10728 <div class="middle"><!-- --></div>
10729 </div>
10730 <div class='clearing'><!-- --></div>
10731 </div><!-- .section -->
10732 </td>
10733 <td class="section-border"><div class="decorator-box"></div></td>
10734 </tr>
10735</table><!-- .section-collection -->
10736</div><!-- -->
10737 <div class="fixed_height_elem"><table class="section-collection"><tr class="top">
10738 <td class="section-border"><div class="decorator-box"></div></td>
10739 <td id="section-footer"
10740 class="section-holder section-width-large"
10741 style=""
10742 data-width="1030"
10743 >
10744 <div class="section"> <div class=" container_spacer last">
10745 <div class="left"><!-- --></div>
10746 <div class="right"><!-- --></div>
10747 <div class="middle"><!-- --></div>
10748 </div>
10749 <div class='clearing'><!-- --></div>
10750 </div><!-- .section -->
10751 </td>
10752 <td class="section-border"><div class="decorator-box"></div></td>
10753 </tr>
10754</table><!-- .section-collection -->
10755</div><!-- -->
10756
10757
10758 </div><!-- #site-body -->
10759
10760 <div class="fixed_height_elem" id="page-footer">
10761 <div class="left">
10762 <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/"><img alt="Creative Commons License" style="border-width:0;" src="http://i.creativecommons.org/l/by-nc-nd/3.0/80x15.png"></a> </div>
10763 </div>
10764
10765 </div><!-- #page-wrap -->
10766</div><!-- #page -->
10767
10768
10769
10770
10771
10772</div></div>
10773
10774
10775
10776
10777
10778
10779
10780<script type="text/javascript">
10781$(document).ready(function() {
10782 $('#enjin-tray-chatchannels').addClass('announcements');
10783
10784 Enjin_Core.Announcements.init([{"announcement_id":"48622","site_id":"207770","title":"Happy Holidays!","announcement":"\n<div class=\"bbcode_center\" style=\"text-align:center\">\n<span style=\"font-size:18px\"><b><span style=\"color:#dd9323\">Happy New Years to everyone from all of us here at WoK! Hope you guys are enjoying the start of this new year and to celebrate we are having a sale! 40% off kredits from Jan 1 -15th.<br \/>\n<br \/>\nThank you to all who have supported us thru all these years and continue to this day. We've had our ups and downs but no doubt in this 2017 year we will continue working hard to provide you the best that we can.<br \/>\nHappy New Year, one and all, and thank you once again.<br \/>\n\u2764 \u2764 \u2764 <\/span><\/b><\/span>\n<\/div>\n","type":"popup","animation":"disabled","ack_btn_text":"I Agree","starts":"now","starts_date":"0","starts_days":"0","ends":"delete","ends_date":"0","ends_days":"0","allow_specific_users":"","on_pages":"all","specific_pages":"","repeat":"0","repeat_unit":"days","repeat_value":"1","repeat_week_days":"0000000","send_notification":"0","order":"0","hidden":"0","_time_viewed_":null}]);
10785 Enjin_Core.Reminders.init([]);
10786});
10787</script>
10788<div id="site-announcements">
10789 <a href="#">
10790 <i class="icon-warning-sign icon"></i>
10791 <span class="ann-tray-text"><span class="amount"></span> <span class="singular">Notice</span><span class="plural">Notices</span></span>
10792 </a>
10793 <div class="site-announcement">
10794 <div class="title-bar">
10795 <div class="title ann-title"></div>
10796 <div class="close-wrapper"><a href="#" onclick="Enjin_Core.Announcements.close(true);return false;"><div class="close"></div></a></div>
10797 </div>
10798 <div class="content"></div>
10799
10800 <div class="nav-bar nav-bar-bottom">
10801 <div class="nav">
10802 <div class="announcements-nav">
10803 <div class="element_button" onclick="Enjin_Core.Announcements.prev();return false;">
10804 <div class="l"><!-- --></div>
10805 <div class="r"><!-- --></div>
10806 <input type="button" value="Prev" onclick="">
10807 </div>
10808 <div class="element_button" onclick="Enjin_Core.Announcements.next();return false;">
10809 <div class="l"><!-- --></div>
10810 <div class="r"><!-- --></div>
10811 <input type="button" value="Next" onclick="">
10812 </div>
10813 <div class="title title-bottom">Announcement <span class="index"></span> of <span class="total"></span></div>
10814 </div>
10815
10816 <div class="element_button btn-delete-ann">
10817 <div class="l"><!-- --></div>
10818 <div class="r"><!-- --></div>
10819 <input type="button" value="Delete Announcement" />
10820 </div>
10821 <div class="element_button btn-agree-terms">
10822 <div class="l"><!-- --></div>
10823 <div class="r"><!-- --></div>
10824 <input type="button" value="I Agree to the Terms" />
10825 </div>
10826
10827 </div>
10828 </div>
10829 </div>
10830 <div class="border"></div>
10831</div>
10832
10833
10834<div id="announcement-popup" class="element_popup element_popup_core element_popup_window warning-issued-popup" style="z-index: 20000; display: none;">
10835 <div class="inner window-frame">
10836 <div class="popup_window_title">
10837 <span class="title-text"></span>
10838 <div class="close-wrapper btn-delete-ann-x">
10839 <a href="#"><div class="close"></div></a>
10840 </div>
10841 </div>
10842 <div class="content">
10843 <div class="announcement-text">
10844
10845 </div>
10846 <div class="controls">
10847 <div class="element_button prev"><div class="l"><!-- --></div><div class="r"><!-- --></div><input type="button" value="Prev" onclick=""></div>
10848 <div class="element_button next"><div class="l"><!-- --></div><div class="r"><!-- --></div><input type="button" value="Next" onclick=""></div>
10849
10850 <div class="title title-bottom"><span class="index">1</span> of <span class="total">4</span> Announcement</div>
10851
10852 <div class="element_button btn-delete-ann"><div class="l"><!-- --></div><div class="r"><!-- --></div><input type="button" value="Delete Announcement"></div>
10853 <div class="element_button btn-agree"><div class="l"><!-- --></div><div class="r"><!-- --></div><input type="button" value=""></div>
10854 </div>
10855 </div>
10856 </div>
10857</div>
10858<div class="announcement-canvas-separator" style="z-index: 19999;height: 100% !important; display: none;"> </div>
10859<!-- 0.068s -->
10860<!-- pusher part -->
10861
10862
10863<script src="https://www.google.com/recaptcha/api.js" async defer></script><script type="text/javascript">var recaptcha_publickey = "6Le3_AUTAAAAALjgZgjXxE1mU9KxrYl_g9mWmNSd";</script><script type="text/javascript">var recaptcha_token = "jOo-pnrHzjsIqxlH-g3G8w1jHfNU2lys_rVxUwHv9R3IgoQ8v9CbXHVhpsYVZG6e7YwAbUtSchhv5wJFPEeWUoX9MQ9k04FeN3UjmBGjHjM";</script>
10864<!-- Start Quantcast tag -->
10865<script type="text/javascript">
10866_qoptions={
10867qacct:"p-e2f9QTuI7ynec"
10868};
10869</script>
10870<script type="text/javascript" src="http://edge.quantserve.com/quant.js" async defer></script>
10871<noscript>
10872<img src="http://pixel.quantserve.com/pixel/p-e2f9QTuI7ynec.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/>
10873</noscript>
10874<!-- End Quantcast tag -->
10875
10876
10877
10878<div id="fb-root"></div><script type="text/javascript">
10879 //<!--
10880 (function(d, s, id) {
10881 var js, fjs = d.getElementsByTagName(s)[0];
10882 if (d.getElementById(id)) return;
10883 js = d.createElement(s); js.id = id;
10884 js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
10885 js.async = true;
10886 fjs.parentNode.insertBefore(js, fjs);
10887 }(document, 'script', 'facebook-jssdk'));
10888 //-->
10889</script>
10890<script type="text/javascript">
10891 //<!--
10892 (function() {
10893 var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
10894 po.src = 'https://apis.google.com/js/plusone.js';
10895 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
10896 })();
10897 //-->
10898</script>
10899<script type="text/javascript">
10900 //<!--
10901 !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); //-->
10902</script><!-- web6.enjin.com -->
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912<script type="text/javascript" src="http://enjin.host/201701160642/platform/react.js"></script>
10913
10914<script type="text/javascript">
10915//<![CDATA[
10916(function() {
10917var _analytics_scr = document.createElement('script');
10918_analytics_scr.type = 'text/javascript'; _analytics_scr.async = true; _analytics_scr.src = '/_Incapsula_Resource?SWJIYLWA=2977d8d74f63d7f8fedbea018b7a1d05&ns=1';
10919var _analytics_elem = document.getElementsByTagName('script')[0]; _analytics_elem.parentNode.insertBefore(_analytics_scr, _analytics_elem);
10920})();
10921// ]]>
10922</script></body>
10923
10924</html>