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