All In One Schema Rich Snippets - Version 1.0

Version Description

  • Initial Release.

=

Download this release

Release Info

Developer brainstormforce
Plugin Icon 128x128 All In One Schema Rich Snippets
Version 1.0
Comparing to
See all releases

Version 1.0

admin/css/style.css ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Metabox Styling
3
+ */
4
+ table.bsf_metabox td, table.bsf_metabox th { border-bottom: 0px solid #E9E9E9; }
5
+ table.bsf_metabox th { text-align: right; font-weight:bold;}
6
+ table.bsf_metabox th label { margin-top:5px; display:block;}
7
+ p.bsf_metabox_description { color: #AAA; font-style: italic; margin: 2px 0 !important;}
8
+ span.bsf_metabox_description { color: #AAA; font-style: italic;}
9
+ table.bsf_metabox input, table.bsf_metabox textarea { font-size:12px; padding: 5px; }
10
+ table.bsf_metabox input[type=text], table.bsf_metabox textarea { width: 97%; }
11
+ table.bsf_metabox textarea.bsf_textarea_code { font-family: Consolas,Monaco,monospace; line-height: 16px; }
12
+ table.bsf_metabox input.bsf_text_small { width: 100px; margin-right: 15px;}
13
+ table.bsf_metabox input.bsf_timepicker { width: 100px; margin-right: 15px;}
14
+ table.bsf_metabox input.bsf_text_money { width: 90px; margin-right: 15px;}
15
+ table.bsf_metabox input.bsf_text_medium { width: 230px; margin-right: 15px;}
16
+ table.bsf_metabox input.bsf_upload_file { width: 65%; }
17
+ table.bsf_metabox li { font-size:12px; margin: 1px 0 5px 0; line-height: 16px; }
18
+ table.bsf_metabox ul { padding-top:5px; margin: 0; }
19
+ table.bsf_metabox select { font-size:12px; margin-top: 3px;}
20
+ table.bsf_metabox input:focus, table.bsf_metabox textarea:focus { background: #fffff8;}
21
+ .bsf_metabox_title { margin: 0 0 5px 0; padding: 5px 0 0 0; font: italic 24px/35px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}
22
+ .bsf_radio_inline { padding: 4px 0 0 0;}
23
+ .bsf_radio_inline_option {display: inline; padding-right: 18px;}
24
+ table.bsf_metabox input[type="radio"] { margin: 0 5px 0 0; padding: 0;}
25
+ table.bsf_metabox input[type="checkbox"] { margin: 0 5px 0 0; padding: 0;}
26
+ table.bsf_metabox .mceLayout {border:1px solid #DFDFDF !important;}
27
+ table.bsf_metabox .mceIframeContainer {background:#FFF;}
28
+ table.bsf_metabox .meta_mce {width:97%;}
29
+ table.bsf_metabox .meta_mce textarea {width:100%;}
30
+ table.bsf_metabox .bsf_media_status { margin: 10px 0 0 0;}
31
+ table.bsf_metabox .bsf_media_status .img_status, table.bsf_metabox .bsf_media_status .embed_status { position: relative; }
32
+ table.bsf_metabox .bsf_media_status .img_status img, table.bsf_metabox .bsf_media_status .embed_status { border:1px solid #DFDFDF; background: #FAFAFA; max-width:350px; padding: 5px; -moz-border-radius: 2px; border-radius: 2px;}
33
+ table.bsf_metabox .bsf_media_status .embed_status { float: left; max-width:800px;}
34
+ table.bsf_metabox .bsf_media_status .img_status .bsf_remove_file_button, table.bsf_metabox .bsf_media_status .embed_status .bsf_remove_file_button { text-indent: -9999px; background: url(images/ico-delete.png); width: 16px; height: 16px; position: absolute; top: -5px; left: -5px;}
35
+ /* Sidebar placement adjustments */
36
+ .inner-sidebar table.bsf_metabox input[type=text], table.bsf_metabox textarea { width: 95%; }
37
+ .inner-sidebar table.bsf_metabox .bsf_media_status .img_status img, .inner-sidebar table.bsf_metabox .bsf_media_status .embed_status img { width: 90%; }
38
+ .postbox table.bsf_metabox .cmb-spinner { float: left; }
39
+ /**
40
+ * Color picker
41
+ */
42
+ table.bsf_metabox .wp-color-result, table.bsf_metabox .wp-picker-input-wrap { vertical-align: middle; }
43
+ table.bsf_metabox .wp-color-result, table.bsf_metabox .wp-picker-container { margin: 0 10px 0 0; }
44
+
45
+ /**
46
+ * Timepicker
47
+ */
48
+ div.time-picker { position: absolute; height: 191px; width:6em; /* needed for IE */overflow: auto; background: #fff; border: 1px solid #aaa; z-index: 99; margin: 0;}
49
+ div.time-picker-12hours { width:8em; /* needed for IE */}
50
+ div.time-picker ul { list-style-type: none; margin: 0; padding: 0; }
51
+ div.time-picker li { cursor: pointer; height: 10px; font: 12px/1 Helvetica, Arial, sans-serif; padding: 4px 3px; }
52
+ div.time-picker li.selected { background: #0063CE; color: #fff; }
53
+
54
+ /**
55
+ * jQuery UI CSS Framework 1.8.16
56
+ *
57
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
58
+ * Dual licensed under the MIT or GPL Version 2 licenses.
59
+ * http://jquery.org/license
60
+ *
61
+ * http://docs.jquery.com/UI/Theming/API
62
+ */
63
+ .bsf_element .ui-helper-hidden { display: none; }
64
+ .bsf_element .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
65
+ .bsf_element .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
66
+ .bsf_element .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
67
+ .bsf_element .ui-helper-clearfix { display: inline-block; }
68
+ * html .ui-helper-clearfix { height:1%; }
69
+ .bsf_element .ui-helper-clearfix { display:block; }
70
+ .bsf_element .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
71
+ .bsf_element .ui-state-disabled { cursor: default !important; }
72
+ .bsf_element .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
73
+ .bsf_element .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
74
+ .bsf_element .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
75
+ .bsf_element .ui-widget .ui-widget { font-size: 1em; }
76
+ .bsf_element .ui-widget input, .bsf_element .ui-widget select, .bsf_element .ui-widget textarea, .bsf_element .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
77
+ .bsf_element .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
78
+ .bsf_element .ui-widget-content a { color: #222222; }
79
+ .bsf_element .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
80
+ .bsf_element .ui-widget-header a { color: #222222; }
81
+ .bsf_element .ui-state-default, .bsf_element .ui-widget-content .ui-state-default, .bsf_element .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
82
+ .bsf_element .ui-state-default a, .bsf_element .ui-state-default a:link, .bsf_element .ui-state-default a:visited { color: #555555; text-decoration: none; }
83
+ .bsf_element .ui-state-hover, .bsf_element .ui-widget-content .ui-state-hover, .bsf_element .ui-widget-header .ui-state-hover, .bsf_element .ui-state-focus, .bsf_element .ui-widget-content .ui-state-focus, .bsf_element .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
84
+ .bsf_element .ui-state-hover a, .bsf_element .ui-state-hover a:hover { color: #212121; text-decoration: none; }
85
+ .bsf_element .ui-state-active, .bsf_element .ui-widget-content .ui-state-active, .bsf_element .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
86
+ .bsf_element .ui-state-active a, .bsf_element .ui-state-active a:link, .bsf_element .ui-state-active a:visited { color: #212121; text-decoration: none; }
87
+ .bsf_element .ui-widget :active { outline: none; }
88
+ .bsf_element .ui-state-highlight, .bsf_element .ui-widget-content .ui-state-highlight, .bsf_element .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
89
+ .bsf_element .ui-state-highlight a, .bsf_element .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
90
+ .bsf_element .ui-state-error, .bsf_element .ui-widget-content .ui-state-error, .bsf_element .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
91
+ .bsf_element .ui-state-error a, .bsf_element .ui-widget-content .ui-state-error a, .bsf_element .ui-widget-header .ui-state-error a { color: #cd0a0a; }
92
+ .bsf_element .ui-state-error-text, .bsf_element .ui-widget-content .ui-state-error-text, .bsf_element .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
93
+ .bsf_element .ui-priority-primary, .bsf_element .ui-widget-content .ui-priority-primary, .bsf_element .ui-widget-header .ui-priority-primary { font-weight: bold; }
94
+ .bsf_element .ui-priority-secondary, .bsf_element .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
95
+ .bsf_element .ui-state-disabled, .bsf_element .ui-widget-content .ui-state-disabled, .bsf_element .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
96
+ .bsf_element .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
97
+ .bsf_element .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
98
+ .bsf_element .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
99
+ .bsf_element .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
100
+ .bsf_element .ui-state-hover .ui-icon, .bsf_element .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
101
+ .bsf_element .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
102
+ .bsf_element .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
103
+ .bsf_element .ui-state-error .ui-icon, .bsf_element .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
104
+ .bsf_element .ui-icon-carat-1-n { background-position: 0 0; }
105
+ .bsf_element .ui-icon-carat-1-ne { background-position: -16px 0; }
106
+ .bsf_element .ui-icon-carat-1-e { background-position: -32px 0; }
107
+ .bsf_element .ui-icon-carat-1-se { background-position: -48px 0; }
108
+ .bsf_element .ui-icon-carat-1-s { background-position: -64px 0; }
109
+ .bsf_element .ui-icon-carat-1-sw { background-position: -80px 0; }
110
+ .bsf_element .ui-icon-carat-1-w { background-position: -96px 0; }
111
+ .bsf_element .ui-icon-carat-1-nw { background-position: -112px 0; }
112
+ .bsf_element .ui-icon-carat-2-n-s { background-position: -128px 0; }
113
+ .bsf_element .ui-icon-carat-2-e-w { background-position: -144px 0; }
114
+ .bsf_element .ui-icon-triangle-1-n { background-position: 0 -16px; }
115
+ .bsf_element .ui-icon-triangle-1-ne { background-position: -16px -16px; }
116
+ .bsf_element .ui-icon-triangle-1-e { background-position: -32px -16px; }
117
+ .bsf_element .ui-icon-triangle-1-se { background-position: -48px -16px; }
118
+ .bsf_element .ui-icon-triangle-1-s { background-position: -64px -16px; }
119
+ .bsf_element .ui-icon-triangle-1-sw { background-position: -80px -16px; }
120
+ .bsf_element .ui-icon-triangle-1-w { background-position: -96px -16px; }
121
+ .bsf_element .ui-icon-triangle-1-nw { background-position: -112px -16px; }
122
+ .bsf_element .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
123
+ .bsf_element .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
124
+ .bsf_element .ui-icon-arrow-1-n { background-position: 0 -32px; }
125
+ .bsf_element .ui-icon-arrow-1-ne { background-position: -16px -32px; }
126
+ .bsf_element .ui-icon-arrow-1-e { background-position: -32px -32px; }
127
+ .bsf_element .ui-icon-arrow-1-se { background-position: -48px -32px; }
128
+ .bsf_element .ui-icon-arrow-1-s { background-position: -64px -32px; }
129
+ .bsf_element .ui-icon-arrow-1-sw { background-position: -80px -32px; }
130
+ .bsf_element .ui-icon-arrow-1-w { background-position: -96px -32px; }
131
+ .bsf_element .ui-icon-arrow-1-nw { background-position: -112px -32px; }
132
+ .bsf_element .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
133
+ .bsf_element .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
134
+ .bsf_element .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
135
+ .bsf_element .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
136
+ .bsf_element .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
137
+ .bsf_element .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
138
+ .bsf_element .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
139
+ .bsf_element .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
140
+ .bsf_element .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
141
+ .bsf_element .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
142
+ .bsf_element .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
143
+ .bsf_element .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
144
+ .bsf_element .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
145
+ .bsf_element .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
146
+ .bsf_element .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
147
+ .bsf_element .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
148
+ .bsf_element .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
149
+ .bsf_element .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
150
+ .bsf_element .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
151
+ .bsf_element .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
152
+ .bsf_element .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
153
+ .bsf_element .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
154
+ .bsf_element .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
155
+ .bsf_element .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
156
+ .bsf_element .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
157
+ .bsf_element .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
158
+ .bsf_element .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
159
+ .bsf_element .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
160
+ .bsf_element .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
161
+ .bsf_element .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
162
+ .bsf_element .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
163
+ .bsf_element .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
164
+ .bsf_element .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
165
+ .bsf_element .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
166
+ .bsf_element .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
167
+ .bsf_element .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
168
+ .bsf_element .ui-icon-arrow-4 { background-position: 0 -80px; }
169
+ .bsf_element .ui-icon-arrow-4-diag { background-position: -16px -80px; }
170
+ .bsf_element .ui-icon-extlink { background-position: -32px -80px; }
171
+ .bsf_element .ui-icon-newwin { background-position: -48px -80px; }
172
+ .bsf_element .ui-icon-refresh { background-position: -64px -80px; }
173
+ .bsf_element .ui-icon-shuffle { background-position: -80px -80px; }
174
+ .bsf_element .ui-icon-transfer-e-w { background-position: -96px -80px; }
175
+ .bsf_element .ui-icon-transferthick-e-w { background-position: -112px -80px; }
176
+ .bsf_element .ui-icon-folder-collapsed { background-position: 0 -96px; }
177
+ .bsf_element .ui-icon-folder-open { background-position: -16px -96px; }
178
+ .bsf_element .ui-icon-document { background-position: -32px -96px; }
179
+ .bsf_element .ui-icon-document-b { background-position: -48px -96px; }
180
+ .bsf_element .ui-icon-note { background-position: -64px -96px; }
181
+ .bsf_element .ui-icon-mail-closed { background-position: -80px -96px; }
182
+ .bsf_element .ui-icon-mail-open { background-position: -96px -96px; }
183
+ .bsf_element .ui-icon-suitcase { background-position: -112px -96px; }
184
+ .bsf_element .ui-icon-comment { background-position: -128px -96px; }
185
+ .bsf_element .ui-icon-person { background-position: -144px -96px; }
186
+ .bsf_element .ui-icon-print { background-position: -160px -96px; }
187
+ .bsf_element .ui-icon-trash { background-position: -176px -96px; }
188
+ .bsf_element .ui-icon-locked { background-position: -192px -96px; }
189
+ .bsf_element .ui-icon-unlocked { background-position: -208px -96px; }
190
+ .bsf_element .ui-icon-bookmark { background-position: -224px -96px; }
191
+ .bsf_element .ui-icon-tag { background-position: -240px -96px; }
192
+ .bsf_element .ui-icon-home { background-position: 0 -112px; }
193
+ .bsf_element .ui-icon-flag { background-position: -16px -112px; }
194
+ .bsf_element .ui-icon-calendar { background-position: -32px -112px; }
195
+ .bsf_element .ui-icon-cart { background-position: -48px -112px; }
196
+ .bsf_element .ui-icon-pencil { background-position: -64px -112px; }
197
+ .bsf_element .ui-icon-clock { background-position: -80px -112px; }
198
+ .bsf_element .ui-icon-disk { background-position: -96px -112px; }
199
+ .bsf_element .ui-icon-calculator { background-position: -112px -112px; }
200
+ .bsf_element .ui-icon-zoomin { background-position: -128px -112px; }
201
+ .bsf_element .ui-icon-zoomout { background-position: -144px -112px; }
202
+ .bsf_element .ui-icon-search { background-position: -160px -112px; }
203
+ .bsf_element .ui-icon-wrench { background-position: -176px -112px; }
204
+ .bsf_element .ui-icon-gear { background-position: -192px -112px; }
205
+ .bsf_element .ui-icon-heart { background-position: -208px -112px; }
206
+ .bsf_element .ui-icon-star { background-position: -224px -112px; }
207
+ .bsf_element .ui-icon-link { background-position: -240px -112px; }
208
+ .bsf_element .ui-icon-cancel { background-position: 0 -128px; }
209
+ .bsf_element .ui-icon-plus { background-position: -16px -128px; }
210
+ .bsf_element .ui-icon-plusthick { background-position: -32px -128px; }
211
+ .bsf_element .ui-icon-minus { background-position: -48px -128px; }
212
+ .bsf_element .ui-icon-minusthick { background-position: -64px -128px; }
213
+ .bsf_element .ui-icon-close { background-position: -80px -128px; }
214
+ .bsf_element .ui-icon-closethick { background-position: -96px -128px; }
215
+ .bsf_element .ui-icon-key { background-position: -112px -128px; }
216
+ .bsf_element .ui-icon-lightbulb { background-position: -128px -128px; }
217
+ .bsf_element .ui-icon-scissors { background-position: -144px -128px; }
218
+ .bsf_element .ui-icon-clipboard { background-position: -160px -128px; }
219
+ .bsf_element .ui-icon-copy { background-position: -176px -128px; }
220
+ .bsf_element .ui-icon-contact { background-position: -192px -128px; }
221
+ .bsf_element .ui-icon-image { background-position: -208px -128px; }
222
+ .bsf_element .ui-icon-video { background-position: -224px -128px; }
223
+ .bsf_element .ui-icon-script { background-position: -240px -128px; }
224
+ .bsf_element .ui-icon-alert { background-position: 0 -144px; }
225
+ .bsf_element .ui-icon-info { background-position: -16px -144px; }
226
+ .bsf_element .ui-icon-notice { background-position: -32px -144px; }
227
+ .bsf_element .ui-icon-help { background-position: -48px -144px; }
228
+ .bsf_element .ui-icon-check { background-position: -64px -144px; }
229
+ .bsf_element .ui-icon-bullet { background-position: -80px -144px; }
230
+ .bsf_element .ui-icon-radio-off { background-position: -96px -144px; }
231
+ .bsf_element .ui-icon-radio-on { background-position: -112px -144px; }
232
+ .bsf_element .ui-icon-pin-w { background-position: -128px -144px; }
233
+ .bsf_element .ui-icon-pin-s { background-position: -144px -144px; }
234
+ .bsf_element .ui-icon-play { background-position: 0 -160px; }
235
+ .bsf_element .ui-icon-pause { background-position: -16px -160px; }
236
+ .bsf_element .ui-icon-seek-next { background-position: -32px -160px; }
237
+ .bsf_element .ui-icon-seek-prev { background-position: -48px -160px; }
238
+ .bsf_element .ui-icon-seek-end { background-position: -64px -160px; }
239
+ .bsf_element .ui-icon-seek-start { background-position: -80px -160px; }
240
+ .bsf_element .ui-icon-seek-first { background-position: -80px -160px; }
241
+ .bsf_element .ui-icon-stop { background-position: -96px -160px; }
242
+ .bsf_element .ui-icon-eject { background-position: -112px -160px; }
243
+ .bsf_element .ui-icon-volume-off { background-position: -128px -160px; }
244
+ .bsf_element .ui-icon-volume-on { background-position: -144px -160px; }
245
+ .bsf_element .ui-icon-power { background-position: 0 -176px; }
246
+ .bsf_element .ui-icon-signal-diag { background-position: -16px -176px; }
247
+ .bsf_element .ui-icon-signal { background-position: -32px -176px; }
248
+ .bsf_element .ui-icon-battery-0 { background-position: -48px -176px; }
249
+ .bsf_element .ui-icon-battery-1 { background-position: -64px -176px; }
250
+ .bsf_element .ui-icon-battery-2 { background-position: -80px -176px; }
251
+ .bsf_element .ui-icon-battery-3 { background-position: -96px -176px; }
252
+ .bsf_element .ui-icon-circle-plus { background-position: 0 -192px; }
253
+ .bsf_element .ui-icon-circle-minus { background-position: -16px -192px; }
254
+ .bsf_element .ui-icon-circle-close { background-position: -32px -192px; }
255
+ .bsf_element .ui-icon-circle-triangle-e { background-position: -48px -192px; }
256
+ .bsf_element .ui-icon-circle-triangle-s { background-position: -64px -192px; }
257
+ .bsf_element .ui-icon-circle-triangle-w { background-position: -80px -192px; }
258
+ .bsf_element .ui-icon-circle-triangle-n { background-position: -96px -192px; }
259
+ .bsf_element .ui-icon-circle-arrow-e { background-position: -112px -192px; }
260
+ .bsf_element .ui-icon-circle-arrow-s { background-position: -128px -192px; }
261
+ .bsf_element .ui-icon-circle-arrow-w { background-position: -144px -192px; }
262
+ .bsf_element .ui-icon-circle-arrow-n { background-position: -160px -192px; }
263
+ .bsf_element .ui-icon-circle-zoomin { background-position: -176px -192px; }
264
+ .bsf_element .ui-icon-circle-zoomout { background-position: -192px -192px; }
265
+ .bsf_element .ui-icon-circle-check { background-position: -208px -192px; }
266
+ .bsf_element .ui-icon-circlesmall-plus { background-position: 0 -208px; }
267
+ .bsf_element .ui-icon-circlesmall-minus { background-position: -16px -208px; }
268
+ .bsf_element .ui-icon-circlesmall-close { background-position: -32px -208px; }
269
+ .bsf_element .ui-icon-squaresmall-plus { background-position: -48px -208px; }
270
+ .bsf_element .ui-icon-squaresmall-minus { background-position: -64px -208px; }
271
+ .bsf_element .ui-icon-squaresmall-close { background-position: -80px -208px; }
272
+ .bsf_element .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
273
+ .bsf_element .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
274
+ .bsf_element .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
275
+ .bsf_element .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
276
+ .bsf_element .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
277
+ .bsf_element .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
278
+ .bsf_element .ui-corner-all, .bsf_element .ui-corner-top, .bsf_element .ui-corner-left, .bsf_element .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
279
+ .bsf_element .ui-corner-all, .bsf_element .ui-corner-top, .bsf_element .ui-corner-right, .bsf_element .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
280
+ .bsf_element .ui-corner-all, .bsf_element .ui-corner-bottom, .bsf_element .ui-corner-left, .bsf_element .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
281
+ .bsf_element .ui-corner-all, .bsf_element .ui-corner-bottom, .bsf_element .ui-corner-right, .bsf_element .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
282
+ .bsf_element .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
283
+ .bsf_element .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
284
+ .bsf_element .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
285
+ .bsf_element .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
286
+ .bsf_element .ui-datepicker .ui-datepicker-prev, .bsf_element .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
287
+ .bsf_element .ui-datepicker .ui-datepicker-prev-hover, .bsf_element .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
288
+ .bsf_element .ui-datepicker .ui-datepicker-prev { left:2px; }
289
+ .bsf_element .ui-datepicker .ui-datepicker-next { right:2px; }
290
+ .bsf_element .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
291
+ .bsf_element .ui-datepicker .ui-datepicker-next-hover { right:1px; }
292
+ .bsf_element .ui-datepicker .ui-datepicker-prev span, .bsf_element .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
293
+ .bsf_element .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
294
+ .bsf_element .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
295
+ .bsf_element .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
296
+ .bsf_element .ui-datepicker select.ui-datepicker-month,
297
+ .bsf_element .ui-datepicker select.ui-datepicker-year { width: 49%;}
298
+ .bsf_element .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
299
+ .bsf_element .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
300
+ .bsf_element .ui-datepicker td { border: 0; padding: 1px; }
301
+ .bsf_element .ui-datepicker td span, .bsf_element .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
302
+ .bsf_element .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
303
+ .bsf_element .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
304
+ .bsf_element .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
305
+ .bsf_element .ui-datepicker.ui-datepicker-multi { width:auto; }
306
+ .bsf_element .ui-datepicker-multi .ui-datepicker-group { float:left; }
307
+ .bsf_element .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
308
+ .bsf_element .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
309
+ .bsf_element .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
310
+ .bsf_element .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
311
+ .bsf_element .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
312
+ .bsf_element .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
313
+ .bsf_element .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
314
+ .bsf_element .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
315
+ .bsf_element .ui-datepicker-rtl { direction: rtl; }
316
+ .bsf_element .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
317
+ .bsf_element .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
318
+ .bsf_element .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
319
+ .bsf_element .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
320
+ .bsf_element .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
321
+ .bsf_element .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
322
+ .bsf_element .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
323
+ .bsf_element .ui-datepicker-rtl .ui-datepicker-group { float:right; }
324
+ .bsf_element .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
325
+ .bsf_element .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
326
+ .bsf_element .ui-datepicker-cover {
327
+ display: none; /*sorry for IE5*/
328
+ display/**/: block; /*sorry for IE5*/
329
+ position: absolute; /*must have*/
330
+ z-index: -1; /*must have*/
331
+ filter: mask(); /*must have*/
332
+ top: -4px; /*must have*/
333
+ left: -4px; /*must have*/
334
+ width: 200px; /*must have*/
335
+ height: 200px; /*must have*/
336
+ }
admin/images/code-in-page.php.png ADDED
Binary file
admin/images/code-in-single.php.png ADDED
Binary file
admin/images/icon.png ADDED
Binary file
admin/images/icon_32.png ADDED
Binary file
admin/images/sidebar.jpg ADDED
Binary file
admin/index.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //enqueues the scripts and styles in admin dashboard
3
+ function bsf_admin_styles() {
4
+ // wp_enqueue_style( 'ui_style' );
5
+ wp_enqueue_style( 'star_style' );
6
+ wp_enqueue_script( 'bsf_jquery' );
7
+ wp_enqueue_script( 'bsf_jquery_ui' );
8
+ wp_enqueue_script( 'bsf_jquery_star' );
9
+
10
+ }
11
+ //The Main Admin Dashboard for Rich Snippets Plugin
12
+ function rich_snippet_dashboard() {
13
+ $plugins_url = plugins_url();
14
+ echo '<div class="wrap">';
15
+ echo '<div id="star-icons-32" class="icon32"></div><h2>'.__("All in One Rich Snippets Dashboard","rich-snippets").'</h2>';
16
+ echo '<div class="clear"></div><div id="tabs">';
17
+ echo '<ul class="subsubsub">
18
+ <li class="active"><a id="t1" class="current" href="#tab-1">'.__(" How to Use","rich-snippets").'</a> |</li>
19
+ <li class="active"><a id="t2" class="" href="#tab-2">'.__("FAQs","rich-snippets").'</a> |</li>
20
+ <li class="active"><a id="t3" class="" href="#tab-3">'.__("Get in Touch","rich-snippets").'</a></li>
21
+ </ul>
22
+ <div class="clear"></div>
23
+ <div id="tab-1">
24
+ <table class="wp-list-table widefat fixed">
25
+ <thead> <tr><th>'.__("<span>Usage Instructions</span>","rich-snippets").'</th></tr></thead>
26
+ <tbody><tr><td><h3>'.__("Notice that you have a new meta box below the field where you enter content for your post or page.","rich-snippets").'</h3>
27
+ <img src="'.plugins_url("/all-in-one-schema.org-rich-snippets/screenshot-1.png").'"/>
28
+ <h3>'.__("Select type of your content.","rich-snippets").'</h3>
29
+ <img src="'.plugins_url("/all-in-one-schema.org-rich-snippets/screenshot-2.png").'"/>
30
+ <h3>'.__("Fill in as much data as you can","rich-snippets").'</h3>
31
+ <img src="'.plugins_url("/all-in-one-schema.org-rich-snippets/screenshot-3.png").'"/>
32
+ <h3>'.__("And publish! Isn't that simple?").'</h3>
33
+ </td></tr></tbody>
34
+ </table>
35
+ </div>
36
+ <div id="tab-2">
37
+ <table class="wp-list-table widefat fixed">
38
+ <thead> <tr><th>'.__("<span>Plugins FAQs</span>","rich-snippets").'</th></tr></thead>
39
+ <tbody> <tr><td><ul><li><strong>'.__("How much time would it take to show up rich snippets for my posts?","rich-snippets").'</strong></li>
40
+ <p>'.__("Most probably as soon as Google Crawls it.","rich-snippets").'</p>
41
+ <li><strong>'.__("Where I can see preview of my search results?","rich-snippets").'</strong></li>
42
+ <p>'.__("Here: <a href='http://www.google.com/webmasters/tools/richsnippets'>http://www.google.com/webmasters/tools/richsnippets</a>","rich-snippets").'</p>
43
+ <li><strong>'.__("Do I have to fill in all the details?","rich-snippets").'</strong></li>
44
+ <p>'.__("No. Though some fields are mandatory and required to by Google in order to display rich snippet.","rich-snippets").'</p>
45
+ <li><strong>'.__("Can I edit CSS?","rich-snippets").'</strong></li>
46
+ <p>'.__("Of course. CSS file is in the plugin directory which you can edit easily.","rich-snippets").'</p>
47
+ </ul></td></tr></tbody>
48
+ </table>
49
+ </div>
50
+ <div id="tab-3">
51
+ <table class="wp-list-table widefat fixed">
52
+ <thead> <tr><th>'.__("<span>Get in touch with us</span>","rich-snippets").'</th></tr></thead>
53
+ <tbody> <tr><td>'.__("<p>For any support regarding our plugin, you can give a support request on the pulic forum provided by Wordpress.</p>","rich-snippets").'
54
+ '.__("<p>Click the following button to access the Support Forum.</p>","rich-snippets").'
55
+ '.__("<p><a class='button-primary' href='#'>Support Forum</a></p>","rich-snippets").'
56
+ '.__("<p>Optionally, you can mail us on : </p><p><a class='button-primary' href='mailto:contact@brainstormforce.com'>contact@brainstormforce.com</a></p>").'</td></tr></tbody>
57
+ </table>
58
+ </div>
59
+ </div> ';
60
+ echo '<div id="sidebar"></div>';
61
+ echo '
62
+ <script language="javascript">
63
+ jQuery(function() {
64
+ jQuery( "#tabs" ).tabs();
65
+ jQuery( "#t1" ).click(function() {
66
+ jQuery(this).toggleClass("current");
67
+ jQuery("#t2").removeClass("current");
68
+ jQuery("#t3").removeClass("current");
69
+ });
70
+ jQuery( "#t2" ).click(function() {
71
+ jQuery(this).toggleClass("current");
72
+ jQuery("#t1").removeClass("current");
73
+ jQuery("#t3").removeClass("current");
74
+ });
75
+ jQuery( "#t3" ).click(function() {
76
+ jQuery(this).toggleClass("current");
77
+ jQuery("#t2").removeClass("current");
78
+ jQuery("#t1").removeClass("current");
79
+
80
+ });
81
+ });
82
+ </script>';
83
+ }
84
+ ?>
css/delete.gif ADDED
Binary file
css/jquery.rating.css ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */
2
+ div.rating-cancel,div.star-rating{float:left;width:17px;height:15px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
3
+ div.rating-cancel,div.rating-cancel a{background:url(delete.gif) no-repeat 0 -16px}
4
+ div.star-rating,div.star-rating a{background:url(star.gif) no-repeat 0 0px}
5
+ div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 0px;border:0}
6
+ div.star-rating-on a{background-position:0 -32px!important}
7
+ div.star-rating-hover a{background-position:0 -16px}
8
+ /* Read Only CSS */
9
+ div.star-rating-readonly a{cursor:default !important}
10
+ /* Partial Star CSS */
11
+ div.star-rating{background:transparent!important;overflow:hidden!important}
12
+ /* END jQuery.Rating Plugin CSS */
13
+
14
+ #tabs {
15
+ width:60%;
16
+ float:left;
17
+ margin-right:10px;
18
+ }
css/star.gif ADDED
Binary file
css/style.css ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @charset "utf-8";
2
+ /* CSS Document For Styling the Rich Snippets Data*/
3
+ table #tbl-rich-snippet {
4
+ width:100%;
5
+ }
6
+ tr .tbl-bsf-tr{
7
+ border:1px dotted #ddd;
8
+ }
9
+ td .tbl-bdf-td{
10
+ padding:5px;
11
+ }
12
+ .tbl-img{
13
+ width:170px;
14
+ }
15
+ .tbl-addrs-tr{
16
+ border:0px;
17
+ }
functions.php ADDED
@@ -0,0 +1,322 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //add_filter( 'bsf_meta_boxes', 'bsf_review_metaboxes' );
3
+ /**
4
+ * Define the metabox and field configurations.
5
+ *
6
+ * @param array $meta_boxes
7
+ * @return array
8
+ */
9
+
10
+ add_action( 'init', 'bsf_initialize_bsf_meta_boxes', 9999 );
11
+ /**
12
+ * Initialize the metabox class.
13
+ */
14
+ function bsf_initialize_bsf_meta_boxes() {
15
+
16
+ if ( ! class_exists( 'bsf_Meta_Box' ) )
17
+ require_once 'init.php';
18
+ }
19
+ //Function to display the rich snippet output below the content
20
+ function display_rich_snippet($content) {
21
+ global $post;
22
+ $id = $post->ID;
23
+ $type = get_post_meta($id, '_bsf_post_type', true);
24
+ if($type == '1')
25
+ {
26
+ global $post;
27
+ // echo $post->ID;
28
+ $review = $content;
29
+ $review .= '<div><h3>Review Summary :</h3></div>';
30
+ $review .= "<div xmlns:v='http://rdf.data-vocabulary.org/#' typeof='v:Review'><table style='width:100%;'>";
31
+ $item = get_post_meta( $post->ID, '_bsf_item_name', true );
32
+ $rating = get_post_meta( $post->ID, '_bsf_rating', true );
33
+ $desc = get_post_meta( $post->ID, '_bsf_item_desc', true );
34
+ $reviewer = get_post_meta( $post->ID, '_bsf_item_reviewer', true);
35
+ $post_date = get_the_date('Y-m-d');
36
+ if(trim($reviewer) != "")
37
+ $review .= "<tr style='border:1px solid #ddd;'><td style='padding:5px;'>Reviewer : </td><td><span property='v:reviewer'>".$reviewer."</span></td></tr>";
38
+ $review .= "<tr style='border:1px solid #ddd;'><td style='padding:5px;'>Review Date : </td><td><span property='v:dtreviewed' content='".$post_date."'>".$post_date."</span></td></tr>";
39
+ if(trim($item) != "")
40
+ $review .= "<tr style='border:1px solid #ddd;'><td style='padding:5px;'>Item Name : </td><td><span property='v:itemreviewed'>".$item."</span></td></tr>";
41
+ if(trim($rating) != "")
42
+ $review .= "<tr style='border:1px solid #ddd;'><td style='padding:5px;'>Author Rating: </td><td><span property='v:rating'>".$rating."</span></td></tr>";
43
+ if(trim($desc) != "")
44
+ $review .= "<tr style='border:1px solid #ddd;'><td style='padding:5px;'>Item Description: </td><td><span property='v:summary'>".$desc."</span></td></tr>";
45
+ $review .= "</table></div>";
46
+ return $review;
47
+ }
48
+ else if($type == '2')
49
+ {
50
+ global $post;
51
+ $event = $content;
52
+ $event .= '<div><h3>Event Summary :</h3></div>';
53
+ $event .= '<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Event"><table id="tbl-rich-snippet">';
54
+ $event_title = get_post_meta( $post->ID, '_bsf_event_title', true );
55
+ $event_org = get_post_meta( $post->ID, '_bsf_event_organization', true );
56
+ $event_street = get_post_meta( $post->ID, '_bsf_event_street', true );
57
+ $event_local = get_post_meta( $post->ID, '_bsf_event_local', true );
58
+ $event_region = get_post_meta( $post->ID, '_bsf_event_region', true );
59
+ $event_desc = get_post_meta( $post->ID, '_bsf_event_desc', true );
60
+ $event_start_date = get_post_meta( $post->ID, '_bsf_event_start_date', true );
61
+ $event_end_date = get_post_meta( $post->ID, '_bsf_event_end_date', true );
62
+ $event_geo_latitude = get_post_meta( $post->ID, '_bsf_event_geo_latitude', true );
63
+ $event_geo_longitude = get_post_meta( $post->ID, '_bsf_event_geo_longitude', true );
64
+ $event_photo = get_post_meta( $post->ID, '_bsf_event_photo', true );
65
+ if(trim($event_photo) != "")
66
+ $event .= '<tr class="tbl-bsf-tr" align="center"><td colspan="2" class="tbl-bsf-td"> <img src="'.$event_photo.'" rel="v:photo"></td></tr>';
67
+ if(trim($event_title) != "")
68
+ $event .= '<tr class="tbl-bsf-tr"><td style="padding:5px; width:30%;">Event : </td><td><span property="v:summary">'.$event_title.'</span></td></tr>';
69
+ if(trim($event_desc) != "")
70
+ $event .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Event Description : </td><td class="tbl-bsf-td"><span property="v:description">'.$event_desc.'</span></td></tr>';
71
+ if(trim($event_org) != "")
72
+ $event .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Location : </td><td>
73
+ <span rel="v:location">
74
+ <span typeof="v:Organization">
75
+ <span property="v:name">'.$event_org.'</span>,</td></tr>';
76
+ if(trim($event_street) != "")
77
+ $event .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td"></td><td class="tbl-bsf-td"><span rel="v:address">
78
+ <span typeof="v:Address">
79
+ <span property="v:street-address">'.$event_street.'</span>,</td></tr>';
80
+ if(trim($event_local) != "")
81
+ $event .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td"></td><td class="tbl-bsf-td"> <span property="v:locality">'.$event_local.'</span>,</td></tr>';
82
+ if(trim($event_region) != "")
83
+ $event .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td"></td><td class="tbl-bsf-td"> <span property="v:region">'.$event_region.'</span>
84
+ </span>
85
+ </span></td></tr>';
86
+ if(trim($event_geo_latitude) != "")
87
+ $event .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">GEO : </td><td><span rel="v:geo">
88
+ <span typeof="v:Geo">
89
+ <span property="v:latitude" content="'.$event_geo_latitude.'">'.$event_geo_latitude.'</span> - ';
90
+ if(trim($event_geo_longitude) != "")
91
+ $event .= '<span property="v:longitude" content="'.$event_geo_longitude.'">'.$event_geo_longitude.'</span>
92
+ </span>
93
+ </span>
94
+ </span>
95
+ </span> </td></tr>';
96
+ if(trim($event_start_date) != "")
97
+ $event .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Start Date : </td><td><span property="v:startDate" content="'.$event_start_date.'">'.$event_start_date.'</span></td></tr>';
98
+ if(trim($event_end_date) != "")
99
+ $event .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">End Date : </td><td><span property="v:endDate" content="'.$event_end_date.'">'.$event_end_date.'</span></td></tr>';
100
+ $event .= '</table></div>';
101
+ return $event;
102
+ }
103
+ else if($type == '4')
104
+ {
105
+ global $post;
106
+ $organization = $content;
107
+ $organization .= '<div><h3>Organization Brief :</h3></div>';
108
+ $organization .= '<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Organization"><table id="tbl-rich-snippet">';
109
+ $org_name = get_post_meta( $post->ID,'_bsf_organization_name', true );
110
+ $org_url = get_post_meta( $post->ID,'_bsf_organization_url', true );
111
+ $org_tel = get_post_meta( $post->ID,'_bsf_organization_tel', true );
112
+ $org_street = get_post_meta( $post->ID,'_bsf_organization_street', true );
113
+ $org_local = get_post_meta( $post->ID,'_bsf_organization_local', true );
114
+ $org_region = get_post_meta( $post->ID,'_bsf_organization_region', true );
115
+ $org_zip = get_post_meta( $post->ID,'_bsf_organization_zip', true );
116
+ $org_country = get_post_meta( $post->ID,'_bsf_organization_country', true );
117
+ $org_latitude = get_post_meta( $post->ID,'_bsf_organization_latitude', true );
118
+ $org_longitude = get_post_meta( $post->ID,'_bsf_organization_longitude', true );
119
+ if(trim($org_name) != "")
120
+ $organization .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Organization Name : </td><td><span property="v:name">'.$org_name.'</span></td></tr>';
121
+ if(trim($org_url) != "")
122
+ $organization .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Website : </td><td><a href="'.$org_url.'" rel="v:url">'.$org_url.'</a></td></tr>';
123
+ if(trim($org_tel) != "")
124
+ $organization .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Telephone No. : </td><td><span property="v:tel">'.$org_tel.'</span></td></tr>';
125
+ if(trim($org_street) != "")
126
+ $organization .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Address : </td><td>
127
+ <span rel="v:address">
128
+ <span typeof="v:Address">
129
+ <span property="v:street-address">'.$org_street.'</span></td></tr>';
130
+ if(trim($org_local) != "")
131
+ $organization .= '<tr class="tbl-bsf-tr tbl-addrs-tr"><td class="tbl-bsf-td"></td><td class="tbl-bsf-td"><span property="v:locality">'.$org_local.'</span></td></tr>';
132
+ if(trim($org_region) != "")
133
+ $organization .= '<tr class="tbl-bsf-tr tbl-addrs-tr"><td class="tbl-bsf-td"></td><td class="tbl-bsf-td tbl-addrs-tr"><span property="v:region">'.$org_region.'</span></td></tr>';
134
+ if(trim($org_zip) != "")
135
+ $organization .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td"></td><td class="tbl-bsf-td"><span property="v:postal-code">'.$org_zip.'</span></td></tr>';
136
+ if(trim($org_country) != "")
137
+ $organization .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td"></td><td class="tbl-bsf-td"><span property="v:country-name">'.$org_country.'</span>
138
+ </span>
139
+ </span></td></tr>';
140
+ if(trim($org_latitude) != "")
141
+ $organization .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">GEO Location : </td><td>
142
+ <span rel="v:geo">
143
+ <span typeof="v:Geo">
144
+ <span property="v:latitude" content="'.$org_latitude.'">'.$org_latitude.'</span> - ';
145
+ if(trim($org_longitude) != "")
146
+ $organization .= '<span property="v:longitude" content="'.$org_longitude.'">'.$org_longitude.'</span>
147
+ </span>
148
+ </span></td></tr>';
149
+ $organization .= '</table></div>';
150
+ return $organization;
151
+ }
152
+ else if($type == '5')
153
+ {
154
+ global $post;
155
+ $people = $content;
156
+ $people .= '<div><h3>Short Bio:</h3></div>';
157
+ $people .= '<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Person"><table id="tbl-rich-snippet">';
158
+ $people_fn = get_post_meta( $post->ID, '_bsf_people_fn', true );
159
+ $people_nickname = get_post_meta( $post->ID, '_bsf_people_nickname', true );
160
+ $people_photo = get_post_meta( $post->ID, '_bsf_people_photo', true );
161
+ $people_job_title = get_post_meta( $post->ID, '_bsf_people_job_title', true );
162
+ $people_website = get_post_meta( $post->ID, '_bsf_people_website', true );
163
+ $people_company = get_post_meta( $post->ID, '_bsf_people_company', true );
164
+ $people_local = get_post_meta( $post->ID, '_bsf_people_local', true );
165
+ $people_region = get_post_meta( $post->ID, '_bsf_people_region', true );
166
+ if(trim($people_photo) != "")
167
+ $people .= '<tr class="tbl-bsf-tr"><td rowspan="6" class="tbl-bsf-td tbl-img"><img width="160" height="160" src="'.$people_photo.'" rel="v:photo" /></td></tr>';
168
+ if(trim($people_fn) != "")
169
+ $people .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td"> <span property="v:name">'.$people_fn.'</span>';
170
+ if(trim($people_nickname) != "")
171
+ $people .= ' (<span property="v:nickname">'.$people_nickname.'</span>)</td></tr>';
172
+ if(trim($people_website) != "")
173
+ $people .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td"></td><td class="tbl-bsf-td"> <a href="'.$people_website.'" rel="v:url">'.$people_website.'</a></td></tr>';
174
+ if(trim($people_job_title) != "")
175
+ $people .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td"></td><td class="tbl-bsf-td"><span property="v:title">'.$people_job_title.'</span></td></tr>';
176
+ if(trim($people_company) != "")
177
+ $people .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td"></td><td class="tbl-bsf-td"><span property="v:affiliation">'.$people_company.'</span></td></tr>';
178
+ if(trim($people_local) != "")
179
+ $people .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td"></td><td class="tbl-bsf-td">
180
+ <span rel="v:address">
181
+ <span typeof="v:Address">
182
+ <span property="v:locality">'.$people_local.'</span>, ';
183
+ if(trim($people_region) != "")
184
+ $people .= '<span property="v:region">'.$people_region.'</span>
185
+ </span>
186
+ </span></td></tr>';
187
+ $people .= '</table></div>';
188
+ return $people;
189
+ }
190
+ else if($type == '6')
191
+ {
192
+ global $post;
193
+ $product = $content;
194
+ $product .= '<div><h3>Product Summary :</h3></div>';
195
+ $product .= '<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Product"><table id="tbl-rich-snippet">';
196
+ $product_rating = get_post_meta( $post->ID, '_bsf_product_rating', true);
197
+ $product_brand = get_post_meta( $post->ID, '_bsf_product_brand', true);
198
+ $product_name = get_post_meta( $post->ID, '_bsf_product_name', true);
199
+ $product_image = get_post_meta($post->ID, '_bsf_product_image', true);
200
+ $product_cat = get_post_meta($post->ID, '_bsf_product_cat', true);
201
+ $product_price = get_post_meta($post->ID, '_bsf_product_price', true);
202
+ $product_status = get_post_meta($post->ID, '_bsf_product_status', true);
203
+ if(trim($product_status) == "out_of_stock")
204
+ $availability = "Out of Stock";
205
+ else if(trim($product_status) == "in_stock")
206
+ $availability = "Available in Stock";
207
+ else if(trim($product_status) == "instore_only")
208
+ $availability = "Available in Store Only";
209
+ else if(trim($product_status) == "preorder")
210
+ $availability = "Pre-Order Only";
211
+
212
+ if(trim($product_rating) != "")
213
+ $product .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Rating : </td><td class="tbl-bsf-td"><span property="v:rating">'.$product_rating.'</span></td></tr>';
214
+ if(trim($product_brand) != "")
215
+ $product .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Brand Name : </td><td class="tbl-bsf-td"><span property="v:brand">'.$product_brand.'</span></td></tr>';
216
+ if(trim($product_name) != "")
217
+ $product .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Product Name : </td><td class="tbl-bsf-td"><span property="v:name">'.$product_name.'</span></td></tr>';
218
+ if(trim($product_cat) != "")
219
+ $product .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Category : </td><td class="tbl-bsf-td"><span property="v:category">'.$product_cat.'</span></td></tr>';
220
+ if(trim($product_image) != "")
221
+ $product .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Price : </td><td class="tbl-bsf-td"><span typeof="currency" content="USD"><span property="v:price">'.$product_price.'</span></span></td></tr>';
222
+ if(trim($product_status) != "")
223
+ $product .= '<tr class="tbl-bsf-tr"><td class="tbl-bsf-td">Availability : </td><td class="tbl-bsf-td"><span property="v:availability" content="'.$product_status.'">'.$availability.'</span></td></tr>';
224
+ if(trim($product_image) != "")
225
+ $product .= '<tr class="tbl-bsf-tr"><td colspan="2" class="tbl-bsf-td"><img src="'.$product_image.'" rel="v:image" /></td></tr>';
226
+ $product .= '</table></div>';
227
+ return $product;
228
+ }
229
+ else if($type == '7')
230
+ {
231
+ global $post;
232
+ $recipe = $content;
233
+ $recipe .= '<div><h3>Recipe in Short :</h3></div>';
234
+ $recipe .= '<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Recipe"><table id="tbl-rich-snippet">';
235
+ $recipes_name = get_post_meta( $post->ID, '_bsf_recipes_name', true );
236
+ $recipes_preptime = get_post_meta( $post->ID, '_bsf_recipes_preptime', true );
237
+ $recipes_cooktime = get_post_meta( $post->ID, '_bsf_recipes_cooktime', true );
238
+ $recipes_totaltime = get_post_meta( $post->ID, '_bsf_recipes_totaltime', true );
239
+ $recipes_photo = get_post_meta( $post->ID, '_bsf_recipes_photo', true );
240
+ $recipes_desc = get_post_meta( $post->ID, '_bsf_recipes_desc', true );
241
+ $recipes_ingredient = get_post_meta( $post->ID, '_bsf_recipes_ingredient', true );
242
+ if(trim($recipes_photo) != "")
243
+ $recipe .= '<tr class="tbl-bsf-tr"><td rowspan="8" style="padding:5px; width:180px;"><img width="160" height="160" src="'.$recipes_photo.'" rel="v:photo" /></td></tr>';
244
+ if(trim($recipes_name) != "")
245
+ $recipe .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Recipe : <h1 property="v:name">'.$recipes_name.'</h1></td></tr>';
246
+ $recipe .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Published on : <span property="v:published" content="'.get_the_date('Y-m-d').'">'.get_the_date('Y-m-d').'</span></td></tr>';
247
+ if(trim($recipes_preptime) != "")
248
+ $recipe .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Prep. Time : <span property="v:prepTime" content="'.$recipes_preptime.'">'.$recipes_preptime.'</span></td></tr>';
249
+ if(trim($recipes_cooktime) != "")
250
+ $recipe .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Cook Time : <span property="v:cookTime" content="'.$recipes_cooktime.'">'.$recipes_cooktime.'</span></td></tr>';
251
+ if(trim($recipes_totaltime) != "")
252
+ $recipe .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Total Time : '.$recipes_totaltime.'</td></tr>';
253
+ if(trim($recipes_ingredient) != "")
254
+ $recipe .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Ingredients Used : '.$recipes_ingredient.'</td></tr>';
255
+ if(trim($recipes_desc) != "")
256
+ $recipe .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Summary : <span property="v:summary">'.$recipes_desc.'</span></td></tr>';
257
+ $recipe .= '</table></div>';
258
+ return $recipe;
259
+ }
260
+ else if($type == '8')
261
+ {
262
+ global $post;
263
+ $software = $content;
264
+ $software .= '<div><h3>Software Overview :</h3></div>';
265
+ $software .= '<div itemscope itemtype="http://schema.org/SoftwareApplication"><table id="tbl-rich-snippet">';
266
+ $software_rating = get_post_meta( $post->ID, '_bsf_software_rating', true);
267
+ $software_name = get_post_meta( $post->ID, '_bsf_software_name', true );
268
+ $software_desc = get_post_meta( $post->ID, '_bsf_software_desc', true );
269
+ $software_landing = get_post_meta( $post->ID, '_bsf_software_landing', true );
270
+ $software_image = get_post_meta( $post->ID, '_bsf_software_image', true );
271
+ $software_price = get_post_meta( $post->ID, '_bsf_software_price', true );
272
+ $software_os = get_post_meta( $post->ID, '_bsf_software_os', true );
273
+ if(trim($software_image) != "")
274
+ $software .= '<tr class="tbl-bsf-tr"><td rowspan="7" style="padding:5px; width:180px;"><img width="180" height="180" src="'.$software_image.'" itemprop="image" /></td></tr>';
275
+ if(trim($software_rating) != "")
276
+ $software .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Rating : <span itemprop="ratingValue">'.$software_rating.'</span></td></tr>';
277
+ if(trim($software_name) != "")
278
+ $software .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Name : <span itemprop="name">'.$software_name.'</span></td></tr>';
279
+ if(trim($software_os) != "")
280
+ $software .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Operating System : <span itemprop="operatingSystems">'.$software_os.'</span></td></tr>';
281
+ if(trim($software_price) != "")
282
+ $software .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Price : <span itemprop="price">'.$software_price.'</span></td></tr>';
283
+ if(trim($software_desc) != "")
284
+ $software .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Description : <span itemprop="description">'.$software_desc.'</span></td></tr>';
285
+ if(trim($software_landing) != "")
286
+ $software .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td">Landing Page : <a itemprop="url href="'.$software_landing.'">'.$software_landing.'</a></td></tr>';
287
+ $software .= '</table></div>';
288
+ return $software;
289
+ }
290
+ else if($type == '9')
291
+ {
292
+ global $post;
293
+ $video = $content;
294
+ $video .= '<div><h3>Video Summary :</h3></div>';
295
+ $video .= '<div itemprop="video" itemscope itemtype="http://schema.org/VideoObject"><table id="tbl-rich-snippet">';
296
+ $video_title = get_post_meta( $post->ID, '_bsf_video_title', true );
297
+ $video_desc = get_post_meta( $post->ID, '_bsf_video_desc', true );
298
+ $video_thumb = get_post_meta( $post->ID, '_bsf_video_thumb', true );
299
+ $video_url = get_post_meta( $post->ID, '_bsf_video_url', true );
300
+ $video_duration = get_post_meta( $post->ID, '_bsf_video_duration', true );
301
+ $video_date = get_post_meta( $post->ID, '_bsf_video_date', true );
302
+ if(trim($video_url) != "")
303
+ $video .= '<tr class="tbl-bsf-tr"><td rowspan="3" style="padding:5px; width:180px;"><a itemprop="url" href="'.$video_url.'"><img width="220" height="160" src="'.$video_thumb.'"></a></td></tr>';
304
+ if(trim($video_title) != "")
305
+ $video .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td"><h2 itemprop="name">'.$video_title.'</h2></td></tr>';
306
+ if(trim($video_desc) != "")
307
+ $video .= '<tr class="tbl-bsf-tr"><td></td><td class="tbl-bsf-td"><p itemprop="description">'.$video_desc.'</p></td></tr>';
308
+ if(trim($video_thumb) != "")
309
+ $video .= '<meta itemprop="thumbnail" content="'.$video_thumb.'">';
310
+ if(trim($video_duration) != "")
311
+ $video .= '<meta itemprop="duration" content="'.$video_duration.'">';
312
+ if(trim($video_date) != "")
313
+ $video .= '<meta itemprop="date" content="'.$video_date.'">';
314
+ $video .= '</table></div>';
315
+ return $video;
316
+ } else {
317
+ return $content;
318
+ }
319
+ }
320
+ //Filter the content and return with rich snippet output
321
+ add_filter('the_content','display_rich_snippet');
322
+ require_once('meta-boxes.php');
images/gray-32.png ADDED
Binary file
images/gray.png ADDED
Binary file
images/ico-delete.png ADDED
Binary file
images/icon.png ADDED
Binary file
images/star.png ADDED
Binary file
index.php ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: All In One Schema.org Rich Snippets
4
+ Plugin URI: http://www.brainstormforce.com
5
+ Description: The All in One Rich Snippets gives the power to the blog author to control the rich snippets to be shown in the search results by the search engines.
6
+ Version: 1.0
7
+ Author: Brainstorm Force
8
+ Author URI: http://www.brainstormforce.com
9
+ License: GPL2
10
+ */
11
+ ?>
12
+ <?php
13
+ /* Copyright 2013 All in One Rich Snippets (email : nitiny@brainstormforce.com)
14
+
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License, version 2, as
17
+ published by the Free Software Foundation.
18
+
19
+ This program is distributed in the hope that it will be useful,
20
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ GNU General Public License for more details.
23
+
24
+ You should have received a copy of the GNU General Public License
25
+ along with this program; if not, write to the Free Software
26
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
+ */
28
+ ?>
29
+ <?php
30
+ if ( !class_exists( "RichSnippets" ) )
31
+ {
32
+ class RichSnippets
33
+ {
34
+ function __construct() // Constructor
35
+ {
36
+ register_activation_hook( __FILE__, array($this, 'run_on_activate') );
37
+
38
+ add_action( 'admin_head', array( $this, 'star_icons') );
39
+ // Add Admin Menu
40
+ add_action('admin_menu', array( $this, 'register_custom_menu_page') );
41
+
42
+ add_action( 'admin_init', array( $this, 'set_styles' ));
43
+
44
+ add_action( 'wp_head', array($this, 'frontend_style') );
45
+
46
+ add_filter('plugins_loaded', array( $this, 'rich_snippet_translation'));
47
+
48
+ add_action( 'admin_enqueue_scripts', array( $this, 'post_enqueue') );
49
+
50
+ add_action( 'admin_enqueue_scripts', array( $this, 'post_new_enqueue') );
51
+
52
+ $plugin = plugin_basename(__FILE__);
53
+ add_filter("plugin_action_links_$plugin", array( $this,'bsf_settings_link') );
54
+ }
55
+
56
+ function frontend_style() {
57
+ wp_register_style( 'bsf_style', plugins_url('/css/style.css', __FILE__) );
58
+ wp_enqueue_style('bsf_style');
59
+ }
60
+ function register_custom_menu_page()
61
+ {
62
+ require_once('admin/index.php');
63
+ $page = add_menu_page('All in One Rich Snippets Dashboard', 'Rich Snippets', 'administrator', 'rich_snippet_dashboard', 'rich_snippet_dashboard', 'div');
64
+ //Call the function to print the stylesheets and javascripts in only this plugins admin area
65
+ add_action( 'admin_print_styles-' . $page, 'bsf_admin_styles' );
66
+ }
67
+ // Add settings link on plugin page
68
+ function bsf_settings_link($links) {
69
+ $settings_link = '<a href="admin.php?page=rich_snippet_dashboard">Settings</a>';
70
+ array_unshift($links, $settings_link);
71
+ return $links;
72
+ }
73
+ function run_on_activate()
74
+ {
75
+ wp_enqueue_style('wp-pointer');
76
+ wp_enqueue_script('wp-pointer');
77
+ add_action('admin_print_footer_scripts', array( $this,'custom_print_footer_scripts') );
78
+ }
79
+
80
+ function custom_print_footer_scripts(){
81
+ $pointer_content = '<h3>Rich Snippets Installed !</h3>';
82
+ $pointer_content .= '<p>Check out this panel to know more about "All in One Schema.org Rich Snippets".</p>';
83
+ ?>
84
+ <script type="text/javascript">
85
+ //<![CDATA[
86
+ jQuery(document).ready( function(jQuery) {
87
+ jQuery('#all-in-one-rich-snippets').pointer({
88
+ content: '<?php echo $pointer_content; ?>',
89
+ position: 'top',
90
+ close: function() {
91
+ // This function is fired when you click the close button
92
+ }
93
+ }).pointer('open');
94
+ });
95
+ //]]>
96
+ </script>
97
+ <?php
98
+ }
99
+
100
+ //print the star rating style on post edit page
101
+ function post_enqueue($hook) {
102
+ if( 'post.php' != $hook )
103
+ return;
104
+ // wp_enqueue_script( 'bsf_jquery' );
105
+ wp_enqueue_script( 'jquery' );
106
+ wp_enqueue_script( 'bsf_jquery_star' );
107
+ wp_enqueue_script( 'bsf_toggle' );
108
+ wp_enqueue_style( 'star_style' );
109
+ }
110
+ function post_new_enqueue($hook) {
111
+ if('post-new.php' != $hook )
112
+ return;
113
+ // wp_enqueue_script( 'bsf_jquery' );
114
+ wp_enqueue_script( 'jquery' );
115
+ wp_enqueue_script( 'bsf_jquery_star' );
116
+ wp_enqueue_script( 'bsf_toggle' );
117
+ wp_enqueue_style( 'star_style' );
118
+ }
119
+
120
+ //Initialize the metabox class
121
+ function wp_initialize_bsf_meta_boxes() {
122
+ if ( ! class_exists( 'bsf_Meta_Box' ) )
123
+ require_once(plugin_dir_path( __FILE__ ) . 'init.php');
124
+ }
125
+
126
+ function set_styles() {
127
+ wp_register_style( 'star_style', plugins_url('/css/jquery.rating.css', __FILE__) );
128
+ wp_register_script( 'bsf_jquery_ui', plugins_url('/js/jquery-ui.js', __FILE__) );
129
+ wp_register_script( 'bsf_jquery_star', plugins_url('/js/jquery.rating.min.js', __FILE__) );
130
+ wp_register_script( 'bsf_toggle', plugins_url('/js/toggle.js', __FILE__) );
131
+ }
132
+
133
+
134
+ // Define icon styles for the custom post type
135
+ function star_icons() {
136
+ ?>
137
+ <style>
138
+ #toplevel_page_rich_snippet_dashboard .wp-menu-image {
139
+ background: url(<?php echo plugins_url('/images/star.png',__FILE__); ?>) no-repeat !important;
140
+ }
141
+ #toplevel_page_rich_snippet_dashboard:hover .wp-menu-image, #toplevel_page_rich_snippet_dashboard.wp-has-current-submenu .wp-menu-image {
142
+ background: url(<?php echo plugins_url('/images/star.png',__FILE__); ?>) no-repeat 0 -32px !important;
143
+ }
144
+ #toplevel_page_rich_snippet_dashboard .current .wp-menu-image, #toplevel_page_rich_snippet_dashboard.wp-has-current-submenu .wp-menu-image {
145
+ background: url(<?php echo plugins_url('/images/star.png',__FILE__); ?>) no-repeat 0 -32px !important;
146
+ }
147
+ #star-icons-32.icon32 {background: url(<?php echo plugins_url('/images/gray-32.png',__FILE__); ?>) no-repeat;}
148
+ </style>
149
+
150
+ <?php }
151
+
152
+ /* Translation */
153
+ function rich_snippet_translation()
154
+ {
155
+ // Load Translation File
156
+ load_plugin_textdomain('rich-snippets', false, basename( dirname( __FILE__ ) ) . '/lang/' );
157
+ }
158
+ }
159
+ }
160
+
161
+ require_once('functions.php');
162
+
163
+ add_filter( 'bsf_meta_boxes', 'bsf_metaboxes' );
164
+
165
+ // Instantiating the Class
166
+ if (class_exists("RichSnippets")) {
167
+ $RichSnippets= new RichSnippets();
168
+ }
169
+
170
+ ?>
init.php ADDED
@@ -0,0 +1,632 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $meta_boxes = array();
3
+ $meta_boxes = apply_filters ( 'bsf_meta_boxes' , $meta_boxes );
4
+ foreach ( $meta_boxes as $meta_box ) {
5
+ $my_box = new bsf_Meta_Box( $meta_box );
6
+ }
7
+
8
+ /**
9
+ * Validate value of meta fields
10
+ * Define ALL validation methods inside this class and use the names of these
11
+ * methods in the definition of meta boxes (key 'validate_func' of each field)
12
+ */
13
+ class bsf_Meta_Box_Validate {
14
+ function check_text( $text ) {
15
+ if ($text != 'hello') {
16
+ return false;
17
+ }
18
+ return true;
19
+ }
20
+ }
21
+
22
+ /**
23
+ * Defines the url to which is used to load local resources.
24
+ * This may need to be filtered for local Window installations.
25
+ * If resources do not load, please check the wiki for details.
26
+ */
27
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
28
+ //winblows
29
+ define( 'BSF_META_BOX_URL', trailingslashit( str_replace( DIRECTORY_SEPARATOR, '/', str_replace( str_replace( '/', DIRECTORY_SEPARATOR, WP_CONTENT_DIR ), WP_CONTENT_URL, dirname(__FILE__) ) ) ) );
30
+
31
+ } else {
32
+ define( 'BSF_META_BOX_URL', apply_filters( 'bsf_meta_box_url', trailingslashit( str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, dirname( __FILE__ ) ) ) ) );
33
+ }
34
+
35
+ /**
36
+ * Create meta boxes
37
+ */
38
+ class bsf_Meta_Box {
39
+ protected $_meta_box;
40
+
41
+ function __construct( $meta_box ) {
42
+ if ( !is_admin() ) return;
43
+
44
+ $this->_meta_box = $meta_box;
45
+
46
+ $upload = false;
47
+ foreach ( $meta_box['fields'] as $field ) {
48
+ if ( $field['type'] == 'file' || $field['type'] == 'file_list' ) {
49
+ $upload = true;
50
+ break;
51
+ }
52
+ }
53
+
54
+ global $pagenow;
55
+ if ( $upload && in_array( $pagenow, array( 'page.php', 'page-new.php', 'post.php', 'post-new.php' ) ) ) {
56
+ add_action( 'admin_head', array( &$this, 'add_post_enctype' ) );
57
+ }
58
+
59
+ add_action( 'admin_menu', array( &$this, 'add' ) );
60
+ add_action( 'save_post', array( &$this, 'save' ) );
61
+
62
+ add_filter( 'bsf_show_on', array( &$this, 'add_for_id' ), 10, 2 );
63
+ add_filter( 'bsf_show_on', array( &$this, 'add_for_page_template' ), 10, 2 );
64
+ }
65
+
66
+ function add_post_enctype() {
67
+ echo '
68
+ <script type="text/javascript">
69
+ jQuery(document).ready(function(){
70
+ jQuery("#post").attr("enctype", "multipart/form-data");
71
+ jQuery("#post").attr("encoding", "multipart/form-data");
72
+ });
73
+ </script>';
74
+ }
75
+
76
+ // Add metaboxes
77
+ function add() {
78
+ $this->_meta_box['context'] = empty($this->_meta_box['context']) ? 'normal' : $this->_meta_box['context'];
79
+ $this->_meta_box['priority'] = empty($this->_meta_box['priority']) ? 'high' : $this->_meta_box['priority'];
80
+ $this->_meta_box['show_on'] = empty( $this->_meta_box['show_on'] ) ? array('key' => false, 'value' => false) : $this->_meta_box['show_on'];
81
+
82
+ foreach ( $this->_meta_box['pages'] as $page ) {
83
+ if( apply_filters( 'bsf_show_on', true, $this->_meta_box ) )
84
+ add_meta_box( $this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']) ;
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Show On Filters
90
+ * Use the 'bsf_show_on' filter to further refine the conditions under which a metabox is displayed.
91
+ * Below you can limit it by ID and page template
92
+ */
93
+
94
+ // Add for ID
95
+ function add_for_id( $display, $meta_box ) {
96
+ if ( 'id' !== $meta_box['show_on']['key'] )
97
+ return $display;
98
+
99
+ // If we're showing it based on ID, get the current ID
100
+ if( isset( $_GET['post'] ) ) $post_id = $_GET['post'];
101
+ elseif( isset( $_POST['post_ID'] ) ) $post_id = $_POST['post_ID'];
102
+ if( !isset( $post_id ) )
103
+ return false;
104
+
105
+ // If value isn't an array, turn it into one
106
+ $meta_box['show_on']['value'] = !is_array( $meta_box['show_on']['value'] ) ? array( $meta_box['show_on']['value'] ) : $meta_box['show_on']['value'];
107
+
108
+ // If current page id is in the included array, display the metabox
109
+
110
+ if ( in_array( $post_id, $meta_box['show_on']['value'] ) )
111
+ return true;
112
+ else
113
+ return false;
114
+ }
115
+
116
+ // Add for Page Template
117
+ function add_for_page_template( $display, $meta_box ) {
118
+ if( 'page-template' !== $meta_box['show_on']['key'] )
119
+ return $display;
120
+
121
+ // Get the current ID
122
+ if( isset( $_GET['post'] ) ) $post_id = $_GET['post'];
123
+ elseif( isset( $_POST['post_ID'] ) ) $post_id = $_POST['post_ID'];
124
+ if( !( isset( $post_id ) || is_page() ) ) return false;
125
+
126
+ // Get current template
127
+ $current_template = get_post_meta( $post_id, '_wp_page_template', true );
128
+
129
+ // If value isn't an array, turn it into one
130
+ $meta_box['show_on']['value'] = !is_array( $meta_box['show_on']['value'] ) ? array( $meta_box['show_on']['value'] ) : $meta_box['show_on']['value'];
131
+
132
+ // See if there's a match
133
+ if( in_array( $current_template, $meta_box['show_on']['value'] ) )
134
+ return true;
135
+ else
136
+ return false;
137
+ }
138
+
139
+ // Show fields
140
+ function show() {
141
+
142
+ global $post;
143
+
144
+ // Use nonce for verification
145
+ echo '<input type="hidden" name="wp_meta_box_nonce" value="', wp_create_nonce( basename(__FILE__) ), '" />';
146
+ echo '<table class="form-table bsf_metabox">';
147
+
148
+ foreach ( $this->_meta_box['fields'] as $field ) {
149
+ // Set up blank or default values for empty ones
150
+ if ( !isset( $field['name'] ) ) $field['name'] = '';
151
+ if ( !isset( $field['desc'] ) ) $field['desc'] = '';
152
+ if ( !isset( $field['std'] ) ) $field['std'] = '';
153
+ if ( 'file' == $field['type'] && !isset( $field['allow'] ) ) $field['allow'] = array( 'url', 'attachment' );
154
+ if ( 'file' == $field['type'] && !isset( $field['save_id'] ) ) $field['save_id'] = false;
155
+ if ( 'multicheck' == $field['type'] ) $field['multiple'] = true;
156
+
157
+ $meta = get_post_meta( $post->ID, $field['id'], 'multicheck' != $field['type'] /* If multicheck this can be multiple values */ );
158
+
159
+ echo '<tr class="', $field['class'],'">';
160
+
161
+ if ( $field['type'] == "title" ) {
162
+ echo '<td colspan="2">';
163
+ } else {
164
+ if( $this->_meta_box['show_names'] == true ) {
165
+ echo '<th style="width:18%"><label class="', $field['class'],'" for="', $field['id'], '">', $field['name'], '</label></th>';
166
+ }
167
+ echo '<td>';
168
+ }
169
+
170
+ switch ( $field['type'] ) {
171
+
172
+ case 'text':
173
+ echo '<input class="', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
174
+ break;
175
+ case 'text_small':
176
+ echo '<input class="bsf_text_small ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
177
+ break;
178
+ case 'text_medium':
179
+ echo '<input class="bsf_text_medium ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
180
+ break;
181
+ case 'text_date':
182
+ echo '<input class="bsf_text_small bsf_datepicker ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
183
+ break;
184
+ case 'text_date_timestamp':
185
+ echo '<input class="bsf_text_small bsf_datepicker ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
186
+ break;
187
+
188
+ case 'text_datetime_timestamp':
189
+ echo '<input class="bsf_text_small bsf_datepicker ', $field['class'],'" type="text" name="', $field['id'], '[date]" id="', $field['id'], '_date" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" />';
190
+ echo '<input class="bsf_timepicker text_time ', $field['class'],'" type="text" name="', $field['id'], '[time]" id="', $field['id'], '_time" value="', '' !== $meta ? date( 'h:i A', $meta ) : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'" >', $field['desc'], '</span>';
191
+ break;
192
+ case 'text_time':
193
+ echo '<input class="bsf_timepicker text_time ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
194
+ break;
195
+ case 'text_money':
196
+ echo '$ <input class="bsf_text_money ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
197
+ break;
198
+ case 'colorpicker':
199
+ $meta = '' !== $meta ? $meta : $field['std'];
200
+ $hex_color = '(([a-fA-F0-9]){3}){1,2}$';
201
+ if ( preg_match( '/^' . $hex_color . '/i', $meta ) ) // Value is just 123abc, so prepend #.
202
+ $meta = '#' . $meta;
203
+ elseif ( ! preg_match( '/^#' . $hex_color . '/i', $meta ) ) // Value doesn't match #123abc, so sanitize to just #.
204
+ $meta = "#";
205
+ echo '<input class="bsf_colorpicker bsf_text_small ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta, '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
206
+ break;
207
+ case 'textarea':
208
+ echo '<textarea class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10">', '' !== $meta ? $meta : $field['std'], '</textarea>','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
209
+ break;
210
+ case 'textarea_small':
211
+ echo '<textarea class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4">', '' !== $meta ? $meta : $field['std'], '</textarea>','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
212
+ break;
213
+ case 'textarea_code':
214
+ echo '<textarea class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10" class="bsf_textarea_code">', '' !== $meta ? $meta : $field['std'], '</textarea>','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
215
+ break;
216
+ case 'select':
217
+ if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
218
+ echo '<select class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '">';
219
+ foreach ($field['options'] as $option) {
220
+ echo '<option class="', $field['class'],'" value="', $option['value'], '"', $meta == $option['value'] ? ' selected="selected"' : '', '>', $option['name'], '</option>';
221
+ }
222
+ echo '</select>';
223
+ echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
224
+ break;
225
+ case 'radio_inline':
226
+ if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
227
+ echo '<div class="bsf_radio_inline ', $field['class'],'">';
228
+ $i = 1;
229
+ foreach ($field['options'] as $option) {
230
+ echo '<div class="bsf_radio_inline_option ', $field['class'],'"><input class="', $field['class'],'" type="radio" name="', $field['id'], '" id="', $field['id'], $i, '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' /><label class="', $field['class'],'" for="', $field['id'], $i, '">', $option['name'], '</label></div>';
231
+ $i++;
232
+ }
233
+ echo '</div>';
234
+ echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
235
+ break;
236
+ case 'radio':
237
+ if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
238
+ echo '<div class=class="', $field['class'],'"><ul>';
239
+ $i = 1;
240
+ foreach ($field['options'] as $option) {
241
+ if( $field['class'] == "star review" || $field['class'] == "star product" || $field['class'] == "star software")
242
+ $class = "star";
243
+ else
244
+ $class = $field['class'];
245
+ echo '<li class="', $field['class'],'">
246
+ <input class="', $class,'" type="radio" name="', $field['id'], '" id="', $field['id'], $i,'" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' /><label class="', $field['class'],'" for="', $field['id'], $i, '">', $option['name'].'</label> </li>';
247
+ $i++;
248
+ }
249
+ echo '</ul></div>';
250
+ echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
251
+ break;
252
+ case 'checkbox':
253
+ echo '<input type="checkbox" class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';
254
+ echo '<span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
255
+ break;
256
+ case 'multicheck':
257
+ echo '<ul class="', $field['class'],'">';
258
+ $i = 1;
259
+ foreach ( $field['options'] as $value => $name ) {
260
+ // Append `[]` to the name to get multiple values
261
+ // Use in_array() to check whether the current option should be checked
262
+ echo '<li class="', $field['class'],'"><input type="checkbox" class="', $field['class'],'" name="', $field['id'], '[]" id="', $field['id'], $i, '" value="', $value, '"', in_array( $value, $meta ) ? ' checked="checked"' : '', ' /><label class="', $field['class'],'" for="', $field['id'], $i, '">', $name, '</label></li>';
263
+ $i++;
264
+ }
265
+ echo '</ul>';
266
+ echo '<span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
267
+ break;
268
+ case 'title':
269
+ echo '<h5 class="bsf_metabox_title ', $field['class'],'">', $field['name'], '</h5>';
270
+ echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
271
+ break;
272
+ case 'wysiwyg':
273
+ wp_editor( $meta ? $meta : $field['std'], $field['id'], isset( $field['options'] ) ? $field['options'] : array() );
274
+ echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
275
+ break;
276
+ case 'taxonomy_select':
277
+ echo '<select class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '">';
278
+ $names= wp_get_object_terms( $post->ID, $field['taxonomy'] );
279
+ $terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
280
+ foreach ( $terms as $term ) {
281
+ if (!is_wp_error( $names ) && !empty( $names ) && !strcmp( $term->slug, $names[0]->slug ) ) {
282
+ echo '<option value="' . $term->slug . '" selected>' . $term->name . '</option>';
283
+ } else {
284
+ echo '<option value="' . $term->slug . ' ' , $meta == $term->slug ? $meta : ' ' ,' ">' . $term->name . '</option>';
285
+ }
286
+ }
287
+ echo '</select>';
288
+ echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
289
+ break;
290
+ case 'taxonomy_radio':
291
+ $names= wp_get_object_terms( $post->ID, $field['taxonomy'] );
292
+ $terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
293
+ echo '<ul class="', $field['class'],'">';
294
+ foreach ( $terms as $term ) {
295
+ if ( !is_wp_error( $names ) && !empty( $names ) && !strcmp( $term->slug, $names[0]->slug ) ) {
296
+ echo '<li class="', $field['class'],'"><input class="', $field['class'],'" type="radio" name="', $field['id'], '" value="'. $term->slug . '" checked>' . $term->name . '</li>';
297
+ } else {
298
+ echo '<li class="', $field['class'],'"><input class="', $field['class'],'" type="radio" name="', $field['id'], '" value="' . $term->slug . ' ' , $meta == $term->slug ? $meta : ' ' ,' ">' . $term->name .'</li>';
299
+ }
300
+ }
301
+ echo '</ul>';
302
+ echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
303
+ break;
304
+ case 'taxonomy_multicheck':
305
+ echo '<ul>';
306
+ $names = wp_get_object_terms( $post->ID, $field['taxonomy'] );
307
+ $terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
308
+ foreach ($terms as $term) {
309
+ echo '<li><input class="', $field['class'],'" type="checkbox" name="', $field['id'], '[]" id="', $field['id'], '" value="', $term->name , '"';
310
+ foreach ($names as $name) {
311
+ if ( $term->slug == $name->slug ){ echo ' checked="checked" ';};
312
+ }
313
+ echo' /><label>', $term->name , '</label></li>';
314
+ }
315
+ echo '</ul>';
316
+ echo '<span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
317
+ break;
318
+ case 'file_list':
319
+ echo '<input class="bsf_upload_file ', $field['class'],'" type="text" size="36" name="', $field['id'], '" value="" />';
320
+ echo '<input class="bsf_upload_button button ', $field['class'],'" type="button" value="Upload File" />';
321
+ echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
322
+ $args = array(
323
+ 'post_type' => 'attachment',
324
+ 'numberposts' => null,
325
+ 'post_status' => null,
326
+ 'post_parent' => $post->ID
327
+ );
328
+ $attachments = get_posts($args);
329
+ if ($attachments) {
330
+ echo '<ul class="attach_list">';
331
+ foreach ($attachments as $attachment) {
332
+ echo '<li>'.wp_get_attachment_link($attachment->ID, 'thumbnail', 0, 0, 'Download');
333
+ echo '<span>';
334
+ echo apply_filters('the_title', '&nbsp;'.$attachment->post_title);
335
+ echo '</span></li>';
336
+ }
337
+ echo '</ul>';
338
+ }
339
+ break;
340
+ case 'file':
341
+ $input_type_url = "hidden";
342
+ if ( 'url' == $field['allow'] || ( is_array( $field['allow'] ) && in_array( 'url', $field['allow'] ) ) )
343
+ $input_type_url="text";
344
+ echo '<input class="bsf_upload_file ', $field['class'],'" type="' . $input_type_url . '" size="45" id="', $field['id'], '" name="', $field['id'], '" value="', $meta, '" />';
345
+ echo '<input class="bsf_upload_button button ', $field['class'],'" type="button" value="Upload File" />';
346
+ echo '<input class="bsf_upload_file_id ', $field['class'],'" type="hidden" id="', $field['id'], '_id" name="', $field['id'], '_id" value="', get_post_meta( $post->ID, $field['id'] . "_id",true), '" />';
347
+ echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
348
+ echo '<div id="', $field['id'], '_status" class="bsf_media_status ', $field['class'],'">';
349
+ if ( $meta != '' ) {
350
+ $check_image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $meta );
351
+ if ( $check_image ) {
352
+ echo '<div class="img_status">';
353
+ echo '<img src="', $meta, '" alt="" />';
354
+ echo '<a href="#" class="bsf_remove_file_button ', $field['class'],'" rel="', $field['id'], '">Remove Image</a>';
355
+ echo '</div>';
356
+ } else {
357
+ $parts = explode( '/', $meta );
358
+ for( $i = 0; $i < count( $parts ); ++$i ) {
359
+ $title = $parts[$i];
360
+ }
361
+ echo 'File: <strong>', $title, '</strong>&nbsp;&nbsp;&nbsp; (<a href="', $meta, '" target="_blank" rel="external">Download</a> / <a href="#" class="bsf_remove_file_button" rel="', $field['id'], '">Remove</a>)';
362
+ }
363
+ }
364
+ echo '</div>';
365
+ break;
366
+ case 'oembed':
367
+ echo '<input class="bsf_oembed ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
368
+ echo '<p class="bsf-spinner spinner ', $field['class'],'"></p>';
369
+ echo '<div id="', $field['id'], '_status" class="bsf_media_status ui-helper-clearfix embed_wrap ', $field['class'],'">';
370
+ if ( $meta != '' ) {
371
+ $check_embed = $GLOBALS['wp_embed']->run_shortcode( '[embed]'. esc_url( $meta ) .'[/embed]' );
372
+ if ( $check_embed ) {
373
+ echo '<div class="embed_status ', $field['class'],'">';
374
+ echo $check_embed;
375
+ echo '<a href="#" class="bsf_remove_file_button ', $field['class'],'" rel="', $field['id'], '">Remove Embed</a>';
376
+ echo '</div>';
377
+ } else {
378
+ echo 'URL is not a valid oEmbed URL.';
379
+ }
380
+ }
381
+ echo '</div>';
382
+ break;
383
+
384
+ default:
385
+ do_action('bsf_render_' . $field['type'] , $field, $meta);
386
+ }
387
+
388
+ echo '</td>','</tr>';
389
+ }
390
+ echo '</table>';
391
+ }
392
+
393
+ // Save data from metabox
394
+ function save( $post_id) {
395
+
396
+ // verify nonce
397
+ if ( ! isset( $_POST['wp_meta_box_nonce'] ) || !wp_verify_nonce( $_POST['wp_meta_box_nonce'], basename(__FILE__) ) ) {
398
+ return $post_id;
399
+ }
400
+
401
+ // check autosave
402
+ if ( defined('DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
403
+ return $post_id;
404
+ }
405
+
406
+ // check permissions
407
+ if ( 'page' == $_POST['post_type'] ) {
408
+ if ( !current_user_can( 'edit_page', $post_id ) ) {
409
+ return $post_id;
410
+ }
411
+ } elseif ( !current_user_can( 'edit_post', $post_id ) ) {
412
+ return $post_id;
413
+ }
414
+
415
+ foreach ( $this->_meta_box['fields'] as $field ) {
416
+ $name = $field['id'];
417
+
418
+ if ( ! isset( $field['multiple'] ) )
419
+ $field['multiple'] = ( 'multicheck' == $field['type'] ) ? true : false;
420
+
421
+ $old = get_post_meta( $post_id, $name, !$field['multiple'] /* If multicheck this can be multiple values */ );
422
+ $new = isset( $_POST[$field['id']] ) ? $_POST[$field['id']] : null;
423
+
424
+ if ( in_array( $field['type'], array( 'taxonomy_select', 'taxonomy_radio', 'taxonomy_multicheck' ) ) ) {
425
+ $new = wp_set_object_terms( $post_id, $new, $field['taxonomy'] );
426
+ }
427
+
428
+ if ( ($field['type'] == 'textarea') || ($field['type'] == 'textarea_small') ) {
429
+ $new = htmlspecialchars( $new );
430
+ }
431
+
432
+ if ( ($field['type'] == 'textarea_code') ) {
433
+ $new = htmlspecialchars_decode( $new );
434
+ }
435
+
436
+ if ( $field['type'] == 'text_date_timestamp' ) {
437
+ $new = strtotime( $new );
438
+ }
439
+
440
+ if ( $field['type'] == 'text_datetime_timestamp' ) {
441
+ $string = $new['date'] . ' ' . $new['time'];
442
+ $new = strtotime( $string );
443
+ }
444
+
445
+ $new = apply_filters('bsf_validate_' . $field['type'], $new, $post_id, $field);
446
+
447
+ // validate meta value
448
+ if ( isset( $field['validate_func']) ) {
449
+ $ok = call_user_func( array( 'bsf_Meta_Box_Validate', $field['validate_func']), $new );
450
+ if ( $ok === false ) { // pass away when meta value is invalid
451
+ continue;
452
+ }
453
+ } elseif ( $field['multiple'] ) {
454
+ delete_post_meta( $post_id, $name );
455
+ if ( !empty( $new ) ) {
456
+ foreach ( $new as $add_new ) {
457
+ add_post_meta( $post_id, $name, $add_new, false );
458
+ }
459
+ }
460
+ } elseif ( '' !== $new && $new != $old ) {
461
+ update_post_meta( $post_id, $name, $new );
462
+ } elseif ( '' == $new ) {
463
+ delete_post_meta( $post_id, $name );
464
+ }
465
+
466
+ if ( 'file' == $field['type'] ) {
467
+ $name = $field['id'] . "_id";
468
+ $old = get_post_meta( $post_id, $name, !$field['multiple'] /* If multicheck this can be multiple values */ );
469
+ if ( isset( $field['save_id'] ) && $field['save_id'] ) {
470
+ $new = isset( $_POST[$name] ) ? $_POST[$name] : null;
471
+ } else {
472
+ $new = "";
473
+ }
474
+
475
+ if ( $new && $new != $old ) {
476
+ update_post_meta( $post_id, $name, $new );
477
+ } elseif ( '' == $new && $old ) {
478
+ delete_post_meta( $post_id, $name, $old );
479
+ }
480
+ }
481
+ }
482
+ }
483
+ }
484
+
485
+ /**
486
+ * Adding scripts and styles
487
+ */
488
+ function bsf_scripts( $hook ) {
489
+ global $wp_version;
490
+ // only enqueue our scripts/styles on the proper pages
491
+ if ( $hook == 'post.php' || $hook == 'post-new.php' || $hook == 'page-new.php' || $hook == 'page.php' ) {
492
+ // scripts required for cmb
493
+ $bsf_script_array = array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'media-upload', 'thickbox' );
494
+ // styles required for cmb
495
+ $bsf_style_array = array( 'thickbox' );
496
+ // if we're 3.5 or later, user wp-color-picker
497
+ if ( 3.5 <= $wp_version ) {
498
+ $bsf_script_array[] = 'wp-color-picker';
499
+ $bsf_style_array[] = 'wp-color-picker';
500
+ } else {
501
+ // otherwise use the older 'farbtastic'
502
+ $bsf_script_array[] = 'farbtastic';
503
+ $bsf_style_array[] = 'farbtastic';
504
+ }
505
+ wp_register_script( 'bsf-timepicker', BSF_META_BOX_URL . 'js/jquery.timePicker.min.js' );
506
+ wp_register_script( 'bsf-scripts', BSF_META_BOX_URL . 'js/cmb.js', $bsf_script_array, '0.9.1' );
507
+ wp_localize_script( 'bsf-scripts', 'bsf_ajax_data', array( 'ajax_nonce' => wp_create_nonce( 'ajax_nonce' ), 'post_id' => get_the_ID() ) );
508
+ wp_enqueue_script( 'bsf-timepicker' );
509
+ wp_enqueue_script( 'bsf-scripts' );
510
+ wp_register_style( 'bsf-styles', BSF_META_BOX_URL . 'admin/css/style.css', $bsf_style_array );
511
+ wp_enqueue_style( 'bsf-styles' );
512
+ }
513
+ }
514
+ add_action( 'admin_enqueue_scripts', 'bsf_scripts', 10 );
515
+
516
+ function bsf_editor_footer_scripts() { ?>
517
+ <?php
518
+ if ( isset( $_GET['bsf_force_send'] ) && 'true' == $_GET['bsf_force_send'] ) {
519
+ $label = $_GET['bsf_send_label'];
520
+ if ( empty( $label ) ) $label="Select File";
521
+ ?>
522
+ <script type="text/javascript">
523
+ jQuery(function($) {
524
+ $('td.savesend input').val('<?php echo $label; ?>');
525
+ });
526
+ </script>
527
+ <?php
528
+ }
529
+ }
530
+ add_action( 'admin_print_footer_scripts', 'bsf_editor_footer_scripts', 99 );
531
+
532
+ // Force 'Insert into Post' button from Media Library
533
+ add_filter( 'get_media_item_args', 'bsf_force_send' );
534
+ function bsf_force_send( $args ) {
535
+
536
+ // if the Gallery tab is opened from a custom meta box field, add Insert Into Post button
537
+ if ( isset( $_GET['bsf_force_send'] ) && 'true' == $_GET['bsf_force_send'] )
538
+ $args['send'] = true;
539
+
540
+ // if the From Computer tab is opened AT ALL, add Insert Into Post button after an image is uploaded
541
+ if ( isset( $_POST['attachment_id'] ) && '' != $_POST["attachment_id"] ) {
542
+
543
+ $args['send'] = true;
544
+
545
+ // TO DO: Are there any conditions in which we don't want the Insert Into Post
546
+ // button added? For example, if a post type supports thumbnails, does not support
547
+ // the editor, and does not have any cmb file inputs? If so, here's the first
548
+ // bits of code needed to check all that.
549
+ // $attachment_ancestors = get_post_ancestors( $_POST["attachment_id"] );
550
+ // $attachment_parent_post_type = get_post_type( $attachment_ancestors[0] );
551
+ // $post_type_object = get_post_type_object( $attachment_parent_post_type );
552
+ }
553
+
554
+ // change the label of the button on the From Computer tab
555
+ if ( isset( $_POST['attachment_id'] ) && '' != $_POST["attachment_id"] ) {
556
+
557
+ echo '
558
+ <script type="text/javascript">
559
+ function cmbGetParameterByNameInline(name) {
560
+ name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
561
+ var regexS = "[\\?&]" + name + "=([^&#]*)";
562
+ var regex = new RegExp(regexS);
563
+ var results = regex.exec(window.location.href);
564
+ if(results == null)
565
+ return "";
566
+ else
567
+ return decodeURIComponent(results[1].replace(/\+/g, " "));
568
+ }
569
+
570
+ jQuery(function($) {
571
+ if (cmbGetParameterByNameInline("bsf_force_send")=="true") {
572
+ var bsf_send_label = cmbGetParameterByNameInline("bsf_send_label");
573
+ $("td.savesend input").val(bsf_send_label);
574
+ }
575
+ });
576
+ </script>
577
+ ';
578
+ }
579
+
580
+ return $args;
581
+
582
+ }
583
+
584
+ add_action( 'wp_ajax_bsf_oembed_handler', 'bsf_oembed_ajax_results' );
585
+ /**
586
+ * Handles our oEmbed ajax request
587
+ */
588
+ function bsf_oembed_ajax_results() {
589
+
590
+ // verify our nonce
591
+ if ( ! ( isset( $_REQUEST['bsf_ajax_nonce'], $_REQUEST['oembed_url'] ) && wp_verify_nonce( $_REQUEST['bsf_ajax_nonce'], 'ajax_nonce' ) ) )
592
+ die();
593
+
594
+ // sanitize our search string
595
+ $oembed_string = sanitize_text_field( $_REQUEST['oembed_url'] );
596
+
597
+ if ( empty( $oembed_string ) ) {
598
+ $return = '<p class="ui-state-error-text">'. __( 'Please Try Again', 'cmb' ) .'</p>';
599
+ $found = 'not found';
600
+ } else {
601
+
602
+ global $wp_embed;
603
+
604
+ $oembed_url = esc_url( $oembed_string );
605
+ // Post ID is needed to check for embeds
606
+ if ( isset( $_REQUEST['post_id'] ) )
607
+ $GLOBALS['post'] = get_post( $_REQUEST['post_id'] );
608
+ // ping WordPress for an embed
609
+ $check_embed = $wp_embed->run_shortcode( '[embed]'. $oembed_url .'[/embed]' );
610
+ // fallback that WordPress creates when no oEmbed was found
611
+ $fallback = $wp_embed->maybe_make_link( $oembed_url );
612
+
613
+ if ( $check_embed && $check_embed != $fallback ) {
614
+ // Embed data
615
+ $return = '<div class="embed_status">'. $check_embed .'<a href="#" class="bsf_remove_file_button" rel="'. $_REQUEST['field_id'] .'">'. __( 'Remove Embed', 'cmb' ) .'</a></div>';
616
+ // set our response id
617
+ $found = 'found';
618
+
619
+ } else {
620
+ // error info when no oEmbeds were found
621
+ $return = '<p class="ui-state-error-text">'.sprintf( __( 'No oEmbed Results Found for %s. View more info at', 'cmb' ), $fallback ) .' <a href="http://codex.wordpress.org/Embeds" target="_blank">codex.wordpress.org/Embeds</a>.</p>';
622
+ // set our response id
623
+ $found = 'not found';
624
+ }
625
+ }
626
+
627
+ // send back our encoded data
628
+ echo json_encode( array( 'result' => $return, 'id' => $found ) );
629
+ die();
630
+ }
631
+
632
+ // End. That's it, folks! //
js/cmb.js ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /*jslint browser: true, devel: true, indent: 4, maxerr: 50, sub: true */
3
+ /*global jQuery, tb_show, tb_remove */
4
+
5
+ /**
6
+ * Custom jQuery for Custom Metaboxes and Fields
7
+ */
8
+ jQuery(document).ready(function (jQuery) {
9
+ 'use strict';
10
+
11
+ var formfield;
12
+
13
+ /**
14
+ * Initialize timepicker (this will be moved inline in a future release)
15
+ */
16
+ jQuery('.bsf_timepicker').each(function () {
17
+ jQuery('#' + jQuery(this).attr('id')).timePicker({
18
+ startTime: "07:00",
19
+ endTime: "22:00",
20
+ show24Hours: false,
21
+ separator: ':',
22
+ step: 30
23
+ });
24
+ });
25
+
26
+ /**
27
+ * Initialize jQuery UI datepicker (this will be moved inline in a future release)
28
+ */
29
+ jQuery('.bsf_datepicker').each(function () {
30
+ //jQuery('#' + jQuery(this).attr('id')).datepicker();
31
+ jQuery('#' + jQuery(this).attr('id')).datepicker({ dateFormat: 'yy-mm-dd' });
32
+ // For more options see http://jqueryui.com/demos/datepicker/#option-dateFormat
33
+ });
34
+ // Wrap date picker in class to narrow the scope of jQuery UI CSS and prevent conflicts
35
+ jQuery("#ui-datepicker-div").wrap('<div class="bsf_element" />');
36
+
37
+ /**
38
+ * Initialize color picker
39
+ */
40
+ if (typeof jQuery.wp === 'object' && typeof jQuery.wp.wpColorPicker === 'function') {
41
+ jQuery('input:text.bsf_colorpicker').wpColorPicker();
42
+ } else {
43
+ jQuery('input:text.bsf_colorpicker').each(function (i) {
44
+ jQuery(this).after('<div id="picker-' + i + '" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>');
45
+ jQuery('#picker-' + i).hide().farbtastic(jQuery(this));
46
+ })
47
+ .focus(function () {
48
+ jQuery(this).next().show();
49
+ })
50
+ .blur(function () {
51
+ jQuery(this).next().hide();
52
+ });
53
+ }
54
+
55
+ /**
56
+ * File and image upload handling
57
+ */
58
+ jQuery('.bsf_upload_file').change(function () {
59
+ formfield = jQuery(this).attr('name');
60
+ jQuery('#' + formfield + '_id').val("");
61
+ });
62
+
63
+ jQuery('.bsf_upload_button').live('click', function () {
64
+ var buttonLabel;
65
+ formfield = jQuery(this).prev('input').attr('name');
66
+ buttonLabel = 'Use as ' + jQuery('label[for=' + formfield + ']').text();
67
+ tb_show('', 'media-upload.php?post_id=' + jQuery('#post_ID').val() + '&type=file&bsf_force_send=true&bsf_send_label=' + buttonLabel + '&TB_iframe=true');
68
+ return false;
69
+ });
70
+
71
+ jQuery('.bsf_remove_file_button').live('click', function () {
72
+ formfield = jQuery(this).attr('rel');
73
+ jQuery('input#' + formfield).val('');
74
+ jQuery('input#' + formfield + '_id').val('');
75
+ jQuery(this).parent().remove();
76
+ return false;
77
+ });
78
+
79
+ window.original_send_to_editor = window.send_to_editor;
80
+ window.send_to_editor = function (html) {
81
+ var itemurl, itemclass, itemClassBits, itemid, htmlBits, itemtitle,
82
+ image, uploadStatus = true;
83
+
84
+ if (formfield) {
85
+
86
+ if (jQuery(html).html(html).find('img').length > 0) {
87
+ itemurl = jQuery(html).html(html).find('img').attr('src'); // Use the URL to the size selected.
88
+ itemclass = jQuery(html).html(html).find('img').attr('class'); // Extract the ID from the returned class name.
89
+ itemClassBits = itemclass.split(" ");
90
+ itemid = itemClassBits[itemClassBits.length - 1];
91
+ itemid = itemid.replace('wp-image-', '');
92
+ } else {
93
+ // It's not an image. Get the URL to the file instead.
94
+ htmlBits = html.split("'"); // jQuery seems to strip out XHTML when assigning the string to an object. Use alternate method.
95
+ itemurl = htmlBits[1]; // Use the URL to the file.
96
+ itemtitle = htmlBits[2];
97
+ itemtitle = itemtitle.replace('>', '');
98
+ itemtitle = itemtitle.replace('</a>', '');
99
+ itemid = ""; // TO DO: Get ID for non-image attachments.
100
+ }
101
+
102
+ image = /(jpe?g|png|gif|ico)jQuery/gi;
103
+
104
+ if (itemurl.match(image)) {
105
+ uploadStatus = '<div class="img_status"><img src="' + itemurl + '" alt="" /><a href="#" class="bsf_remove_file_button" rel="' + formfield + '">Remove Image</a></div>';
106
+ } else {
107
+ // No output preview if it's not an image
108
+ // Standard generic output if it's not an image.
109
+ html = '<a href="' + itemurl + '" target="_blank" rel="external">View File</a>';
110
+ uploadStatus = '<div class="no_image"><span class="file_link">' + html + '</span>&nbsp;&nbsp;&nbsp;<a href="#" class="bsf_remove_file_button" rel="' + formfield + '">Remove</a></div>';
111
+ }
112
+
113
+ jQuery('#' + formfield).val(itemurl);
114
+ jQuery('#' + formfield + '_id').val(itemid);
115
+ jQuery('#' + formfield).siblings('.bsf_media_status').slideDown().html(uploadStatus);
116
+ tb_remove();
117
+
118
+ } else {
119
+ window.original_send_to_editor(html);
120
+ }
121
+
122
+ formfield = '';
123
+ };
124
+
125
+ /**
126
+ * Ajax oEmbed display
127
+ */
128
+
129
+ // ajax on paste
130
+ jQuery('.bsf_oembed').bind('paste', function (e) {
131
+ var pasteitem = jQuery(this);
132
+ // paste event is fired before the value is filled, so wait a bit
133
+ setTimeout(function () {
134
+ // fire our ajax function
135
+ doCMBajax(pasteitem, 'paste');
136
+ }, 100);
137
+ }).blur(function () {
138
+ // when leaving the input
139
+ setTimeout(function () {
140
+ // if it's been 2 seconds, hide our spinner
141
+ jQuery('.postbox table.bsf_metabox .cmb-spinner').hide();
142
+ }, 2000);
143
+ });
144
+
145
+ // ajax when typing
146
+ jQuery('.bsf_metabox').on('keyup', '.bsf_oembed', function (event) {
147
+ // fire our ajax function
148
+ doCMBajax(jQuery(this), event);
149
+ });
150
+
151
+ // function for running our ajax
152
+ function doCMBajax(obj, e) {
153
+ // get typed value
154
+ var oembed_url = obj.val();
155
+ // only proceed if the field contains more than 6 characters
156
+ if (oembed_url.length < 6)
157
+ return;
158
+
159
+ // only proceed if the user has pasted, pressed a number, letter, or whitelisted characters
160
+ if (e === 'paste' || e.which <= 90 && e.which >= 48 || e.which >= 96 && e.which <= 111 || e.which == 8 || e.which == 9 || e.which == 187 || e.which == 190) {
161
+
162
+ // get field id
163
+ var field_id = obj.attr('id');
164
+ // get our inputs context for pinpointing
165
+ var context = obj.parents('.bsf_metabox tr td');
166
+ // show our spinner
167
+ jQuery('.cmb-spinner', context).show();
168
+ // clear out previous results
169
+ jQuery('.embed_wrap', context).html('');
170
+ // and run our ajax function
171
+ setTimeout(function () {
172
+ // if they haven't typed in 500 ms
173
+ if (jQuery('.bsf_oembed:focus').val() == oembed_url) {
174
+ jQuery.ajax({
175
+ type : 'post',
176
+ dataType : 'json',
177
+ url : window.ajaxurl,
178
+ data : {
179
+ 'action': 'bsf_oembed_handler',
180
+ 'oembed_url': oembed_url,
181
+ 'field_id': field_id,
182
+ 'post_id': window.bsf_ajax_data.post_id,
183
+ 'bsf_ajax_nonce': window.bsf_ajax_data.ajax_nonce
184
+ },
185
+ success: function (response) {
186
+ // if we have a response id
187
+ if (typeof response.id !== 'undefined') {
188
+ // hide our spinner
189
+ jQuery('.cmb-spinner', context).hide();
190
+ // and populate our results from ajax response
191
+ jQuery('.embed_wrap', context).html(response.result);
192
+ }
193
+ }
194
+ });
195
+ }
196
+ }, 500);
197
+ }
198
+ }
199
+
200
+ });
js/jquery-ui.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.10.2 - 2013-03-15
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js
4
+ * Copyright 2013 jQuery Foundation and other contributors Licensed MIT */
5
+
6
+ (function(e,t){function i(t,i){var a,n,r,o=t.nodeName.toLowerCase();return"area"===o?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&s(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var a=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var s,a,n=e(this[0]);n.length&&n[0]!==document;){if(s=n.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(a=parseInt(n.css("zIndex"),10),!isNaN(a)&&0!==a))return a;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var s=e.attr(t,"tabindex"),a=isNaN(s);return(a||s>=0)&&i(t,!a)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,s){function a(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===s?["Left","Right"]:["Top","Bottom"],r=s.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+s]=function(i){return i===t?o["inner"+s].call(this):this.each(function(){e(this).css(r,a(this,i)+"px")})},e.fn["outer"+s]=function(t,i){return"number"!=typeof t?o["outer"+s].call(this,t):this.each(function(){e(this).css(r,a(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,s){var a,n=e.ui[t].prototype;for(a in s)n.plugins[a]=n.plugins[a]||[],n.plugins[a].push([i,s[a]])},call:function(e,t,i){var s,a=e.plugins[t];if(a&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(s=0;a.length>s;s++)e.options[a[s][0]]&&a[s][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",a=!1;return t[s]>0?!0:(t[s]=1,a=t[s]>0,t[s]=0,a)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,n=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(a){}n(t)},e.widget=function(i,s,n){var a,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],a=u+"-"+i,n||(n=s,s=e.Widget),e.expr[":"][a.toLowerCase()]=function(t){return!!e.data(t,a)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(n,function(i,n){return e.isFunction(n)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,a=this._superApply;return this._super=e,this._superApply=t,i=n.apply(this,arguments),this._super=s,this._superApply=a,i}}(),t):(l[i]=n,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:a}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var n,a,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(n in r[o])a=r[o][n],r[o].hasOwnProperty(n)&&a!==t&&(i[n]=e.isPlainObject(a)?e.isPlainObject(i[n])?e.widget.extend({},i[n],a):e.widget.extend({},a):a);return i},e.widget.bridge=function(i,n){var a=n.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,n=e.data(this,a);return n?e.isFunction(n[r])&&"_"!==r.charAt(0)?(s=n[r].apply(n,h),s!==n&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,a);t?t.option(r||{})._init():e.data(this,a,new n(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var n,a,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},n=i.split("."),i=n.shift(),n.length){for(a=o[i]=e.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)a[n[r]]=a[n[r]]||{},a=a[n[r]];if(i=n.pop(),s===t)return a[i]===t?null:a[i];a[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var a,r=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=a=e(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,a=this.widget()),e.each(n,function(n,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?a.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var r,o=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),r=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),r&&e.effects&&e.effects.effect[o]?s[t](n):o!==t&&s[o]?s[o](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),s=e.isWindow?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]);return{element:i,isWindow:s,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,m,g,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),w=t.position.getScrollInfo(y),x=(e.collision||"flip").split(" "),k={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,m=_.height,g=_.offset,v=t.extend({},g),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=l.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=l.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),k[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=m:"center"===e.at[1]&&(v.top+=m/2),a=i(k.at,p,m),v.left+=a[0],v.top+=a[1],this.each(function(){var n,l,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),D=u+f+s(this,"marginRight")+w.width,T=d+_+s(this,"marginBottom")+w.height,C=t.extend({},v),M=i(k.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?C.left-=u:"center"===e.my[0]&&(C.left-=u/2),"bottom"===e.my[1]?C.top-=d:"center"===e.my[1]&&(C.top-=d/2),C.left+=M[0],C.top+=M[1],t.support.offsetFractions||(C.left=h(C.left),C.top=h(C.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[x[i]]&&t.ui.position[x[i]][s](C,{targetWidth:p,targetHeight:m,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:D,collisionHeight:T,offset:[a[0]+M[0],a[1]+M[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(l=function(t){var i=g.left-C.left,s=i+p-u,n=g.top-C.top,a=n+m-d,h={target:{element:b,left:g.left,top:g.top,width:p,height:m},element:{element:c,left:C.left,top:C.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(h.horizontal="center"),d>m&&m>r(n+a)&&(h.vertical="middle"),h.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(C,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-o-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-o-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-o-a,t.top+p+f+m>c&&(0>s||r(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,t.top+p+f+m>u&&(i>0||u>r(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var i=this.options;return this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),i.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i,s=this,n=!1,a=!1;for(e.ui.ddmanager&&!this.options.dropBehaviour&&(a=e.ui.ddmanager.drop(this,t)),this.dropped&&(a=this.dropped,this.dropped=!1),i=this.element[0];i&&(i=i.parentNode);)i===document&&(n=!0);return n||"original"!==this.options.helper?("invalid"===this.options.revert&&!a||"valid"===this.options.revert&&a||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,a)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;if("parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=["document"===n.containment?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"===n.containment?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"===n.containment?0:e(window).scrollLeft())+e("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"===n.containment?0:e(window).scrollTop())+(e("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||n.containment.constructor===Array)n.containment.constructor===Array&&(this.containment=n.containment);else{if(i=e(n.containment),s=i[0],!s)return;t="hidden"!==e(s).css("overflow"),this.containment=[(parseInt(e(s).css("borderLeftWidth"),10)||0)+(parseInt(e(s).css("paddingLeft"),10)||0),(parseInt(e(s).css("borderTopWidth"),10)||0)+(parseInt(e(s).css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(e(s).css("borderRightWidth"),10)||0)-(parseInt(e(s).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(e(s).css("borderBottomWidth"),10)||0)-(parseInt(e(s).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i}},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName),l=t.pageX,u=t.pageY;return this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(u=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(u=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((u-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,u=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:u-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var s=e(this).data("ui-draggable"),n=s.options,a=e.extend({},i,{item:s.element});s.sortables=[],e(n.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i){var s=e(this).data("ui-draggable"),n=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i){var s=e(this).data("ui-draggable"),n=this;e.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._opacity&&e(i.helper).css("opacity",s._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-t.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-e(document).scrollTop()<s.scrollSensitivity?n=e(document).scrollTop(e(document).scrollTop()-s.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<s.scrollSensitivity&&(n=e(document).scrollTop(e(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-e(document).scrollLeft()<s.scrollSensitivity?n=e(document).scrollLeft(e(document).scrollLeft()-s.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<s.scrollSensitivity&&(n=e(document).scrollLeft(e(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(i,t)}}),e.ui.plugin.add("draggable","snap",{start:function(){var t=e(this).data("ui-draggable"),i=t.options;t.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=e(this),s=i.offset();this!==t.element[0]&&t.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(t,i){var s,n,a,o,r,h,l,u,c,d,p=e(this).data("ui-draggable"),f=p.options,m=f.snapTolerance,g=i.offset.left,v=g+p.helperProportions.width,y=i.offset.top,b=y+p.helperProportions.height;for(c=p.snapElements.length-1;c>=0;c--)r=p.snapElements[c].left,h=r+p.snapElements[c].width,l=p.snapElements[c].top,u=l+p.snapElements[c].height,g>r-m&&h+m>g&&y>l-m&&u+m>y||g>r-m&&h+m>g&&b>l-m&&u+m>b||v>r-m&&h+m>v&&y>l-m&&u+m>y||v>r-m&&h+m>v&&b>l-m&&u+m>b?("inner"!==f.snapMode&&(s=m>=Math.abs(l-b),n=m>=Math.abs(u-y),a=m>=Math.abs(r-v),o=m>=Math.abs(h-g),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||a||o,"outer"!==f.snapMode&&(s=m>=Math.abs(l-y),n=m>=Math.abs(u-b),a=m>=Math.abs(r-g),o=m>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[c].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=s||n||a||o||d):(p.snapElements[c].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=!1)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,s=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});s.length&&(t=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._zIndex&&e(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(e){function t(e,t,i){return e>t&&t+i>e}e.widget("ui.droppable",{version:"1.10.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t=this.options,i=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(i)?i:function(e){return e.is(i)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var t=0,i=e.ui.ddmanager.droppables[this.options.scope];i.length>t;t++)i[t]===this&&i.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){"accept"===t&&(this.accept=e.isFunction(i)?i:function(e){return e.is(i)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");return t.options.greedy&&!t.options.disabled&&t.options.scope===s.options.scope&&t.accept.call(t.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,i,s){if(!i.offset)return!1;var n,a,o=(e.positionAbs||e.position.absolute).left,r=o+e.helperProportions.width,h=(e.positionAbs||e.position.absolute).top,l=h+e.helperProportions.height,u=i.offset.left,c=u+i.proportions.width,d=i.offset.top,p=d+i.proportions.height;switch(s){case"fit":return o>=u&&c>=r&&h>=d&&p>=l;case"intersect":return o+e.helperProportions.width/2>u&&c>r-e.helperProportions.width/2&&h+e.helperProportions.height/2>d&&p>l-e.helperProportions.height/2;case"pointer":return n=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,a=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,t(a,d,i.proportions.height)&&t(n,u,i.proportions.width);case"touch":return(h>=d&&p>=h||l>=d&&p>=l||d>h&&l>p)&&(o>=u&&c>=o||r>=u&&c>=r||u>o&&r>c);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions.height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions={width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight})}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===n}),a.length&&(s=e.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}}})(jQuery);(function(e){function t(e){return parseInt(e,10)||0}function i(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=e(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=t(this.helper.css("left")),n=t(this.helper.css("top")),o.containment&&(s+=e(o.containment).scrollLeft()||0,n+=e(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(t){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,u=this.size.height,c=t.pageX-a.left||0,d=t.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[t,c,d]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==u&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(n)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&e.ui.hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||e)&&(t=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset(),i(e.left)&&(this.position.left=e.left),i(e.top)&&(this.position.top=e.top),i(e.height)&&(this.size.height=e.height),i(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,s=this.size,n=this.axis;return i(e.height)?e.width=e.height*this.aspectRatio:i(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===n&&(e.left=t.left+(s.width-e.width),e.top=null),"nw"===n&&(e.top=t.top+(s.height-e.height),e.left=t.left+(s.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,s=this.axis,n=i(e.width)&&t.maxWidth&&t.maxWidth<e.width,a=i(e.height)&&t.maxHeight&&t.maxHeight<e.height,o=i(e.width)&&t.minWidth&&t.minWidth>e.width,r=i(e.height)&&t.minHeight&&t.minHeight>e.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,u=/sw|nw|w/.test(s),c=/nw|ne|n/.test(s);return o&&(e.width=t.minWidth),r&&(e.height=t.minHeight),n&&(e.width=t.maxWidth),a&&(e.height=t.maxHeight),o&&u&&(e.left=h-t.minWidth),n&&u&&(e.left=h-t.maxWidth),r&&c&&(e.top=l-t.minHeight),a&&c&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,s,n,a=this.helper||this.element;for(e=0;this._proportionallyResizeElements.length>e;e++){if(n=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],t=0;i.length>t;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(s[t],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&e.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=e(this).data("ui-resizable"),u=l.options,c=l.element,d=u.containment,p=d instanceof e?d.get(0):/parent/.test(d)?c.parent().get(0):d;p&&(l.containerElement=e(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(i=e(p),s=[],e(["Top","Right","Left","Bottom"]).each(function(e,n){s[e]=t(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=e.ui.hasScroll(p,"left")?p.scrollWidth:o,h=e.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(t){var i,s,n,a,o=e(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,c={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(c=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-c.left),u&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-c.left:o.offset.left-c.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-c.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=o.parentData.left),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size,n=t.originalSize,a=t.originalPosition,o=t.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,u=Math.round((s.width-n.width)/h)*h,c=Math.round((s.height-n.height)/l)*l,d=n.width+u,p=n.height+c,f=i.maxWidth&&d>i.maxWidth,m=i.maxHeight&&p>i.maxHeight,g=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,g&&(d+=h),v&&(p+=l),f&&(d-=h),m&&(p-=l),/^(se|s|e)$/.test(o)?(t.size.width=d,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.top=a.top-c):/^(sw)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.left=a.left-u):(t.size.width=d,t.size.height=p,t.position.top=a.top-c,t.position.left=a.left-u)}})})(jQuery);(function(e){e.widget("ui.selectable",e.ui.mouse,{version:"1.10.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,a.widgetName+"-item")===a?(s=t(this),!1):undefined}),t.data(e.target,a.widgetName+"-item")===a&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=t("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:e.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:e.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(e.pageY-t(document).scrollTop()<o.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-o.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<o.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+o.scrollSpeed)),e.pageX-t(document).scrollLeft()<o.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-o.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<o.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+o.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=t.left,o=a+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u=s+l>r&&h>s+l&&e+c>a&&o>e+c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?u:e+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,a=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return n?this.floating?o&&"right"===o||"down"===a?2:1:a&&("down"===a?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"===a&&s||"left"===a&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i,s,n,a,o=[],r=[],h=this._connectWith();if(h&&e)for(i=h.length-1;i>=0;i--)for(n=t(h[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&r.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(r.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=r.length-1;i>=0;i--)r[i][0].each(function(){o.push(this)});return t(o)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(u.push([t.isFunction(a.options.items)?a.options.items.call(a.element[0],e,{item:this.currentItem}):t(a.options.items,a.element),a]),this.containers.push(a));for(i=u.length-1;i>=0;i--)for(o=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",o),c.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t(e.document[0].createElement(s)).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?n.append("<td colspan='99'>&#160;</td>"):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,a,o,r,h,l,c,u,d,p,f=null,m=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],m=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(o=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],a=this.items.length-1;a>=0;a--)t.contains(this.containers[m].element[0],this.items[a].item[0])&&this.items[a].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[a].top,this.items[a].height))&&(u=this.items[a].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[a][l]-c)&&(d=!0,u+=this.items[a][l]),o>Math.abs(u-c)&&(o=Math.abs(u-c),r=this.items[a],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[m])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[m].element,!0),this._trigger("change",s,this._uiHash()),this.containers[m]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[m],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,a=e.pageX,o=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)e||s.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);(function(t){var e=0,i={},s={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.10.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t(),content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("<span>").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),undefined):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e),undefined)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),a=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(t(e.target).attr("tabIndex",-1),t(a).attr("tabIndex",0),a.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),(e.active===!1&&e.collapsible===!0||!this.headers.length)&&(e.active=!1,this.active=t()),e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,s=this.options,n=s.heightStyle,a=this.element.parent(),o=this.accordionId="ui-accordion-"+(this.element.attr("id")||++e);this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),s=i.attr("id"),n=i.next(),a=n.attr("id");s||(s=o+"-header-"+e,i.attr("id",s)),a||(a=o+"-panel-"+e,n.attr("id",a)),i.attr("aria-controls",a),n.attr("aria-labelledby",s)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(s.event),"fill"===n?(i=a.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(i=0,this.headers.next().each(function(){i=Math.max(i,t(this).css("height","").height())}).height(i))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?t():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?t():n,newPanel:r};e.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",e,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?t():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-expanded":"false","aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(t,e,n){var a,o,r,h=this,l=0,c=t.length&&(!e.length||t.index()<e.index()),u=this.options.animate||{},d=c&&u.down||u,p=function(){h._toggleComplete(n)};return"number"==typeof d&&(r=d),"string"==typeof d&&(o=d),o=o||d.easing||u.easing,r=r||d.duration||u.duration,e.length?t.length?(a=t.show().outerHeight(),e.animate(i,{duration:r,easing:o,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(s,{duration:r,easing:o,complete:p,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?l+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(a-e.outerHeight()-l),l=0)}}),undefined):e.animate(i,r,o,p):t.animate(s,r,o,p)},_toggleComplete:function(t){var e=t.oldPanel;e.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}})})(jQuery);(function(e){var t=0;e.widget("ui.autocomplete",{version:"1.10.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,undefined;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,s.preventDefault(),undefined;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),undefined):(this._searchTimeout(e),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(e),this._change(e),undefined)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({input:e(),role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:s})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):undefined},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=this,i=++t;return function(s){i===t&&e.__response(s),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[e](t),undefined):(this.search(null,t),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})})(jQuery);(function(t){var e,i,s,n,a="ui-button ui-widget ui-state-default ui-corner-all",o="ui-state-hover ui-state-active ",r="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",h=function(){var e=t(this).find(":ui-button");setTimeout(function(){e.button("refresh")},1)},l=function(e){var i=e.name,s=e.form,n=t([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?t(s).find("[name='"+i+"']"):t("[name='"+i+"']",e.ownerDocument).filter(function(){return!this.form})),n};t.widget("ui.button",{version:"1.10.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,h),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var o=this,r=this.options,c="checkbox"===this.type||"radio"===this.type,u=c?"":"ui-state-active",d="ui-state-focus";null===r.label&&(r.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(a).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){r.disabled||this===e&&t(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){r.disabled||t(this).removeClass(u)}).bind("click"+this.eventNamespace,function(t){r.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){o.buttonElement.addClass(d)}).bind("blur"+this.eventNamespace,function(){o.buttonElement.removeClass(d)}),c&&(this.element.bind("change"+this.eventNamespace,function(){n||o.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(t){r.disabled||(n=!1,i=t.pageX,s=t.pageY)}).bind("mouseup"+this.eventNamespace,function(t){r.disabled||(i!==t.pageX||s!==t.pageY)&&(n=!0)})),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return r.disabled||n?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(r.disabled||n)return!1;t(this).addClass("ui-state-active"),o.buttonElement.attr("aria-pressed","true");var e=o.element[0];l(e).not(e).map(function(){return t(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return r.disabled?!1:(t(this).addClass("ui-state-active"),e=this,o.document.one("mouseup",function(){e=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return r.disabled?!1:(t(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(e){return r.disabled?!1:((e.keyCode===t.ui.keyCode.SPACE||e.keyCode===t.ui.keyCode.ENTER)&&t(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){t(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===t.ui.keyCode.SPACE&&t(this).click()})),this._setOption("disabled",r.disabled),this._resetButton()},_determineButtonType:function(){var t,e,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(t=this.element.parents().last(),e="label[for='"+this.element.attr("id")+"']",this.buttonElement=t.find(e),this.buttonElement.length||(t=t.length?t.siblings():this.element.siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(a+" "+o+" "+r).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(t,e){return this._super(t,e),"disabled"===t?(e?this.element.prop("disabled",!0):this.element.prop("disabled",!1),undefined):(this._resetButton(),undefined)},refresh:function(){var e=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?l(this.element[0]).each(function(){t(this).is(":checked")?t(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):t(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var e=this.buttonElement.removeClass(r),i=t("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",t.trim(i)))):a.push("ui-button-text-only"),e.addClass(a.join(" "))}}),t.widget("ui.buttonset",{version:"1.10.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,e){"disabled"===t&&this.buttons.button("option",t,e),this._super(t,e)},refresh:function(){var e="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(t,e){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.dpDiv=s(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(a.inline?e.parent()[0]:a.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))})}function n(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.10.2"}});var a,r="datepicker",o=(new Date).getTime();t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return n(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,a;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),a=this._newInst(t(e),n),a.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,a):n&&this._inlineDatepicker(e,a)},_newInst:function(e,i){var n=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),t.data(e,r,i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,a,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=t("<span class='"+this._appendClass+"'>"+r+"</span>"),e[o?"before":"after"](i.append)),e.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(a?t("<img/>").attr({src:a,alt:n,title:n}):n)),e[o?"before":"after"](i.trigger),i.trigger.click(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,a=new Date(2009,11,20),r=this._get(t,"dateFormat");r.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},a.setMonth(e(this._get(t,r.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(e(this._get(t,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),t.input.attr("size",this._formatDate(t,a).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,a,o){var h,l,c,u,d,p=this._dialogInst;return p||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+h+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),t("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},t.data(this._dialogInput[0],r,p)),n(p.settings,a||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(l=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,r);s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,r),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,s,a){var r,o,h,l,c=this._getInst(i);return 2===arguments.length&&"string"==typeof s?"defaults"===s?t.extend({},t.datepicker._defaults):c?"all"===s?t.extend({},c.settings):this._get(c,s):null:(r=s||{},"string"==typeof s&&(r={},r[s]=a),c&&(this._curInst===c&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),h=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),n(c.settings,r),null!==h&&r.dateFormat!==e&&r.minDate===e&&(c.settings.minDate=this._formatDate(c,h)),null!==l&&r.dateFormat!==e&&r.maxDate===e&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(t(i),c),this._autoSize(c),this._setDate(c,o),this._updateAlternate(c),this._updateDatepicker(c)),e)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,a=t.datepicker._getInst(e.target),r=!0,o=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),r=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",a.dpDiv),n[0]&&t.datepicker._selectDay(e.target,a.selectedMonth,a.selectedYear,n[0]),i=t.datepicker._get(a,"onSelect"),i?(s=t.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),r=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),r=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?1:-1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),r=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?-1:1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),r=e.ctrlKey||e.metaKey;break;default:r=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):r=!1;r&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(i){var s,n,a=t.datepicker._getInst(i.target);return t.datepicker._get(a,"constrainInput")?(s=t.datepicker._possibleChars(t.datepicker._get(a,"dateFormat")),n=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">n||!s||s.indexOf(n)>-1):e},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var i,s,a,r,o,h,l;i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),s=t.datepicker._get(i,"beforeShow"),a=s?s.apply(e,[e,i]):{},a!==!1&&(n(i.settings,a),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),o={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),o=t.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(h=t.datepicker._get(i,"showAnim"),l=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?i.dpDiv.show(h,t.datepicker._get(i,"showOptions"),l):i.dpDiv[h||"show"](h?l:null),i.input.is(":visible")&&!i.input.is(":disabled")&&i.input.focus(),t.datepicker._curInst=i))}},_updateDatepicker:function(e){this.maxRows=4,a=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,s=this._getNumberOfMonths(e),n=s[1],r=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",r*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!==document.activeElement&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_getBorders:function(t){var e=function(t){return{thin:1,medium:2,thick:3}[t]||t};return[parseFloat(e(t.css("border-left-width"))),parseFloat(e(t.css("border-top-width")))]},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),a=e.dpDiv.outerHeight(),r=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-r:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+o?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+o):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,a,o=this._curInst;!o||e&&o!==t.data(e,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){t.datepicker._tidyDialog(o)},t.effects&&(t.effects.effect[i]||t.effects[i])?o.dpDiv.hide(i,t.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(e,i,s,n){var a,r=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(a=this._getInst(r[0]),a.selectedDay=a.currentDay=t("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(e,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,a=this._get(e,"altField");a&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(a).each(function(){t(this).val(n)}))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,s,n){if(null==i||null==s)throw"Invalid arguments";if(s="object"==typeof s?""+s:s+"",""===s)return null;var a,r,o,h,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,p=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,m=(n?n.monthNames:null)||this._defaults.monthNames,g=-1,v=-1,_=-1,b=-1,y=!1,w=function(t){var e=i.length>a+1&&i.charAt(a+1)===t;return e&&a++,e},k=function(t){var e=w(t),i="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n=RegExp("^\\d{1,"+i+"}"),a=s.substring(l).match(n);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},x=function(i,n,a){var r=-1,o=t.map(w(i)?a:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(o,function(t,i){var n=i[1];return s.substr(l,n.length).toLowerCase()===n.toLowerCase()?(r=i[0],l+=n.length,!1):e}),-1!==r)return r+1;throw"Unknown name at position "+l},D=function(){if(s.charAt(l)!==i.charAt(a))throw"Unexpected literal at position "+l;l++};for(a=0;i.length>a;a++)if(y)"'"!==i.charAt(a)||w("'")?D():y=!1;else switch(i.charAt(a)){case"d":_=k("d");break;case"D":x("D",d,p);break;case"o":b=k("o");break;case"m":v=k("m");break;case"M":v=x("M",f,m);break;case"y":g=k("y");break;case"@":h=new Date(k("@")),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"!":h=new Date((k("!")-this._ticksTo1970)/1e4),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"'":w("'")?D():y=!0;break;default:D()}if(s.length>l&&(o=s.substr(l),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=g?0:-100)),b>-1)for(v=1,_=b;;){if(r=this._getDaysInMonth(g,v-1),r>=_)break;v++,_-=r}if(h=this._daylightSavingAdjust(new Date(g,v-1,_)),h.getFullYear()!==g||h.getMonth()+1!==v||h.getDate()!==_)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,a);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),r,o);break;case"y":u+=h("y")?e.getFullYear():(10>e.getYear()%100?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,i){return t.settings[i]!==e?t.settings[i]:this._defaults[i]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),a=n,r=this._getFormatConfig(t);try{a=this.parseDate(i,s,r)||n}catch(o){s=e?"":s}t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),t.currentDay=s?a.getDate():0,t.currentMonth=s?a.getMonth():0,t.currentYear=s?a.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},a=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,a=n.getFullYear(),r=n.getMonth(),o=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":o+=parseInt(l[1],10);break;case"w":case"W":o+=7*parseInt(l[1],10);break;case"m":case"M":r+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r));break;case"y":case"Y":a+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r))}l=h.exec(i)}return new Date(a,r,o)},r=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?s:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,a=t.selectedYear,r=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=r.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=r.getMonth(),t.drawYear=t.selectedYear=t.currentYear=r.getFullYear(),n===t.selectedMonth&&a===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){window["DP_jQuery_"+o].datepicker._adjustDate(s,-i,"M")},next:function(){window["DP_jQuery_"+o].datepicker._adjustDate(s,+i,"M")},hide:function(){window["DP_jQuery_"+o].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+o].datepicker._gotoToday(s)},selectDay:function(){return window["DP_jQuery_"+o].datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+o].datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+o].datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,a,r,o,h,l,c,u,d,p,f,m,g,v,_,b,y,w,k,x,D,T,C,S,M,N,I,P,A,z,H,E,F,O,W,j,R=new Date,L=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),B=this._get(t,"showButtonPanel"),J=this._get(t,"hideIfNoPrevNext"),Q=this._get(t,"navigationAsDateFormat"),K=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),U=this._get(t,"stepMonths"),q=1!==K[0]||1!==K[1],X=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(t,"min"),$=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),$)for(e=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),e=G&&G>e?G:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=Q?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-U,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=Q?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+U,1)),this._getFormatConfig(t)):n,a=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",r=this._get(t,"currentText"),o=this._get(t,"gotoCurrent")&&t.currentDay?X:L,r=Q?this.formatDate(r,o,this._getFormatConfig(t)):r,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),m=this._get(t,"monthNamesShort"),g=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),_=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;K[0]>k;k++){for(x="",this.maxRows=4,D=0;K[1]>D;D++){if(T=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),C=" ui-corner-all",S="",q){if(S+="<div class='ui-datepicker-group",K[1]>1)switch(D){case 0:S+=" ui-datepicker-group-first",C=" ui-corner-"+(Y?"right":"left");break;case K[1]-1:S+=" ui-datepicker-group-last",C=" ui-corner-"+(Y?"left":"right");break;default:S+=" ui-datepicker-group-middle",C=""}S+="'>"}for(S+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+C+"'>"+(/all|left/.test(C)&&0===k?Y?a:s:"")+(/all|right/.test(C)&&0===k?Y?s:a:"")+this._generateMonthYearHeader(t,Z,te,G,$,k>0||D>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",M=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)N=(w+c)%7,M+="<th"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[N]+"'>"+p[N]+"</span></th>";for(S+=M+"</tr></thead><tbody>",I=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,I)),P=(this._getFirstDayOfMonth(te,Z)-c+7)%7,A=Math.ceil((P+I)/7),z=q?this.maxRows>A?this.maxRows:A:A,this.maxRows=z,H=this._daylightSavingAdjust(new Date(te,Z,1-P)),E=0;z>E;E++){for(S+="<tr>",F=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(H)+"</td>":"",w=0;7>w;w++)O=g?g.apply(t.input?t.input[0]:null,[H]):[!0,""],W=H.getMonth()!==Z,j=W&&!_||!O[0]||G&&G>H||$&&H>$,F+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(W?" ui-datepicker-other-month":"")+(H.getTime()===T.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===H.getTime()&&b.getTime()===T.getTime()?" "+this._dayOverClass:"")+(j?" "+this._unselectableClass+" ui-state-disabled":"")+(W&&!v?"":" "+O[1]+(H.getTime()===X.getTime()?" "+this._currentClass:"")+(H.getTime()===L.getTime()?" ui-datepicker-today":""))+"'"+(W&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(j?"":" data-handler='selectDay' data-event='click' data-month='"+H.getMonth()+"' data-year='"+H.getFullYear()+"'")+">"+(W&&!v?"&#xa0;":j?"<span class='ui-state-default'>"+H.getDate()+"</span>":"<a class='ui-state-default"+(H.getTime()===L.getTime()?" ui-state-highlight":"")+(H.getTime()===X.getTime()?" ui-state-active":"")+(W?" ui-priority-secondary":"")+"' href='#'>"+H.getDate()+"</a>")+"</td>",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);S+=F+"</tr>"}Z++,Z>11&&(Z=0,te++),S+="</tbody></table>"+(q?"</div>"+(K[0]>0&&D===K[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=S}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,a,r,o){var h,l,c,u,d,p,f,m,g=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(a||!g)y+="<span class='ui-datepicker-month'>"+r[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+o[c]+"</option>");
7
+ y+="</select>"}if(_||(b+=y+(!a&&g&&v?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),m=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),_&&(b+=(!a&&g&&v?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"===i?e:0),n=t.drawMonth+("M"===i?e:0),a=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),r=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,a)));t.selectedDay=r.getDate(),t.drawMonth=t.selectedMonth=r.getMonth(),t.drawYear=t.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),a=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(t,a)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),a=this._getMinMaxDate(t,"max"),r=null,o=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=s),i[1].match(/[+\-].*/)&&(o+=s)),(!n||e.getTime()>=n.getTime())&&(!a||e.getTime()<=a.getTime())&&(!r||e.getFullYear()>=r)&&(!o||o>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new i,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.10.2",window["DP_jQuery_"+o]=t})(jQuery);(function(t){var e={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.10.2",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||t(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!e&&this._trigger("focus",t),i},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var t=this.element.find("[autofocus]");t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).focus()},_keepFocus:function(e){function i(){var e=this.document[0].activeElement,i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),undefined;if(e.keyCode===t.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(n.focus(1),e.preventDefault()):(s.focus(1),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=t("<button></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title||t.html("&#160;"),t.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(t.each(i,function(i,s){var n,a;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(e.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,t("<button></button>",s).button(a).appendTo(e.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,a){s.position=[a.position.left-i.document.scrollLeft(),a.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(a))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,a){s.height=t(this).height(),s.width=t(this).width(),t(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(a))}}).css("position",a)},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(s){var n=this,a=!1,o={};t.each(s,function(t,s){n._setOption(t,s),t in e&&(a=!0),t in i&&(o[t]=s)}),a&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(t,e){var i,s,n=this.uiDialog;"dialogClass"===t&&n.removeClass(this.options.dialogClass).addClass(e),"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:""+e}),"draggable"===t&&(i=n.is(":data(ui-draggable)"),i&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(s=n.is(":data(ui-resizable)"),s&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||e===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(s){e._allowInteraction(s)||(s.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,s=[],n=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(s=i.split?i.split(" "):[i[0],i[1]],1===s.length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),i={my:s[0]+(0>n[0]?n[0]:"+"+n[0])+" "+s[1]+(0>n[1]?n[1]:"+"+n[1]),at:s.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})})(jQuery);(function(t){t.widget("ui.menu",{version:"1.10.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(e),i.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);(function(t,e){t.widget("ui.progressbar",{version:"1.10.2",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery);(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):this.range=t([])},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,h,l,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-a.width()/2,top:e.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i,!0))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery);(function(t,e){function i(){return++n}function s(t){return t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),u=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),u&&l.data("ui-tabs-aria-controls",u),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),u={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,u))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.2",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,a=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=a),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function a(t){l.of=t,o.is(":hidden")||o.position(l)}var o,r,h,l=t.extend({},this.options.position);if(n){if(o=this._find(s),o.length)return o.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),o=this._tooltip(s),e(s,o.attr("id")),o.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:a}),a(i)):o.position(t.extend({of:s},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){o.is(":visible")&&(a(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:o}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(o)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),a=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),a.stop(!0),this._hide(a,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:a}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery);(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[c[l].cache]=o[c[l].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,o,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,h],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),a=c[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],l=s[a],c=u[n.type]||{};null!==l&&(null===o?h[a]=l:(c.mod&&(l-o>c.mod/2?o+=c.mod:o-l>c.mod/2&&(o-=c.mod)),h[a]=i((l-o)*e+o,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[o]=d,n):l(d)},f(a,function(e,i){l.fn[e]||(l.fn[e]=function(n){var a,o=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=l(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var h=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.2",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,h=t(this),l=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(h,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",m=i.test(u),g={},v="show"===c;h.parent().is(".ui-effects-wrapper")?t.effects.save(h.parent(),l):t.effects.save(h,l),h.show(),a=t.effects.createWrapper(h).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,g[p]=v?o:0,m||(h.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),g[f]=v?r:o+r),v&&(a.css(p,0),m||a.css(f,r+o)),a.animate(g,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&h.hide(),t.effects.restore(h,l),t.effects.removeWrapper(h),n()}})}})(jQuery);(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"effect"),l="hide"===h,c="show"===h,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||l?1:0),m=e.duration/f,g=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||l)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,m,g)),l&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,m,g).animate(a,m,g),d=l?2*d:d/2;l&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery);(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"hide"),l="show"===h,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),l&&(n.css(d,0),n.css(p,a/2)),f[d]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){l||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===c?-s:s),u[l]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),m||p.hide(),i()}var a,o,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(h=g.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=g.left+o*v,l=o-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(m?l*v:0),top:h+(m?c*_:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:c*_),opacity:m?1:0},e.duration||500,e.easing,s)}})(jQuery);(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery);(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),h="show"===r,l="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=h!==d,f=p?["width","height"]:["height","width"],m=e.duration/2,g={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:c}:{height:c,width:0}),g[f[0]]=h?n[0]:c,v[f[1]]=h?n[1]:0,s.animate(g,m,e.easing).animate(v,m,e.easing,function(){l&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery);(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery);(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(e.times||5)+(h?1:0),c=e.duration/l,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;l>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",h=e.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*c.y,width:l.width*c.x,outerHeight:l.outerHeight*c.y,outerWidth:l.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,m=e.scale||"both",g=e.origin||["middle","center"],v=o.css("position"),_=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(l),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=t.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),l=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery);(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",h=e.distance||20,l=e.times||3,c=2*l+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+h,m[d]=(p?"+=":"-=")+2*h,g[d]=(p?"-=":"+=")+2*h,n.animate(f,u,e.easing),s=1;l>s;s++)n.animate(m,u,e.easing).animate(g,u,e.easing);n.animate(m,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery);(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,c?isNaN(s)?"-"+s:-s:s),u[l]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery);
js/jquery.js ADDED
@@ -0,0 +1,9597 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery JavaScript Library v1.9.1
3
+ * http://jquery.com/
4
+ *
5
+ * Includes Sizzle.js
6
+ * http://sizzlejs.com/
7
+ *
8
+ * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
9
+ * Released under the MIT license
10
+ * http://jquery.org/license
11
+ *
12
+ * Date: 2013-2-4
13
+ */
14
+ (function( window, undefined ) {
15
+
16
+ // Can't do this because several apps including ASP.NET trace
17
+ // the stack via arguments.caller.callee and Firefox dies if
18
+ // you try to trace through "use strict" call chains. (#13335)
19
+ // Support: Firefox 18+
20
+ //"use strict";
21
+ var
22
+ // The deferred used on DOM ready
23
+ readyList,
24
+
25
+ // A central reference to the root jQuery(document)
26
+ rootjQuery,
27
+
28
+ // Support: IE<9
29
+ // For `typeof node.method` instead of `node.method !== undefined`
30
+ core_strundefined = typeof undefined,
31
+
32
+ // Use the correct document accordingly with window argument (sandbox)
33
+ document = window.document,
34
+ location = window.location,
35
+
36
+ // Map over jQuery in case of overwrite
37
+ _jQuery = window.jQuery,
38
+
39
+ // Map over the $ in case of overwrite
40
+ _$ = window.$,
41
+
42
+ // [[Class]] -> type pairs
43
+ class2type = {},
44
+
45
+ // List of deleted data cache ids, so we can reuse them
46
+ core_deletedIds = [],
47
+
48
+ core_version = "1.9.1",
49
+
50
+ // Save a reference to some core methods
51
+ core_concat = core_deletedIds.concat,
52
+ core_push = core_deletedIds.push,
53
+ core_slice = core_deletedIds.slice,
54
+ core_indexOf = core_deletedIds.indexOf,
55
+ core_toString = class2type.toString,
56
+ core_hasOwn = class2type.hasOwnProperty,
57
+ core_trim = core_version.trim,
58
+
59
+ // Define a local copy of jQuery
60
+ jQuery = function( selector, context ) {
61
+ // The jQuery object is actually just the init constructor 'enhanced'
62
+ return new jQuery.fn.init( selector, context, rootjQuery );
63
+ },
64
+
65
+ // Used for matching numbers
66
+ core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
67
+
68
+ // Used for splitting on whitespace
69
+ core_rnotwhite = /\S+/g,
70
+
71
+ // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
72
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
73
+
74
+ // A simple way to check for HTML strings
75
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
76
+ // Strict HTML recognition (#11290: must start with <)
77
+ rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
78
+
79
+ // Match a standalone tag
80
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
81
+
82
+ // JSON RegExp
83
+ rvalidchars = /^[\],:{}\s]*$/,
84
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
85
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
86
+ rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
87
+
88
+ // Matches dashed string for camelizing
89
+ rmsPrefix = /^-ms-/,
90
+ rdashAlpha = /-([\da-z])/gi,
91
+
92
+ // Used by jQuery.camelCase as callback to replace()
93
+ fcamelCase = function( all, letter ) {
94
+ return letter.toUpperCase();
95
+ },
96
+
97
+ // The ready event handler
98
+ completed = function( event ) {
99
+
100
+ // readyState === "complete" is good enough for us to call the dom ready in oldIE
101
+ if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
102
+ detach();
103
+ jQuery.ready();
104
+ }
105
+ },
106
+ // Clean-up method for dom ready events
107
+ detach = function() {
108
+ if ( document.addEventListener ) {
109
+ document.removeEventListener( "DOMContentLoaded", completed, false );
110
+ window.removeEventListener( "load", completed, false );
111
+
112
+ } else {
113
+ document.detachEvent( "onreadystatechange", completed );
114
+ window.detachEvent( "onload", completed );
115
+ }
116
+ };
117
+
118
+ jQuery.fn = jQuery.prototype = {
119
+ // The current version of jQuery being used
120
+ jquery: core_version,
121
+
122
+ constructor: jQuery,
123
+ init: function( selector, context, rootjQuery ) {
124
+ var match, elem;
125
+
126
+ // HANDLE: $(""), $(null), $(undefined), $(false)
127
+ if ( !selector ) {
128
+ return this;
129
+ }
130
+
131
+ // Handle HTML strings
132
+ if ( typeof selector === "string" ) {
133
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
134
+ // Assume that strings that start and end with <> are HTML and skip the regex check
135
+ match = [ null, selector, null ];
136
+
137
+ } else {
138
+ match = rquickExpr.exec( selector );
139
+ }
140
+
141
+ // Match html or make sure no context is specified for #id
142
+ if ( match && (match[1] || !context) ) {
143
+
144
+ // HANDLE: $(html) -> $(array)
145
+ if ( match[1] ) {
146
+ context = context instanceof jQuery ? context[0] : context;
147
+
148
+ // scripts is true for back-compat
149
+ jQuery.merge( this, jQuery.parseHTML(
150
+ match[1],
151
+ context && context.nodeType ? context.ownerDocument || context : document,
152
+ true
153
+ ) );
154
+
155
+ // HANDLE: $(html, props)
156
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
157
+ for ( match in context ) {
158
+ // Properties of context are called as methods if possible
159
+ if ( jQuery.isFunction( this[ match ] ) ) {
160
+ this[ match ]( context[ match ] );
161
+
162
+ // ...and otherwise set as attributes
163
+ } else {
164
+ this.attr( match, context[ match ] );
165
+ }
166
+ }
167
+ }
168
+
169
+ return this;
170
+
171
+ // HANDLE: $(#id)
172
+ } else {
173
+ elem = document.getElementById( match[2] );
174
+
175
+ // Check parentNode to catch when Blackberry 4.6 returns
176
+ // nodes that are no longer in the document #6963
177
+ if ( elem && elem.parentNode ) {
178
+ // Handle the case where IE and Opera return items
179
+ // by name instead of ID
180
+ if ( elem.id !== match[2] ) {
181
+ return rootjQuery.find( selector );
182
+ }
183
+
184
+ // Otherwise, we inject the element directly into the jQuery object
185
+ this.length = 1;
186
+ this[0] = elem;
187
+ }
188
+
189
+ this.context = document;
190
+ this.selector = selector;
191
+ return this;
192
+ }
193
+
194
+ // HANDLE: $(expr, $(...))
195
+ } else if ( !context || context.jquery ) {
196
+ return ( context || rootjQuery ).find( selector );
197
+
198
+ // HANDLE: $(expr, context)
199
+ // (which is just equivalent to: $(context).find(expr)
200
+ } else {
201
+ return this.constructor( context ).find( selector );
202
+ }
203
+
204
+ // HANDLE: $(DOMElement)
205
+ } else if ( selector.nodeType ) {
206
+ this.context = this[0] = selector;
207
+ this.length = 1;
208
+ return this;
209
+
210
+ // HANDLE: $(function)
211
+ // Shortcut for document ready
212
+ } else if ( jQuery.isFunction( selector ) ) {
213
+ return rootjQuery.ready( selector );
214
+ }
215
+
216
+ if ( selector.selector !== undefined ) {
217
+ this.selector = selector.selector;
218
+ this.context = selector.context;
219
+ }
220
+
221
+ return jQuery.makeArray( selector, this );
222
+ },
223
+
224
+ // Start with an empty selector
225
+ selector: "",
226
+
227
+ // The default length of a jQuery object is 0
228
+ length: 0,
229
+
230
+ // The number of elements contained in the matched element set
231
+ size: function() {
232
+ return this.length;
233
+ },
234
+
235
+ toArray: function() {
236
+ return core_slice.call( this );
237
+ },
238
+
239
+ // Get the Nth element in the matched element set OR
240
+ // Get the whole matched element set as a clean array
241
+ get: function( num ) {
242
+ return num == null ?
243
+
244
+ // Return a 'clean' array
245
+ this.toArray() :
246
+
247
+ // Return just the object
248
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
249
+ },
250
+
251
+ // Take an array of elements and push it onto the stack
252
+ // (returning the new matched element set)
253
+ pushStack: function( elems ) {
254
+
255
+ // Build a new jQuery matched element set
256
+ var ret = jQuery.merge( this.constructor(), elems );
257
+
258
+ // Add the old object onto the stack (as a reference)
259
+ ret.prevObject = this;
260
+ ret.context = this.context;
261
+
262
+ // Return the newly-formed element set
263
+ return ret;
264
+ },
265
+
266
+ // Execute a callback for every element in the matched set.
267
+ // (You can seed the arguments with an array of args, but this is
268
+ // only used internally.)
269
+ each: function( callback, args ) {
270
+ return jQuery.each( this, callback, args );
271
+ },
272
+
273
+ ready: function( fn ) {
274
+ // Add the callback
275
+ jQuery.ready.promise().done( fn );
276
+
277
+ return this;
278
+ },
279
+
280
+ slice: function() {
281
+ return this.pushStack( core_slice.apply( this, arguments ) );
282
+ },
283
+
284
+ first: function() {
285
+ return this.eq( 0 );
286
+ },
287
+
288
+ last: function() {
289
+ return this.eq( -1 );
290
+ },
291
+
292
+ eq: function( i ) {
293
+ var len = this.length,
294
+ j = +i + ( i < 0 ? len : 0 );
295
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
296
+ },
297
+
298
+ map: function( callback ) {
299
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
300
+ return callback.call( elem, i, elem );
301
+ }));
302
+ },
303
+
304
+ end: function() {
305
+ return this.prevObject || this.constructor(null);
306
+ },
307
+
308
+ // For internal use only.
309
+ // Behaves like an Array's method, not like a jQuery method.
310
+ push: core_push,
311
+ sort: [].sort,
312
+ splice: [].splice
313
+ };
314
+
315
+ // Give the init function the jQuery prototype for later instantiation
316
+ jQuery.fn.init.prototype = jQuery.fn;
317
+
318
+ jQuery.extend = jQuery.fn.extend = function() {
319
+ var src, copyIsArray, copy, name, options, clone,
320
+ target = arguments[0] || {},
321
+ i = 1,
322
+ length = arguments.length,
323
+ deep = false;
324
+
325
+ // Handle a deep copy situation
326
+ if ( typeof target === "boolean" ) {
327
+ deep = target;
328
+ target = arguments[1] || {};
329
+ // skip the boolean and the target
330
+ i = 2;
331
+ }
332
+
333
+ // Handle case when target is a string or something (possible in deep copy)
334
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
335
+ target = {};
336
+ }
337
+
338
+ // extend jQuery itself if only one argument is passed
339
+ if ( length === i ) {
340
+ target = this;
341
+ --i;
342
+ }
343
+
344
+ for ( ; i < length; i++ ) {
345
+ // Only deal with non-null/undefined values
346
+ if ( (options = arguments[ i ]) != null ) {
347
+ // Extend the base object
348
+ for ( name in options ) {
349
+ src = target[ name ];
350
+ copy = options[ name ];
351
+
352
+ // Prevent never-ending loop
353
+ if ( target === copy ) {
354
+ continue;
355
+ }
356
+
357
+ // Recurse if we're merging plain objects or arrays
358
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
359
+ if ( copyIsArray ) {
360
+ copyIsArray = false;
361
+ clone = src && jQuery.isArray(src) ? src : [];
362
+
363
+ } else {
364
+ clone = src && jQuery.isPlainObject(src) ? src : {};
365
+ }
366
+
367
+ // Never move original objects, clone them
368
+ target[ name ] = jQuery.extend( deep, clone, copy );
369
+
370
+ // Don't bring in undefined values
371
+ } else if ( copy !== undefined ) {
372
+ target[ name ] = copy;
373
+ }
374
+ }
375
+ }
376
+ }
377
+
378
+ // Return the modified object
379
+ return target;
380
+ };
381
+
382
+ jQuery.extend({
383
+ noConflict: function( deep ) {
384
+ if ( window.$ === jQuery ) {
385
+ window.$ = _$;
386
+ }
387
+
388
+ if ( deep && window.jQuery === jQuery ) {
389
+ window.jQuery = _jQuery;
390
+ }
391
+
392
+ return jQuery;
393
+ },
394
+
395
+ // Is the DOM ready to be used? Set to true once it occurs.
396
+ isReady: false,
397
+
398
+ // A counter to track how many items to wait for before
399
+ // the ready event fires. See #6781
400
+ readyWait: 1,
401
+
402
+ // Hold (or release) the ready event
403
+ holdReady: function( hold ) {
404
+ if ( hold ) {
405
+ jQuery.readyWait++;
406
+ } else {
407
+ jQuery.ready( true );
408
+ }
409
+ },
410
+
411
+ // Handle when the DOM is ready
412
+ ready: function( wait ) {
413
+
414
+ // Abort if there are pending holds or we're already ready
415
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
416
+ return;
417
+ }
418
+
419
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
420
+ if ( !document.body ) {
421
+ return setTimeout( jQuery.ready );
422
+ }
423
+
424
+ // Remember that the DOM is ready
425
+ jQuery.isReady = true;
426
+
427
+ // If a normal DOM Ready event fired, decrement, and wait if need be
428
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
429
+ return;
430
+ }
431
+
432
+ // If there are functions bound, to execute
433
+ readyList.resolveWith( document, [ jQuery ] );
434
+
435
+ // Trigger any bound ready events
436
+ if ( jQuery.fn.trigger ) {
437
+ jQuery( document ).trigger("ready").off("ready");
438
+ }
439
+ },
440
+
441
+ // See test/unit/core.js for details concerning isFunction.
442
+ // Since version 1.3, DOM methods and functions like alert
443
+ // aren't supported. They return false on IE (#2968).
444
+ isFunction: function( obj ) {
445
+ return jQuery.type(obj) === "function";
446
+ },
447
+
448
+ isArray: Array.isArray || function( obj ) {
449
+ return jQuery.type(obj) === "array";
450
+ },
451
+
452
+ isWindow: function( obj ) {
453
+ return obj != null && obj == obj.window;
454
+ },
455
+
456
+ isNumeric: function( obj ) {
457
+ return !isNaN( parseFloat(obj) ) && isFinite( obj );
458
+ },
459
+
460
+ type: function( obj ) {
461
+ if ( obj == null ) {
462
+ return String( obj );
463
+ }
464
+ return typeof obj === "object" || typeof obj === "function" ?
465
+ class2type[ core_toString.call(obj) ] || "object" :
466
+ typeof obj;
467
+ },
468
+
469
+ isPlainObject: function( obj ) {
470
+ // Must be an Object.
471
+ // Because of IE, we also have to check the presence of the constructor property.
472
+ // Make sure that DOM nodes and window objects don't pass through, as well
473
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
474
+ return false;
475
+ }
476
+
477
+ try {
478
+ // Not own constructor property must be Object
479
+ if ( obj.constructor &&
480
+ !core_hasOwn.call(obj, "constructor") &&
481
+ !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
482
+ return false;
483
+ }
484
+ } catch ( e ) {
485
+ // IE8,9 Will throw exceptions on certain host objects #9897
486
+ return false;
487
+ }
488
+
489
+ // Own properties are enumerated firstly, so to speed up,
490
+ // if last one is own, then all properties are own.
491
+
492
+ var key;
493
+ for ( key in obj ) {}
494
+
495
+ return key === undefined || core_hasOwn.call( obj, key );
496
+ },
497
+
498
+ isEmptyObject: function( obj ) {
499
+ var name;
500
+ for ( name in obj ) {
501
+ return false;
502
+ }
503
+ return true;
504
+ },
505
+
506
+ error: function( msg ) {
507
+ throw new Error( msg );
508
+ },
509
+
510
+ // data: string of html
511
+ // context (optional): If specified, the fragment will be created in this context, defaults to document
512
+ // keepScripts (optional): If true, will include scripts passed in the html string
513
+ parseHTML: function( data, context, keepScripts ) {
514
+ if ( !data || typeof data !== "string" ) {
515
+ return null;
516
+ }
517
+ if ( typeof context === "boolean" ) {
518
+ keepScripts = context;
519
+ context = false;
520
+ }
521
+ context = context || document;
522
+
523
+ var parsed = rsingleTag.exec( data ),
524
+ scripts = !keepScripts && [];
525
+
526
+ // Single tag
527
+ if ( parsed ) {
528
+ return [ context.createElement( parsed[1] ) ];
529
+ }
530
+
531
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
532
+ if ( scripts ) {
533
+ jQuery( scripts ).remove();
534
+ }
535
+ return jQuery.merge( [], parsed.childNodes );
536
+ },
537
+
538
+ parseJSON: function( data ) {
539
+ // Attempt to parse using the native JSON parser first
540
+ if ( window.JSON && window.JSON.parse ) {
541
+ return window.JSON.parse( data );
542
+ }
543
+
544
+ if ( data === null ) {
545
+ return data;
546
+ }
547
+
548
+ if ( typeof data === "string" ) {
549
+
550
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
551
+ data = jQuery.trim( data );
552
+
553
+ if ( data ) {
554
+ // Make sure the incoming data is actual JSON
555
+ // Logic borrowed from http://json.org/json2.js
556
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
557
+ .replace( rvalidtokens, "]" )
558
+ .replace( rvalidbraces, "")) ) {
559
+
560
+ return ( new Function( "return " + data ) )();
561
+ }
562
+ }
563
+ }
564
+
565
+ jQuery.error( "Invalid JSON: " + data );
566
+ },
567
+
568
+ // Cross-browser xml parsing
569
+ parseXML: function( data ) {
570
+ var xml, tmp;
571
+ if ( !data || typeof data !== "string" ) {
572
+ return null;
573
+ }
574
+ try {
575
+ if ( window.DOMParser ) { // Standard
576
+ tmp = new DOMParser();
577
+ xml = tmp.parseFromString( data , "text/xml" );
578
+ } else { // IE
579
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
580
+ xml.async = "false";
581
+ xml.loadXML( data );
582
+ }
583
+ } catch( e ) {
584
+ xml = undefined;
585
+ }
586
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
587
+ jQuery.error( "Invalid XML: " + data );
588
+ }
589
+ return xml;
590
+ },
591
+
592
+ noop: function() {},
593
+
594
+ // Evaluates a script in a global context
595
+ // Workarounds based on findings by Jim Driscoll
596
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
597
+ globalEval: function( data ) {
598
+ if ( data && jQuery.trim( data ) ) {
599
+ // We use execScript on Internet Explorer
600
+ // We use an anonymous function so that context is window
601
+ // rather than jQuery in Firefox
602
+ ( window.execScript || function( data ) {
603
+ window[ "eval" ].call( window, data );
604
+ } )( data );
605
+ }
606
+ },
607
+
608
+ // Convert dashed to camelCase; used by the css and data modules
609
+ // Microsoft forgot to hump their vendor prefix (#9572)
610
+ camelCase: function( string ) {
611
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
612
+ },
613
+
614
+ nodeName: function( elem, name ) {
615
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
616
+ },
617
+
618
+ // args is for internal usage only
619
+ each: function( obj, callback, args ) {
620
+ var value,
621
+ i = 0,
622
+ length = obj.length,
623
+ isArray = isArraylike( obj );
624
+
625
+ if ( args ) {
626
+ if ( isArray ) {
627
+ for ( ; i < length; i++ ) {
628
+ value = callback.apply( obj[ i ], args );
629
+
630
+ if ( value === false ) {
631
+ break;
632
+ }
633
+ }
634
+ } else {
635
+ for ( i in obj ) {
636
+ value = callback.apply( obj[ i ], args );
637
+
638
+ if ( value === false ) {
639
+ break;
640
+ }
641
+ }
642
+ }
643
+
644
+ // A special, fast, case for the most common use of each
645
+ } else {
646
+ if ( isArray ) {
647
+ for ( ; i < length; i++ ) {
648
+ value = callback.call( obj[ i ], i, obj[ i ] );
649
+
650
+ if ( value === false ) {
651
+ break;
652
+ }
653
+ }
654
+ } else {
655
+ for ( i in obj ) {
656
+ value = callback.call( obj[ i ], i, obj[ i ] );
657
+
658
+ if ( value === false ) {
659
+ break;
660
+ }
661
+ }
662
+ }
663
+ }
664
+
665
+ return obj;
666
+ },
667
+
668
+ // Use native String.trim function wherever possible
669
+ trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
670
+ function( text ) {
671
+ return text == null ?
672
+ "" :
673
+ core_trim.call( text );
674
+ } :
675
+
676
+ // Otherwise use our own trimming functionality
677
+ function( text ) {
678
+ return text == null ?
679
+ "" :
680
+ ( text + "" ).replace( rtrim, "" );
681
+ },
682
+
683
+ // results is for internal usage only
684
+ makeArray: function( arr, results ) {
685
+ var ret = results || [];
686
+
687
+ if ( arr != null ) {
688
+ if ( isArraylike( Object(arr) ) ) {
689
+ jQuery.merge( ret,
690
+ typeof arr === "string" ?
691
+ [ arr ] : arr
692
+ );
693
+ } else {
694
+ core_push.call( ret, arr );
695
+ }
696
+ }
697
+
698
+ return ret;
699
+ },
700
+
701
+ inArray: function( elem, arr, i ) {
702
+ var len;
703
+
704
+ if ( arr ) {
705
+ if ( core_indexOf ) {
706
+ return core_indexOf.call( arr, elem, i );
707
+ }
708
+
709
+ len = arr.length;
710
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
711
+
712
+ for ( ; i < len; i++ ) {
713
+ // Skip accessing in sparse arrays
714
+ if ( i in arr && arr[ i ] === elem ) {
715
+ return i;
716
+ }
717
+ }
718
+ }
719
+
720
+ return -1;
721
+ },
722
+
723
+ merge: function( first, second ) {
724
+ var l = second.length,
725
+ i = first.length,
726
+ j = 0;
727
+
728
+ if ( typeof l === "number" ) {
729
+ for ( ; j < l; j++ ) {
730
+ first[ i++ ] = second[ j ];
731
+ }
732
+ } else {
733
+ while ( second[j] !== undefined ) {
734
+ first[ i++ ] = second[ j++ ];
735
+ }
736
+ }
737
+
738
+ first.length = i;
739
+
740
+ return first;
741
+ },
742
+
743
+ grep: function( elems, callback, inv ) {
744
+ var retVal,
745
+ ret = [],
746
+ i = 0,
747
+ length = elems.length;
748
+ inv = !!inv;
749
+
750
+ // Go through the array, only saving the items
751
+ // that pass the validator function
752
+ for ( ; i < length; i++ ) {
753
+ retVal = !!callback( elems[ i ], i );
754
+ if ( inv !== retVal ) {
755
+ ret.push( elems[ i ] );
756
+ }
757
+ }
758
+
759
+ return ret;
760
+ },
761
+
762
+ // arg is for internal usage only
763
+ map: function( elems, callback, arg ) {
764
+ var value,
765
+ i = 0,
766
+ length = elems.length,
767
+ isArray = isArraylike( elems ),
768
+ ret = [];
769
+
770
+ // Go through the array, translating each of the items to their
771
+ if ( isArray ) {
772
+ for ( ; i < length; i++ ) {
773
+ value = callback( elems[ i ], i, arg );
774
+
775
+ if ( value != null ) {
776
+ ret[ ret.length ] = value;
777
+ }
778
+ }
779
+
780
+ // Go through every key on the object,
781
+ } else {
782
+ for ( i in elems ) {
783
+ value = callback( elems[ i ], i, arg );
784
+
785
+ if ( value != null ) {
786
+ ret[ ret.length ] = value;
787
+ }
788
+ }
789
+ }
790
+
791
+ // Flatten any nested arrays
792
+ return core_concat.apply( [], ret );
793
+ },
794
+
795
+ // A global GUID counter for objects
796
+ guid: 1,
797
+
798
+ // Bind a function to a context, optionally partially applying any
799
+ // arguments.
800
+ proxy: function( fn, context ) {
801
+ var args, proxy, tmp;
802
+
803
+ if ( typeof context === "string" ) {
804
+ tmp = fn[ context ];
805
+ context = fn;
806
+ fn = tmp;
807
+ }
808
+
809
+ // Quick check to determine if target is callable, in the spec
810
+ // this throws a TypeError, but we will just return undefined.
811
+ if ( !jQuery.isFunction( fn ) ) {
812
+ return undefined;
813
+ }
814
+
815
+ // Simulated bind
816
+ args = core_slice.call( arguments, 2 );
817
+ proxy = function() {
818
+ return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
819
+ };
820
+
821
+ // Set the guid of unique handler to the same of original handler, so it can be removed
822
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
823
+
824
+ return proxy;
825
+ },
826
+
827
+ // Multifunctional method to get and set values of a collection
828
+ // The value/s can optionally be executed if it's a function
829
+ access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
830
+ var i = 0,
831
+ length = elems.length,
832
+ bulk = key == null;
833
+
834
+ // Sets many values
835
+ if ( jQuery.type( key ) === "object" ) {
836
+ chainable = true;
837
+ for ( i in key ) {
838
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
839
+ }
840
+
841
+ // Sets one value
842
+ } else if ( value !== undefined ) {
843
+ chainable = true;
844
+
845
+ if ( !jQuery.isFunction( value ) ) {
846
+ raw = true;
847
+ }
848
+
849
+ if ( bulk ) {
850
+ // Bulk operations run against the entire set
851
+ if ( raw ) {
852
+ fn.call( elems, value );
853
+ fn = null;
854
+
855
+ // ...except when executing function values
856
+ } else {
857
+ bulk = fn;
858
+ fn = function( elem, key, value ) {
859
+ return bulk.call( jQuery( elem ), value );
860
+ };
861
+ }
862
+ }
863
+
864
+ if ( fn ) {
865
+ for ( ; i < length; i++ ) {
866
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
867
+ }
868
+ }
869
+ }
870
+
871
+ return chainable ?
872
+ elems :
873
+
874
+ // Gets
875
+ bulk ?
876
+ fn.call( elems ) :
877
+ length ? fn( elems[0], key ) : emptyGet;
878
+ },
879
+
880
+ now: function() {
881
+ return ( new Date() ).getTime();
882
+ }
883
+ });
884
+
885
+ jQuery.ready.promise = function( obj ) {
886
+ if ( !readyList ) {
887
+
888
+ readyList = jQuery.Deferred();
889
+
890
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
891
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
892
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
893
+ if ( document.readyState === "complete" ) {
894
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
895
+ setTimeout( jQuery.ready );
896
+
897
+ // Standards-based browsers support DOMContentLoaded
898
+ } else if ( document.addEventListener ) {
899
+ // Use the handy event callback
900
+ document.addEventListener( "DOMContentLoaded", completed, false );
901
+
902
+ // A fallback to window.onload, that will always work
903
+ window.addEventListener( "load", completed, false );
904
+
905
+ // If IE event model is used
906
+ } else {
907
+ // Ensure firing before onload, maybe late but safe also for iframes
908
+ document.attachEvent( "onreadystatechange", completed );
909
+
910
+ // A fallback to window.onload, that will always work
911
+ window.attachEvent( "onload", completed );
912
+
913
+ // If IE and not a frame
914
+ // continually check to see if the document is ready
915
+ var top = false;
916
+
917
+ try {
918
+ top = window.frameElement == null && document.documentElement;
919
+ } catch(e) {}
920
+
921
+ if ( top && top.doScroll ) {
922
+ (function doScrollCheck() {
923
+ if ( !jQuery.isReady ) {
924
+
925
+ try {
926
+ // Use the trick by Diego Perini
927
+ // http://javascript.nwbox.com/IEContentLoaded/
928
+ top.doScroll("left");
929
+ } catch(e) {
930
+ return setTimeout( doScrollCheck, 50 );
931
+ }
932
+
933
+ // detach all dom ready events
934
+ detach();
935
+
936
+ // and execute any waiting functions
937
+ jQuery.ready();
938
+ }
939
+ })();
940
+ }
941
+ }
942
+ }
943
+ return readyList.promise( obj );
944
+ };
945
+
946
+ // Populate the class2type map
947
+ jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
948
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
949
+ });
950
+
951
+ function isArraylike( obj ) {
952
+ var length = obj.length,
953
+ type = jQuery.type( obj );
954
+
955
+ if ( jQuery.isWindow( obj ) ) {
956
+ return false;
957
+ }
958
+
959
+ if ( obj.nodeType === 1 && length ) {
960
+ return true;
961
+ }
962
+
963
+ return type === "array" || type !== "function" &&
964
+ ( length === 0 ||
965
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj );
966
+ }
967
+
968
+ // All jQuery objects should point back to these
969
+ rootjQuery = jQuery(document);
970
+ // String to Object options format cache
971
+ var optionsCache = {};
972
+
973
+ // Convert String-formatted options into Object-formatted ones and store in cache
974
+ function createOptions( options ) {
975
+ var object = optionsCache[ options ] = {};
976
+ jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
977
+ object[ flag ] = true;
978
+ });
979
+ return object;
980
+ }
981
+
982
+ /*
983
+ * Create a callback list using the following parameters:
984
+ *
985
+ * options: an optional list of space-separated options that will change how
986
+ * the callback list behaves or a more traditional option object
987
+ *
988
+ * By default a callback list will act like an event callback list and can be
989
+ * "fired" multiple times.
990
+ *
991
+ * Possible options:
992
+ *
993
+ * once: will ensure the callback list can only be fired once (like a Deferred)
994
+ *
995
+ * memory: will keep track of previous values and will call any callback added
996
+ * after the list has been fired right away with the latest "memorized"
997
+ * values (like a Deferred)
998
+ *
999
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
1000
+ *
1001
+ * stopOnFalse: interrupt callings when a callback returns false
1002
+ *
1003
+ */
1004
+ jQuery.Callbacks = function( options ) {
1005
+
1006
+ // Convert options from String-formatted to Object-formatted if needed
1007
+ // (we check in cache first)
1008
+ options = typeof options === "string" ?
1009
+ ( optionsCache[ options ] || createOptions( options ) ) :
1010
+ jQuery.extend( {}, options );
1011
+
1012
+ var // Flag to know if list is currently firing
1013
+ firing,
1014
+ // Last fire value (for non-forgettable lists)
1015
+ memory,
1016
+ // Flag to know if list was already fired
1017
+ fired,
1018
+ // End of the loop when firing
1019
+ firingLength,
1020
+ // Index of currently firing callback (modified by remove if needed)
1021
+ firingIndex,
1022
+ // First callback to fire (used internally by add and fireWith)
1023
+ firingStart,
1024
+ // Actual callback list
1025
+ list = [],
1026
+ // Stack of fire calls for repeatable lists
1027
+ stack = !options.once && [],
1028
+ // Fire callbacks
1029
+ fire = function( data ) {
1030
+ memory = options.memory && data;
1031
+ fired = true;
1032
+ firingIndex = firingStart || 0;
1033
+ firingStart = 0;
1034
+ firingLength = list.length;
1035
+ firing = true;
1036
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
1037
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
1038
+ memory = false; // To prevent further calls using add
1039
+ break;
1040
+ }
1041
+ }
1042
+ firing = false;
1043
+ if ( list ) {
1044
+ if ( stack ) {
1045
+ if ( stack.length ) {
1046
+ fire( stack.shift() );
1047
+ }
1048
+ } else if ( memory ) {
1049
+ list = [];
1050
+ } else {
1051
+ self.disable();
1052
+ }
1053
+ }
1054
+ },
1055
+ // Actual Callbacks object
1056
+ self = {
1057
+ // Add a callback or a collection of callbacks to the list
1058
+ add: function() {
1059
+ if ( list ) {
1060
+ // First, we save the current length
1061
+ var start = list.length;
1062
+ (function add( args ) {
1063
+ jQuery.each( args, function( _, arg ) {
1064
+ var type = jQuery.type( arg );
1065
+ if ( type === "function" ) {
1066
+ if ( !options.unique || !self.has( arg ) ) {
1067
+ list.push( arg );
1068
+ }
1069
+ } else if ( arg && arg.length && type !== "string" ) {
1070
+ // Inspect recursively
1071
+ add( arg );
1072
+ }
1073
+ });
1074
+ })( arguments );
1075
+ // Do we need to add the callbacks to the
1076
+ // current firing batch?
1077
+ if ( firing ) {
1078
+ firingLength = list.length;
1079
+ // With memory, if we're not firing then
1080
+ // we should call right away
1081
+ } else if ( memory ) {
1082
+ firingStart = start;
1083
+ fire( memory );
1084
+ }
1085
+ }
1086
+ return this;
1087
+ },
1088
+ // Remove a callback from the list
1089
+ remove: function() {
1090
+ if ( list ) {
1091
+ jQuery.each( arguments, function( _, arg ) {
1092
+ var index;
1093
+ while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
1094
+ list.splice( index, 1 );
1095
+ // Handle firing indexes
1096
+ if ( firing ) {
1097
+ if ( index <= firingLength ) {
1098
+ firingLength--;
1099
+ }
1100
+ if ( index <= firingIndex ) {
1101
+ firingIndex--;
1102
+ }
1103
+ }
1104
+ }
1105
+ });
1106
+ }
1107
+ return this;
1108
+ },
1109
+ // Check if a given callback is in the list.
1110
+ // If no argument is given, return whether or not list has callbacks attached.
1111
+ has: function( fn ) {
1112
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
1113
+ },
1114
+ // Remove all callbacks from the list
1115
+ empty: function() {
1116
+ list = [];
1117
+ return this;
1118
+ },
1119
+ // Have the list do nothing anymore
1120
+ disable: function() {
1121
+ list = stack = memory = undefined;
1122
+ return this;
1123
+ },
1124
+ // Is it disabled?
1125
+ disabled: function() {
1126
+ return !list;
1127
+ },
1128
+ // Lock the list in its current state
1129
+ lock: function() {
1130
+ stack = undefined;
1131
+ if ( !memory ) {
1132
+ self.disable();
1133
+ }
1134
+ return this;
1135
+ },
1136
+ // Is it locked?
1137
+ locked: function() {
1138
+ return !stack;
1139
+ },
1140
+ // Call all callbacks with the given context and arguments
1141
+ fireWith: function( context, args ) {
1142
+ args = args || [];
1143
+ args = [ context, args.slice ? args.slice() : args ];
1144
+ if ( list && ( !fired || stack ) ) {
1145
+ if ( firing ) {
1146
+ stack.push( args );
1147
+ } else {
1148
+ fire( args );
1149
+ }
1150
+ }
1151
+ return this;
1152
+ },
1153
+ // Call all the callbacks with the given arguments
1154
+ fire: function() {
1155
+ self.fireWith( this, arguments );
1156
+ return this;
1157
+ },
1158
+ // To know if the callbacks have already been called at least once
1159
+ fired: function() {
1160
+ return !!fired;
1161
+ }
1162
+ };
1163
+
1164
+ return self;
1165
+ };
1166
+ jQuery.extend({
1167
+
1168
+ Deferred: function( func ) {
1169
+ var tuples = [
1170
+ // action, add listener, listener list, final state
1171
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
1172
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
1173
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
1174
+ ],
1175
+ state = "pending",
1176
+ promise = {
1177
+ state: function() {
1178
+ return state;
1179
+ },
1180
+ always: function() {
1181
+ deferred.done( arguments ).fail( arguments );
1182
+ return this;
1183
+ },
1184
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
1185
+ var fns = arguments;
1186
+ return jQuery.Deferred(function( newDefer ) {
1187
+ jQuery.each( tuples, function( i, tuple ) {
1188
+ var action = tuple[ 0 ],
1189
+ fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
1190
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
1191
+ deferred[ tuple[1] ](function() {
1192
+ var returned = fn && fn.apply( this, arguments );
1193
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
1194
+ returned.promise()
1195
+ .done( newDefer.resolve )
1196
+ .fail( newDefer.reject )
1197
+ .progress( newDefer.notify );
1198
+ } else {
1199
+ newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
1200
+ }
1201
+ });
1202
+ });
1203
+ fns = null;
1204
+ }).promise();
1205
+ },
1206
+ // Get a promise for this deferred
1207
+ // If obj is provided, the promise aspect is added to the object
1208
+ promise: function( obj ) {
1209
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
1210
+ }
1211
+ },
1212
+ deferred = {};
1213
+
1214
+ // Keep pipe for back-compat
1215
+ promise.pipe = promise.then;
1216
+
1217
+ // Add list-specific methods
1218
+ jQuery.each( tuples, function( i, tuple ) {
1219
+ var list = tuple[ 2 ],
1220
+ stateString = tuple[ 3 ];
1221
+
1222
+ // promise[ done | fail | progress ] = list.add
1223
+ promise[ tuple[1] ] = list.add;
1224
+
1225
+ // Handle state
1226
+ if ( stateString ) {
1227
+ list.add(function() {
1228
+ // state = [ resolved | rejected ]
1229
+ state = stateString;
1230
+
1231
+ // [ reject_list | resolve_list ].disable; progress_list.lock
1232
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
1233
+ }
1234
+
1235
+ // deferred[ resolve | reject | notify ]
1236
+ deferred[ tuple[0] ] = function() {
1237
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
1238
+ return this;
1239
+ };
1240
+ deferred[ tuple[0] + "With" ] = list.fireWith;
1241
+ });
1242
+
1243
+ // Make the deferred a promise
1244
+ promise.promise( deferred );
1245
+
1246
+ // Call given func if any
1247
+ if ( func ) {
1248
+ func.call( deferred, deferred );
1249
+ }
1250
+
1251
+ // All done!
1252
+ return deferred;
1253
+ },
1254
+
1255
+ // Deferred helper
1256
+ when: function( subordinate /* , ..., subordinateN */ ) {
1257
+ var i = 0,
1258
+ resolveValues = core_slice.call( arguments ),
1259
+ length = resolveValues.length,
1260
+
1261
+ // the count of uncompleted subordinates
1262
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
1263
+
1264
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
1265
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
1266
+
1267
+ // Update function for both resolve and progress values
1268
+ updateFunc = function( i, contexts, values ) {
1269
+ return function( value ) {
1270
+ contexts[ i ] = this;
1271
+ values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
1272
+ if( values === progressValues ) {
1273
+ deferred.notifyWith( contexts, values );
1274
+ } else if ( !( --remaining ) ) {
1275
+ deferred.resolveWith( contexts, values );
1276
+ }
1277
+ };
1278
+ },
1279
+
1280
+ progressValues, progressContexts, resolveContexts;
1281
+
1282
+ // add listeners to Deferred subordinates; treat others as resolved
1283
+ if ( length > 1 ) {
1284
+ progressValues = new Array( length );
1285
+ progressContexts = new Array( length );
1286
+ resolveContexts = new Array( length );
1287
+ for ( ; i < length; i++ ) {
1288
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
1289
+ resolveValues[ i ].promise()
1290
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
1291
+ .fail( deferred.reject )
1292
+ .progress( updateFunc( i, progressContexts, progressValues ) );
1293
+ } else {
1294
+ --remaining;
1295
+ }
1296
+ }
1297
+ }
1298
+
1299
+ // if we're not waiting on anything, resolve the master
1300
+ if ( !remaining ) {
1301
+ deferred.resolveWith( resolveContexts, resolveValues );
1302
+ }
1303
+
1304
+ return deferred.promise();
1305
+ }
1306
+ });
1307
+ jQuery.support = (function() {
1308
+
1309
+ var support, all, a,
1310
+ input, select, fragment,
1311
+ opt, eventName, isSupported, i,
1312
+ div = document.createElement("div");
1313
+
1314
+ // Setup
1315
+ div.setAttribute( "className", "t" );
1316
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
1317
+
1318
+ // Support tests won't run in some limited or non-browser environments
1319
+ all = div.getElementsByTagName("*");
1320
+ a = div.getElementsByTagName("a")[ 0 ];
1321
+ if ( !all || !a || !all.length ) {
1322
+ return {};
1323
+ }
1324
+
1325
+ // First batch of tests
1326
+ select = document.createElement("select");
1327
+ opt = select.appendChild( document.createElement("option") );
1328
+ input = div.getElementsByTagName("input")[ 0 ];
1329
+
1330
+ a.style.cssText = "top:1px;float:left;opacity:.5";
1331
+ support = {
1332
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
1333
+ getSetAttribute: div.className !== "t",
1334
+
1335
+ // IE strips leading whitespace when .innerHTML is used
1336
+ leadingWhitespace: div.firstChild.nodeType === 3,
1337
+
1338
+ // Make sure that tbody elements aren't automatically inserted
1339
+ // IE will insert them into empty tables
1340
+ tbody: !div.getElementsByTagName("tbody").length,
1341
+
1342
+ // Make sure that link elements get serialized correctly by innerHTML
1343
+ // This requires a wrapper element in IE
1344
+ htmlSerialize: !!div.getElementsByTagName("link").length,
1345
+
1346
+ // Get the style information from getAttribute
1347
+ // (IE uses .cssText instead)
1348
+ style: /top/.test( a.getAttribute("style") ),
1349
+
1350
+ // Make sure that URLs aren't manipulated
1351
+ // (IE normalizes it by default)
1352
+ hrefNormalized: a.getAttribute("href") === "/a",
1353
+
1354
+ // Make sure that element opacity exists
1355
+ // (IE uses filter instead)
1356
+ // Use a regex to work around a WebKit issue. See #5145
1357
+ opacity: /^0.5/.test( a.style.opacity ),
1358
+
1359
+ // Verify style float existence
1360
+ // (IE uses styleFloat instead of cssFloat)
1361
+ cssFloat: !!a.style.cssFloat,
1362
+
1363
+ // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
1364
+ checkOn: !!input.value,
1365
+
1366
+ // Make sure that a selected-by-default option has a working selected property.
1367
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
1368
+ optSelected: opt.selected,
1369
+
1370
+ // Tests for enctype support on a form (#6743)
1371
+ enctype: !!document.createElement("form").enctype,
1372
+
1373
+ // Makes sure cloning an html5 element does not cause problems
1374
+ // Where outerHTML is undefined, this still works
1375
+ html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
1376
+
1377
+ // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
1378
+ boxModel: document.compatMode === "CSS1Compat",
1379
+
1380
+ // Will be defined later
1381
+ deleteExpando: true,
1382
+ noCloneEvent: true,
1383
+ inlineBlockNeedsLayout: false,
1384
+ shrinkWrapBlocks: false,
1385
+ reliableMarginRight: true,
1386
+ boxSizingReliable: true,
1387
+ pixelPosition: false
1388
+ };
1389
+
1390
+ // Make sure checked status is properly cloned
1391
+ input.checked = true;
1392
+ support.noCloneChecked = input.cloneNode( true ).checked;
1393
+
1394
+ // Make sure that the options inside disabled selects aren't marked as disabled
1395
+ // (WebKit marks them as disabled)
1396
+ select.disabled = true;
1397
+ support.optDisabled = !opt.disabled;
1398
+
1399
+ // Support: IE<9
1400
+ try {
1401
+ delete div.test;
1402
+ } catch( e ) {
1403
+ support.deleteExpando = false;
1404
+ }
1405
+
1406
+ // Check if we can trust getAttribute("value")
1407
+ input = document.createElement("input");
1408
+ input.setAttribute( "value", "" );
1409
+ support.input = input.getAttribute( "value" ) === "";
1410
+
1411
+ // Check if an input maintains its value after becoming a radio
1412
+ input.value = "t";
1413
+ input.setAttribute( "type", "radio" );
1414
+ support.radioValue = input.value === "t";
1415
+
1416
+ // #11217 - WebKit loses check when the name is after the checked attribute
1417
+ input.setAttribute( "checked", "t" );
1418
+ input.setAttribute( "name", "t" );
1419
+
1420
+ fragment = document.createDocumentFragment();
1421
+ fragment.appendChild( input );
1422
+
1423
+ // Check if a disconnected checkbox will retain its checked
1424
+ // value of true after appended to the DOM (IE6/7)
1425
+ support.appendChecked = input.checked;
1426
+
1427
+ // WebKit doesn't clone checked state correctly in fragments
1428
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
1429
+
1430
+ // Support: IE<9
1431
+ // Opera does not clone events (and typeof div.attachEvent === undefined).
1432
+ // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
1433
+ if ( div.attachEvent ) {
1434
+ div.attachEvent( "onclick", function() {
1435
+ support.noCloneEvent = false;
1436
+ });
1437
+
1438
+ div.cloneNode( true ).click();
1439
+ }
1440
+
1441
+ // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
1442
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
1443
+ for ( i in { submit: true, change: true, focusin: true }) {
1444
+ div.setAttribute( eventName = "on" + i, "t" );
1445
+
1446
+ support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
1447
+ }
1448
+
1449
+ div.style.backgroundClip = "content-box";
1450
+ div.cloneNode( true ).style.backgroundClip = "";
1451
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
1452
+
1453
+ // Run tests that need a body at doc ready
1454
+ jQuery(function() {
1455
+ var container, marginDiv, tds,
1456
+ divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
1457
+ body = document.getElementsByTagName("body")[0];
1458
+
1459
+ if ( !body ) {
1460
+ // Return for frameset docs that don't have a body
1461
+ return;
1462
+ }
1463
+
1464
+ container = document.createElement("div");
1465
+ container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
1466
+
1467
+ body.appendChild( container ).appendChild( div );
1468
+
1469
+ // Support: IE8
1470
+ // Check if table cells still have offsetWidth/Height when they are set
1471
+ // to display:none and there are still other visible table cells in a
1472
+ // table row; if so, offsetWidth/Height are not reliable for use when
1473
+ // determining if an element has been hidden directly using
1474
+ // display:none (it is still safe to use offsets if a parent element is
1475
+ // hidden; don safety goggles and see bug #4512 for more information).
1476
+ div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
1477
+ tds = div.getElementsByTagName("td");
1478
+ tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
1479
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
1480
+
1481
+ tds[ 0 ].style.display = "";
1482
+ tds[ 1 ].style.display = "none";
1483
+
1484
+ // Support: IE8
1485
+ // Check if empty table cells still have offsetWidth/Height
1486
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
1487
+
1488
+ // Check box-sizing and margin behavior
1489
+ div.innerHTML = "";
1490
+ 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%;";
1491
+ support.boxSizing = ( div.offsetWidth === 4 );
1492
+ support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
1493
+
1494
+ // Use window.getComputedStyle because jsdom on node.js will break without it.
1495
+ if ( window.getComputedStyle ) {
1496
+ support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
1497
+ support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
1498
+
1499
+ // Check if div with explicit width and no margin-right incorrectly
1500
+ // gets computed margin-right based on width of container. (#3333)
1501
+ // Fails in WebKit before Feb 2011 nightlies
1502
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
1503
+ marginDiv = div.appendChild( document.createElement("div") );
1504
+ marginDiv.style.cssText = div.style.cssText = divReset;
1505
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
1506
+ div.style.width = "1px";
1507
+
1508
+ support.reliableMarginRight =
1509
+ !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
1510
+ }
1511
+
1512
+ if ( typeof div.style.zoom !== core_strundefined ) {
1513
+ // Support: IE<8
1514
+ // Check if natively block-level elements act like inline-block
1515
+ // elements when setting their display to 'inline' and giving
1516
+ // them layout
1517
+ div.innerHTML = "";
1518
+ div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
1519
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
1520
+
1521
+ // Support: IE6
1522
+ // Check if elements with layout shrink-wrap their children
1523
+ div.style.display = "block";
1524
+ div.innerHTML = "<div></div>";
1525
+ div.firstChild.style.width = "5px";
1526
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
1527
+
1528
+ if ( support.inlineBlockNeedsLayout ) {
1529
+ // Prevent IE 6 from affecting layout for positioned elements #11048
1530
+ // Prevent IE from shrinking the body in IE 7 mode #12869
1531
+ // Support: IE<8
1532
+ body.style.zoom = 1;
1533
+ }
1534
+ }
1535
+
1536
+ body.removeChild( container );
1537
+
1538
+ // Null elements to avoid leaks in IE
1539
+ container = div = tds = marginDiv = null;
1540
+ });
1541
+
1542
+ // Null elements to avoid leaks in IE
1543
+ all = select = fragment = opt = a = input = null;
1544
+
1545
+ return support;
1546
+ })();
1547
+
1548
+ var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
1549
+ rmultiDash = /([A-Z])/g;
1550
+
1551
+ function internalData( elem, name, data, pvt /* Internal Use Only */ ){
1552
+ if ( !jQuery.acceptData( elem ) ) {
1553
+ return;
1554
+ }
1555
+
1556
+ var thisCache, ret,
1557
+ internalKey = jQuery.expando,
1558
+ getByName = typeof name === "string",
1559
+
1560
+ // We have to handle DOM nodes and JS objects differently because IE6-7
1561
+ // can't GC object references properly across the DOM-JS boundary
1562
+ isNode = elem.nodeType,
1563
+
1564
+ // Only DOM nodes need the global jQuery cache; JS object data is
1565
+ // attached directly to the object so GC can occur automatically
1566
+ cache = isNode ? jQuery.cache : elem,
1567
+
1568
+ // Only defining an ID for JS objects if its cache already exists allows
1569
+ // the code to shortcut on the same path as a DOM node with no cache
1570
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
1571
+
1572
+ // Avoid doing any more work than we need to when trying to get data on an
1573
+ // object that has no data at all
1574
+ if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
1575
+ return;
1576
+ }
1577
+
1578
+ if ( !id ) {
1579
+ // Only DOM nodes need a new unique ID for each element since their data
1580
+ // ends up in the global cache
1581
+ if ( isNode ) {
1582
+ elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
1583
+ } else {
1584
+ id = internalKey;
1585
+ }
1586
+ }
1587
+
1588
+ if ( !cache[ id ] ) {
1589
+ cache[ id ] = {};
1590
+
1591
+ // Avoids exposing jQuery metadata on plain JS objects when the object
1592
+ // is serialized using JSON.stringify
1593
+ if ( !isNode ) {
1594
+ cache[ id ].toJSON = jQuery.noop;
1595
+ }
1596
+ }
1597
+
1598
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
1599
+ // shallow copied over onto the existing cache
1600
+ if ( typeof name === "object" || typeof name === "function" ) {
1601
+ if ( pvt ) {
1602
+ cache[ id ] = jQuery.extend( cache[ id ], name );
1603
+ } else {
1604
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
1605
+ }
1606
+ }
1607
+
1608
+ thisCache = cache[ id ];
1609
+
1610
+ // jQuery data() is stored in a separate object inside the object's internal data
1611
+ // cache in order to avoid key collisions between internal data and user-defined
1612
+ // data.
1613
+ if ( !pvt ) {
1614
+ if ( !thisCache.data ) {
1615
+ thisCache.data = {};
1616
+ }
1617
+
1618
+ thisCache = thisCache.data;
1619
+ }
1620
+
1621
+ if ( data !== undefined ) {
1622
+ thisCache[ jQuery.camelCase( name ) ] = data;
1623
+ }
1624
+
1625
+ // Check for both converted-to-camel and non-converted data property names
1626
+ // If a data property was specified
1627
+ if ( getByName ) {
1628
+
1629
+ // First Try to find as-is property data
1630
+ ret = thisCache[ name ];
1631
+
1632
+ // Test for null|undefined property data
1633
+ if ( ret == null ) {
1634
+
1635
+ // Try to find the camelCased property
1636
+ ret = thisCache[ jQuery.camelCase( name ) ];
1637
+ }
1638
+ } else {
1639
+ ret = thisCache;
1640
+ }
1641
+
1642
+ return ret;
1643
+ }
1644
+
1645
+ function internalRemoveData( elem, name, pvt ) {
1646
+ if ( !jQuery.acceptData( elem ) ) {
1647
+ return;
1648
+ }
1649
+
1650
+ var i, l, thisCache,
1651
+ isNode = elem.nodeType,
1652
+
1653
+ // See jQuery.data for more information
1654
+ cache = isNode ? jQuery.cache : elem,
1655
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
1656
+
1657
+ // If there is already no cache entry for this object, there is no
1658
+ // purpose in continuing
1659
+ if ( !cache[ id ] ) {
1660
+ return;
1661
+ }
1662
+
1663
+ if ( name ) {
1664
+
1665
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
1666
+
1667
+ if ( thisCache ) {
1668
+
1669
+ // Support array or space separated string names for data keys
1670
+ if ( !jQuery.isArray( name ) ) {
1671
+
1672
+ // try the string as a key before any manipulation
1673
+ if ( name in thisCache ) {
1674
+ name = [ name ];
1675
+ } else {
1676
+
1677
+ // split the camel cased version by spaces unless a key with the spaces exists
1678
+ name = jQuery.camelCase( name );
1679
+ if ( name in thisCache ) {
1680
+ name = [ name ];
1681
+ } else {
1682
+ name = name.split(" ");
1683
+ }
1684
+ }
1685
+ } else {
1686
+ // If "name" is an array of keys...
1687
+ // When data is initially created, via ("key", "val") signature,
1688
+ // keys will be converted to camelCase.
1689
+ // Since there is no way to tell _how_ a key was added, remove
1690
+ // both plain key and camelCase key. #12786
1691
+ // This will only penalize the array argument path.
1692
+ name = name.concat( jQuery.map( name, jQuery.camelCase ) );
1693
+ }
1694
+
1695
+ for ( i = 0, l = name.length; i < l; i++ ) {
1696
+ delete thisCache[ name[i] ];
1697
+ }
1698
+
1699
+ // If there is no data left in the cache, we want to continue
1700
+ // and let the cache object itself get destroyed
1701
+ if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
1702
+ return;
1703
+ }
1704
+ }
1705
+ }
1706
+
1707
+ // See jQuery.data for more information
1708
+ if ( !pvt ) {
1709
+ delete cache[ id ].data;
1710
+
1711
+ // Don't destroy the parent cache unless the internal data object
1712
+ // had been the only thing left in it
1713
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
1714
+ return;
1715
+ }
1716
+ }
1717
+
1718
+ // Destroy the cache
1719
+ if ( isNode ) {
1720
+ jQuery.cleanData( [ elem ], true );
1721
+
1722
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
1723
+ } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
1724
+ delete cache[ id ];
1725
+
1726
+ // When all else fails, null
1727
+ } else {
1728
+ cache[ id ] = null;
1729
+ }
1730
+ }
1731
+
1732
+ jQuery.extend({
1733
+ cache: {},
1734
+
1735
+ // Unique for each copy of jQuery on the page
1736
+ // Non-digits removed to match rinlinejQuery
1737
+ expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
1738
+
1739
+ // The following elements throw uncatchable exceptions if you
1740
+ // attempt to add expando properties to them.
1741
+ noData: {
1742
+ "embed": true,
1743
+ // Ban all objects except for Flash (which handle expandos)
1744
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
1745
+ "applet": true
1746
+ },
1747
+
1748
+ hasData: function( elem ) {
1749
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
1750
+ return !!elem && !isEmptyDataObject( elem );
1751
+ },
1752
+
1753
+ data: function( elem, name, data ) {
1754
+ return internalData( elem, name, data );
1755
+ },
1756
+
1757
+ removeData: function( elem, name ) {
1758
+ return internalRemoveData( elem, name );
1759
+ },
1760
+
1761
+ // For internal use only.
1762
+ _data: function( elem, name, data ) {
1763
+ return internalData( elem, name, data, true );
1764
+ },
1765
+
1766
+ _removeData: function( elem, name ) {
1767
+ return internalRemoveData( elem, name, true );
1768
+ },
1769
+
1770
+ // A method for determining if a DOM node can handle the data expando
1771
+ acceptData: function( elem ) {
1772
+ // Do not set data on non-element because it will not be cleared (#8335).
1773
+ if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
1774
+ return false;
1775
+ }
1776
+
1777
+ var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
1778
+
1779
+ // nodes accept data unless otherwise specified; rejection can be conditional
1780
+ return !noData || noData !== true && elem.getAttribute("classid") === noData;
1781
+ }
1782
+ });
1783
+
1784
+ jQuery.fn.extend({
1785
+ data: function( key, value ) {
1786
+ var attrs, name,
1787
+ elem = this[0],
1788
+ i = 0,
1789
+ data = null;
1790
+
1791
+ // Gets all values
1792
+ if ( key === undefined ) {
1793
+ if ( this.length ) {
1794
+ data = jQuery.data( elem );
1795
+
1796
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
1797
+ attrs = elem.attributes;
1798
+ for ( ; i < attrs.length; i++ ) {
1799
+ name = attrs[i].name;
1800
+
1801
+ if ( !name.indexOf( "data-" ) ) {
1802
+ name = jQuery.camelCase( name.slice(5) );
1803
+
1804
+ dataAttr( elem, name, data[ name ] );
1805
+ }
1806
+ }
1807
+ jQuery._data( elem, "parsedAttrs", true );
1808
+ }
1809
+ }
1810
+
1811
+ return data;
1812
+ }
1813
+
1814
+ // Sets multiple values
1815
+ if ( typeof key === "object" ) {
1816
+ return this.each(function() {
1817
+ jQuery.data( this, key );
1818
+ });
1819
+ }
1820
+
1821
+ return jQuery.access( this, function( value ) {
1822
+
1823
+ if ( value === undefined ) {
1824
+ // Try to fetch any internally stored data first
1825
+ return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
1826
+ }
1827
+
1828
+ this.each(function() {
1829
+ jQuery.data( this, key, value );
1830
+ });
1831
+ }, null, value, arguments.length > 1, null, true );
1832
+ },
1833
+
1834
+ removeData: function( key ) {
1835
+ return this.each(function() {
1836
+ jQuery.removeData( this, key );
1837
+ });
1838
+ }
1839
+ });
1840
+
1841
+ function dataAttr( elem, key, data ) {
1842
+ // If nothing was found internally, try to fetch any
1843
+ // data from the HTML5 data-* attribute
1844
+ if ( data === undefined && elem.nodeType === 1 ) {
1845
+
1846
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
1847
+
1848
+ data = elem.getAttribute( name );
1849
+
1850
+ if ( typeof data === "string" ) {
1851
+ try {
1852
+ data = data === "true" ? true :
1853
+ data === "false" ? false :
1854
+ data === "null" ? null :
1855
+ // Only convert to a number if it doesn't change the string
1856
+ +data + "" === data ? +data :
1857
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
1858
+ data;
1859
+ } catch( e ) {}
1860
+
1861
+ // Make sure we set the data so it isn't changed later
1862
+ jQuery.data( elem, key, data );
1863
+
1864
+ } else {
1865
+ data = undefined;
1866
+ }
1867
+ }
1868
+
1869
+ return data;
1870
+ }
1871
+
1872
+ // checks a cache object for emptiness
1873
+ function isEmptyDataObject( obj ) {
1874
+ var name;
1875
+ for ( name in obj ) {
1876
+
1877
+ // if the public data object is empty, the private is still empty
1878
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
1879
+ continue;
1880
+ }
1881
+ if ( name !== "toJSON" ) {
1882
+ return false;
1883
+ }
1884
+ }
1885
+
1886
+ return true;
1887
+ }
1888
+ jQuery.extend({
1889
+ queue: function( elem, type, data ) {
1890
+ var queue;
1891
+
1892
+ if ( elem ) {
1893
+ type = ( type || "fx" ) + "queue";
1894
+ queue = jQuery._data( elem, type );
1895
+
1896
+ // Speed up dequeue by getting out quickly if this is just a lookup
1897
+ if ( data ) {
1898
+ if ( !queue || jQuery.isArray(data) ) {
1899
+ queue = jQuery._data( elem, type, jQuery.makeArray(data) );
1900
+ } else {
1901
+ queue.push( data );
1902
+ }
1903
+ }
1904
+ return queue || [];
1905
+ }
1906
+ },
1907
+
1908
+ dequeue: function( elem, type ) {
1909
+ type = type || "fx";
1910
+
1911
+ var queue = jQuery.queue( elem, type ),
1912
+ startLength = queue.length,
1913
+ fn = queue.shift(),
1914
+ hooks = jQuery._queueHooks( elem, type ),
1915
+ next = function() {
1916
+ jQuery.dequeue( elem, type );
1917
+ };
1918
+
1919
+ // If the fx queue is dequeued, always remove the progress sentinel
1920
+ if ( fn === "inprogress" ) {
1921
+ fn = queue.shift();
1922
+ startLength--;
1923
+ }
1924
+
1925
+ hooks.cur = fn;
1926
+ if ( fn ) {
1927
+
1928
+ // Add a progress sentinel to prevent the fx queue from being
1929
+ // automatically dequeued
1930
+ if ( type === "fx" ) {
1931
+ queue.unshift( "inprogress" );
1932
+ }
1933
+
1934
+ // clear up the last queue stop function
1935
+ delete hooks.stop;
1936
+ fn.call( elem, next, hooks );
1937
+ }
1938
+
1939
+ if ( !startLength && hooks ) {
1940
+ hooks.empty.fire();
1941
+ }
1942
+ },
1943
+
1944
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
1945
+ _queueHooks: function( elem, type ) {
1946
+ var key = type + "queueHooks";
1947
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
1948
+ empty: jQuery.Callbacks("once memory").add(function() {
1949
+ jQuery._removeData( elem, type + "queue" );
1950
+ jQuery._removeData( elem, key );
1951
+ })
1952
+ });
1953
+ }
1954
+ });
1955
+
1956
+ jQuery.fn.extend({
1957
+ queue: function( type, data ) {
1958
+ var setter = 2;
1959
+
1960
+ if ( typeof type !== "string" ) {
1961
+ data = type;
1962
+ type = "fx";
1963
+ setter--;
1964
+ }
1965
+
1966
+ if ( arguments.length < setter ) {
1967
+ return jQuery.queue( this[0], type );
1968
+ }
1969
+
1970
+ return data === undefined ?
1971
+ this :
1972
+ this.each(function() {
1973
+ var queue = jQuery.queue( this, type, data );
1974
+
1975
+ // ensure a hooks for this queue
1976
+ jQuery._queueHooks( this, type );
1977
+
1978
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
1979
+ jQuery.dequeue( this, type );
1980
+ }
1981
+ });
1982
+ },
1983
+ dequeue: function( type ) {
1984
+ return this.each(function() {
1985
+ jQuery.dequeue( this, type );
1986
+ });
1987
+ },
1988
+ // Based off of the plugin by Clint Helfers, with permission.
1989
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
1990
+ delay: function( time, type ) {
1991
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
1992
+ type = type || "fx";
1993
+
1994
+ return this.queue( type, function( next, hooks ) {
1995
+ var timeout = setTimeout( next, time );
1996
+ hooks.stop = function() {
1997
+ clearTimeout( timeout );
1998
+ };
1999
+ });
2000
+ },
2001
+ clearQueue: function( type ) {
2002
+ return this.queue( type || "fx", [] );
2003
+ },
2004
+ // Get a promise resolved when queues of a certain type
2005
+ // are emptied (fx is the type by default)
2006
+ promise: function( type, obj ) {
2007
+ var tmp,
2008
+ count = 1,
2009
+ defer = jQuery.Deferred(),
2010
+ elements = this,
2011
+ i = this.length,
2012
+ resolve = function() {
2013
+ if ( !( --count ) ) {
2014
+ defer.resolveWith( elements, [ elements ] );
2015
+ }
2016
+ };
2017
+
2018
+ if ( typeof type !== "string" ) {
2019
+ obj = type;
2020
+ type = undefined;
2021
+ }
2022
+ type = type || "fx";
2023
+
2024
+ while( i-- ) {
2025
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
2026
+ if ( tmp && tmp.empty ) {
2027
+ count++;
2028
+ tmp.empty.add( resolve );
2029
+ }
2030
+ }
2031
+ resolve();
2032
+ return defer.promise( obj );
2033
+ }
2034
+ });
2035
+ var nodeHook, boolHook,
2036
+ rclass = /[\t\r\n]/g,
2037
+ rreturn = /\r/g,
2038
+ rfocusable = /^(?:input|select|textarea|button|object)$/i,
2039
+ rclickable = /^(?:a|area)$/i,
2040
+ rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
2041
+ ruseDefault = /^(?:checked|selected)$/i,
2042
+ getSetAttribute = jQuery.support.getSetAttribute,
2043
+ getSetInput = jQuery.support.input;
2044
+
2045
+ jQuery.fn.extend({
2046
+ attr: function( name, value ) {
2047
+ return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
2048
+ },
2049
+
2050
+ removeAttr: function( name ) {
2051
+ return this.each(function() {
2052
+ jQuery.removeAttr( this, name );
2053
+ });
2054
+ },
2055
+
2056
+ prop: function( name, value ) {
2057
+ return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
2058
+ },
2059
+
2060
+ removeProp: function( name ) {
2061
+ name = jQuery.propFix[ name ] || name;
2062
+ return this.each(function() {
2063
+ // try/catch handles cases where IE balks (such as removing a property on window)
2064
+ try {
2065
+ this[ name ] = undefined;
2066
+ delete this[ name ];
2067
+ } catch( e ) {}
2068
+ });
2069
+ },
2070
+
2071
+ addClass: function( value ) {
2072
+ var classes, elem, cur, clazz, j,
2073
+ i = 0,
2074
+ len = this.length,
2075
+ proceed = typeof value === "string" && value;
2076
+
2077
+ if ( jQuery.isFunction( value ) ) {
2078
+ return this.each(function( j ) {
2079
+ jQuery( this ).addClass( value.call( this, j, this.className ) );
2080
+ });
2081
+ }
2082
+
2083
+ if ( proceed ) {
2084
+ // The disjunction here is for better compressibility (see removeClass)
2085
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
2086
+
2087
+ for ( ; i < len; i++ ) {
2088
+ elem = this[ i ];
2089
+ cur = elem.nodeType === 1 && ( elem.className ?
2090
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
2091
+ " "
2092
+ );
2093
+
2094
+ if ( cur ) {
2095
+ j = 0;
2096
+ while ( (clazz = classes[j++]) ) {
2097
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
2098
+ cur += clazz + " ";
2099
+ }
2100
+ }
2101
+ elem.className = jQuery.trim( cur );
2102
+
2103
+ }
2104
+ }
2105
+ }
2106
+
2107
+ return this;
2108
+ },
2109
+
2110
+ removeClass: function( value ) {
2111
+ var classes, elem, cur, clazz, j,
2112
+ i = 0,
2113
+ len = this.length,
2114
+ proceed = arguments.length === 0 || typeof value === "string" && value;
2115
+
2116
+ if ( jQuery.isFunction( value ) ) {
2117
+ return this.each(function( j ) {
2118
+ jQuery( this ).removeClass( value.call( this, j, this.className ) );
2119
+ });
2120
+ }
2121
+ if ( proceed ) {
2122
+ classes = ( value || "" ).match( core_rnotwhite ) || [];
2123
+
2124
+ for ( ; i < len; i++ ) {
2125
+ elem = this[ i ];
2126
+ // This expression is here for better compressibility (see addClass)
2127
+ cur = elem.nodeType === 1 && ( elem.className ?
2128
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
2129
+ ""
2130
+ );
2131
+
2132
+ if ( cur ) {
2133
+ j = 0;
2134
+ while ( (clazz = classes[j++]) ) {
2135
+ // Remove *all* instances
2136
+ while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
2137
+ cur = cur.replace( " " + clazz + " ", " " );
2138
+ }
2139
+ }
2140
+ elem.className = value ? jQuery.trim( cur ) : "";
2141
+ }
2142
+ }
2143
+ }
2144
+
2145
+ return this;
2146
+ },
2147
+
2148
+ toggleClass: function( value, stateVal ) {
2149
+ var type = typeof value,
2150
+ isBool = typeof stateVal === "boolean";
2151
+
2152
+ if ( jQuery.isFunction( value ) ) {
2153
+ return this.each(function( i ) {
2154
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
2155
+ });
2156
+ }
2157
+
2158
+ return this.each(function() {
2159
+ if ( type === "string" ) {
2160
+ // toggle individual class names
2161
+ var className,
2162
+ i = 0,
2163
+ self = jQuery( this ),
2164
+ state = stateVal,
2165
+ classNames = value.match( core_rnotwhite ) || [];
2166
+
2167
+ while ( (className = classNames[ i++ ]) ) {
2168
+ // check each className given, space separated list
2169
+ state = isBool ? state : !self.hasClass( className );
2170
+ self[ state ? "addClass" : "removeClass" ]( className );
2171
+ }
2172
+
2173
+ // Toggle whole class name
2174
+ } else if ( type === core_strundefined || type === "boolean" ) {
2175
+ if ( this.className ) {
2176
+ // store className if set
2177
+ jQuery._data( this, "__className__", this.className );
2178
+ }
2179
+
2180
+ // If the element has a class name or if we're passed "false",
2181
+ // then remove the whole classname (if there was one, the above saved it).
2182
+ // Otherwise bring back whatever was previously saved (if anything),
2183
+ // falling back to the empty string if nothing was stored.
2184
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
2185
+ }
2186
+ });
2187
+ },
2188
+
2189
+ hasClass: function( selector ) {
2190
+ var className = " " + selector + " ",
2191
+ i = 0,
2192
+ l = this.length;
2193
+ for ( ; i < l; i++ ) {
2194
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
2195
+ return true;
2196
+ }
2197
+ }
2198
+
2199
+ return false;
2200
+ },
2201
+
2202
+ val: function( value ) {
2203
+ var ret, hooks, isFunction,
2204
+ elem = this[0];
2205
+
2206
+ if ( !arguments.length ) {
2207
+ if ( elem ) {
2208
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
2209
+
2210
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
2211
+ return ret;
2212
+ }
2213
+
2214
+ ret = elem.value;
2215
+
2216
+ return typeof ret === "string" ?
2217
+ // handle most common string cases
2218
+ ret.replace(rreturn, "") :
2219
+ // handle cases where value is null/undef or number
2220
+ ret == null ? "" : ret;
2221
+ }
2222
+
2223
+ return;
2224
+ }
2225
+
2226
+ isFunction = jQuery.isFunction( value );
2227
+
2228
+ return this.each(function( i ) {
2229
+ var val,
2230
+ self = jQuery(this);
2231
+
2232
+ if ( this.nodeType !== 1 ) {
2233
+ return;
2234
+ }
2235
+
2236
+ if ( isFunction ) {
2237
+ val = value.call( this, i, self.val() );
2238
+ } else {
2239
+ val = value;
2240
+ }
2241
+
2242
+ // Treat null/undefined as ""; convert numbers to string
2243
+ if ( val == null ) {
2244
+ val = "";
2245
+ } else if ( typeof val === "number" ) {
2246
+ val += "";
2247
+ } else if ( jQuery.isArray( val ) ) {
2248
+ val = jQuery.map(val, function ( value ) {
2249
+ return value == null ? "" : value + "";
2250
+ });
2251
+ }
2252
+
2253
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
2254
+
2255
+ // If set returns undefined, fall back to normal setting
2256
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
2257
+ this.value = val;
2258
+ }
2259
+ });
2260
+ }
2261
+ });
2262
+
2263
+ jQuery.extend({
2264
+ valHooks: {
2265
+ option: {
2266
+ get: function( elem ) {
2267
+ // attributes.value is undefined in Blackberry 4.7 but
2268
+ // uses .value. See #6932
2269
+ var val = elem.attributes.value;
2270
+ return !val || val.specified ? elem.value : elem.text;
2271
+ }
2272
+ },
2273
+ select: {
2274
+ get: function( elem ) {
2275
+ var value, option,
2276
+ options = elem.options,
2277
+ index = elem.selectedIndex,
2278
+ one = elem.type === "select-one" || index < 0,
2279
+ values = one ? null : [],
2280
+ max = one ? index + 1 : options.length,
2281
+ i = index < 0 ?
2282
+ max :
2283
+ one ? index : 0;
2284
+
2285
+ // Loop through all the selected options
2286
+ for ( ; i < max; i++ ) {
2287
+ option = options[ i ];
2288
+
2289
+ // oldIE doesn't update selected after form reset (#2551)
2290
+ if ( ( option.selected || i === index ) &&
2291
+ // Don't return options that are disabled or in a disabled optgroup
2292
+ ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
2293
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
2294
+
2295
+ // Get the specific value for the option
2296
+ value = jQuery( option ).val();
2297
+
2298
+ // We don't need an array for one selects
2299
+ if ( one ) {
2300
+ return value;
2301
+ }
2302
+
2303
+ // Multi-Selects return an array
2304
+ values.push( value );
2305
+ }
2306
+ }
2307
+
2308
+ return values;
2309
+ },
2310
+
2311
+ set: function( elem, value ) {
2312
+ var values = jQuery.makeArray( value );
2313
+
2314
+ jQuery(elem).find("option").each(function() {
2315
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
2316
+ });
2317
+
2318
+ if ( !values.length ) {
2319
+ elem.selectedIndex = -1;
2320
+ }
2321
+ return values;
2322
+ }
2323
+ }
2324
+ },
2325
+
2326
+ attr: function( elem, name, value ) {
2327
+ var hooks, notxml, ret,
2328
+ nType = elem.nodeType;
2329
+
2330
+ // don't get/set attributes on text, comment and attribute nodes
2331
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
2332
+ return;
2333
+ }
2334
+
2335
+ // Fallback to prop when attributes are not supported
2336
+ if ( typeof elem.getAttribute === core_strundefined ) {
2337
+ return jQuery.prop( elem, name, value );
2338
+ }
2339
+
2340
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2341
+
2342
+ // All attributes are lowercase
2343
+ // Grab necessary hook if one is defined
2344
+ if ( notxml ) {
2345
+ name = name.toLowerCase();
2346
+ hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
2347
+ }
2348
+
2349
+ if ( value !== undefined ) {
2350
+
2351
+ if ( value === null ) {
2352
+ jQuery.removeAttr( elem, name );
2353
+
2354
+ } else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
2355
+ return ret;
2356
+
2357
+ } else {
2358
+ elem.setAttribute( name, value + "" );
2359
+ return value;
2360
+ }
2361
+
2362
+ } else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
2363
+ return ret;
2364
+
2365
+ } else {
2366
+
2367
+ // In IE9+, Flash objects don't have .getAttribute (#12945)
2368
+ // Support: IE9+
2369
+ if ( typeof elem.getAttribute !== core_strundefined ) {
2370
+ ret = elem.getAttribute( name );
2371
+ }
2372
+
2373
+ // Non-existent attributes return null, we normalize to undefined
2374
+ return ret == null ?
2375
+ undefined :
2376
+ ret;
2377
+ }
2378
+ },
2379
+
2380
+ removeAttr: function( elem, value ) {
2381
+ var name, propName,
2382
+ i = 0,
2383
+ attrNames = value && value.match( core_rnotwhite );
2384
+
2385
+ if ( attrNames && elem.nodeType === 1 ) {
2386
+ while ( (name = attrNames[i++]) ) {
2387
+ propName = jQuery.propFix[ name ] || name;
2388
+
2389
+ // Boolean attributes get special treatment (#10870)
2390
+ if ( rboolean.test( name ) ) {
2391
+ // Set corresponding property to false for boolean attributes
2392
+ // Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
2393
+ if ( !getSetAttribute && ruseDefault.test( name ) ) {
2394
+ elem[ jQuery.camelCase( "default-" + name ) ] =
2395
+ elem[ propName ] = false;
2396
+ } else {
2397
+ elem[ propName ] = false;
2398
+ }
2399
+
2400
+ // See #9699 for explanation of this approach (setting first, then removal)
2401
+ } else {
2402
+ jQuery.attr( elem, name, "" );
2403
+ }
2404
+
2405
+ elem.removeAttribute( getSetAttribute ? name : propName );
2406
+ }
2407
+ }
2408
+ },
2409
+
2410
+ attrHooks: {
2411
+ type: {
2412
+ set: function( elem, value ) {
2413
+ if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
2414
+ // Setting the type on a radio button after the value resets the value in IE6-9
2415
+ // Reset value to default in case type is set after value during creation
2416
+ var val = elem.value;
2417
+ elem.setAttribute( "type", value );
2418
+ if ( val ) {
2419
+ elem.value = val;
2420
+ }
2421
+ return value;
2422
+ }
2423
+ }
2424
+ }
2425
+ },
2426
+
2427
+ propFix: {
2428
+ tabindex: "tabIndex",
2429
+ readonly: "readOnly",
2430
+ "for": "htmlFor",
2431
+ "class": "className",
2432
+ maxlength: "maxLength",
2433
+ cellspacing: "cellSpacing",
2434
+ cellpadding: "cellPadding",
2435
+ rowspan: "rowSpan",
2436
+ colspan: "colSpan",
2437
+ usemap: "useMap",
2438
+ frameborder: "frameBorder",
2439
+ contenteditable: "contentEditable"
2440
+ },
2441
+
2442
+ prop: function( elem, name, value ) {
2443
+ var ret, hooks, notxml,
2444
+ nType = elem.nodeType;
2445
+
2446
+ // don't get/set properties on text, comment and attribute nodes
2447
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
2448
+ return;
2449
+ }
2450
+
2451
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
2452
+
2453
+ if ( notxml ) {
2454
+ // Fix name and attach hooks
2455
+ name = jQuery.propFix[ name ] || name;
2456
+ hooks = jQuery.propHooks[ name ];
2457
+ }
2458
+
2459
+ if ( value !== undefined ) {
2460
+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
2461
+ return ret;
2462
+
2463
+ } else {
2464
+ return ( elem[ name ] = value );
2465
+ }
2466
+
2467
+ } else {
2468
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
2469
+ return ret;
2470
+
2471
+ } else {
2472
+ return elem[ name ];
2473
+ }
2474
+ }
2475
+ },
2476
+
2477
+ propHooks: {
2478
+ tabIndex: {
2479
+ get: function( elem ) {
2480
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
2481
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
2482
+ var attributeNode = elem.getAttributeNode("tabindex");
2483
+
2484
+ return attributeNode && attributeNode.specified ?
2485
+ parseInt( attributeNode.value, 10 ) :
2486
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
2487
+ 0 :
2488
+ undefined;
2489
+ }
2490
+ }
2491
+ }
2492
+ });
2493
+
2494
+ // Hook for boolean attributes
2495
+ boolHook = {
2496
+ get: function( elem, name ) {
2497
+ var
2498
+ // Use .prop to determine if this attribute is understood as boolean
2499
+ prop = jQuery.prop( elem, name ),
2500
+
2501
+ // Fetch it accordingly
2502
+ attr = typeof prop === "boolean" && elem.getAttribute( name ),
2503
+ detail = typeof prop === "boolean" ?
2504
+
2505
+ getSetInput && getSetAttribute ?
2506
+ attr != null :
2507
+ // oldIE fabricates an empty string for missing boolean attributes
2508
+ // and conflates checked/selected into attroperties
2509
+ ruseDefault.test( name ) ?
2510
+ elem[ jQuery.camelCase( "default-" + name ) ] :
2511
+ !!attr :
2512
+
2513
+ // fetch an attribute node for properties not recognized as boolean
2514
+ elem.getAttributeNode( name );
2515
+
2516
+ return detail && detail.value !== false ?
2517
+ name.toLowerCase() :
2518
+ undefined;
2519
+ },
2520
+ set: function( elem, value, name ) {
2521
+ if ( value === false ) {
2522
+ // Remove boolean attributes when set to false
2523
+ jQuery.removeAttr( elem, name );
2524
+ } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
2525
+ // IE<8 needs the *property* name
2526
+ elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
2527
+
2528
+ // Use defaultChecked and defaultSelected for oldIE
2529
+ } else {
2530
+ elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
2531
+ }
2532
+
2533
+ return name;
2534
+ }
2535
+ };
2536
+
2537
+ // fix oldIE value attroperty
2538
+ if ( !getSetInput || !getSetAttribute ) {
2539
+ jQuery.attrHooks.value = {
2540
+ get: function( elem, name ) {
2541
+ var ret = elem.getAttributeNode( name );
2542
+ return jQuery.nodeName( elem, "input" ) ?
2543
+
2544
+ // Ignore the value *property* by using defaultValue
2545
+ elem.defaultValue :
2546
+
2547
+ ret && ret.specified ? ret.value : undefined;
2548
+ },
2549
+ set: function( elem, value, name ) {
2550
+ if ( jQuery.nodeName( elem, "input" ) ) {
2551
+ // Does not return so that setAttribute is also used
2552
+ elem.defaultValue = value;
2553
+ } else {
2554
+ // Use nodeHook if defined (#1954); otherwise setAttribute is fine
2555
+ return nodeHook && nodeHook.set( elem, value, name );
2556
+ }
2557
+ }
2558
+ };
2559
+ }
2560
+
2561
+ // IE6/7 do not support getting/setting some attributes with get/setAttribute
2562
+ if ( !getSetAttribute ) {
2563
+
2564
+ // Use this for any attribute in IE6/7
2565
+ // This fixes almost every IE6/7 issue
2566
+ nodeHook = jQuery.valHooks.button = {
2567
+ get: function( elem, name ) {
2568
+ var ret = elem.getAttributeNode( name );
2569
+ return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
2570
+ ret.value :
2571
+ undefined;
2572
+ },
2573
+ set: function( elem, value, name ) {
2574
+ // Set the existing or create a new attribute node
2575
+ var ret = elem.getAttributeNode( name );
2576
+ if ( !ret ) {
2577
+ elem.setAttributeNode(
2578
+ (ret = elem.ownerDocument.createAttribute( name ))
2579
+ );
2580
+ }
2581
+
2582
+ ret.value = value += "";
2583
+
2584
+ // Break association with cloned elements by also using setAttribute (#9646)
2585
+ return name === "value" || value === elem.getAttribute( name ) ?
2586
+ value :
2587
+ undefined;
2588
+ }
2589
+ };
2590
+
2591
+ // Set contenteditable to false on removals(#10429)
2592
+ // Setting to empty string throws an error as an invalid value
2593
+ jQuery.attrHooks.contenteditable = {
2594
+ get: nodeHook.get,
2595
+ set: function( elem, value, name ) {
2596
+ nodeHook.set( elem, value === "" ? false : value, name );
2597
+ }
2598
+ };
2599
+
2600
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
2601
+ // This is for removals
2602
+ jQuery.each([ "width", "height" ], function( i, name ) {
2603
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2604
+ set: function( elem, value ) {
2605
+ if ( value === "" ) {
2606
+ elem.setAttribute( name, "auto" );
2607
+ return value;
2608
+ }
2609
+ }
2610
+ });
2611
+ });
2612
+ }
2613
+
2614
+
2615
+ // Some attributes require a special call on IE
2616
+ // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2617
+ if ( !jQuery.support.hrefNormalized ) {
2618
+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
2619
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
2620
+ get: function( elem ) {
2621
+ var ret = elem.getAttribute( name, 2 );
2622
+ return ret == null ? undefined : ret;
2623
+ }
2624
+ });
2625
+ });
2626
+
2627
+ // href/src property should get the full normalized URL (#10299/#12915)
2628
+ jQuery.each([ "href", "src" ], function( i, name ) {
2629
+ jQuery.propHooks[ name ] = {
2630
+ get: function( elem ) {
2631
+ return elem.getAttribute( name, 4 );
2632
+ }
2633
+ };
2634
+ });
2635
+ }
2636
+
2637
+ if ( !jQuery.support.style ) {
2638
+ jQuery.attrHooks.style = {
2639
+ get: function( elem ) {
2640
+ // Return undefined in the case of empty string
2641
+ // Note: IE uppercases css property names, but if we were to .toLowerCase()
2642
+ // .cssText, that would destroy case senstitivity in URL's, like in "background"
2643
+ return elem.style.cssText || undefined;
2644
+ },
2645
+ set: function( elem, value ) {
2646
+ return ( elem.style.cssText = value + "" );
2647
+ }
2648
+ };
2649
+ }
2650
+
2651
+ // Safari mis-reports the default selected property of an option
2652
+ // Accessing the parent's selectedIndex property fixes it
2653
+ if ( !jQuery.support.optSelected ) {
2654
+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
2655
+ get: function( elem ) {
2656
+ var parent = elem.parentNode;
2657
+
2658
+ if ( parent ) {
2659
+ parent.selectedIndex;
2660
+
2661
+ // Make sure that it also works with optgroups, see #5701
2662
+ if ( parent.parentNode ) {
2663
+ parent.parentNode.selectedIndex;
2664
+ }
2665
+ }
2666
+ return null;
2667
+ }
2668
+ });
2669
+ }
2670
+
2671
+ // IE6/7 call enctype encoding
2672
+ if ( !jQuery.support.enctype ) {
2673
+ jQuery.propFix.enctype = "encoding";
2674
+ }
2675
+
2676
+ // Radios and checkboxes getter/setter
2677
+ if ( !jQuery.support.checkOn ) {
2678
+ jQuery.each([ "radio", "checkbox" ], function() {
2679
+ jQuery.valHooks[ this ] = {
2680
+ get: function( elem ) {
2681
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
2682
+ return elem.getAttribute("value") === null ? "on" : elem.value;
2683
+ }
2684
+ };
2685
+ });
2686
+ }
2687
+ jQuery.each([ "radio", "checkbox" ], function() {
2688
+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
2689
+ set: function( elem, value ) {
2690
+ if ( jQuery.isArray( value ) ) {
2691
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
2692
+ }
2693
+ }
2694
+ });
2695
+ });
2696
+ var rformElems = /^(?:input|select|textarea)$/i,
2697
+ rkeyEvent = /^key/,
2698
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
2699
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
2700
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
2701
+
2702
+ function returnTrue() {
2703
+ return true;
2704
+ }
2705
+
2706
+ function returnFalse() {
2707
+ return false;
2708
+ }
2709
+
2710
+ /*
2711
+ * Helper functions for managing events -- not part of the public interface.
2712
+ * Props to Dean Edwards' addEvent library for many of the ideas.
2713
+ */
2714
+ jQuery.event = {
2715
+
2716
+ global: {},
2717
+
2718
+ add: function( elem, types, handler, data, selector ) {
2719
+ var tmp, events, t, handleObjIn,
2720
+ special, eventHandle, handleObj,
2721
+ handlers, type, namespaces, origType,
2722
+ elemData = jQuery._data( elem );
2723
+
2724
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
2725
+ if ( !elemData ) {
2726
+ return;
2727
+ }
2728
+
2729
+ // Caller can pass in an object of custom data in lieu of the handler
2730
+ if ( handler.handler ) {
2731
+ handleObjIn = handler;
2732
+ handler = handleObjIn.handler;
2733
+ selector = handleObjIn.selector;
2734
+ }
2735
+
2736
+ // Make sure that the handler has a unique ID, used to find/remove it later
2737
+ if ( !handler.guid ) {
2738
+ handler.guid = jQuery.guid++;
2739
+ }
2740
+
2741
+ // Init the element's event structure and main handler, if this is the first
2742
+ if ( !(events = elemData.events) ) {
2743
+ events = elemData.events = {};
2744
+ }
2745
+ if ( !(eventHandle = elemData.handle) ) {
2746
+ eventHandle = elemData.handle = function( e ) {
2747
+ // Discard the second event of a jQuery.event.trigger() and
2748
+ // when an event is called after a page has unloaded
2749
+ return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
2750
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
2751
+ undefined;
2752
+ };
2753
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
2754
+ eventHandle.elem = elem;
2755
+ }
2756
+
2757
+ // Handle multiple events separated by a space
2758
+ // jQuery(...).bind("mouseover mouseout", fn);
2759
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
2760
+ t = types.length;
2761
+ while ( t-- ) {
2762
+ tmp = rtypenamespace.exec( types[t] ) || [];
2763
+ type = origType = tmp[1];
2764
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
2765
+
2766
+ // If event changes its type, use the special event handlers for the changed type
2767
+ special = jQuery.event.special[ type ] || {};
2768
+
2769
+ // If selector defined, determine special event api type, otherwise given type
2770
+ type = ( selector ? special.delegateType : special.bindType ) || type;
2771
+
2772
+ // Update special based on newly reset type
2773
+ special = jQuery.event.special[ type ] || {};
2774
+
2775
+ // handleObj is passed to all event handlers
2776
+ handleObj = jQuery.extend({
2777
+ type: type,
2778
+ origType: origType,
2779
+ data: data,
2780
+ handler: handler,
2781
+ guid: handler.guid,
2782
+ selector: selector,
2783
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
2784
+ namespace: namespaces.join(".")
2785
+ }, handleObjIn );
2786
+
2787
+ // Init the event handler queue if we're the first
2788
+ if ( !(handlers = events[ type ]) ) {
2789
+ handlers = events[ type ] = [];
2790
+ handlers.delegateCount = 0;
2791
+
2792
+ // Only use addEventListener/attachEvent if the special events handler returns false
2793
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
2794
+ // Bind the global event handler to the element
2795
+ if ( elem.addEventListener ) {
2796
+ elem.addEventListener( type, eventHandle, false );
2797
+
2798
+ } else if ( elem.attachEvent ) {
2799
+ elem.attachEvent( "on" + type, eventHandle );
2800
+ }
2801
+ }
2802
+ }
2803
+
2804
+ if ( special.add ) {
2805
+ special.add.call( elem, handleObj );
2806
+
2807
+ if ( !handleObj.handler.guid ) {
2808
+ handleObj.handler.guid = handler.guid;
2809
+ }
2810
+ }
2811
+
2812
+ // Add to the element's handler list, delegates in front
2813
+ if ( selector ) {
2814
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
2815
+ } else {
2816
+ handlers.push( handleObj );
2817
+ }
2818
+
2819
+ // Keep track of which events have ever been used, for event optimization
2820
+ jQuery.event.global[ type ] = true;
2821
+ }
2822
+
2823
+ // Nullify elem to prevent memory leaks in IE
2824
+ elem = null;
2825
+ },
2826
+
2827
+ // Detach an event or set of events from an element
2828
+ remove: function( elem, types, handler, selector, mappedTypes ) {
2829
+ var j, handleObj, tmp,
2830
+ origCount, t, events,
2831
+ special, handlers, type,
2832
+ namespaces, origType,
2833
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
2834
+
2835
+ if ( !elemData || !(events = elemData.events) ) {
2836
+ return;
2837
+ }
2838
+
2839
+ // Once for each type.namespace in types; type may be omitted
2840
+ types = ( types || "" ).match( core_rnotwhite ) || [""];
2841
+ t = types.length;
2842
+ while ( t-- ) {
2843
+ tmp = rtypenamespace.exec( types[t] ) || [];
2844
+ type = origType = tmp[1];
2845
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
2846
+
2847
+ // Unbind all events (on this namespace, if provided) for the element
2848
+ if ( !type ) {
2849
+ for ( type in events ) {
2850
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
2851
+ }
2852
+ continue;
2853
+ }
2854
+
2855
+ special = jQuery.event.special[ type ] || {};
2856
+ type = ( selector ? special.delegateType : special.bindType ) || type;
2857
+ handlers = events[ type ] || [];
2858
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
2859
+
2860
+ // Remove matching events
2861
+ origCount = j = handlers.length;
2862
+ while ( j-- ) {
2863
+ handleObj = handlers[ j ];
2864
+
2865
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
2866
+ ( !handler || handler.guid === handleObj.guid ) &&
2867
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
2868
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
2869
+ handlers.splice( j, 1 );
2870
+
2871
+ if ( handleObj.selector ) {
2872
+ handlers.delegateCount--;
2873
+ }
2874
+ if ( special.remove ) {
2875
+ special.remove.call( elem, handleObj );
2876
+ }
2877
+ }
2878
+ }
2879
+
2880
+ // Remove generic event handler if we removed something and no more handlers exist
2881
+ // (avoids potential for endless recursion during removal of special event handlers)
2882
+ if ( origCount && !handlers.length ) {
2883
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
2884
+ jQuery.removeEvent( elem, type, elemData.handle );
2885
+ }
2886
+
2887
+ delete events[ type ];
2888
+ }
2889
+ }
2890
+
2891
+ // Remove the expando if it's no longer used
2892
+ if ( jQuery.isEmptyObject( events ) ) {
2893
+ delete elemData.handle;
2894
+
2895
+ // removeData also checks for emptiness and clears the expando if empty
2896
+ // so use it instead of delete
2897
+ jQuery._removeData( elem, "events" );
2898
+ }
2899
+ },
2900
+
2901
+ trigger: function( event, data, elem, onlyHandlers ) {
2902
+ var handle, ontype, cur,
2903
+ bubbleType, special, tmp, i,
2904
+ eventPath = [ elem || document ],
2905
+ type = core_hasOwn.call( event, "type" ) ? event.type : event,
2906
+ namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
2907
+
2908
+ cur = tmp = elem = elem || document;
2909
+
2910
+ // Don't do events on text and comment nodes
2911
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
2912
+ return;
2913
+ }
2914
+
2915
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
2916
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
2917
+ return;
2918
+ }
2919
+
2920
+ if ( type.indexOf(".") >= 0 ) {
2921
+ // Namespaced trigger; create a regexp to match event type in handle()
2922
+ namespaces = type.split(".");
2923
+ type = namespaces.shift();
2924
+ namespaces.sort();
2925
+ }
2926
+ ontype = type.indexOf(":") < 0 && "on" + type;
2927
+
2928
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
2929
+ event = event[ jQuery.expando ] ?
2930
+ event :
2931
+ new jQuery.Event( type, typeof event === "object" && event );
2932
+
2933
+ event.isTrigger = true;
2934
+ event.namespace = namespaces.join(".");
2935
+ event.namespace_re = event.namespace ?
2936
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
2937
+ null;
2938
+
2939
+ // Clean up the event in case it is being reused
2940
+ event.result = undefined;
2941
+ if ( !event.target ) {
2942
+ event.target = elem;
2943
+ }
2944
+
2945
+ // Clone any incoming data and prepend the event, creating the handler arg list
2946
+ data = data == null ?
2947
+ [ event ] :
2948
+ jQuery.makeArray( data, [ event ] );
2949
+
2950
+ // Allow special events to draw outside the lines
2951
+ special = jQuery.event.special[ type ] || {};
2952
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
2953
+ return;
2954
+ }
2955
+
2956
+ // Determine event propagation path in advance, per W3C events spec (#9951)
2957
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
2958
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
2959
+
2960
+ bubbleType = special.delegateType || type;
2961
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
2962
+ cur = cur.parentNode;
2963
+ }
2964
+ for ( ; cur; cur = cur.parentNode ) {
2965
+ eventPath.push( cur );
2966
+ tmp = cur;
2967
+ }
2968
+
2969
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
2970
+ if ( tmp === (elem.ownerDocument || document) ) {
2971
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
2972
+ }
2973
+ }
2974
+
2975
+ // Fire handlers on the event path
2976
+ i = 0;
2977
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
2978
+
2979
+ event.type = i > 1 ?
2980
+ bubbleType :
2981
+ special.bindType || type;
2982
+
2983
+ // jQuery handler
2984
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
2985
+ if ( handle ) {
2986
+ handle.apply( cur, data );
2987
+ }
2988
+
2989
+ // Native handler
2990
+ handle = ontype && cur[ ontype ];
2991
+ if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
2992
+ event.preventDefault();
2993
+ }
2994
+ }
2995
+ event.type = type;
2996
+
2997
+ // If nobody prevented the default action, do it now
2998
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
2999
+
3000
+ if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
3001
+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
3002
+
3003
+ // Call a native DOM method on the target with the same name name as the event.
3004
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
3005
+ // Don't do default actions on window, that's where global variables be (#6170)
3006
+ if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
3007
+
3008
+ // Don't re-trigger an onFOO event when we call its FOO() method
3009
+ tmp = elem[ ontype ];
3010
+
3011
+ if ( tmp ) {
3012
+ elem[ ontype ] = null;
3013
+ }
3014
+
3015
+ // Prevent re-triggering of the same event, since we already bubbled it above
3016
+ jQuery.event.triggered = type;
3017
+ try {
3018
+ elem[ type ]();
3019
+ } catch ( e ) {
3020
+ // IE<9 dies on focus/blur to hidden element (#1486,#12518)
3021
+ // only reproducible on winXP IE8 native, not IE9 in IE8 mode
3022
+ }
3023
+ jQuery.event.triggered = undefined;
3024
+
3025
+ if ( tmp ) {
3026
+ elem[ ontype ] = tmp;
3027
+ }
3028
+ }
3029
+ }
3030
+ }
3031
+
3032
+ return event.result;
3033
+ },
3034
+
3035
+ dispatch: function( event ) {
3036
+
3037
+ // Make a writable jQuery.Event from the native event object
3038
+ event = jQuery.event.fix( event );
3039
+
3040
+ var i, ret, handleObj, matched, j,
3041
+ handlerQueue = [],
3042
+ args = core_slice.call( arguments ),
3043
+ handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
3044
+ special = jQuery.event.special[ event.type ] || {};
3045
+
3046
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
3047
+ args[0] = event;
3048
+ event.delegateTarget = this;
3049
+
3050
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
3051
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
3052
+ return;
3053
+ }
3054
+
3055
+ // Determine handlers
3056
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
3057
+
3058
+ // Run delegates first; they may want to stop propagation beneath us
3059
+ i = 0;
3060
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
3061
+ event.currentTarget = matched.elem;
3062
+
3063
+ j = 0;
3064
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
3065
+
3066
+ // Triggered event must either 1) have no namespace, or
3067
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
3068
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
3069
+
3070
+ event.handleObj = handleObj;
3071
+ event.data = handleObj.data;
3072
+
3073
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
3074
+ .apply( matched.elem, args );
3075
+
3076
+ if ( ret !== undefined ) {
3077
+ if ( (event.result = ret) === false ) {
3078
+ event.preventDefault();
3079
+ event.stopPropagation();
3080
+ }
3081
+ }
3082
+ }
3083
+ }
3084
+ }
3085
+
3086
+ // Call the postDispatch hook for the mapped type
3087
+ if ( special.postDispatch ) {
3088
+ special.postDispatch.call( this, event );
3089
+ }
3090
+
3091
+ return event.result;
3092
+ },
3093
+
3094
+ handlers: function( event, handlers ) {
3095
+ var sel, handleObj, matches, i,
3096
+ handlerQueue = [],
3097
+ delegateCount = handlers.delegateCount,
3098
+ cur = event.target;
3099
+
3100
+ // Find delegate handlers
3101
+ // Black-hole SVG <use> instance trees (#13180)
3102
+ // Avoid non-left-click bubbling in Firefox (#3861)
3103
+ if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
3104
+
3105
+ for ( ; cur != this; cur = cur.parentNode || this ) {
3106
+
3107
+ // Don't check non-elements (#13208)
3108
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
3109
+ if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
3110
+ matches = [];
3111
+ for ( i = 0; i < delegateCount; i++ ) {
3112
+ handleObj = handlers[ i ];
3113
+
3114
+ // Don't conflict with Object.prototype properties (#13203)
3115
+ sel = handleObj.selector + " ";
3116
+
3117
+ if ( matches[ sel ] === undefined ) {
3118
+ matches[ sel ] = handleObj.needsContext ?
3119
+ jQuery( sel, this ).index( cur ) >= 0 :
3120
+ jQuery.find( sel, this, null, [ cur ] ).length;
3121
+ }
3122
+ if ( matches[ sel ] ) {
3123
+ matches.push( handleObj );
3124
+ }
3125
+ }
3126
+ if ( matches.length ) {
3127
+ handlerQueue.push({ elem: cur, handlers: matches });
3128
+ }
3129
+ }
3130
+ }
3131
+ }
3132
+
3133
+ // Add the remaining (directly-bound) handlers
3134
+ if ( delegateCount < handlers.length ) {
3135
+ handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
3136
+ }
3137
+
3138
+ return handlerQueue;
3139
+ },
3140
+
3141
+ fix: function( event ) {
3142
+ if ( event[ jQuery.expando ] ) {
3143
+ return event;
3144
+ }
3145
+
3146
+ // Create a writable copy of the event object and normalize some properties
3147
+ var i, prop, copy,
3148
+ type = event.type,
3149
+ originalEvent = event,
3150
+ fixHook = this.fixHooks[ type ];
3151
+
3152
+ if ( !fixHook ) {
3153
+ this.fixHooks[ type ] = fixHook =
3154
+ rmouseEvent.test( type ) ? this.mouseHooks :
3155
+ rkeyEvent.test( type ) ? this.keyHooks :
3156
+ {};
3157
+ }
3158
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
3159
+
3160
+ event = new jQuery.Event( originalEvent );
3161
+
3162
+ i = copy.length;
3163
+ while ( i-- ) {
3164
+ prop = copy[ i ];
3165
+ event[ prop ] = originalEvent[ prop ];
3166
+ }
3167
+
3168
+ // Support: IE<9
3169
+ // Fix target property (#1925)
3170
+ if ( !event.target ) {
3171
+ event.target = originalEvent.srcElement || document;
3172
+ }
3173
+
3174
+ // Support: Chrome 23+, Safari?
3175
+ // Target should not be a text node (#504, #13143)
3176
+ if ( event.target.nodeType === 3 ) {
3177
+ event.target = event.target.parentNode;
3178
+ }
3179
+
3180
+ // Support: IE<9
3181
+ // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
3182
+ event.metaKey = !!event.metaKey;
3183
+
3184
+ return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
3185
+ },
3186
+
3187
+ // Includes some event props shared by KeyEvent and MouseEvent
3188
+ props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
3189
+
3190
+ fixHooks: {},
3191
+
3192
+ keyHooks: {
3193
+ props: "char charCode key keyCode".split(" "),
3194
+ filter: function( event, original ) {
3195
+
3196
+ // Add which for key events
3197
+ if ( event.which == null ) {
3198
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
3199
+ }
3200
+
3201
+ return event;
3202
+ }
3203
+ },
3204
+
3205
+ mouseHooks: {
3206
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
3207
+ filter: function( event, original ) {
3208
+ var body, eventDoc, doc,
3209
+ button = original.button,
3210
+ fromElement = original.fromElement;
3211
+
3212
+ // Calculate pageX/Y if missing and clientX/Y available
3213
+ if ( event.pageX == null && original.clientX != null ) {
3214
+ eventDoc = event.target.ownerDocument || document;
3215
+ doc = eventDoc.documentElement;
3216
+ body = eventDoc.body;
3217
+
3218
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
3219
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
3220
+ }
3221
+
3222
+ // Add relatedTarget, if necessary
3223
+ if ( !event.relatedTarget && fromElement ) {
3224
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
3225
+ }
3226
+
3227
+ // Add which for click: 1 === left; 2 === middle; 3 === right
3228
+ // Note: button is not normalized, so don't use it
3229
+ if ( !event.which && button !== undefined ) {
3230
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
3231
+ }
3232
+
3233
+ return event;
3234
+ }
3235
+ },
3236
+
3237
+ special: {
3238
+ load: {
3239
+ // Prevent triggered image.load events from bubbling to window.load
3240
+ noBubble: true
3241
+ },
3242
+ click: {
3243
+ // For checkbox, fire native event so checked state will be right
3244
+ trigger: function() {
3245
+ if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
3246
+ this.click();
3247
+ return false;
3248
+ }
3249
+ }
3250
+ },
3251
+ focus: {
3252
+ // Fire native event if possible so blur/focus sequence is correct
3253
+ trigger: function() {
3254
+ if ( this !== document.activeElement && this.focus ) {
3255
+ try {
3256
+ this.focus();
3257
+ return false;
3258
+ } catch ( e ) {
3259
+ // Support: IE<9
3260
+ // If we error on focus to hidden element (#1486, #12518),
3261
+ // let .trigger() run the handlers
3262
+ }
3263
+ }
3264
+ },
3265
+ delegateType: "focusin"
3266
+ },
3267
+ blur: {
3268
+ trigger: function() {
3269
+ if ( this === document.activeElement && this.blur ) {
3270
+ this.blur();
3271
+ return false;
3272
+ }
3273
+ },
3274
+ delegateType: "focusout"
3275
+ },
3276
+
3277
+ beforeunload: {
3278
+ postDispatch: function( event ) {
3279
+
3280
+ // Even when returnValue equals to undefined Firefox will still show alert
3281
+ if ( event.result !== undefined ) {
3282
+ event.originalEvent.returnValue = event.result;
3283
+ }
3284
+ }
3285
+ }
3286
+ },
3287
+
3288
+ simulate: function( type, elem, event, bubble ) {
3289
+ // Piggyback on a donor event to simulate a different one.
3290
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
3291
+ // simulated event prevents default then we do the same on the donor.
3292
+ var e = jQuery.extend(
3293
+ new jQuery.Event(),
3294
+ event,
3295
+ { type: type,
3296
+ isSimulated: true,
3297
+ originalEvent: {}
3298
+ }
3299
+ );
3300
+ if ( bubble ) {
3301
+ jQuery.event.trigger( e, null, elem );
3302
+ } else {
3303
+ jQuery.event.dispatch.call( elem, e );
3304
+ }
3305
+ if ( e.isDefaultPrevented() ) {
3306
+ event.preventDefault();
3307
+ }
3308
+ }
3309
+ };
3310
+
3311
+ jQuery.removeEvent = document.removeEventListener ?
3312
+ function( elem, type, handle ) {
3313
+ if ( elem.removeEventListener ) {
3314
+ elem.removeEventListener( type, handle, false );
3315
+ }
3316
+ } :
3317
+ function( elem, type, handle ) {
3318
+ var name = "on" + type;
3319
+
3320
+ if ( elem.detachEvent ) {
3321
+
3322
+ // #8545, #7054, preventing memory leaks for custom events in IE6-8
3323
+ // detachEvent needed property on element, by name of that event, to properly expose it to GC
3324
+ if ( typeof elem[ name ] === core_strundefined ) {
3325
+ elem[ name ] = null;
3326
+ }
3327
+
3328
+ elem.detachEvent( name, handle );
3329
+ }
3330
+ };
3331
+
3332
+ jQuery.Event = function( src, props ) {
3333
+ // Allow instantiation without the 'new' keyword
3334
+ if ( !(this instanceof jQuery.Event) ) {
3335
+ return new jQuery.Event( src, props );
3336
+ }
3337
+
3338
+ // Event object
3339
+ if ( src && src.type ) {
3340
+ this.originalEvent = src;
3341
+ this.type = src.type;
3342
+
3343
+ // Events bubbling up the document may have been marked as prevented
3344
+ // by a handler lower down the tree; reflect the correct value.
3345
+ this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
3346
+ src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
3347
+
3348
+ // Event type
3349
+ } else {
3350
+ this.type = src;
3351
+ }
3352
+
3353
+ // Put explicitly provided properties onto the event object
3354
+ if ( props ) {
3355
+ jQuery.extend( this, props );
3356
+ }
3357
+
3358
+ // Create a timestamp if incoming event doesn't have one
3359
+ this.timeStamp = src && src.timeStamp || jQuery.now();
3360
+
3361
+ // Mark it as fixed
3362
+ this[ jQuery.expando ] = true;
3363
+ };
3364
+
3365
+ // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
3366
+ // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
3367
+ jQuery.Event.prototype = {
3368
+ isDefaultPrevented: returnFalse,
3369
+ isPropagationStopped: returnFalse,
3370
+ isImmediatePropagationStopped: returnFalse,
3371
+
3372
+ preventDefault: function() {
3373
+ var e = this.originalEvent;
3374
+
3375
+ this.isDefaultPrevented = returnTrue;
3376
+ if ( !e ) {
3377
+ return;
3378
+ }
3379
+
3380
+ // If preventDefault exists, run it on the original event
3381
+ if ( e.preventDefault ) {
3382
+ e.preventDefault();
3383
+
3384
+ // Support: IE
3385
+ // Otherwise set the returnValue property of the original event to false
3386
+ } else {
3387
+ e.returnValue = false;
3388
+ }
3389
+ },
3390
+ stopPropagation: function() {
3391
+ var e = this.originalEvent;
3392
+
3393
+ this.isPropagationStopped = returnTrue;
3394
+ if ( !e ) {
3395
+ return;
3396
+ }
3397
+ // If stopPropagation exists, run it on the original event
3398
+ if ( e.stopPropagation ) {
3399
+ e.stopPropagation();
3400
+ }
3401
+
3402
+ // Support: IE
3403
+ // Set the cancelBubble property of the original event to true
3404
+ e.cancelBubble = true;
3405
+ },
3406
+ stopImmediatePropagation: function() {
3407
+ this.isImmediatePropagationStopped = returnTrue;
3408
+ this.stopPropagation();
3409
+ }
3410
+ };
3411
+
3412
+ // Create mouseenter/leave events using mouseover/out and event-time checks
3413
+ jQuery.each({
3414
+ mouseenter: "mouseover",
3415
+ mouseleave: "mouseout"
3416
+ }, function( orig, fix ) {
3417
+ jQuery.event.special[ orig ] = {
3418
+ delegateType: fix,
3419
+ bindType: fix,
3420
+
3421
+ handle: function( event ) {
3422
+ var ret,
3423
+ target = this,
3424
+ related = event.relatedTarget,
3425
+ handleObj = event.handleObj;
3426
+
3427
+ // For mousenter/leave call the handler if related is outside the target.
3428
+ // NB: No relatedTarget if the mouse left/entered the browser window
3429
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
3430
+ event.type = handleObj.origType;
3431
+ ret = handleObj.handler.apply( this, arguments );
3432
+ event.type = fix;
3433
+ }
3434
+ return ret;
3435
+ }
3436
+ };
3437
+ });
3438
+
3439
+ // IE submit delegation
3440
+ if ( !jQuery.support.submitBubbles ) {
3441
+
3442
+ jQuery.event.special.submit = {
3443
+ setup: function() {
3444
+ // Only need this for delegated form submit events
3445
+ if ( jQuery.nodeName( this, "form" ) ) {
3446
+ return false;
3447
+ }
3448
+
3449
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
3450
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
3451
+ // Node name check avoids a VML-related crash in IE (#9807)
3452
+ var elem = e.target,
3453
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
3454
+ if ( form && !jQuery._data( form, "submitBubbles" ) ) {
3455
+ jQuery.event.add( form, "submit._submit", function( event ) {
3456
+ event._submit_bubble = true;
3457
+ });
3458
+ jQuery._data( form, "submitBubbles", true );
3459
+ }
3460
+ });
3461
+ // return undefined since we don't need an event listener
3462
+ },
3463
+
3464
+ postDispatch: function( event ) {
3465
+ // If form was submitted by the user, bubble the event up the tree
3466
+ if ( event._submit_bubble ) {
3467
+ delete event._submit_bubble;
3468
+ if ( this.parentNode && !event.isTrigger ) {
3469
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
3470
+ }
3471
+ }
3472
+ },
3473
+
3474
+ teardown: function() {
3475
+ // Only need this for delegated form submit events
3476
+ if ( jQuery.nodeName( this, "form" ) ) {
3477
+ return false;
3478
+ }
3479
+
3480
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
3481
+ jQuery.event.remove( this, "._submit" );
3482
+ }
3483
+ };
3484
+ }
3485
+
3486
+ // IE change delegation and checkbox/radio fix
3487
+ if ( !jQuery.support.changeBubbles ) {
3488
+
3489
+ jQuery.event.special.change = {
3490
+
3491
+ setup: function() {
3492
+
3493
+ if ( rformElems.test( this.nodeName ) ) {
3494
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
3495
+ // after a propertychange. Eat the blur-change in special.change.handle.
3496
+ // This still fires onchange a second time for check/radio after blur.
3497
+ if ( this.type === "checkbox" || this.type === "radio" ) {
3498
+ jQuery.event.add( this, "propertychange._change", function( event ) {
3499
+ if ( event.originalEvent.propertyName === "checked" ) {
3500
+ this._just_changed = true;
3501
+ }
3502
+ });
3503
+ jQuery.event.add( this, "click._change", function( event ) {
3504
+ if ( this._just_changed && !event.isTrigger ) {
3505
+ this._just_changed = false;
3506
+ }
3507
+ // Allow triggered, simulated change events (#11500)
3508
+ jQuery.event.simulate( "change", this, event, true );
3509
+ });
3510
+ }
3511
+ return false;
3512
+ }
3513
+ // Delegated event; lazy-add a change handler on descendant inputs
3514
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
3515
+ var elem = e.target;
3516
+
3517
+ if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
3518
+ jQuery.event.add( elem, "change._change", function( event ) {
3519
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
3520
+ jQuery.event.simulate( "change", this.parentNode, event, true );
3521
+ }
3522
+ });
3523
+ jQuery._data( elem, "changeBubbles", true );
3524
+ }
3525
+ });
3526
+ },
3527
+
3528
+ handle: function( event ) {
3529
+ var elem = event.target;
3530
+
3531
+ // Swallow native change events from checkbox/radio, we already triggered them above
3532
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
3533
+ return event.handleObj.handler.apply( this, arguments );
3534
+ }
3535
+ },
3536
+
3537
+ teardown: function() {
3538
+ jQuery.event.remove( this, "._change" );
3539
+
3540
+ return !rformElems.test( this.nodeName );
3541
+ }
3542
+ };
3543
+ }
3544
+
3545
+ // Create "bubbling" focus and blur events
3546
+ if ( !jQuery.support.focusinBubbles ) {
3547
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
3548
+
3549
+ // Attach a single capturing handler while someone wants focusin/focusout
3550
+ var attaches = 0,
3551
+ handler = function( event ) {
3552
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
3553
+ };
3554
+
3555
+ jQuery.event.special[ fix ] = {
3556
+ setup: function() {
3557
+ if ( attaches++ === 0 ) {
3558
+ document.addEventListener( orig, handler, true );
3559
+ }
3560
+ },
3561
+ teardown: function() {
3562
+ if ( --attaches === 0 ) {
3563
+ document.removeEventListener( orig, handler, true );
3564
+ }
3565
+ }
3566
+ };
3567
+ });
3568
+ }
3569
+
3570
+ jQuery.fn.extend({
3571
+
3572
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
3573
+ var type, origFn;
3574
+
3575
+ // Types can be a map of types/handlers
3576
+ if ( typeof types === "object" ) {
3577
+ // ( types-Object, selector, data )
3578
+ if ( typeof selector !== "string" ) {
3579
+ // ( types-Object, data )
3580
+ data = data || selector;
3581
+ selector = undefined;
3582
+ }
3583
+ for ( type in types ) {
3584
+ this.on( type, selector, data, types[ type ], one );
3585
+ }
3586
+ return this;
3587
+ }
3588
+
3589
+ if ( data == null && fn == null ) {
3590
+ // ( types, fn )
3591
+ fn = selector;
3592
+ data = selector = undefined;
3593
+ } else if ( fn == null ) {
3594
+ if ( typeof selector === "string" ) {
3595
+ // ( types, selector, fn )
3596
+ fn = data;
3597
+ data = undefined;
3598
+ } else {
3599
+ // ( types, data, fn )
3600
+ fn = data;
3601
+ data = selector;
3602
+ selector = undefined;
3603
+ }
3604
+ }
3605
+ if ( fn === false ) {
3606
+ fn = returnFalse;
3607
+ } else if ( !fn ) {
3608
+ return this;
3609
+ }
3610
+
3611
+ if ( one === 1 ) {
3612
+ origFn = fn;
3613
+ fn = function( event ) {
3614
+ // Can use an empty set, since event contains the info
3615
+ jQuery().off( event );
3616
+ return origFn.apply( this, arguments );
3617
+ };
3618
+ // Use same guid so caller can remove using origFn
3619
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
3620
+ }
3621
+ return this.each( function() {
3622
+ jQuery.event.add( this, types, fn, data, selector );
3623
+ });
3624
+ },
3625
+ one: function( types, selector, data, fn ) {
3626
+ return this.on( types, selector, data, fn, 1 );
3627
+ },
3628
+ off: function( types, selector, fn ) {
3629
+ var handleObj, type;
3630
+ if ( types && types.preventDefault && types.handleObj ) {
3631
+ // ( event ) dispatched jQuery.Event
3632
+ handleObj = types.handleObj;
3633
+ jQuery( types.delegateTarget ).off(
3634
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
3635
+ handleObj.selector,
3636
+ handleObj.handler
3637
+ );
3638
+ return this;
3639
+ }
3640
+ if ( typeof types === "object" ) {
3641
+ // ( types-object [, selector] )
3642
+ for ( type in types ) {
3643
+ this.off( type, selector, types[ type ] );
3644
+ }
3645
+ return this;
3646
+ }
3647
+ if ( selector === false || typeof selector === "function" ) {
3648
+ // ( types [, fn] )
3649
+ fn = selector;
3650
+ selector = undefined;
3651
+ }
3652
+ if ( fn === false ) {
3653
+ fn = returnFalse;
3654
+ }
3655
+ return this.each(function() {
3656
+ jQuery.event.remove( this, types, fn, selector );
3657
+ });
3658
+ },
3659
+
3660
+ bind: function( types, data, fn ) {
3661
+ return this.on( types, null, data, fn );
3662
+ },
3663
+ unbind: function( types, fn ) {
3664
+ return this.off( types, null, fn );
3665
+ },
3666
+
3667
+ delegate: function( selector, types, data, fn ) {
3668
+ return this.on( types, selector, data, fn );
3669
+ },
3670
+ undelegate: function( selector, types, fn ) {
3671
+ // ( namespace ) or ( selector, types [, fn] )
3672
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
3673
+ },
3674
+
3675
+ trigger: function( type, data ) {
3676
+ return this.each(function() {
3677
+ jQuery.event.trigger( type, data, this );
3678
+ });
3679
+ },
3680
+ triggerHandler: function( type, data ) {
3681
+ var elem = this[0];
3682
+ if ( elem ) {
3683
+ return jQuery.event.trigger( type, data, elem, true );
3684
+ }
3685
+ }
3686
+ });
3687
+ /*!
3688
+ * Sizzle CSS Selector Engine
3689
+ * Copyright 2012 jQuery Foundation and other contributors
3690
+ * Released under the MIT license
3691
+ * http://sizzlejs.com/
3692
+ */
3693
+ (function( window, undefined ) {
3694
+
3695
+ var i,
3696
+ cachedruns,
3697
+ Expr,
3698
+ getText,
3699
+ isXML,
3700
+ compile,
3701
+ hasDuplicate,
3702
+ outermostContext,
3703
+
3704
+ // Local document vars
3705
+ setDocument,
3706
+ document,
3707
+ docElem,
3708
+ documentIsXML,
3709
+ rbuggyQSA,
3710
+ rbuggyMatches,
3711
+ matches,
3712
+ contains,
3713
+ sortOrder,
3714
+
3715
+ // Instance-specific data
3716
+ expando = "sizzle" + -(new Date()),
3717
+ preferredDoc = window.document,
3718
+ support = {},
3719
+ dirruns = 0,
3720
+ done = 0,
3721
+ classCache = createCache(),
3722
+ tokenCache = createCache(),
3723
+ compilerCache = createCache(),
3724
+
3725
+ // General-purpose constants
3726
+ strundefined = typeof undefined,
3727
+ MAX_NEGATIVE = 1 << 31,
3728
+
3729
+ // Array methods
3730
+ arr = [],
3731
+ pop = arr.pop,
3732
+ push = arr.push,
3733
+ slice = arr.slice,
3734
+ // Use a stripped-down indexOf if we can't use a native one
3735
+ indexOf = arr.indexOf || function( elem ) {
3736
+ var i = 0,
3737
+ len = this.length;
3738
+ for ( ; i < len; i++ ) {
3739
+ if ( this[i] === elem ) {
3740
+ return i;
3741
+ }
3742
+ }
3743
+ return -1;
3744
+ },
3745
+
3746
+
3747
+ // Regular expressions
3748
+
3749
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
3750
+ whitespace = "[\\x20\\t\\r\\n\\f]",
3751
+ // http://www.w3.org/TR/css3-syntax/#characters
3752
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
3753
+
3754
+ // Loosely modeled on CSS identifier characters
3755
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
3756
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
3757
+ identifier = characterEncoding.replace( "w", "w#" ),
3758
+
3759
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
3760
+ operators = "([*^$|!~]?=)",
3761
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
3762
+ "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
3763
+
3764
+ // Prefer arguments quoted,
3765
+ // then not containing pseudos/brackets,
3766
+ // then attribute selectors/non-parenthetical expressions,
3767
+ // then anything else
3768
+ // These preferences are here to reduce the number of selectors
3769
+ // needing tokenize in the PSEUDO preFilter
3770
+ pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
3771
+
3772
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
3773
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
3774
+
3775
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
3776
+ rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
3777
+ rpseudo = new RegExp( pseudos ),
3778
+ ridentifier = new RegExp( "^" + identifier + "$" ),
3779
+
3780
+ matchExpr = {
3781
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
3782
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
3783
+ "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
3784
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
3785
+ "ATTR": new RegExp( "^" + attributes ),
3786
+ "PSEUDO": new RegExp( "^" + pseudos ),
3787
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
3788
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
3789
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
3790
+ // For use in libraries implementing .is()
3791
+ // We use this for POS matching in `select`
3792
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
3793
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
3794
+ },
3795
+
3796
+ rsibling = /[\x20\t\r\n\f]*[+~]/,
3797
+
3798
+ rnative = /^[^{]+\{\s*\[native code/,
3799
+
3800
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
3801
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
3802
+
3803
+ rinputs = /^(?:input|select|textarea|button)$/i,
3804
+ rheader = /^h\d$/i,
3805
+
3806
+ rescape = /'|\\/g,
3807
+ rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
3808
+
3809
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
3810
+ runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
3811
+ funescape = function( _, escaped ) {
3812
+ var high = "0x" + escaped - 0x10000;
3813
+ // NaN means non-codepoint
3814
+ return high !== high ?
3815
+ escaped :
3816
+ // BMP codepoint
3817
+ high < 0 ?
3818
+ String.fromCharCode( high + 0x10000 ) :
3819
+ // Supplemental Plane codepoint (surrogate pair)
3820
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
3821
+ };
3822
+
3823
+ // Use a stripped-down slice if we can't use a native one
3824
+ try {
3825
+ slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;
3826
+ } catch ( e ) {
3827
+ slice = function( i ) {
3828
+ var elem,
3829
+ results = [];
3830
+ while ( (elem = this[i++]) ) {
3831
+ results.push( elem );
3832
+ }
3833
+ return results;
3834
+ };
3835
+ }
3836
+
3837
+ /**
3838
+ * For feature detection
3839
+ * @param {Function} fn The function to test for native support
3840
+ */
3841
+ function isNative( fn ) {
3842
+ return rnative.test( fn + "" );
3843
+ }
3844
+
3845
+ /**
3846
+ * Create key-value caches of limited size
3847
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
3848
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
3849
+ * deleting the oldest entry
3850
+ */
3851
+ function createCache() {
3852
+ var cache,
3853
+ keys = [];
3854
+
3855
+ return (cache = function( key, value ) {
3856
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
3857
+ if ( keys.push( key += " " ) > Expr.cacheLength ) {
3858
+ // Only keep the most recent entries
3859
+ delete cache[ keys.shift() ];
3860
+ }
3861
+ return (cache[ key ] = value);
3862
+ });
3863
+ }
3864
+
3865
+ /**
3866
+ * Mark a function for special use by Sizzle
3867
+ * @param {Function} fn The function to mark
3868
+ */
3869
+ function markFunction( fn ) {
3870
+ fn[ expando ] = true;
3871
+ return fn;
3872
+ }
3873
+
3874
+ /**
3875
+ * Support testing using an element
3876
+ * @param {Function} fn Passed the created div and expects a boolean result
3877
+ */
3878
+ function assert( fn ) {
3879
+ var div = document.createElement("div");
3880
+
3881
+ try {
3882
+ return fn( div );
3883
+ } catch (e) {
3884
+ return false;
3885
+ } finally {
3886
+ // release memory in IE
3887
+ div = null;
3888
+ }
3889
+ }
3890
+
3891
+ function Sizzle( selector, context, results, seed ) {
3892
+ var match, elem, m, nodeType,
3893
+ // QSA vars
3894
+ i, groups, old, nid, newContext, newSelector;
3895
+
3896
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
3897
+ setDocument( context );
3898
+ }
3899
+
3900
+ context = context || document;
3901
+ results = results || [];
3902
+
3903
+ if ( !selector || typeof selector !== "string" ) {
3904
+ return results;
3905
+ }
3906
+
3907
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
3908
+ return [];
3909
+ }
3910
+
3911
+ if ( !documentIsXML && !seed ) {
3912
+
3913
+ // Shortcuts
3914
+ if ( (match = rquickExpr.exec( selector )) ) {
3915
+ // Speed-up: Sizzle("#ID")
3916
+ if ( (m = match[1]) ) {
3917
+ if ( nodeType === 9 ) {
3918
+ elem = context.getElementById( m );
3919
+ // Check parentNode to catch when Blackberry 4.6 returns
3920
+ // nodes that are no longer in the document #6963
3921
+ if ( elem && elem.parentNode ) {
3922
+ // Handle the case where IE, Opera, and Webkit return items
3923
+ // by name instead of ID
3924
+ if ( elem.id === m ) {
3925
+ results.push( elem );
3926
+ return results;
3927
+ }
3928
+ } else {
3929
+ return results;
3930
+ }
3931
+ } else {
3932
+ // Context is not a document
3933
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
3934
+ contains( context, elem ) && elem.id === m ) {
3935
+ results.push( elem );
3936
+ return results;
3937
+ }
3938
+ }
3939
+
3940
+ // Speed-up: Sizzle("TAG")
3941
+ } else if ( match[2] ) {
3942
+ push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
3943
+ return results;
3944
+
3945
+ // Speed-up: Sizzle(".CLASS")
3946
+ } else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
3947
+ push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
3948
+ return results;
3949
+ }
3950
+ }
3951
+
3952
+ // QSA path
3953
+ if ( support.qsa && !rbuggyQSA.test(selector) ) {
3954
+ old = true;
3955
+ nid = expando;
3956
+ newContext = context;
3957
+ newSelector = nodeType === 9 && selector;
3958
+
3959
+ // qSA works strangely on Element-rooted queries
3960
+ // We can work around this by specifying an extra ID on the root
3961
+ // and working up from there (Thanks to Andrew Dupont for the technique)
3962
+ // IE 8 doesn't work on object elements
3963
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
3964
+ groups = tokenize( selector );
3965
+
3966
+ if ( (old = context.getAttribute("id")) ) {
3967
+ nid = old.replace( rescape, "\\$&" );
3968
+ } else {
3969
+ context.setAttribute( "id", nid );
3970
+ }
3971
+ nid = "[id='" + nid + "'] ";
3972
+
3973
+ i = groups.length;
3974
+ while ( i-- ) {
3975
+ groups[i] = nid + toSelector( groups[i] );
3976
+ }
3977
+ newContext = rsibling.test( selector ) && context.parentNode || context;
3978
+ newSelector = groups.join(",");
3979
+ }
3980
+
3981
+ if ( newSelector ) {
3982
+ try {
3983
+ push.apply( results, slice.call( newContext.querySelectorAll(
3984
+ newSelector
3985
+ ), 0 ) );
3986
+ return results;
3987
+ } catch(qsaError) {
3988
+ } finally {
3989
+ if ( !old ) {
3990
+ context.removeAttribute("id");
3991
+ }
3992
+ }
3993
+ }
3994
+ }
3995
+ }
3996
+
3997
+ // All others
3998
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
3999
+ }
4000
+
4001
+ /**
4002
+ * Detect xml
4003
+ * @param {Element|Object} elem An element or a document
4004
+ */
4005
+ isXML = Sizzle.isXML = function( elem ) {
4006
+ // documentElement is verified for cases where it doesn't yet exist
4007
+ // (such as loading iframes in IE - #4833)
4008
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
4009
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
4010
+ };
4011
+
4012
+ /**
4013
+ * Sets document-related variables once based on the current document
4014
+ * @param {Element|Object} [doc] An element or document object to use to set the document
4015
+ * @returns {Object} Returns the current document
4016
+ */
4017
+ setDocument = Sizzle.setDocument = function( node ) {
4018
+ var doc = node ? node.ownerDocument || node : preferredDoc;
4019
+
4020
+ // If no document and documentElement is available, return
4021
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
4022
+ return document;
4023
+ }
4024
+
4025
+ // Set our document
4026
+ document = doc;
4027
+ docElem = doc.documentElement;
4028
+
4029
+ // Support tests
4030
+ documentIsXML = isXML( doc );
4031
+
4032
+ // Check if getElementsByTagName("*") returns only elements
4033
+ support.tagNameNoComments = assert(function( div ) {
4034
+ div.appendChild( doc.createComment("") );
4035
+ return !div.getElementsByTagName("*").length;
4036
+ });
4037
+
4038
+ // Check if attributes should be retrieved by attribute nodes
4039
+ support.attributes = assert(function( div ) {
4040
+ div.innerHTML = "<select></select>";
4041
+ var type = typeof div.lastChild.getAttribute("multiple");
4042
+ // IE8 returns a string for some attributes even when not present
4043
+ return type !== "boolean" && type !== "string";
4044
+ });
4045
+
4046
+ // Check if getElementsByClassName can be trusted
4047
+ support.getByClassName = assert(function( div ) {
4048
+ // Opera can't find a second classname (in 9.6)
4049
+ div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
4050
+ if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
4051
+ return false;
4052
+ }
4053
+
4054
+ // Safari 3.2 caches class attributes and doesn't catch changes
4055
+ div.lastChild.className = "e";
4056
+ return div.getElementsByClassName("e").length === 2;
4057
+ });
4058
+
4059
+ // Check if getElementById returns elements by name
4060
+ // Check if getElementsByName privileges form controls or returns elements by ID
4061
+ support.getByName = assert(function( div ) {
4062
+ // Inject content
4063
+ div.id = expando + 0;
4064
+ div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
4065
+ docElem.insertBefore( div, docElem.firstChild );
4066
+
4067
+ // Test
4068
+ var pass = doc.getElementsByName &&
4069
+ // buggy browsers will return fewer than the correct 2
4070
+ doc.getElementsByName( expando ).length === 2 +
4071
+ // buggy browsers will return more than the correct 0
4072
+ doc.getElementsByName( expando + 0 ).length;
4073
+ support.getIdNotName = !doc.getElementById( expando );
4074
+
4075
+ // Cleanup
4076
+ docElem.removeChild( div );
4077
+
4078
+ return pass;
4079
+ });
4080
+
4081
+ // IE6/7 return modified attributes
4082
+ Expr.attrHandle = assert(function( div ) {
4083
+ div.innerHTML = "<a href='#'></a>";
4084
+ return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
4085
+ div.firstChild.getAttribute("href") === "#";
4086
+ }) ?
4087
+ {} :
4088
+ {
4089
+ "href": function( elem ) {
4090
+ return elem.getAttribute( "href", 2 );
4091
+ },
4092
+ "type": function( elem ) {
4093
+ return elem.getAttribute("type");
4094
+ }
4095
+ };
4096
+
4097
+ // ID find and filter
4098
+ if ( support.getIdNotName ) {
4099
+ Expr.find["ID"] = function( id, context ) {
4100
+ if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
4101
+ var m = context.getElementById( id );
4102
+ // Check parentNode to catch when Blackberry 4.6 returns
4103
+ // nodes that are no longer in the document #6963
4104
+ return m && m.parentNode ? [m] : [];
4105
+ }
4106
+ };
4107
+ Expr.filter["ID"] = function( id ) {
4108
+ var attrId = id.replace( runescape, funescape );
4109
+ return function( elem ) {
4110
+ return elem.getAttribute("id") === attrId;
4111
+ };
4112
+ };
4113
+ } else {
4114
+ Expr.find["ID"] = function( id, context ) {
4115
+ if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
4116
+ var m = context.getElementById( id );
4117
+
4118
+ return m ?
4119
+ m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
4120
+ [m] :
4121
+ undefined :
4122
+ [];
4123
+ }
4124
+ };
4125
+ Expr.filter["ID"] = function( id ) {
4126
+ var attrId = id.replace( runescape, funescape );
4127
+ return function( elem ) {
4128
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
4129
+ return node && node.value === attrId;
4130
+ };
4131
+ };
4132
+ }
4133
+
4134
+ // Tag
4135
+ Expr.find["TAG"] = support.tagNameNoComments ?
4136
+ function( tag, context ) {
4137
+ if ( typeof context.getElementsByTagName !== strundefined ) {
4138
+ return context.getElementsByTagName( tag );
4139
+ }
4140
+ } :
4141
+ function( tag, context ) {
4142
+ var elem,
4143
+ tmp = [],
4144
+ i = 0,
4145
+ results = context.getElementsByTagName( tag );
4146
+
4147
+ // Filter out possible comments
4148
+ if ( tag === "*" ) {
4149
+ while ( (elem = results[i++]) ) {
4150
+ if ( elem.nodeType === 1 ) {
4151
+ tmp.push( elem );
4152
+ }
4153
+ }
4154
+
4155
+ return tmp;
4156
+ }
4157
+ return results;
4158
+ };
4159
+
4160
+ // Name
4161
+ Expr.find["NAME"] = support.getByName && function( tag, context ) {
4162
+ if ( typeof context.getElementsByName !== strundefined ) {
4163
+ return context.getElementsByName( name );
4164
+ }
4165
+ };
4166
+
4167
+ // Class
4168
+ Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
4169
+ if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
4170
+ return context.getElementsByClassName( className );
4171
+ }
4172
+ };
4173
+
4174
+ // QSA and matchesSelector support
4175
+
4176
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
4177
+ rbuggyMatches = [];
4178
+
4179
+ // qSa(:focus) reports false when true (Chrome 21),
4180
+ // no need to also add to buggyMatches since matches checks buggyQSA
4181
+ // A support test would require too much code (would include document ready)
4182
+ rbuggyQSA = [ ":focus" ];
4183
+
4184
+ if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
4185
+ // Build QSA regex
4186
+ // Regex strategy adopted from Diego Perini
4187
+ assert(function( div ) {
4188
+ // Select is set to empty string on purpose
4189
+ // This is to test IE's treatment of not explictly
4190
+ // setting a boolean content attribute,
4191
+ // since its presence should be enough
4192
+ // http://bugs.jquery.com/ticket/12359
4193
+ div.innerHTML = "<select><option selected=''></option></select>";
4194
+
4195
+ // IE8 - Some boolean attributes are not treated correctly
4196
+ if ( !div.querySelectorAll("[selected]").length ) {
4197
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
4198
+ }
4199
+
4200
+ // Webkit/Opera - :checked should return selected option elements
4201
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
4202
+ // IE8 throws error here and will not see later tests
4203
+ if ( !div.querySelectorAll(":checked").length ) {
4204
+ rbuggyQSA.push(":checked");
4205
+ }
4206
+ });
4207
+
4208
+ assert(function( div ) {
4209
+
4210
+ // Opera 10-12/IE8 - ^= $= *= and empty values
4211
+ // Should not select anything
4212
+ div.innerHTML = "<input type='hidden' i=''/>";
4213
+ if ( div.querySelectorAll("[i^='']").length ) {
4214
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
4215
+ }
4216
+
4217
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
4218
+ // IE8 throws error here and will not see later tests
4219
+ if ( !div.querySelectorAll(":enabled").length ) {
4220
+ rbuggyQSA.push( ":enabled", ":disabled" );
4221
+ }
4222
+
4223
+ // Opera 10-11 does not throw on post-comma invalid pseudos
4224
+ div.querySelectorAll("*,:x");
4225
+ rbuggyQSA.push(",.*:");
4226
+ });
4227
+ }
4228
+
4229
+ if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
4230
+ docElem.mozMatchesSelector ||
4231
+ docElem.webkitMatchesSelector ||
4232
+ docElem.oMatchesSelector ||
4233
+ docElem.msMatchesSelector) )) ) {
4234
+
4235
+ assert(function( div ) {
4236
+ // Check to see if it's possible to do matchesSelector
4237
+ // on a disconnected node (IE 9)
4238
+ support.disconnectedMatch = matches.call( div, "div" );
4239
+
4240
+ // This should fail with an exception
4241
+ // Gecko does not error, returns false instead
4242
+ matches.call( div, "[s!='']:x" );
4243
+ rbuggyMatches.push( "!=", pseudos );
4244
+ });
4245
+ }
4246
+
4247
+ rbuggyQSA = new RegExp( rbuggyQSA.join("|") );
4248
+ rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
4249
+
4250
+ // Element contains another
4251
+ // Purposefully does not implement inclusive descendent
4252
+ // As in, an element does not contain itself
4253
+ contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
4254
+ function( a, b ) {
4255
+ var adown = a.nodeType === 9 ? a.documentElement : a,
4256
+ bup = b && b.parentNode;
4257
+ return a === bup || !!( bup && bup.nodeType === 1 && (
4258
+ adown.contains ?
4259
+ adown.contains( bup ) :
4260
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
4261
+ ));
4262
+ } :
4263
+ function( a, b ) {
4264
+ if ( b ) {
4265
+ while ( (b = b.parentNode) ) {
4266
+ if ( b === a ) {
4267
+ return true;
4268
+ }
4269
+ }
4270
+ }
4271
+ return false;
4272
+ };
4273
+
4274
+ // Document order sorting
4275
+ sortOrder = docElem.compareDocumentPosition ?
4276
+ function( a, b ) {
4277
+ var compare;
4278
+
4279
+ if ( a === b ) {
4280
+ hasDuplicate = true;
4281
+ return 0;
4282
+ }
4283
+
4284
+ if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
4285
+ if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
4286
+ if ( a === doc || contains( preferredDoc, a ) ) {
4287
+ return -1;
4288
+ }
4289
+ if ( b === doc || contains( preferredDoc, b ) ) {
4290
+ return 1;
4291
+ }
4292
+ return 0;
4293
+ }
4294
+ return compare & 4 ? -1 : 1;
4295
+ }
4296
+
4297
+ return a.compareDocumentPosition ? -1 : 1;
4298
+ } :
4299
+ function( a, b ) {
4300
+ var cur,
4301
+ i = 0,
4302
+ aup = a.parentNode,
4303
+ bup = b.parentNode,
4304
+ ap = [ a ],
4305
+ bp = [ b ];
4306
+
4307
+ // Exit early if the nodes are identical
4308
+ if ( a === b ) {
4309
+ hasDuplicate = true;
4310
+ return 0;
4311
+
4312
+ // Parentless nodes are either documents or disconnected
4313
+ } else if ( !aup || !bup ) {
4314
+ return a === doc ? -1 :
4315
+ b === doc ? 1 :
4316
+ aup ? -1 :
4317
+ bup ? 1 :
4318
+ 0;
4319
+
4320
+ // If the nodes are siblings, we can do a quick check
4321
+ } else if ( aup === bup ) {
4322
+ return siblingCheck( a, b );
4323
+ }
4324
+
4325
+ // Otherwise we need full lists of their ancestors for comparison
4326
+ cur = a;
4327
+ while ( (cur = cur.parentNode) ) {
4328
+ ap.unshift( cur );
4329
+ }
4330
+ cur = b;
4331
+ while ( (cur = cur.parentNode) ) {
4332
+ bp.unshift( cur );
4333
+ }
4334
+
4335
+ // Walk down the tree looking for a discrepancy
4336
+ while ( ap[i] === bp[i] ) {
4337
+ i++;
4338
+ }
4339
+
4340
+ return i ?
4341
+ // Do a sibling check if the nodes have a common ancestor
4342
+ siblingCheck( ap[i], bp[i] ) :
4343
+
4344
+ // Otherwise nodes in our document sort first
4345
+ ap[i] === preferredDoc ? -1 :
4346
+ bp[i] === preferredDoc ? 1 :
4347
+ 0;
4348
+ };
4349
+
4350
+ // Always assume the presence of duplicates if sort doesn't
4351
+ // pass them to our comparison function (as in Google Chrome).
4352
+ hasDuplicate = false;
4353
+ [0, 0].sort( sortOrder );
4354
+ support.detectDuplicates = hasDuplicate;
4355
+
4356
+ return document;
4357
+ };
4358
+
4359
+ Sizzle.matches = function( expr, elements ) {
4360
+ return Sizzle( expr, null, null, elements );
4361
+ };
4362
+
4363
+ Sizzle.matchesSelector = function( elem, expr ) {
4364
+ // Set document vars if needed
4365
+ if ( ( elem.ownerDocument || elem ) !== document ) {
4366
+ setDocument( elem );
4367
+ }
4368
+
4369
+ // Make sure that attribute selectors are quoted
4370
+ expr = expr.replace( rattributeQuotes, "='$1']" );
4371
+
4372
+ // rbuggyQSA always contains :focus, so no need for an existence check
4373
+ if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {
4374
+ try {
4375
+ var ret = matches.call( elem, expr );
4376
+
4377
+ // IE 9's matchesSelector returns false on disconnected nodes
4378
+ if ( ret || support.disconnectedMatch ||
4379
+ // As well, disconnected nodes are said to be in a document
4380
+ // fragment in IE 9
4381
+ elem.document && elem.document.nodeType !== 11 ) {
4382
+ return ret;
4383
+ }
4384
+ } catch(e) {}
4385
+ }
4386
+
4387
+ return Sizzle( expr, document, null, [elem] ).length > 0;
4388
+ };
4389
+
4390
+ Sizzle.contains = function( context, elem ) {
4391
+ // Set document vars if needed
4392
+ if ( ( context.ownerDocument || context ) !== document ) {
4393
+ setDocument( context );
4394
+ }
4395
+ return contains( context, elem );
4396
+ };
4397
+
4398
+ Sizzle.attr = function( elem, name ) {
4399
+ var val;
4400
+
4401
+ // Set document vars if needed
4402
+ if ( ( elem.ownerDocument || elem ) !== document ) {
4403
+ setDocument( elem );
4404
+ }
4405
+
4406
+ if ( !documentIsXML ) {
4407
+ name = name.toLowerCase();
4408
+ }
4409
+ if ( (val = Expr.attrHandle[ name ]) ) {
4410
+ return val( elem );
4411
+ }
4412
+ if ( documentIsXML || support.attributes ) {
4413
+ return elem.getAttribute( name );
4414
+ }
4415
+ return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
4416
+ name :
4417
+ val && val.specified ? val.value : null;
4418
+ };
4419
+
4420
+ Sizzle.error = function( msg ) {
4421
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
4422
+ };
4423
+
4424
+ // Document sorting and removing duplicates
4425
+ Sizzle.uniqueSort = function( results ) {
4426
+ var elem,
4427
+ duplicates = [],
4428
+ i = 1,
4429
+ j = 0;
4430
+
4431
+ // Unless we *know* we can detect duplicates, assume their presence
4432
+ hasDuplicate = !support.detectDuplicates;
4433
+ results.sort( sortOrder );
4434
+
4435
+ if ( hasDuplicate ) {
4436
+ for ( ; (elem = results[i]); i++ ) {
4437
+ if ( elem === results[ i - 1 ] ) {
4438
+ j = duplicates.push( i );
4439
+ }
4440
+ }
4441
+ while ( j-- ) {
4442
+ results.splice( duplicates[ j ], 1 );
4443
+ }
4444
+ }
4445
+
4446
+ return results;
4447
+ };
4448
+
4449
+ function siblingCheck( a, b ) {
4450
+ var cur = b && a,
4451
+ diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );
4452
+
4453
+ // Use IE sourceIndex if available on both nodes
4454
+ if ( diff ) {
4455
+ return diff;
4456
+ }
4457
+
4458
+ // Check if b follows a
4459
+ if ( cur ) {
4460
+ while ( (cur = cur.nextSibling) ) {
4461
+ if ( cur === b ) {
4462
+ return -1;
4463
+ }
4464
+ }
4465
+ }
4466
+
4467
+ return a ? 1 : -1;
4468
+ }
4469
+
4470
+ // Returns a function to use in pseudos for input types
4471
+ function createInputPseudo( type ) {
4472
+ return function( elem ) {
4473
+ var name = elem.nodeName.toLowerCase();
4474
+ return name === "input" && elem.type === type;
4475
+ };
4476
+ }
4477
+
4478
+ // Returns a function to use in pseudos for buttons
4479
+ function createButtonPseudo( type ) {
4480
+ return function( elem ) {
4481
+ var name = elem.nodeName.toLowerCase();
4482
+ return (name === "input" || name === "button") && elem.type === type;
4483
+ };
4484
+ }
4485
+
4486
+ // Returns a function to use in pseudos for positionals
4487
+ function createPositionalPseudo( fn ) {
4488
+ return markFunction(function( argument ) {
4489
+ argument = +argument;
4490
+ return markFunction(function( seed, matches ) {
4491
+ var j,
4492
+ matchIndexes = fn( [], seed.length, argument ),
4493
+ i = matchIndexes.length;
4494
+
4495
+ // Match elements found at the specified indexes
4496
+ while ( i-- ) {
4497
+ if ( seed[ (j = matchIndexes[i]) ] ) {
4498
+ seed[j] = !(matches[j] = seed[j]);
4499
+ }
4500
+ }
4501
+ });
4502
+ });
4503
+ }
4504
+
4505
+ /**
4506
+ * Utility function for retrieving the text value of an array of DOM nodes
4507
+ * @param {Array|Element} elem
4508
+ */
4509
+ getText = Sizzle.getText = function( elem ) {
4510
+ var node,
4511
+ ret = "",
4512
+ i = 0,
4513
+ nodeType = elem.nodeType;
4514
+
4515
+ if ( !nodeType ) {
4516
+ // If no nodeType, this is expected to be an array
4517
+ for ( ; (node = elem[i]); i++ ) {
4518
+ // Do not traverse comment nodes
4519
+ ret += getText( node );
4520
+ }
4521
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
4522
+ // Use textContent for elements
4523
+ // innerText usage removed for consistency of new lines (see #11153)
4524
+ if ( typeof elem.textContent === "string" ) {
4525
+ return elem.textContent;
4526
+ } else {
4527
+ // Traverse its children
4528
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
4529
+ ret += getText( elem );
4530
+ }
4531
+ }
4532
+ } else if ( nodeType === 3 || nodeType === 4 ) {
4533
+ return elem.nodeValue;
4534
+ }
4535
+ // Do not include comment or processing instruction nodes
4536
+
4537
+ return ret;
4538
+ };
4539
+
4540
+ Expr = Sizzle.selectors = {
4541
+
4542
+ // Can be adjusted by the user
4543
+ cacheLength: 50,
4544
+
4545
+ createPseudo: markFunction,
4546
+
4547
+ match: matchExpr,
4548
+
4549
+ find: {},
4550
+
4551
+ relative: {
4552
+ ">": { dir: "parentNode", first: true },
4553
+ " ": { dir: "parentNode" },
4554
+ "+": { dir: "previousSibling", first: true },
4555
+ "~": { dir: "previousSibling" }
4556
+ },
4557
+
4558
+ preFilter: {
4559
+ "ATTR": function( match ) {
4560
+ match[1] = match[1].replace( runescape, funescape );
4561
+
4562
+ // Move the given value to match[3] whether quoted or unquoted
4563
+ match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
4564
+
4565
+ if ( match[2] === "~=" ) {
4566
+ match[3] = " " + match[3] + " ";
4567
+ }
4568
+
4569
+ return match.slice( 0, 4 );
4570
+ },
4571
+
4572
+ "CHILD": function( match ) {
4573
+ /* matches from matchExpr["CHILD"]
4574
+ 1 type (only|nth|...)
4575
+ 2 what (child|of-type)
4576
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
4577
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
4578
+ 5 sign of xn-component
4579
+ 6 x of xn-component
4580
+ 7 sign of y-component
4581
+ 8 y of y-component
4582
+ */
4583
+ match[1] = match[1].toLowerCase();
4584
+
4585
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
4586
+ // nth-* requires argument
4587
+ if ( !match[3] ) {
4588
+ Sizzle.error( match[0] );
4589
+ }
4590
+
4591
+ // numeric x and y parameters for Expr.filter.CHILD
4592
+ // remember that false/true cast respectively to 0/1
4593
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
4594
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
4595
+
4596
+ // other types prohibit arguments
4597
+ } else if ( match[3] ) {
4598
+ Sizzle.error( match[0] );
4599
+ }
4600
+
4601
+ return match;
4602
+ },
4603
+
4604
+ "PSEUDO": function( match ) {
4605
+ var excess,
4606
+ unquoted = !match[5] && match[2];
4607
+
4608
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
4609
+ return null;
4610
+ }
4611
+
4612
+ // Accept quoted arguments as-is
4613
+ if ( match[4] ) {
4614
+ match[2] = match[4];
4615
+
4616
+ // Strip excess characters from unquoted arguments
4617
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
4618
+ // Get excess from tokenize (recursively)
4619
+ (excess = tokenize( unquoted, true )) &&
4620
+ // advance to the next closing parenthesis
4621
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
4622
+
4623
+ // excess is a negative index
4624
+ match[0] = match[0].slice( 0, excess );
4625
+ match[2] = unquoted.slice( 0, excess );
4626
+ }
4627
+
4628
+ // Return only captures needed by the pseudo filter method (type and argument)
4629
+ return match.slice( 0, 3 );
4630
+ }
4631
+ },
4632
+
4633
+ filter: {
4634
+
4635
+ "TAG": function( nodeName ) {
4636
+ if ( nodeName === "*" ) {
4637
+ return function() { return true; };
4638
+ }
4639
+
4640
+ nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
4641
+ return function( elem ) {
4642
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
4643
+ };
4644
+ },
4645
+
4646
+ "CLASS": function( className ) {
4647
+ var pattern = classCache[ className + " " ];
4648
+
4649
+ return pattern ||
4650
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
4651
+ classCache( className, function( elem ) {
4652
+ return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
4653
+ });
4654
+ },
4655
+
4656
+ "ATTR": function( name, operator, check ) {
4657
+ return function( elem ) {
4658
+ var result = Sizzle.attr( elem, name );
4659
+
4660
+ if ( result == null ) {
4661
+ return operator === "!=";
4662
+ }
4663
+ if ( !operator ) {
4664
+ return true;
4665
+ }
4666
+
4667
+ result += "";
4668
+
4669
+ return operator === "=" ? result === check :
4670
+ operator === "!=" ? result !== check :
4671
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
4672
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
4673
+ operator === "$=" ? check && result.slice( -check.length ) === check :
4674
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
4675
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
4676
+ false;
4677
+ };
4678
+ },
4679
+
4680
+ "CHILD": function( type, what, argument, first, last ) {
4681
+ var simple = type.slice( 0, 3 ) !== "nth",
4682
+ forward = type.slice( -4 ) !== "last",
4683
+ ofType = what === "of-type";
4684
+
4685
+ return first === 1 && last === 0 ?
4686
+
4687
+ // Shortcut for :nth-*(n)
4688
+ function( elem ) {
4689
+ return !!elem.parentNode;
4690
+ } :
4691
+
4692
+ function( elem, context, xml ) {
4693
+ var cache, outerCache, node, diff, nodeIndex, start,
4694
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
4695
+ parent = elem.parentNode,
4696
+ name = ofType && elem.nodeName.toLowerCase(),
4697
+ useCache = !xml && !ofType;
4698
+
4699
+ if ( parent ) {
4700
+
4701
+ // :(first|last|only)-(child|of-type)
4702
+ if ( simple ) {
4703
+ while ( dir ) {
4704
+ node = elem;
4705
+ while ( (node = node[ dir ]) ) {
4706
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
4707
+ return false;
4708
+ }
4709
+ }
4710
+ // Reverse direction for :only-* (if we haven't yet done so)
4711
+ start = dir = type === "only" && !start && "nextSibling";
4712
+ }
4713
+ return true;
4714
+ }
4715
+
4716
+ start = [ forward ? parent.firstChild : parent.lastChild ];
4717
+
4718
+ // non-xml :nth-child(...) stores cache data on `parent`
4719
+ if ( forward && useCache ) {
4720
+ // Seek `elem` from a previously-cached index
4721
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
4722
+ cache = outerCache[ type ] || [];
4723
+ nodeIndex = cache[0] === dirruns && cache[1];
4724
+ diff = cache[0] === dirruns && cache[2];
4725
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
4726
+
4727
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
4728
+
4729
+ // Fallback to seeking `elem` from the start
4730
+ (diff = nodeIndex = 0) || start.pop()) ) {
4731
+
4732
+ // When found, cache indexes on `parent` and break
4733
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
4734
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
4735
+ break;
4736
+ }
4737
+ }
4738
+
4739
+ // Use previously-cached element index if available
4740
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
4741
+ diff = cache[1];
4742
+
4743
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
4744
+ } else {
4745
+ // Use the same loop as above to seek `elem` from the start
4746
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
4747
+ (diff = nodeIndex = 0) || start.pop()) ) {
4748
+
4749
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
4750
+ // Cache the index of each encountered element
4751
+ if ( useCache ) {
4752
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
4753
+ }
4754
+
4755
+ if ( node === elem ) {
4756
+ break;
4757
+ }
4758
+ }
4759
+ }
4760
+ }
4761
+
4762
+ // Incorporate the offset, then check against cycle size
4763
+ diff -= last;
4764
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
4765
+ }
4766
+ };
4767
+ },
4768
+
4769
+ "PSEUDO": function( pseudo, argument ) {
4770
+ // pseudo-class names are case-insensitive
4771
+ // http://www.w3.org/TR/selectors/#pseudo-classes
4772
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
4773
+ // Remember that setFilters inherits from pseudos
4774
+ var args,
4775
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
4776
+ Sizzle.error( "unsupported pseudo: " + pseudo );
4777
+
4778
+ // The user may use createPseudo to indicate that
4779
+ // arguments are needed to create the filter function
4780
+ // just as Sizzle does
4781
+ if ( fn[ expando ] ) {
4782
+ return fn( argument );
4783
+ }
4784
+
4785
+ // But maintain support for old signatures
4786
+ if ( fn.length > 1 ) {
4787
+ args = [ pseudo, pseudo, "", argument ];
4788
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
4789
+ markFunction(function( seed, matches ) {
4790
+ var idx,
4791
+ matched = fn( seed, argument ),
4792
+ i = matched.length;
4793
+ while ( i-- ) {
4794
+ idx = indexOf.call( seed, matched[i] );
4795
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
4796
+ }
4797
+ }) :
4798
+ function( elem ) {
4799
+ return fn( elem, 0, args );
4800
+ };
4801
+ }
4802
+
4803
+ return fn;
4804
+ }
4805
+ },
4806
+
4807
+ pseudos: {
4808
+ // Potentially complex pseudos
4809
+ "not": markFunction(function( selector ) {
4810
+ // Trim the selector passed to compile
4811
+ // to avoid treating leading and trailing
4812
+ // spaces as combinators
4813
+ var input = [],
4814
+ results = [],
4815
+ matcher = compile( selector.replace( rtrim, "$1" ) );
4816
+
4817
+ return matcher[ expando ] ?
4818
+ markFunction(function( seed, matches, context, xml ) {
4819
+ var elem,
4820
+ unmatched = matcher( seed, null, xml, [] ),
4821
+ i = seed.length;
4822
+
4823
+ // Match elements unmatched by `matcher`
4824
+ while ( i-- ) {
4825
+ if ( (elem = unmatched[i]) ) {
4826
+ seed[i] = !(matches[i] = elem);
4827
+ }
4828
+ }
4829
+ }) :
4830
+ function( elem, context, xml ) {
4831
+ input[0] = elem;
4832
+ matcher( input, null, xml, results );
4833
+ return !results.pop();
4834
+ };
4835
+ }),
4836
+
4837
+ "has": markFunction(function( selector ) {
4838
+ return function( elem ) {
4839
+ return Sizzle( selector, elem ).length > 0;
4840
+ };
4841
+ }),
4842
+
4843
+ "contains": markFunction(function( text ) {
4844
+ return function( elem ) {
4845
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
4846
+ };
4847
+ }),
4848
+
4849
+ // "Whether an element is represented by a :lang() selector
4850
+ // is based solely on the element's language value
4851
+ // being equal to the identifier C,
4852
+ // or beginning with the identifier C immediately followed by "-".
4853
+ // The matching of C against the element's language value is performed case-insensitively.
4854
+ // The identifier C does not have to be a valid language name."
4855
+ // http://www.w3.org/TR/selectors/#lang-pseudo
4856
+ "lang": markFunction( function( lang ) {
4857
+ // lang value must be a valid identifider
4858
+ if ( !ridentifier.test(lang || "") ) {
4859
+ Sizzle.error( "unsupported lang: " + lang );
4860
+ }
4861
+ lang = lang.replace( runescape, funescape ).toLowerCase();
4862
+ return function( elem ) {
4863
+ var elemLang;
4864
+ do {
4865
+ if ( (elemLang = documentIsXML ?
4866
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
4867
+ elem.lang) ) {
4868
+
4869
+ elemLang = elemLang.toLowerCase();
4870
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
4871
+ }
4872
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
4873
+ return false;
4874
+ };
4875
+ }),
4876
+
4877
+ // Miscellaneous
4878
+ "target": function( elem ) {
4879
+ var hash = window.location && window.location.hash;
4880
+ return hash && hash.slice( 1 ) === elem.id;
4881
+ },
4882
+
4883
+ "root": function( elem ) {
4884
+ return elem === docElem;
4885
+ },
4886
+
4887
+ "focus": function( elem ) {
4888
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
4889
+ },
4890
+
4891
+ // Boolean properties
4892
+ "enabled": function( elem ) {
4893
+ return elem.disabled === false;
4894
+ },
4895
+
4896
+ "disabled": function( elem ) {
4897
+ return elem.disabled === true;
4898
+ },
4899
+
4900
+ "checked": function( elem ) {
4901
+ // In CSS3, :checked should return both checked and selected elements
4902
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
4903
+ var nodeName = elem.nodeName.toLowerCase();
4904
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
4905
+ },
4906
+
4907
+ "selected": function( elem ) {
4908
+ // Accessing this property makes selected-by-default
4909
+ // options in Safari work properly
4910
+ if ( elem.parentNode ) {
4911
+ elem.parentNode.selectedIndex;
4912
+ }
4913
+
4914
+ return elem.selected === true;
4915
+ },
4916
+
4917
+ // Contents
4918
+ "empty": function( elem ) {
4919
+ // http://www.w3.org/TR/selectors/#empty-pseudo
4920
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
4921
+ // not comment, processing instructions, or others
4922
+ // Thanks to Diego Perini for the nodeName shortcut
4923
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
4924
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
4925
+ if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
4926
+ return false;
4927
+ }
4928
+ }
4929
+ return true;
4930
+ },
4931
+
4932
+ "parent": function( elem ) {
4933
+ return !Expr.pseudos["empty"]( elem );
4934
+ },
4935
+
4936
+ // Element/input types
4937
+ "header": function( elem ) {
4938
+ return rheader.test( elem.nodeName );
4939
+ },
4940
+
4941
+ "input": function( elem ) {
4942
+ return rinputs.test( elem.nodeName );
4943
+ },
4944
+
4945
+ "button": function( elem ) {
4946
+ var name = elem.nodeName.toLowerCase();
4947
+ return name === "input" && elem.type === "button" || name === "button";
4948
+ },
4949
+
4950
+ "text": function( elem ) {
4951
+ var attr;
4952
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
4953
+ // use getAttribute instead to test this case
4954
+ return elem.nodeName.toLowerCase() === "input" &&
4955
+ elem.type === "text" &&
4956
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
4957
+ },
4958
+
4959
+ // Position-in-collection
4960
+ "first": createPositionalPseudo(function() {
4961
+ return [ 0 ];
4962
+ }),
4963
+
4964
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
4965
+ return [ length - 1 ];
4966
+ }),
4967
+
4968
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
4969
+ return [ argument < 0 ? argument + length : argument ];
4970
+ }),
4971
+
4972
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
4973
+ var i = 0;
4974
+ for ( ; i < length; i += 2 ) {
4975
+ matchIndexes.push( i );
4976
+ }
4977
+ return matchIndexes;
4978
+ }),
4979
+
4980
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
4981
+ var i = 1;
4982
+ for ( ; i < length; i += 2 ) {
4983
+ matchIndexes.push( i );
4984
+ }
4985
+ return matchIndexes;
4986
+ }),
4987
+
4988
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
4989
+ var i = argument < 0 ? argument + length : argument;
4990
+ for ( ; --i >= 0; ) {
4991
+ matchIndexes.push( i );
4992
+ }
4993
+ return matchIndexes;
4994
+ }),
4995
+
4996
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
4997
+ var i = argument < 0 ? argument + length : argument;
4998
+ for ( ; ++i < length; ) {
4999
+ matchIndexes.push( i );
5000
+ }
5001
+ return matchIndexes;
5002
+ })
5003
+ }
5004
+ };
5005
+
5006
+ // Add button/input type pseudos
5007
+ for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
5008
+ Expr.pseudos[ i ] = createInputPseudo( i );
5009
+ }
5010
+ for ( i in { submit: true, reset: true } ) {
5011
+ Expr.pseudos[ i ] = createButtonPseudo( i );
5012
+ }
5013
+
5014
+ function tokenize( selector, parseOnly ) {
5015
+ var matched, match, tokens, type,
5016
+ soFar, groups, preFilters,
5017
+ cached = tokenCache[ selector + " " ];
5018
+
5019
+ if ( cached ) {
5020
+ return parseOnly ? 0 : cached.slice( 0 );
5021
+ }
5022
+
5023
+ soFar = selector;
5024
+ groups = [];
5025
+ preFilters = Expr.preFilter;
5026
+
5027
+ while ( soFar ) {
5028
+
5029
+ // Comma and first run
5030
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
5031
+ if ( match ) {
5032
+ // Don't consume trailing commas as valid
5033
+ soFar = soFar.slice( match[0].length ) || soFar;
5034
+ }
5035
+ groups.push( tokens = [] );
5036
+ }
5037
+
5038
+ matched = false;
5039
+
5040
+ // Combinators
5041
+ if ( (match = rcombinators.exec( soFar )) ) {
5042
+ matched = match.shift();
5043
+ tokens.push( {
5044
+ value: matched,
5045
+ // Cast descendant combinators to space
5046
+ type: match[0].replace( rtrim, " " )
5047
+ } );
5048
+ soFar = soFar.slice( matched.length );
5049
+ }
5050
+
5051
+ // Filters
5052
+ for ( type in Expr.filter ) {
5053
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
5054
+ (match = preFilters[ type ]( match ))) ) {
5055
+ matched = match.shift();
5056
+ tokens.push( {
5057
+ value: matched,
5058
+ type: type,
5059
+ matches: match
5060
+ } );
5061
+ soFar = soFar.slice( matched.length );
5062
+ }
5063
+ }
5064
+
5065
+ if ( !matched ) {
5066
+ break;
5067
+ }
5068
+ }
5069
+
5070
+ // Return the length of the invalid excess
5071
+ // if we're just parsing
5072
+ // Otherwise, throw an error or return tokens
5073
+ return parseOnly ?
5074
+ soFar.length :
5075
+ soFar ?
5076
+ Sizzle.error( selector ) :
5077
+ // Cache the tokens
5078
+ tokenCache( selector, groups ).slice( 0 );
5079
+ }
5080
+
5081
+ function toSelector( tokens ) {
5082
+ var i = 0,
5083
+ len = tokens.length,
5084
+ selector = "";
5085
+ for ( ; i < len; i++ ) {
5086
+ selector += tokens[i].value;
5087
+ }
5088
+ return selector;
5089
+ }
5090
+
5091
+ function addCombinator( matcher, combinator, base ) {
5092
+ var dir = combinator.dir,
5093
+ checkNonElements = base && dir === "parentNode",
5094
+ doneName = done++;
5095
+
5096
+ return combinator.first ?
5097
+ // Check against closest ancestor/preceding element
5098
+ function( elem, context, xml ) {
5099
+ while ( (elem = elem[ dir ]) ) {
5100
+ if ( elem.nodeType === 1 || checkNonElements ) {
5101
+ return matcher( elem, context, xml );
5102
+ }
5103
+ }
5104
+ } :
5105
+
5106
+ // Check against all ancestor/preceding elements
5107
+ function( elem, context, xml ) {
5108
+ var data, cache, outerCache,
5109
+ dirkey = dirruns + " " + doneName;
5110
+
5111
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
5112
+ if ( xml ) {
5113
+ while ( (elem = elem[ dir ]) ) {
5114
+ if ( elem.nodeType === 1 || checkNonElements ) {
5115
+ if ( matcher( elem, context, xml ) ) {
5116
+ return true;
5117
+ }
5118
+ }
5119
+ }
5120
+ } else {
5121
+ while ( (elem = elem[ dir ]) ) {
5122
+ if ( elem.nodeType === 1 || checkNonElements ) {
5123
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
5124
+ if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
5125
+ if ( (data = cache[1]) === true || data === cachedruns ) {
5126
+ return data === true;
5127
+ }
5128
+ } else {
5129
+ cache = outerCache[ dir ] = [ dirkey ];
5130
+ cache[1] = matcher( elem, context, xml ) || cachedruns;
5131
+ if ( cache[1] === true ) {
5132
+ return true;
5133
+ }
5134
+ }
5135
+ }
5136
+ }
5137
+ }
5138
+ };
5139
+ }
5140
+
5141
+ function elementMatcher( matchers ) {
5142
+ return matchers.length > 1 ?
5143
+ function( elem, context, xml ) {
5144
+ var i = matchers.length;
5145
+ while ( i-- ) {
5146
+ if ( !matchers[i]( elem, context, xml ) ) {
5147
+ return false;
5148
+ }
5149
+ }
5150
+ return true;
5151
+ } :
5152
+ matchers[0];
5153
+ }
5154
+
5155
+ function condense( unmatched, map, filter, context, xml ) {
5156
+ var elem,
5157
+ newUnmatched = [],
5158
+ i = 0,
5159
+ len = unmatched.length,
5160
+ mapped = map != null;
5161
+
5162
+ for ( ; i < len; i++ ) {
5163
+ if ( (elem = unmatched[i]) ) {
5164
+ if ( !filter || filter( elem, context, xml ) ) {
5165
+ newUnmatched.push( elem );
5166
+ if ( mapped ) {
5167
+ map.push( i );
5168
+ }
5169
+ }
5170
+ }
5171
+ }
5172
+
5173
+ return newUnmatched;
5174
+ }
5175
+
5176
+ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
5177
+ if ( postFilter && !postFilter[ expando ] ) {
5178
+ postFilter = setMatcher( postFilter );
5179
+ }
5180
+ if ( postFinder && !postFinder[ expando ] ) {
5181
+ postFinder = setMatcher( postFinder, postSelector );
5182
+ }
5183
+ return markFunction(function( seed, results, context, xml ) {
5184
+ var temp, i, elem,
5185
+ preMap = [],
5186
+ postMap = [],
5187
+ preexisting = results.length,
5188
+
5189
+ // Get initial elements from seed or context
5190
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
5191
+
5192
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
5193
+ matcherIn = preFilter && ( seed || !selector ) ?
5194
+ condense( elems, preMap, preFilter, context, xml ) :
5195
+ elems,
5196
+
5197
+ matcherOut = matcher ?
5198
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
5199
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
5200
+
5201
+ // ...intermediate processing is necessary
5202
+ [] :
5203
+
5204
+ // ...otherwise use results directly
5205
+ results :
5206
+ matcherIn;
5207
+
5208
+ // Find primary matches
5209
+ if ( matcher ) {
5210
+ matcher( matcherIn, matcherOut, context, xml );
5211
+ }
5212
+
5213
+ // Apply postFilter
5214
+ if ( postFilter ) {
5215
+ temp = condense( matcherOut, postMap );
5216
+ postFilter( temp, [], context, xml );
5217
+
5218
+ // Un-match failing elements by moving them back to matcherIn
5219
+ i = temp.length;
5220
+ while ( i-- ) {
5221
+ if ( (elem = temp[i]) ) {
5222
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
5223
+ }
5224
+ }
5225
+ }
5226
+
5227
+ if ( seed ) {
5228
+ if ( postFinder || preFilter ) {
5229
+ if ( postFinder ) {
5230
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
5231
+ temp = [];
5232
+ i = matcherOut.length;
5233
+ while ( i-- ) {
5234
+ if ( (elem = matcherOut[i]) ) {
5235
+ // Restore matcherIn since elem is not yet a final match
5236
+ temp.push( (matcherIn[i] = elem) );
5237
+ }
5238
+ }
5239
+ postFinder( null, (matcherOut = []), temp, xml );
5240
+ }
5241
+
5242
+ // Move matched elements from seed to results to keep them synchronized
5243
+ i = matcherOut.length;
5244
+ while ( i-- ) {
5245
+ if ( (elem = matcherOut[i]) &&
5246
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
5247
+
5248
+ seed[temp] = !(results[temp] = elem);
5249
+ }
5250
+ }
5251
+ }
5252
+
5253
+ // Add elements to results, through postFinder if defined
5254
+ } else {
5255
+ matcherOut = condense(
5256
+ matcherOut === results ?
5257
+ matcherOut.splice( preexisting, matcherOut.length ) :
5258
+ matcherOut
5259
+ );
5260
+ if ( postFinder ) {
5261
+ postFinder( null, results, matcherOut, xml );
5262
+ } else {
5263
+ push.apply( results, matcherOut );
5264
+ }
5265
+ }
5266
+ });
5267
+ }
5268
+
5269
+ function matcherFromTokens( tokens ) {
5270
+ var checkContext, matcher, j,
5271
+ len = tokens.length,
5272
+ leadingRelative = Expr.relative[ tokens[0].type ],
5273
+ implicitRelative = leadingRelative || Expr.relative[" "],
5274
+ i = leadingRelative ? 1 : 0,
5275
+
5276
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
5277
+ matchContext = addCombinator( function( elem ) {
5278
+ return elem === checkContext;
5279
+ }, implicitRelative, true ),
5280
+ matchAnyContext = addCombinator( function( elem ) {
5281
+ return indexOf.call( checkContext, elem ) > -1;
5282
+ }, implicitRelative, true ),
5283
+ matchers = [ function( elem, context, xml ) {
5284
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
5285
+ (checkContext = context).nodeType ?
5286
+ matchContext( elem, context, xml ) :
5287
+ matchAnyContext( elem, context, xml ) );
5288
+ } ];
5289
+
5290
+ for ( ; i < len; i++ ) {
5291
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
5292
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
5293
+ } else {
5294
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
5295
+
5296
+ // Return special upon seeing a positional matcher
5297
+ if ( matcher[ expando ] ) {
5298
+ // Find the next relative operator (if any) for proper handling
5299
+ j = ++i;
5300
+ for ( ; j < len; j++ ) {
5301
+ if ( Expr.relative[ tokens[j].type ] ) {
5302
+ break;
5303
+ }
5304
+ }
5305
+ return setMatcher(
5306
+ i > 1 && elementMatcher( matchers ),
5307
+ i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
5308
+ matcher,
5309
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
5310
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
5311
+ j < len && toSelector( tokens )
5312
+ );
5313
+ }
5314
+ matchers.push( matcher );
5315
+ }
5316
+ }
5317
+
5318
+ return elementMatcher( matchers );
5319
+ }
5320
+
5321
+ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
5322
+ // A counter to specify which element is currently being matched
5323
+ var matcherCachedRuns = 0,
5324
+ bySet = setMatchers.length > 0,
5325
+ byElement = elementMatchers.length > 0,
5326
+ superMatcher = function( seed, context, xml, results, expandContext ) {
5327
+ var elem, j, matcher,
5328
+ setMatched = [],
5329
+ matchedCount = 0,
5330
+ i = "0",
5331
+ unmatched = seed && [],
5332
+ outermost = expandContext != null,
5333
+ contextBackup = outermostContext,
5334
+ // We must always have either seed elements or context
5335
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
5336
+ // Use integer dirruns iff this is the outermost matcher
5337
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
5338
+
5339
+ if ( outermost ) {
5340
+ outermostContext = context !== document && context;
5341
+ cachedruns = matcherCachedRuns;
5342
+ }
5343
+
5344
+ // Add elements passing elementMatchers directly to results
5345
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
5346
+ for ( ; (elem = elems[i]) != null; i++ ) {
5347
+ if ( byElement && elem ) {
5348
+ j = 0;
5349
+ while ( (matcher = elementMatchers[j++]) ) {
5350
+ if ( matcher( elem, context, xml ) ) {
5351
+ results.push( elem );
5352
+ break;
5353
+ }
5354
+ }
5355
+ if ( outermost ) {
5356
+ dirruns = dirrunsUnique;
5357
+ cachedruns = ++matcherCachedRuns;
5358
+ }
5359
+ }
5360
+
5361
+ // Track unmatched elements for set filters
5362
+ if ( bySet ) {
5363
+ // They will have gone through all possible matchers
5364
+ if ( (elem = !matcher && elem) ) {
5365
+ matchedCount--;
5366
+ }
5367
+
5368
+ // Lengthen the array for every element, matched or not
5369
+ if ( seed ) {
5370
+ unmatched.push( elem );
5371
+ }
5372
+ }
5373
+ }
5374
+
5375
+ // Apply set filters to unmatched elements
5376
+ matchedCount += i;
5377
+ if ( bySet && i !== matchedCount ) {
5378
+ j = 0;
5379
+ while ( (matcher = setMatchers[j++]) ) {
5380
+ matcher( unmatched, setMatched, context, xml );
5381
+ }
5382
+
5383
+ if ( seed ) {
5384
+ // Reintegrate element matches to eliminate the need for sorting
5385
+ if ( matchedCount > 0 ) {
5386
+ while ( i-- ) {
5387
+ if ( !(unmatched[i] || setMatched[i]) ) {
5388
+ setMatched[i] = pop.call( results );
5389
+ }
5390
+ }
5391
+ }
5392
+
5393
+ // Discard index placeholder values to get only actual matches
5394
+ setMatched = condense( setMatched );
5395
+ }
5396
+
5397
+ // Add matches to results
5398
+ push.apply( results, setMatched );
5399
+
5400
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
5401
+ if ( outermost && !seed && setMatched.length > 0 &&
5402
+ ( matchedCount + setMatchers.length ) > 1 ) {
5403
+
5404
+ Sizzle.uniqueSort( results );
5405
+ }
5406
+ }
5407
+
5408
+ // Override manipulation of globals by nested matchers
5409
+ if ( outermost ) {
5410
+ dirruns = dirrunsUnique;
5411
+ outermostContext = contextBackup;
5412
+ }
5413
+
5414
+ return unmatched;
5415
+ };
5416
+
5417
+ return bySet ?
5418
+ markFunction( superMatcher ) :
5419
+ superMatcher;
5420
+ }
5421
+
5422
+ compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
5423
+ var i,
5424
+ setMatchers = [],
5425
+ elementMatchers = [],
5426
+ cached = compilerCache[ selector + " " ];
5427
+
5428
+ if ( !cached ) {
5429
+ // Generate a function of recursive functions that can be used to check each element
5430
+ if ( !group ) {
5431
+ group = tokenize( selector );
5432
+ }
5433
+ i = group.length;
5434
+ while ( i-- ) {
5435
+ cached = matcherFromTokens( group[i] );
5436
+ if ( cached[ expando ] ) {
5437
+ setMatchers.push( cached );
5438
+ } else {
5439
+ elementMatchers.push( cached );
5440
+ }
5441
+ }
5442
+
5443
+ // Cache the compiled function
5444
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
5445
+ }
5446
+ return cached;
5447
+ };
5448
+
5449
+ function multipleContexts( selector, contexts, results ) {
5450
+ var i = 0,
5451
+ len = contexts.length;
5452
+ for ( ; i < len; i++ ) {
5453
+ Sizzle( selector, contexts[i], results );
5454
+ }
5455
+ return results;
5456
+ }
5457
+
5458
+ function select( selector, context, results, seed ) {
5459
+ var i, tokens, token, type, find,
5460
+ match = tokenize( selector );
5461
+
5462
+ if ( !seed ) {
5463
+ // Try to minimize operations if there is only one group
5464
+ if ( match.length === 1 ) {
5465
+
5466
+ // Take a shortcut and set the context if the root selector is an ID
5467
+ tokens = match[0] = match[0].slice( 0 );
5468
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
5469
+ context.nodeType === 9 && !documentIsXML &&
5470
+ Expr.relative[ tokens[1].type ] ) {
5471
+
5472
+ context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
5473
+ if ( !context ) {
5474
+ return results;
5475
+ }
5476
+
5477
+ selector = selector.slice( tokens.shift().value.length );
5478
+ }
5479
+
5480
+ // Fetch a seed set for right-to-left matching
5481
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
5482
+ while ( i-- ) {
5483
+ token = tokens[i];
5484
+
5485
+ // Abort if we hit a combinator
5486
+ if ( Expr.relative[ (type = token.type) ] ) {
5487
+ break;
5488
+ }
5489
+ if ( (find = Expr.find[ type ]) ) {
5490
+ // Search, expanding context for leading sibling combinators
5491
+ if ( (seed = find(
5492
+ token.matches[0].replace( runescape, funescape ),
5493
+ rsibling.test( tokens[0].type ) && context.parentNode || context
5494
+ )) ) {
5495
+
5496
+ // If seed is empty or no tokens remain, we can return early
5497
+ tokens.splice( i, 1 );
5498
+ selector = seed.length && toSelector( tokens );
5499
+ if ( !selector ) {
5500
+ push.apply( results, slice.call( seed, 0 ) );
5501
+ return results;
5502
+ }
5503
+
5504
+ break;
5505
+ }
5506
+ }
5507
+ }
5508
+ }
5509
+ }
5510
+
5511
+ // Compile and execute a filtering function
5512
+ // Provide `match` to avoid retokenization if we modified the selector above
5513
+ compile( selector, match )(
5514
+ seed,
5515
+ context,
5516
+ documentIsXML,
5517
+ results,
5518
+ rsibling.test( selector )
5519
+ );
5520
+ return results;
5521
+ }
5522
+
5523
+ // Deprecated
5524
+ Expr.pseudos["nth"] = Expr.pseudos["eq"];
5525
+
5526
+ // Easy API for creating new setFilters
5527
+ function setFilters() {}
5528
+ Expr.filters = setFilters.prototype = Expr.pseudos;
5529
+ Expr.setFilters = new setFilters();
5530
+
5531
+ // Initialize with the default document
5532
+ setDocument();
5533
+
5534
+ // Override sizzle attribute retrieval
5535
+ Sizzle.attr = jQuery.attr;
5536
+ jQuery.find = Sizzle;
5537
+ jQuery.expr = Sizzle.selectors;
5538
+ jQuery.expr[":"] = jQuery.expr.pseudos;
5539
+ jQuery.unique = Sizzle.uniqueSort;
5540
+ jQuery.text = Sizzle.getText;
5541
+ jQuery.isXMLDoc = Sizzle.isXML;
5542
+ jQuery.contains = Sizzle.contains;
5543
+
5544
+
5545
+ })( window );
5546
+ var runtil = /Until$/,
5547
+ rparentsprev = /^(?:parents|prev(?:Until|All))/,
5548
+ isSimple = /^.[^:#\[\.,]*$/,
5549
+ rneedsContext = jQuery.expr.match.needsContext,
5550
+ // methods guaranteed to produce a unique set when starting from a unique set
5551
+ guaranteedUnique = {
5552
+ children: true,
5553
+ contents: true,
5554
+ next: true,
5555
+ prev: true
5556
+ };
5557
+
5558
+ jQuery.fn.extend({
5559
+ find: function( selector ) {
5560
+ var i, ret, self,
5561
+ len = this.length;
5562
+
5563
+ if ( typeof selector !== "string" ) {
5564
+ self = this;
5565
+ return this.pushStack( jQuery( selector ).filter(function() {
5566
+ for ( i = 0; i < len; i++ ) {
5567
+ if ( jQuery.contains( self[ i ], this ) ) {
5568
+ return true;
5569
+ }
5570
+ }
5571
+ }) );
5572
+ }
5573
+
5574
+ ret = [];
5575
+ for ( i = 0; i < len; i++ ) {
5576
+ jQuery.find( selector, this[ i ], ret );
5577
+ }
5578
+
5579
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
5580
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
5581
+ ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
5582
+ return ret;
5583
+ },
5584
+
5585
+ has: function( target ) {
5586
+ var i,
5587
+ targets = jQuery( target, this ),
5588
+ len = targets.length;
5589
+
5590
+ return this.filter(function() {
5591
+ for ( i = 0; i < len; i++ ) {
5592
+ if ( jQuery.contains( this, targets[i] ) ) {
5593
+ return true;
5594
+ }
5595
+ }
5596
+ });
5597
+ },
5598
+
5599
+ not: function( selector ) {
5600
+ return this.pushStack( winnow(this, selector, false) );
5601
+ },
5602
+
5603
+ filter: function( selector ) {
5604
+ return this.pushStack( winnow(this, selector, true) );
5605
+ },
5606
+
5607
+ is: function( selector ) {
5608
+ return !!selector && (
5609
+ typeof selector === "string" ?
5610
+ // If this is a positional/relative selector, check membership in the returned set
5611
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
5612
+ rneedsContext.test( selector ) ?
5613
+ jQuery( selector, this.context ).index( this[0] ) >= 0 :
5614
+ jQuery.filter( selector, this ).length > 0 :
5615
+ this.filter( selector ).length > 0 );
5616
+ },
5617
+
5618
+ closest: function( selectors, context ) {
5619
+ var cur,
5620
+ i = 0,
5621
+ l = this.length,
5622
+ ret = [],
5623
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
5624
+ jQuery( selectors, context || this.context ) :
5625
+ 0;
5626
+
5627
+ for ( ; i < l; i++ ) {
5628
+ cur = this[i];
5629
+
5630
+ while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
5631
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
5632
+ ret.push( cur );
5633
+ break;
5634
+ }
5635
+ cur = cur.parentNode;
5636
+ }
5637
+ }
5638
+
5639
+ return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
5640
+ },
5641
+
5642
+ // Determine the position of an element within
5643
+ // the matched set of elements
5644
+ index: function( elem ) {
5645
+
5646
+ // No argument, return index in parent
5647
+ if ( !elem ) {
5648
+ return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
5649
+ }
5650
+
5651
+ // index in selector
5652
+ if ( typeof elem === "string" ) {
5653
+ return jQuery.inArray( this[0], jQuery( elem ) );
5654
+ }
5655
+
5656
+ // Locate the position of the desired element
5657
+ return jQuery.inArray(
5658
+ // If it receives a jQuery object, the first element is used
5659
+ elem.jquery ? elem[0] : elem, this );
5660
+ },
5661
+
5662
+ add: function( selector, context ) {
5663
+ var set = typeof selector === "string" ?
5664
+ jQuery( selector, context ) :
5665
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
5666
+ all = jQuery.merge( this.get(), set );
5667
+
5668
+ return this.pushStack( jQuery.unique(all) );
5669
+ },
5670
+
5671
+ addBack: function( selector ) {
5672
+ return this.add( selector == null ?
5673
+ this.prevObject : this.prevObject.filter(selector)
5674
+ );
5675
+ }
5676
+ });
5677
+
5678
+ jQuery.fn.andSelf = jQuery.fn.addBack;
5679
+
5680
+ function sibling( cur, dir ) {
5681
+ do {
5682
+ cur = cur[ dir ];
5683
+ } while ( cur && cur.nodeType !== 1 );
5684
+
5685
+ return cur;
5686
+ }
5687
+
5688
+ jQuery.each({
5689
+ parent: function( elem ) {
5690
+ var parent = elem.parentNode;
5691
+ return parent && parent.nodeType !== 11 ? parent : null;
5692
+ },
5693
+ parents: function( elem ) {
5694
+ return jQuery.dir( elem, "parentNode" );
5695
+ },
5696
+ parentsUntil: function( elem, i, until ) {
5697
+ return jQuery.dir( elem, "parentNode", until );
5698
+ },
5699
+ next: function( elem ) {
5700
+ return sibling( elem, "nextSibling" );
5701
+ },
5702
+ prev: function( elem ) {
5703
+ return sibling( elem, "previousSibling" );
5704
+ },
5705
+ nextAll: function( elem ) {
5706
+ return jQuery.dir( elem, "nextSibling" );
5707
+ },
5708
+ prevAll: function( elem ) {
5709
+ return jQuery.dir( elem, "previousSibling" );
5710
+ },
5711
+ nextUntil: function( elem, i, until ) {
5712
+ return jQuery.dir( elem, "nextSibling", until );
5713
+ },
5714
+ prevUntil: function( elem, i, until ) {
5715
+ return jQuery.dir( elem, "previousSibling", until );
5716
+ },
5717
+ siblings: function( elem ) {
5718
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
5719
+ },
5720
+ children: function( elem ) {
5721
+ return jQuery.sibling( elem.firstChild );
5722
+ },
5723
+ contents: function( elem ) {
5724
+ return jQuery.nodeName( elem, "iframe" ) ?
5725
+ elem.contentDocument || elem.contentWindow.document :
5726
+ jQuery.merge( [], elem.childNodes );
5727
+ }
5728
+ }, function( name, fn ) {
5729
+ jQuery.fn[ name ] = function( until, selector ) {
5730
+ var ret = jQuery.map( this, fn, until );
5731
+
5732
+ if ( !runtil.test( name ) ) {
5733
+ selector = until;
5734
+ }
5735
+
5736
+ if ( selector && typeof selector === "string" ) {
5737
+ ret = jQuery.filter( selector, ret );
5738
+ }
5739
+
5740
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
5741
+
5742
+ if ( this.length > 1 && rparentsprev.test( name ) ) {
5743
+ ret = ret.reverse();
5744
+ }
5745
+
5746
+ return this.pushStack( ret );
5747
+ };
5748
+ });
5749
+
5750
+ jQuery.extend({
5751
+ filter: function( expr, elems, not ) {
5752
+ if ( not ) {
5753
+ expr = ":not(" + expr + ")";
5754
+ }
5755
+
5756
+ return elems.length === 1 ?
5757
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
5758
+ jQuery.find.matches(expr, elems);
5759
+ },
5760
+
5761
+ dir: function( elem, dir, until ) {
5762
+ var matched = [],
5763
+ cur = elem[ dir ];
5764
+
5765
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
5766
+ if ( cur.nodeType === 1 ) {
5767
+ matched.push( cur );
5768
+ }
5769
+ cur = cur[dir];
5770
+ }
5771
+ return matched;
5772
+ },
5773
+
5774
+ sibling: function( n, elem ) {
5775
+ var r = [];
5776
+
5777
+ for ( ; n; n = n.nextSibling ) {
5778
+ if ( n.nodeType === 1 && n !== elem ) {
5779
+ r.push( n );
5780
+ }
5781
+ }
5782
+
5783
+ return r;
5784
+ }
5785
+ });
5786
+
5787
+ // Implement the identical functionality for filter and not
5788
+ function winnow( elements, qualifier, keep ) {
5789
+
5790
+ // Can't pass null or undefined to indexOf in Firefox 4
5791
+ // Set to 0 to skip string check
5792
+ qualifier = qualifier || 0;
5793
+
5794
+ if ( jQuery.isFunction( qualifier ) ) {
5795
+ return jQuery.grep(elements, function( elem, i ) {
5796
+ var retVal = !!qualifier.call( elem, i, elem );
5797
+ return retVal === keep;
5798
+ });
5799
+
5800
+ } else if ( qualifier.nodeType ) {
5801
+ return jQuery.grep(elements, function( elem ) {
5802
+ return ( elem === qualifier ) === keep;
5803
+ });
5804
+
5805
+ } else if ( typeof qualifier === "string" ) {
5806
+ var filtered = jQuery.grep(elements, function( elem ) {
5807
+ return elem.nodeType === 1;
5808
+ });
5809
+
5810
+ if ( isSimple.test( qualifier ) ) {
5811
+ return jQuery.filter(qualifier, filtered, !keep);
5812
+ } else {
5813
+ qualifier = jQuery.filter( qualifier, filtered );
5814
+ }
5815
+ }
5816
+
5817
+ return jQuery.grep(elements, function( elem ) {
5818
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
5819
+ });
5820
+ }
5821
+ function createSafeFragment( document ) {
5822
+ var list = nodeNames.split( "|" ),
5823
+ safeFrag = document.createDocumentFragment();
5824
+
5825
+ if ( safeFrag.createElement ) {
5826
+ while ( list.length ) {
5827
+ safeFrag.createElement(
5828
+ list.pop()
5829
+ );
5830
+ }
5831
+ }
5832
+ return safeFrag;
5833
+ }
5834
+
5835
+ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
5836
+ "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
5837
+ rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
5838
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
5839
+ rleadingWhitespace = /^\s+/,
5840
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
5841
+ rtagName = /<([\w:]+)/,
5842
+ rtbody = /<tbody/i,
5843
+ rhtml = /<|&#?\w+;/,
5844
+ rnoInnerhtml = /<(?:script|style|link)/i,
5845
+ manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
5846
+ // checked="checked" or checked
5847
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5848
+ rscriptType = /^$|\/(?:java|ecma)script/i,
5849
+ rscriptTypeMasked = /^true\/(.*)/,
5850
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
5851
+
5852
+ // We have to close these tags to support XHTML (#13200)
5853
+ wrapMap = {
5854
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
5855
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
5856
+ area: [ 1, "<map>", "</map>" ],
5857
+ param: [ 1, "<object>", "</object>" ],
5858
+ thead: [ 1, "<table>", "</table>" ],
5859
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
5860
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
5861
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
5862
+
5863
+ // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
5864
+ // unless wrapped in a div with non-breaking characters in front of it.
5865
+ _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
5866
+ },
5867
+ safeFragment = createSafeFragment( document ),
5868
+ fragmentDiv = safeFragment.appendChild( document.createElement("div") );
5869
+
5870
+ wrapMap.optgroup = wrapMap.option;
5871
+ wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
5872
+ wrapMap.th = wrapMap.td;
5873
+
5874
+ jQuery.fn.extend({
5875
+ text: function( value ) {
5876
+ return jQuery.access( this, function( value ) {
5877
+ return value === undefined ?
5878
+ jQuery.text( this ) :
5879
+ this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
5880
+ }, null, value, arguments.length );
5881
+ },
5882
+
5883
+ wrapAll: function( html ) {
5884
+ if ( jQuery.isFunction( html ) ) {
5885
+ return this.each(function(i) {
5886
+ jQuery(this).wrapAll( html.call(this, i) );
5887
+ });
5888
+ }
5889
+
5890
+ if ( this[0] ) {
5891
+ // The elements to wrap the target around
5892
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
5893
+
5894
+ if ( this[0].parentNode ) {
5895
+ wrap.insertBefore( this[0] );
5896
+ }
5897
+
5898
+ wrap.map(function() {
5899
+ var elem = this;
5900
+
5901
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
5902
+ elem = elem.firstChild;
5903
+ }
5904
+
5905
+ return elem;
5906
+ }).append( this );
5907
+ }
5908
+
5909
+ return this;
5910
+ },
5911
+
5912
+ wrapInner: function( html ) {
5913
+ if ( jQuery.isFunction( html ) ) {
5914
+ return this.each(function(i) {
5915
+ jQuery(this).wrapInner( html.call(this, i) );
5916
+ });
5917
+ }
5918
+
5919
+ return this.each(function() {
5920
+ var self = jQuery( this ),
5921
+ contents = self.contents();
5922
+
5923
+ if ( contents.length ) {
5924
+ contents.wrapAll( html );
5925
+
5926
+ } else {
5927
+ self.append( html );
5928
+ }
5929
+ });
5930
+ },
5931
+
5932
+ wrap: function( html ) {
5933
+ var isFunction = jQuery.isFunction( html );
5934
+
5935
+ return this.each(function(i) {
5936
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
5937
+ });
5938
+ },
5939
+
5940
+ unwrap: function() {
5941
+ return this.parent().each(function() {
5942
+ if ( !jQuery.nodeName( this, "body" ) ) {
5943
+ jQuery( this ).replaceWith( this.childNodes );
5944
+ }
5945
+ }).end();
5946
+ },
5947
+
5948
+ append: function() {
5949
+ return this.domManip(arguments, true, function( elem ) {
5950
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5951
+ this.appendChild( elem );
5952
+ }
5953
+ });
5954
+ },
5955
+
5956
+ prepend: function() {
5957
+ return this.domManip(arguments, true, function( elem ) {
5958
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5959
+ this.insertBefore( elem, this.firstChild );
5960
+ }
5961
+ });
5962
+ },
5963
+
5964
+ before: function() {
5965
+ return this.domManip( arguments, false, function( elem ) {
5966
+ if ( this.parentNode ) {
5967
+ this.parentNode.insertBefore( elem, this );
5968
+ }
5969
+ });
5970
+ },
5971
+
5972
+ after: function() {
5973
+ return this.domManip( arguments, false, function( elem ) {
5974
+ if ( this.parentNode ) {
5975
+ this.parentNode.insertBefore( elem, this.nextSibling );
5976
+ }
5977
+ });
5978
+ },
5979
+
5980
+ // keepData is for internal use only--do not document
5981
+ remove: function( selector, keepData ) {
5982
+ var elem,
5983
+ i = 0;
5984
+
5985
+ for ( ; (elem = this[i]) != null; i++ ) {
5986
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
5987
+ if ( !keepData && elem.nodeType === 1 ) {
5988
+ jQuery.cleanData( getAll( elem ) );
5989
+ }
5990
+
5991
+ if ( elem.parentNode ) {
5992
+ if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
5993
+ setGlobalEval( getAll( elem, "script" ) );
5994
+ }
5995
+ elem.parentNode.removeChild( elem );
5996
+ }
5997
+ }
5998
+ }
5999
+
6000
+ return this;
6001
+ },
6002
+
6003
+ empty: function() {
6004
+ var elem,
6005
+ i = 0;
6006
+
6007
+ for ( ; (elem = this[i]) != null; i++ ) {
6008
+ // Remove element nodes and prevent memory leaks
6009
+ if ( elem.nodeType === 1 ) {
6010
+ jQuery.cleanData( getAll( elem, false ) );
6011
+ }
6012
+
6013
+ // Remove any remaining nodes
6014
+ while ( elem.firstChild ) {
6015
+ elem.removeChild( elem.firstChild );
6016
+ }
6017
+
6018
+ // If this is a select, ensure that it displays empty (#12336)
6019
+ // Support: IE<9
6020
+ if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
6021
+ elem.options.length = 0;
6022
+ }
6023
+ }
6024
+
6025
+ return this;
6026
+ },
6027
+
6028
+ clone: function( dataAndEvents, deepDataAndEvents ) {
6029
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
6030
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
6031
+
6032
+ return this.map( function () {
6033
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
6034
+ });
6035
+ },
6036
+
6037
+ html: function( value ) {
6038
+ return jQuery.access( this, function( value ) {
6039
+ var elem = this[0] || {},
6040
+ i = 0,
6041
+ l = this.length;
6042
+
6043
+ if ( value === undefined ) {
6044
+ return elem.nodeType === 1 ?
6045
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
6046
+ undefined;
6047
+ }
6048
+
6049
+ // See if we can take a shortcut and just use innerHTML
6050
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
6051
+ ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
6052
+ ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
6053
+ !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
6054
+
6055
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
6056
+
6057
+ try {
6058
+ for (; i < l; i++ ) {
6059
+ // Remove element nodes and prevent memory leaks
6060
+ elem = this[i] || {};
6061
+ if ( elem.nodeType === 1 ) {
6062
+ jQuery.cleanData( getAll( elem, false ) );
6063
+ elem.innerHTML = value;
6064
+ }
6065
+ }
6066
+
6067
+ elem = 0;
6068
+
6069
+ // If using innerHTML throws an exception, use the fallback method
6070
+ } catch(e) {}
6071
+ }
6072
+
6073
+ if ( elem ) {
6074
+ this.empty().append( value );
6075
+ }
6076
+ }, null, value, arguments.length );
6077
+ },
6078
+
6079
+ replaceWith: function( value ) {
6080
+ var isFunc = jQuery.isFunction( value );
6081
+
6082
+ // Make sure that the elements are removed from the DOM before they are inserted
6083
+ // this can help fix replacing a parent with child elements
6084
+ if ( !isFunc && typeof value !== "string" ) {
6085
+ value = jQuery( value ).not( this ).detach();
6086
+ }
6087
+
6088
+ return this.domManip( [ value ], true, function( elem ) {
6089
+ var next = this.nextSibling,
6090
+ parent = this.parentNode;
6091
+
6092
+ if ( parent ) {
6093
+ jQuery( this ).remove();
6094
+ parent.insertBefore( elem, next );
6095
+ }
6096
+ });
6097
+ },
6098
+
6099
+ detach: function( selector ) {
6100
+ return this.remove( selector, true );
6101
+ },
6102
+
6103
+ domManip: function( args, table, callback ) {
6104
+
6105
+ // Flatten any nested arrays
6106
+ args = core_concat.apply( [], args );
6107
+
6108
+ var first, node, hasScripts,
6109
+ scripts, doc, fragment,
6110
+ i = 0,
6111
+ l = this.length,
6112
+ set = this,
6113
+ iNoClone = l - 1,
6114
+ value = args[0],
6115
+ isFunction = jQuery.isFunction( value );
6116
+
6117
+ // We can't cloneNode fragments that contain checked, in WebKit
6118
+ if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
6119
+ return this.each(function( index ) {
6120
+ var self = set.eq( index );
6121
+ if ( isFunction ) {
6122
+ args[0] = value.call( this, index, table ? self.html() : undefined );
6123
+ }
6124
+ self.domManip( args, table, callback );
6125
+ });
6126
+ }
6127
+
6128
+ if ( l ) {
6129
+ fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
6130
+ first = fragment.firstChild;
6131
+
6132
+ if ( fragment.childNodes.length === 1 ) {
6133
+ fragment = first;
6134
+ }
6135
+
6136
+ if ( first ) {
6137
+ table = table && jQuery.nodeName( first, "tr" );
6138
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
6139
+ hasScripts = scripts.length;
6140
+
6141
+ // Use the original fragment for the last item instead of the first because it can end up
6142
+ // being emptied incorrectly in certain situations (#8070).
6143
+ for ( ; i < l; i++ ) {
6144
+ node = fragment;
6145
+
6146
+ if ( i !== iNoClone ) {
6147
+ node = jQuery.clone( node, true, true );
6148
+
6149
+ // Keep references to cloned scripts for later restoration
6150
+ if ( hasScripts ) {
6151
+ jQuery.merge( scripts, getAll( node, "script" ) );
6152
+ }
6153
+ }
6154
+
6155
+ callback.call(
6156
+ table && jQuery.nodeName( this[i], "table" ) ?
6157
+ findOrAppend( this[i], "tbody" ) :
6158
+ this[i],
6159
+ node,
6160
+ i
6161
+ );
6162
+ }
6163
+
6164
+ if ( hasScripts ) {
6165
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
6166
+
6167
+ // Reenable scripts
6168
+ jQuery.map( scripts, restoreScript );
6169
+
6170
+ // Evaluate executable scripts on first document insertion
6171
+ for ( i = 0; i < hasScripts; i++ ) {
6172
+ node = scripts[ i ];
6173
+ if ( rscriptType.test( node.type || "" ) &&
6174
+ !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
6175
+
6176
+ if ( node.src ) {
6177
+ // Hope ajax is available...
6178
+ jQuery.ajax({
6179
+ url: node.src,
6180
+ type: "GET",
6181
+ dataType: "script",
6182
+ async: false,
6183
+ global: false,
6184
+ "throws": true
6185
+ });
6186
+ } else {
6187
+ jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
6188
+ }
6189
+ }
6190
+ }
6191
+ }
6192
+
6193
+ // Fix #11809: Avoid leaking memory
6194
+ fragment = first = null;
6195
+ }
6196
+ }
6197
+
6198
+ return this;
6199
+ }
6200
+ });
6201
+
6202
+ function findOrAppend( elem, tag ) {
6203
+ return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
6204
+ }
6205
+
6206
+ // Replace/restore the type attribute of script elements for safe DOM manipulation
6207
+ function disableScript( elem ) {
6208
+ var attr = elem.getAttributeNode("type");
6209
+ elem.type = ( attr && attr.specified ) + "/" + elem.type;
6210
+ return elem;
6211
+ }
6212
+ function restoreScript( elem ) {
6213
+ var match = rscriptTypeMasked.exec( elem.type );
6214
+ if ( match ) {
6215
+ elem.type = match[1];
6216
+ } else {
6217
+ elem.removeAttribute("type");
6218
+ }
6219
+ return elem;
6220
+ }
6221
+
6222
+ // Mark scripts as having already been evaluated
6223
+ function setGlobalEval( elems, refElements ) {
6224
+ var elem,
6225
+ i = 0;
6226
+ for ( ; (elem = elems[i]) != null; i++ ) {
6227
+ jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
6228
+ }
6229
+ }
6230
+
6231
+ function cloneCopyEvent( src, dest ) {
6232
+
6233
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
6234
+ return;
6235
+ }
6236
+
6237
+ var type, i, l,
6238
+ oldData = jQuery._data( src ),
6239
+ curData = jQuery._data( dest, oldData ),
6240
+ events = oldData.events;
6241
+
6242
+ if ( events ) {
6243
+ delete curData.handle;
6244
+ curData.events = {};
6245
+
6246
+ for ( type in events ) {
6247
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
6248
+ jQuery.event.add( dest, type, events[ type ][ i ] );
6249
+ }
6250
+ }
6251
+ }
6252
+
6253
+ // make the cloned public data object a copy from the original
6254
+ if ( curData.data ) {
6255
+ curData.data = jQuery.extend( {}, curData.data );
6256
+ }
6257
+ }
6258
+
6259
+ function fixCloneNodeIssues( src, dest ) {
6260
+ var nodeName, e, data;
6261
+
6262
+ // We do not need to do anything for non-Elements
6263
+ if ( dest.nodeType !== 1 ) {
6264
+ return;
6265
+ }
6266
+
6267
+ nodeName = dest.nodeName.toLowerCase();
6268
+
6269
+ // IE6-8 copies events bound via attachEvent when using cloneNode.
6270
+ if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
6271
+ data = jQuery._data( dest );
6272
+
6273
+ for ( e in data.events ) {
6274
+ jQuery.removeEvent( dest, e, data.handle );
6275
+ }
6276
+
6277
+ // Event data gets referenced instead of copied if the expando gets copied too
6278
+ dest.removeAttribute( jQuery.expando );
6279
+ }
6280
+
6281
+ // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
6282
+ if ( nodeName === "script" && dest.text !== src.text ) {
6283
+ disableScript( dest ).text = src.text;
6284
+ restoreScript( dest );
6285
+
6286
+ // IE6-10 improperly clones children of object elements using classid.
6287
+ // IE10 throws NoModificationAllowedError if parent is null, #12132.
6288
+ } else if ( nodeName === "object" ) {
6289
+ if ( dest.parentNode ) {
6290
+ dest.outerHTML = src.outerHTML;
6291
+ }
6292
+
6293
+ // This path appears unavoidable for IE9. When cloning an object
6294
+ // element in IE9, the outerHTML strategy above is not sufficient.
6295
+ // If the src has innerHTML and the destination does not,
6296
+ // copy the src.innerHTML into the dest.innerHTML. #10324
6297
+ if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
6298
+ dest.innerHTML = src.innerHTML;
6299
+ }
6300
+
6301
+ } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
6302
+ // IE6-8 fails to persist the checked state of a cloned checkbox
6303
+ // or radio button. Worse, IE6-7 fail to give the cloned element
6304
+ // a checked appearance if the defaultChecked value isn't also set
6305
+
6306
+ dest.defaultChecked = dest.checked = src.checked;
6307
+
6308
+ // IE6-7 get confused and end up setting the value of a cloned
6309
+ // checkbox/radio button to an empty string instead of "on"
6310
+ if ( dest.value !== src.value ) {
6311
+ dest.value = src.value;
6312
+ }
6313
+
6314
+ // IE6-8 fails to return the selected option to the default selected
6315
+ // state when cloning options
6316
+ } else if ( nodeName === "option" ) {
6317
+ dest.defaultSelected = dest.selected = src.defaultSelected;
6318
+
6319
+ // IE6-8 fails to set the defaultValue to the correct value when
6320
+ // cloning other types of input fields
6321
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
6322
+ dest.defaultValue = src.defaultValue;
6323
+ }
6324
+ }
6325
+
6326
+ jQuery.each({
6327
+ appendTo: "append",
6328
+ prependTo: "prepend",
6329
+ insertBefore: "before",
6330
+ insertAfter: "after",
6331
+ replaceAll: "replaceWith"
6332
+ }, function( name, original ) {
6333
+ jQuery.fn[ name ] = function( selector ) {
6334
+ var elems,
6335
+ i = 0,
6336
+ ret = [],
6337
+ insert = jQuery( selector ),
6338
+ last = insert.length - 1;
6339
+
6340
+ for ( ; i <= last; i++ ) {
6341
+ elems = i === last ? this : this.clone(true);
6342
+ jQuery( insert[i] )[ original ]( elems );
6343
+
6344
+ // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
6345
+ core_push.apply( ret, elems.get() );
6346
+ }
6347
+
6348
+ return this.pushStack( ret );
6349
+ };
6350
+ });
6351
+
6352
+ function getAll( context, tag ) {
6353
+ var elems, elem,
6354
+ i = 0,
6355
+ found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
6356
+ typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
6357
+ undefined;
6358
+
6359
+ if ( !found ) {
6360
+ for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
6361
+ if ( !tag || jQuery.nodeName( elem, tag ) ) {
6362
+ found.push( elem );
6363
+ } else {
6364
+ jQuery.merge( found, getAll( elem, tag ) );
6365
+ }
6366
+ }
6367
+ }
6368
+
6369
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
6370
+ jQuery.merge( [ context ], found ) :
6371
+ found;
6372
+ }
6373
+
6374
+ // Used in buildFragment, fixes the defaultChecked property
6375
+ function fixDefaultChecked( elem ) {
6376
+ if ( manipulation_rcheckableType.test( elem.type ) ) {
6377
+ elem.defaultChecked = elem.checked;
6378
+ }
6379
+ }
6380
+
6381
+ jQuery.extend({
6382
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
6383
+ var destElements, node, clone, i, srcElements,
6384
+ inPage = jQuery.contains( elem.ownerDocument, elem );
6385
+
6386
+ if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
6387
+ clone = elem.cloneNode( true );
6388
+
6389
+ // IE<=8 does not properly clone detached, unknown element nodes
6390
+ } else {
6391
+ fragmentDiv.innerHTML = elem.outerHTML;
6392
+ fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
6393
+ }
6394
+
6395
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
6396
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
6397
+
6398
+ // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
6399
+ destElements = getAll( clone );
6400
+ srcElements = getAll( elem );
6401
+
6402
+ // Fix all IE cloning issues
6403
+ for ( i = 0; (node = srcElements[i]) != null; ++i ) {
6404
+ // Ensure that the destination node is not null; Fixes #9587
6405
+ if ( destElements[i] ) {
6406
+ fixCloneNodeIssues( node, destElements[i] );
6407
+ }
6408
+ }
6409
+ }
6410
+
6411
+ // Copy the events from the original to the clone
6412
+ if ( dataAndEvents ) {
6413
+ if ( deepDataAndEvents ) {
6414
+ srcElements = srcElements || getAll( elem );
6415
+ destElements = destElements || getAll( clone );
6416
+
6417
+ for ( i = 0; (node = srcElements[i]) != null; i++ ) {
6418
+ cloneCopyEvent( node, destElements[i] );
6419
+ }
6420
+ } else {
6421
+ cloneCopyEvent( elem, clone );
6422
+ }
6423
+ }
6424
+
6425
+ // Preserve script evaluation history
6426
+ destElements = getAll( clone, "script" );
6427
+ if ( destElements.length > 0 ) {
6428
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
6429
+ }
6430
+
6431
+ destElements = srcElements = node = null;
6432
+
6433
+ // Return the cloned set
6434
+ return clone;
6435
+ },
6436
+
6437
+ buildFragment: function( elems, context, scripts, selection ) {
6438
+ var j, elem, contains,
6439
+ tmp, tag, tbody, wrap,
6440
+ l = elems.length,
6441
+
6442
+ // Ensure a safe fragment
6443
+ safe = createSafeFragment( context ),
6444
+
6445
+ nodes = [],
6446
+ i = 0;
6447
+
6448
+ for ( ; i < l; i++ ) {
6449
+ elem = elems[ i ];
6450
+
6451
+ if ( elem || elem === 0 ) {
6452
+
6453
+ // Add nodes directly
6454
+ if ( jQuery.type( elem ) === "object" ) {
6455
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
6456
+
6457
+ // Convert non-html into a text node
6458
+ } else if ( !rhtml.test( elem ) ) {
6459
+ nodes.push( context.createTextNode( elem ) );
6460
+
6461
+ // Convert html into DOM nodes
6462
+ } else {
6463
+ tmp = tmp || safe.appendChild( context.createElement("div") );
6464
+
6465
+ // Deserialize a standard representation
6466
+ tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
6467
+ wrap = wrapMap[ tag ] || wrapMap._default;
6468
+
6469
+ tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
6470
+
6471
+ // Descend through wrappers to the right content
6472
+ j = wrap[0];
6473
+ while ( j-- ) {
6474
+ tmp = tmp.lastChild;
6475
+ }
6476
+
6477
+ // Manually add leading whitespace removed by IE
6478
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
6479
+ nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
6480
+ }
6481
+
6482
+ // Remove IE's autoinserted <tbody> from table fragments
6483
+ if ( !jQuery.support.tbody ) {
6484
+
6485
+ // String was a <table>, *may* have spurious <tbody>
6486
+ elem = tag === "table" && !rtbody.test( elem ) ?
6487
+ tmp.firstChild :
6488
+
6489
+ // String was a bare <thead> or <tfoot>
6490
+ wrap[1] === "<table>" && !rtbody.test( elem ) ?
6491
+ tmp :
6492
+ 0;
6493
+
6494
+ j = elem && elem.childNodes.length;
6495
+ while ( j-- ) {
6496
+ if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
6497
+ elem.removeChild( tbody );
6498
+ }
6499
+ }
6500
+ }
6501
+
6502
+ jQuery.merge( nodes, tmp.childNodes );
6503
+
6504
+ // Fix #12392 for WebKit and IE > 9
6505
+ tmp.textContent = "";
6506
+
6507
+ // Fix #12392 for oldIE
6508
+ while ( tmp.firstChild ) {
6509
+ tmp.removeChild( tmp.firstChild );
6510
+ }
6511
+
6512
+ // Remember the top-level container for proper cleanup
6513
+ tmp = safe.lastChild;
6514
+ }
6515
+ }
6516
+ }
6517
+
6518
+ // Fix #11356: Clear elements from fragment
6519
+ if ( tmp ) {
6520
+ safe.removeChild( tmp );
6521
+ }
6522
+
6523
+ // Reset defaultChecked for any radios and checkboxes
6524
+ // about to be appended to the DOM in IE 6/7 (#8060)
6525
+ if ( !jQuery.support.appendChecked ) {
6526
+ jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
6527
+ }
6528
+
6529
+ i = 0;
6530
+ while ( (elem = nodes[ i++ ]) ) {
6531
+
6532
+ // #4087 - If origin and destination elements are the same, and this is
6533
+ // that element, do not do anything
6534
+ if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
6535
+ continue;
6536
+ }
6537
+
6538
+ contains = jQuery.contains( elem.ownerDocument, elem );
6539
+
6540
+ // Append to fragment
6541
+ tmp = getAll( safe.appendChild( elem ), "script" );
6542
+
6543
+ // Preserve script evaluation history
6544
+ if ( contains ) {
6545
+ setGlobalEval( tmp );
6546
+ }
6547
+
6548
+ // Capture executables
6549
+ if ( scripts ) {
6550
+ j = 0;
6551
+ while ( (elem = tmp[ j++ ]) ) {
6552
+ if ( rscriptType.test( elem.type || "" ) ) {
6553
+ scripts.push( elem );
6554
+ }
6555
+ }
6556
+ }
6557
+ }
6558
+
6559
+ tmp = null;
6560
+
6561
+ return safe;
6562
+ },
6563
+
6564
+ cleanData: function( elems, /* internal */ acceptData ) {
6565
+ var elem, type, id, data,
6566
+ i = 0,
6567
+ internalKey = jQuery.expando,
6568
+ cache = jQuery.cache,
6569
+ deleteExpando = jQuery.support.deleteExpando,
6570
+ special = jQuery.event.special;
6571
+
6572
+ for ( ; (elem = elems[i]) != null; i++ ) {
6573
+
6574
+ if ( acceptData || jQuery.acceptData( elem ) ) {
6575
+
6576
+ id = elem[ internalKey ];
6577
+ data = id && cache[ id ];
6578
+
6579
+ if ( data ) {
6580
+ if ( data.events ) {
6581
+ for ( type in data.events ) {
6582
+ if ( special[ type ] ) {
6583
+ jQuery.event.remove( elem, type );
6584
+
6585
+ // This is a shortcut to avoid jQuery.event.remove's overhead
6586
+ } else {
6587
+ jQuery.removeEvent( elem, type, data.handle );
6588
+ }
6589
+ }
6590
+ }
6591
+
6592
+ // Remove cache only if it was not already removed by jQuery.event.remove
6593
+ if ( cache[ id ] ) {
6594
+
6595
+ delete cache[ id ];
6596
+
6597
+ // IE does not allow us to delete expando properties from nodes,
6598
+ // nor does it have a removeAttribute function on Document nodes;
6599
+ // we must handle all of these cases
6600
+ if ( deleteExpando ) {
6601
+ delete elem[ internalKey ];
6602
+
6603
+ } else if ( typeof elem.removeAttribute !== core_strundefined ) {
6604
+ elem.removeAttribute( internalKey );
6605
+
6606
+ } else {
6607
+ elem[ internalKey ] = null;
6608
+ }
6609
+
6610
+ core_deletedIds.push( id );
6611
+ }
6612
+ }
6613
+ }
6614
+ }
6615
+ }
6616
+ });
6617
+ var iframe, getStyles, curCSS,
6618
+ ralpha = /alpha\([^)]*\)/i,
6619
+ ropacity = /opacity\s*=\s*([^)]*)/,
6620
+ rposition = /^(top|right|bottom|left)$/,
6621
+ // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
6622
+ // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6623
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6624
+ rmargin = /^margin/,
6625
+ rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
6626
+ rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
6627
+ rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
6628
+ elemdisplay = { BODY: "block" },
6629
+
6630
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6631
+ cssNormalTransform = {
6632
+ letterSpacing: 0,
6633
+ fontWeight: 400
6634
+ },
6635
+
6636
+ cssExpand = [ "Top", "Right", "Bottom", "Left" ],
6637
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
6638
+
6639
+ // return a css property mapped to a potentially vendor prefixed property
6640
+ function vendorPropName( style, name ) {
6641
+
6642
+ // shortcut for names that are not vendor prefixed
6643
+ if ( name in style ) {
6644
+ return name;
6645
+ }
6646
+
6647
+ // check for vendor prefixed names
6648
+ var capName = name.charAt(0).toUpperCase() + name.slice(1),
6649
+ origName = name,
6650
+ i = cssPrefixes.length;
6651
+
6652
+ while ( i-- ) {
6653
+ name = cssPrefixes[ i ] + capName;
6654
+ if ( name in style ) {
6655
+ return name;
6656
+ }
6657
+ }
6658
+
6659
+ return origName;
6660
+ }
6661
+
6662
+ function isHidden( elem, el ) {
6663
+ // isHidden might be called from jQuery#filter function;
6664
+ // in that case, element will be second argument
6665
+ elem = el || elem;
6666
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
6667
+ }
6668
+
6669
+ function showHide( elements, show ) {
6670
+ var display, elem, hidden,
6671
+ values = [],
6672
+ index = 0,
6673
+ length = elements.length;
6674
+
6675
+ for ( ; index < length; index++ ) {
6676
+ elem = elements[ index ];
6677
+ if ( !elem.style ) {
6678
+ continue;
6679
+ }
6680
+
6681
+ values[ index ] = jQuery._data( elem, "olddisplay" );
6682
+ display = elem.style.display;
6683
+ if ( show ) {
6684
+ // Reset the inline display of this element to learn if it is
6685
+ // being hidden by cascaded rules or not
6686
+ if ( !values[ index ] && display === "none" ) {
6687
+ elem.style.display = "";
6688
+ }
6689
+
6690
+ // Set elements which have been overridden with display: none
6691
+ // in a stylesheet to whatever the default browser style is
6692
+ // for such an element
6693
+ if ( elem.style.display === "" && isHidden( elem ) ) {
6694
+ values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
6695
+ }
6696
+ } else {
6697
+
6698
+ if ( !values[ index ] ) {
6699
+ hidden = isHidden( elem );
6700
+
6701
+ if ( display && display !== "none" || !hidden ) {
6702
+ jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
6703
+ }
6704
+ }
6705
+ }
6706
+ }
6707
+
6708
+ // Set the display of most of the elements in a second loop
6709
+ // to avoid the constant reflow
6710
+ for ( index = 0; index < length; index++ ) {
6711
+ elem = elements[ index ];
6712
+ if ( !elem.style ) {
6713
+ continue;
6714
+ }
6715
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
6716
+ elem.style.display = show ? values[ index ] || "" : "none";
6717
+ }
6718
+ }
6719
+
6720
+ return elements;
6721
+ }
6722
+
6723
+ jQuery.fn.extend({
6724
+ css: function( name, value ) {
6725
+ return jQuery.access( this, function( elem, name, value ) {
6726
+ var len, styles,
6727
+ map = {},
6728
+ i = 0;
6729
+
6730
+ if ( jQuery.isArray( name ) ) {
6731
+ styles = getStyles( elem );
6732
+ len = name.length;
6733
+
6734
+ for ( ; i < len; i++ ) {
6735
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6736
+ }
6737
+
6738
+ return map;
6739
+ }
6740
+
6741
+ return value !== undefined ?
6742
+ jQuery.style( elem, name, value ) :
6743
+ jQuery.css( elem, name );
6744
+ }, name, value, arguments.length > 1 );
6745
+ },
6746
+ show: function() {
6747
+ return showHide( this, true );
6748
+ },
6749
+ hide: function() {
6750
+ return showHide( this );
6751
+ },
6752
+ toggle: function( state ) {
6753
+ var bool = typeof state === "boolean";
6754
+
6755
+ return this.each(function() {
6756
+ if ( bool ? state : isHidden( this ) ) {
6757
+ jQuery( this ).show();
6758
+ } else {
6759
+ jQuery( this ).hide();
6760
+ }
6761
+ });
6762
+ }
6763
+ });
6764
+
6765
+ jQuery.extend({
6766
+ // Add in style property hooks for overriding the default
6767
+ // behavior of getting and setting a style property
6768
+ cssHooks: {
6769
+ opacity: {
6770
+ get: function( elem, computed ) {
6771
+ if ( computed ) {
6772
+ // We should always get a number back from opacity
6773
+ var ret = curCSS( elem, "opacity" );
6774
+ return ret === "" ? "1" : ret;
6775
+ }
6776
+ }
6777
+ }
6778
+ },
6779
+
6780
+ // Exclude the following css properties to add px
6781
+ cssNumber: {
6782
+ "columnCount": true,
6783
+ "fillOpacity": true,
6784
+ "fontWeight": true,
6785
+ "lineHeight": true,
6786
+ "opacity": true,
6787
+ "orphans": true,
6788
+ "widows": true,
6789
+ "zIndex": true,
6790
+ "zoom": true
6791
+ },
6792
+
6793
+ // Add in properties whose names you wish to fix before
6794
+ // setting or getting the value
6795
+ cssProps: {
6796
+ // normalize float css property
6797
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
6798
+ },
6799
+
6800
+ // Get and set the style property on a DOM Node
6801
+ style: function( elem, name, value, extra ) {
6802
+ // Don't set styles on text and comment nodes
6803
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6804
+ return;
6805
+ }
6806
+
6807
+ // Make sure that we're working with the right name
6808
+ var ret, type, hooks,
6809
+ origName = jQuery.camelCase( name ),
6810
+ style = elem.style;
6811
+
6812
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
6813
+
6814
+ // gets hook for the prefixed version
6815
+ // followed by the unprefixed version
6816
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6817
+
6818
+ // Check if we're setting a value
6819
+ if ( value !== undefined ) {
6820
+ type = typeof value;
6821
+
6822
+ // convert relative number strings (+= or -=) to relative numbers. #7345
6823
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
6824
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
6825
+ // Fixes bug #9237
6826
+ type = "number";
6827
+ }
6828
+
6829
+ // Make sure that NaN and null values aren't set. See: #7116
6830
+ if ( value == null || type === "number" && isNaN( value ) ) {
6831
+ return;
6832
+ }
6833
+
6834
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
6835
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
6836
+ value += "px";
6837
+ }
6838
+
6839
+ // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
6840
+ // but it would mean to define eight (for every problematic property) identical functions
6841
+ if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
6842
+ style[ name ] = "inherit";
6843
+ }
6844
+
6845
+ // If a hook was provided, use that value, otherwise just set the specified value
6846
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
6847
+
6848
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
6849
+ // Fixes bug #5509
6850
+ try {
6851
+ style[ name ] = value;
6852
+ } catch(e) {}
6853
+ }
6854
+
6855
+ } else {
6856
+ // If a hook was provided get the non-computed value from there
6857
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
6858
+ return ret;
6859
+ }
6860
+
6861
+ // Otherwise just get the value from the style object
6862
+ return style[ name ];
6863
+ }
6864
+ },
6865
+
6866
+ css: function( elem, name, extra, styles ) {
6867
+ var num, val, hooks,
6868
+ origName = jQuery.camelCase( name );
6869
+
6870
+ // Make sure that we're working with the right name
6871
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
6872
+
6873
+ // gets hook for the prefixed version
6874
+ // followed by the unprefixed version
6875
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6876
+
6877
+ // If a hook was provided get the computed value from there
6878
+ if ( hooks && "get" in hooks ) {
6879
+ val = hooks.get( elem, true, extra );
6880
+ }
6881
+
6882
+ // Otherwise, if a way to get the computed value exists, use that
6883
+ if ( val === undefined ) {
6884
+ val = curCSS( elem, name, styles );
6885
+ }
6886
+
6887
+ //convert "normal" to computed value
6888
+ if ( val === "normal" && name in cssNormalTransform ) {
6889
+ val = cssNormalTransform[ name ];
6890
+ }
6891
+
6892
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
6893
+ if ( extra === "" || extra ) {
6894
+ num = parseFloat( val );
6895
+ return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
6896
+ }
6897
+ return val;
6898
+ },
6899
+
6900
+ // A method for quickly swapping in/out CSS properties to get correct calculations
6901
+ swap: function( elem, options, callback, args ) {
6902
+ var ret, name,
6903
+ old = {};
6904
+
6905
+ // Remember the old values, and insert the new ones
6906
+ for ( name in options ) {
6907
+ old[ name ] = elem.style[ name ];
6908
+ elem.style[ name ] = options[ name ];
6909
+ }
6910
+
6911
+ ret = callback.apply( elem, args || [] );
6912
+
6913
+ // Revert the old values
6914
+ for ( name in options ) {
6915
+ elem.style[ name ] = old[ name ];
6916
+ }
6917
+
6918
+ return ret;
6919
+ }
6920
+ });
6921
+
6922
+ // NOTE: we've included the "window" in window.getComputedStyle
6923
+ // because jsdom on node.js will break without it.
6924
+ if ( window.getComputedStyle ) {
6925
+ getStyles = function( elem ) {
6926
+ return window.getComputedStyle( elem, null );
6927
+ };
6928
+
6929
+ curCSS = function( elem, name, _computed ) {
6930
+ var width, minWidth, maxWidth,
6931
+ computed = _computed || getStyles( elem ),
6932
+
6933
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
6934
+ ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
6935
+ style = elem.style;
6936
+
6937
+ if ( computed ) {
6938
+
6939
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
6940
+ ret = jQuery.style( elem, name );
6941
+ }
6942
+
6943
+ // A tribute to the "awesome hack by Dean Edwards"
6944
+ // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
6945
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
6946
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
6947
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
6948
+
6949
+ // Remember the original values
6950
+ width = style.width;
6951
+ minWidth = style.minWidth;
6952
+ maxWidth = style.maxWidth;
6953
+
6954
+ // Put in the new values to get a computed value out
6955
+ style.minWidth = style.maxWidth = style.width = ret;
6956
+ ret = computed.width;
6957
+
6958
+ // Revert the changed values
6959
+ style.width = width;
6960
+ style.minWidth = minWidth;
6961
+ style.maxWidth = maxWidth;
6962
+ }
6963
+ }
6964
+
6965
+ return ret;
6966
+ };
6967
+ } else if ( document.documentElement.currentStyle ) {
6968
+ getStyles = function( elem ) {
6969
+ return elem.currentStyle;
6970
+ };
6971
+
6972
+ curCSS = function( elem, name, _computed ) {
6973
+ var left, rs, rsLeft,
6974
+ computed = _computed || getStyles( elem ),
6975
+ ret = computed ? computed[ name ] : undefined,
6976
+ style = elem.style;
6977
+
6978
+ // Avoid setting ret to empty string here
6979
+ // so we don't default to auto
6980
+ if ( ret == null && style && style[ name ] ) {
6981
+ ret = style[ name ];
6982
+ }
6983
+
6984
+ // From the awesome hack by Dean Edwards
6985
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
6986
+
6987
+ // If we're not dealing with a regular pixel number
6988
+ // but a number that has a weird ending, we need to convert it to pixels
6989
+ // but not position css attributes, as those are proportional to the parent element instead
6990
+ // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
6991
+ if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
6992
+
6993
+ // Remember the original values
6994
+ left = style.left;
6995
+ rs = elem.runtimeStyle;
6996
+ rsLeft = rs && rs.left;
6997
+
6998
+ // Put in the new values to get a computed value out
6999
+ if ( rsLeft ) {
7000
+ rs.left = elem.currentStyle.left;
7001
+ }
7002
+ style.left = name === "fontSize" ? "1em" : ret;
7003
+ ret = style.pixelLeft + "px";
7004
+
7005
+ // Revert the changed values
7006
+ style.left = left;
7007
+ if ( rsLeft ) {
7008
+ rs.left = rsLeft;
7009
+ }
7010
+ }
7011
+
7012
+ return ret === "" ? "auto" : ret;
7013
+ };
7014
+ }
7015
+
7016
+ function setPositiveNumber( elem, value, subtract ) {
7017
+ var matches = rnumsplit.exec( value );
7018
+ return matches ?
7019
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
7020
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
7021
+ value;
7022
+ }
7023
+
7024
+ function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
7025
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
7026
+ // If we already have the right measurement, avoid augmentation
7027
+ 4 :
7028
+ // Otherwise initialize for horizontal or vertical properties
7029
+ name === "width" ? 1 : 0,
7030
+
7031
+ val = 0;
7032
+
7033
+ for ( ; i < 4; i += 2 ) {
7034
+ // both box models exclude margin, so add it if we want it
7035
+ if ( extra === "margin" ) {
7036
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
7037
+ }
7038
+
7039
+ if ( isBorderBox ) {
7040
+ // border-box includes padding, so remove it if we want content
7041
+ if ( extra === "content" ) {
7042
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
7043
+ }
7044
+
7045
+ // at this point, extra isn't border nor margin, so remove border
7046
+ if ( extra !== "margin" ) {
7047
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
7048
+ }
7049
+ } else {
7050
+ // at this point, extra isn't content, so add padding
7051
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
7052
+
7053
+ // at this point, extra isn't content nor padding, so add border
7054
+ if ( extra !== "padding" ) {
7055
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
7056
+ }
7057
+ }
7058
+ }
7059
+
7060
+ return val;
7061
+ }
7062
+
7063
+ function getWidthOrHeight( elem, name, extra ) {
7064
+
7065
+ // Start with offset property, which is equivalent to the border-box value
7066
+ var valueIsBorderBox = true,
7067
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
7068
+ styles = getStyles( elem ),
7069
+ isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
7070
+
7071
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
7072
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
7073
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
7074
+ if ( val <= 0 || val == null ) {
7075
+ // Fall back to computed then uncomputed css if necessary
7076
+ val = curCSS( elem, name, styles );
7077
+ if ( val < 0 || val == null ) {
7078
+ val = elem.style[ name ];
7079
+ }
7080
+
7081
+ // Computed unit is not pixels. Stop here and return.
7082
+ if ( rnumnonpx.test(val) ) {
7083
+ return val;
7084
+ }
7085
+
7086
+ // we need the check for style in case a browser which returns unreliable values
7087
+ // for getComputedStyle silently falls back to the reliable elem.style
7088
+ valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
7089
+
7090
+ // Normalize "", auto, and prepare for extra
7091
+ val = parseFloat( val ) || 0;
7092
+ }
7093
+
7094
+ // use the active box-sizing model to add/subtract irrelevant styles
7095
+ return ( val +
7096
+ augmentWidthOrHeight(
7097
+ elem,
7098
+ name,
7099
+ extra || ( isBorderBox ? "border" : "content" ),
7100
+ valueIsBorderBox,
7101
+ styles
7102
+ )
7103
+ ) + "px";
7104
+ }
7105
+
7106
+ // Try to determine the default display value of an element
7107
+ function css_defaultDisplay( nodeName ) {
7108
+ var doc = document,
7109
+ display = elemdisplay[ nodeName ];
7110
+
7111
+ if ( !display ) {
7112
+ display = actualDisplay( nodeName, doc );
7113
+
7114
+ // If the simple way fails, read from inside an iframe
7115
+ if ( display === "none" || !display ) {
7116
+ // Use the already-created iframe if possible
7117
+ iframe = ( iframe ||
7118
+ jQuery("<iframe frameborder='0' width='0' height='0'/>")
7119
+ .css( "cssText", "display:block !important" )
7120
+ ).appendTo( doc.documentElement );
7121
+
7122
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
7123
+ doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
7124
+ doc.write("<!doctype html><html><body>");
7125
+ doc.close();
7126
+
7127
+ display = actualDisplay( nodeName, doc );
7128
+ iframe.detach();
7129
+ }
7130
+
7131
+ // Store the correct default display
7132
+ elemdisplay[ nodeName ] = display;
7133
+ }
7134
+
7135
+ return display;
7136
+ }
7137
+
7138
+ // Called ONLY from within css_defaultDisplay
7139
+ function actualDisplay( name, doc ) {
7140
+ var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
7141
+ display = jQuery.css( elem[0], "display" );
7142
+ elem.remove();
7143
+ return display;
7144
+ }
7145
+
7146
+ jQuery.each([ "height", "width" ], function( i, name ) {
7147
+ jQuery.cssHooks[ name ] = {
7148
+ get: function( elem, computed, extra ) {
7149
+ if ( computed ) {
7150
+ // certain elements can have dimension info if we invisibly show them
7151
+ // however, it must have a current display style that would benefit from this
7152
+ return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
7153
+ jQuery.swap( elem, cssShow, function() {
7154
+ return getWidthOrHeight( elem, name, extra );
7155
+ }) :
7156
+ getWidthOrHeight( elem, name, extra );
7157
+ }
7158
+ },
7159
+
7160
+ set: function( elem, value, extra ) {
7161
+ var styles = extra && getStyles( elem );
7162
+ return setPositiveNumber( elem, value, extra ?
7163
+ augmentWidthOrHeight(
7164
+ elem,
7165
+ name,
7166
+ extra,
7167
+ jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
7168
+ styles
7169
+ ) : 0
7170
+ );
7171
+ }
7172
+ };
7173
+ });
7174
+
7175
+ if ( !jQuery.support.opacity ) {
7176
+ jQuery.cssHooks.opacity = {
7177
+ get: function( elem, computed ) {
7178
+ // IE uses filters for opacity
7179
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
7180
+ ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
7181
+ computed ? "1" : "";
7182
+ },
7183
+
7184
+ set: function( elem, value ) {
7185
+ var style = elem.style,
7186
+ currentStyle = elem.currentStyle,
7187
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
7188
+ filter = currentStyle && currentStyle.filter || style.filter || "";
7189
+
7190
+ // IE has trouble with opacity if it does not have layout
7191
+ // Force it by setting the zoom level
7192
+ style.zoom = 1;
7193
+
7194
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
7195
+ // if value === "", then remove inline opacity #12685
7196
+ if ( ( value >= 1 || value === "" ) &&
7197
+ jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
7198
+ style.removeAttribute ) {
7199
+
7200
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
7201
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
7202
+ // style.removeAttribute is IE Only, but so apparently is this code path...
7203
+ style.removeAttribute( "filter" );
7204
+
7205
+ // if there is no filter style applied in a css rule or unset inline opacity, we are done
7206
+ if ( value === "" || currentStyle && !currentStyle.filter ) {
7207
+ return;
7208
+ }
7209
+ }
7210
+
7211
+ // otherwise, set new filter values
7212
+ style.filter = ralpha.test( filter ) ?
7213
+ filter.replace( ralpha, opacity ) :
7214
+ filter + " " + opacity;
7215
+ }
7216
+ };
7217
+ }
7218
+
7219
+ // These hooks cannot be added until DOM ready because the support test
7220
+ // for it is not run until after DOM ready
7221
+ jQuery(function() {
7222
+ if ( !jQuery.support.reliableMarginRight ) {
7223
+ jQuery.cssHooks.marginRight = {
7224
+ get: function( elem, computed ) {
7225
+ if ( computed ) {
7226
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
7227
+ // Work around by temporarily setting element display to inline-block
7228
+ return jQuery.swap( elem, { "display": "inline-block" },
7229
+ curCSS, [ elem, "marginRight" ] );
7230
+ }
7231
+ }
7232
+ };
7233
+ }
7234
+
7235
+ // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
7236
+ // getComputedStyle returns percent when specified for top/left/bottom/right
7237
+ // rather than make the css module depend on the offset module, we just check for it here
7238
+ if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
7239
+ jQuery.each( [ "top", "left" ], function( i, prop ) {
7240
+ jQuery.cssHooks[ prop ] = {
7241
+ get: function( elem, computed ) {
7242
+ if ( computed ) {
7243
+ computed = curCSS( elem, prop );
7244
+ // if curCSS returns percentage, fallback to offset
7245
+ return rnumnonpx.test( computed ) ?
7246
+ jQuery( elem ).position()[ prop ] + "px" :
7247
+ computed;
7248
+ }
7249
+ }
7250
+ };
7251
+ });
7252
+ }
7253
+
7254
+ });
7255
+
7256
+ if ( jQuery.expr && jQuery.expr.filters ) {
7257
+ jQuery.expr.filters.hidden = function( elem ) {
7258
+ // Support: Opera <= 12.12
7259
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
7260
+ return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
7261
+ (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
7262
+ };
7263
+
7264
+ jQuery.expr.filters.visible = function( elem ) {
7265
+ return !jQuery.expr.filters.hidden( elem );
7266
+ };
7267
+ }
7268
+
7269
+ // These hooks are used by animate to expand properties
7270
+ jQuery.each({
7271
+ margin: "",
7272
+ padding: "",
7273
+ border: "Width"
7274
+ }, function( prefix, suffix ) {
7275
+ jQuery.cssHooks[ prefix + suffix ] = {
7276
+ expand: function( value ) {
7277
+ var i = 0,
7278
+ expanded = {},
7279
+
7280
+ // assumes a single number if not a string
7281
+ parts = typeof value === "string" ? value.split(" ") : [ value ];
7282
+
7283
+ for ( ; i < 4; i++ ) {
7284
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
7285
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
7286
+ }
7287
+
7288
+ return expanded;
7289
+ }
7290
+ };
7291
+
7292
+ if ( !rmargin.test( prefix ) ) {
7293
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
7294
+ }
7295
+ });
7296
+ var r20 = /%20/g,
7297
+ rbracket = /\[\]$/,
7298
+ rCRLF = /\r?\n/g,
7299
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
7300
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;
7301
+
7302
+ jQuery.fn.extend({
7303
+ serialize: function() {
7304
+ return jQuery.param( this.serializeArray() );
7305
+ },
7306
+ serializeArray: function() {
7307
+ return this.map(function(){
7308
+ // Can add propHook for "elements" to filter or add form elements
7309
+ var elements = jQuery.prop( this, "elements" );
7310
+ return elements ? jQuery.makeArray( elements ) : this;
7311
+ })
7312
+ .filter(function(){
7313
+ var type = this.type;
7314
+ // Use .is(":disabled") so that fieldset[disabled] works
7315
+ return this.name && !jQuery( this ).is( ":disabled" ) &&
7316
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
7317
+ ( this.checked || !manipulation_rcheckableType.test( type ) );
7318
+ })
7319
+ .map(function( i, elem ){
7320
+ var val = jQuery( this ).val();
7321
+
7322
+ return val == null ?
7323
+ null :
7324
+ jQuery.isArray( val ) ?
7325
+ jQuery.map( val, function( val ){
7326
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
7327
+ }) :
7328
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
7329
+ }).get();
7330
+ }
7331
+ });
7332
+
7333
+ //Serialize an array of form elements or a set of
7334
+ //key/values into a query string
7335
+ jQuery.param = function( a, traditional ) {
7336
+ var prefix,
7337
+ s = [],
7338
+ add = function( key, value ) {
7339
+ // If value is a function, invoke it and return its value
7340
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
7341
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
7342
+ };
7343
+
7344
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
7345
+ if ( traditional === undefined ) {
7346
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
7347
+ }
7348
+
7349
+ // If an array was passed in, assume that it is an array of form elements.
7350
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
7351
+ // Serialize the form elements
7352
+ jQuery.each( a, function() {
7353
+ add( this.name, this.value );
7354
+ });
7355
+
7356
+ } else {
7357
+ // If traditional, encode the "old" way (the way 1.3.2 or older
7358
+ // did it), otherwise encode params recursively.
7359
+ for ( prefix in a ) {
7360
+ buildParams( prefix, a[ prefix ], traditional, add );
7361
+ }
7362
+ }
7363
+
7364
+ // Return the resulting serialization
7365
+ return s.join( "&" ).replace( r20, "+" );
7366
+ };
7367
+
7368
+ function buildParams( prefix, obj, traditional, add ) {
7369
+ var name;
7370
+
7371
+ if ( jQuery.isArray( obj ) ) {
7372
+ // Serialize array item.
7373
+ jQuery.each( obj, function( i, v ) {
7374
+ if ( traditional || rbracket.test( prefix ) ) {
7375
+ // Treat each array item as a scalar.
7376
+ add( prefix, v );
7377
+
7378
+ } else {
7379
+ // Item is non-scalar (array or object), encode its numeric index.
7380
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
7381
+ }
7382
+ });
7383
+
7384
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
7385
+ // Serialize object item.
7386
+ for ( name in obj ) {
7387
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
7388
+ }
7389
+
7390
+ } else {
7391
+ // Serialize scalar item.
7392
+ add( prefix, obj );
7393
+ }
7394
+ }
7395
+ jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
7396
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
7397
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
7398
+
7399
+ // Handle event binding
7400
+ jQuery.fn[ name ] = function( data, fn ) {
7401
+ return arguments.length > 0 ?
7402
+ this.on( name, null, data, fn ) :
7403
+ this.trigger( name );
7404
+ };
7405
+ });
7406
+
7407
+ jQuery.fn.hover = function( fnOver, fnOut ) {
7408
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
7409
+ };
7410
+ var
7411
+ // Document location
7412
+ ajaxLocParts,
7413
+ ajaxLocation,
7414
+ ajax_nonce = jQuery.now(),
7415
+
7416
+ ajax_rquery = /\?/,
7417
+ rhash = /#.*$/,
7418
+ rts = /([?&])_=[^&]*/,
7419
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
7420
+ // #7653, #8125, #8152: local protocol detection
7421
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
7422
+ rnoContent = /^(?:GET|HEAD)$/,
7423
+ rprotocol = /^\/\//,
7424
+ rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
7425
+
7426
+ // Keep a copy of the old load method
7427
+ _load = jQuery.fn.load,
7428
+
7429
+ /* Prefilters
7430
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
7431
+ * 2) These are called:
7432
+ * - BEFORE asking for a transport
7433
+ * - AFTER param serialization (s.data is a string if s.processData is true)
7434
+ * 3) key is the dataType
7435
+ * 4) the catchall symbol "*" can be used
7436
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
7437
+ */
7438
+ prefilters = {},
7439
+
7440
+ /* Transports bindings
7441
+ * 1) key is the dataType
7442
+ * 2) the catchall symbol "*" can be used
7443
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
7444
+ */
7445
+ transports = {},
7446
+
7447
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
7448
+ allTypes = "*/".concat("*");
7449
+
7450
+ // #8138, IE may throw an exception when accessing
7451
+ // a field from window.location if document.domain has been set
7452
+ try {
7453
+ ajaxLocation = location.href;
7454
+ } catch( e ) {
7455
+ // Use the href attribute of an A element
7456
+ // since IE will modify it given document.location
7457
+ ajaxLocation = document.createElement( "a" );
7458
+ ajaxLocation.href = "";
7459
+ ajaxLocation = ajaxLocation.href;
7460
+ }
7461
+
7462
+ // Segment location into parts
7463
+ ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
7464
+
7465
+ // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
7466
+ function addToPrefiltersOrTransports( structure ) {
7467
+
7468
+ // dataTypeExpression is optional and defaults to "*"
7469
+ return function( dataTypeExpression, func ) {
7470
+
7471
+ if ( typeof dataTypeExpression !== "string" ) {
7472
+ func = dataTypeExpression;
7473
+ dataTypeExpression = "*";
7474
+ }
7475
+
7476
+ var dataType,
7477
+ i = 0,
7478
+ dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
7479
+
7480
+ if ( jQuery.isFunction( func ) ) {
7481
+ // For each dataType in the dataTypeExpression
7482
+ while ( (dataType = dataTypes[i++]) ) {
7483
+ // Prepend if requested
7484
+ if ( dataType[0] === "+" ) {
7485
+ dataType = dataType.slice( 1 ) || "*";
7486
+ (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
7487
+
7488
+ // Otherwise append
7489
+ } else {
7490
+ (structure[ dataType ] = structure[ dataType ] || []).push( func );
7491
+ }
7492
+ }
7493
+ }
7494
+ };
7495
+ }
7496
+
7497
+ // Base inspection function for prefilters and transports
7498
+ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
7499
+
7500
+ var inspected = {},
7501
+ seekingTransport = ( structure === transports );
7502
+
7503
+ function inspect( dataType ) {
7504
+ var selected;
7505
+ inspected[ dataType ] = true;
7506
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
7507
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
7508
+ if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
7509
+ options.dataTypes.unshift( dataTypeOrTransport );
7510
+ inspect( dataTypeOrTransport );
7511
+ return false;
7512
+ } else if ( seekingTransport ) {
7513
+ return !( selected = dataTypeOrTransport );
7514
+ }
7515
+ });
7516
+ return selected;
7517
+ }
7518
+
7519
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
7520
+ }
7521
+
7522
+ // A special extend for ajax options
7523
+ // that takes "flat" options (not to be deep extended)
7524
+ // Fixes #9887
7525
+ function ajaxExtend( target, src ) {
7526
+ var deep, key,
7527
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
7528
+
7529
+ for ( key in src ) {
7530
+ if ( src[ key ] !== undefined ) {
7531
+ ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
7532
+ }
7533
+ }
7534
+ if ( deep ) {
7535
+ jQuery.extend( true, target, deep );
7536
+ }
7537
+
7538
+ return target;
7539
+ }
7540
+
7541
+ jQuery.fn.load = function( url, params, callback ) {
7542
+ if ( typeof url !== "string" && _load ) {
7543
+ return _load.apply( this, arguments );
7544
+ }
7545
+
7546
+ var selector, response, type,
7547
+ self = this,
7548
+ off = url.indexOf(" ");
7549
+
7550
+ if ( off >= 0 ) {
7551
+ selector = url.slice( off, url.length );
7552
+ url = url.slice( 0, off );
7553
+ }
7554
+
7555
+ // If it's a function
7556
+ if ( jQuery.isFunction( params ) ) {
7557
+
7558
+ // We assume that it's the callback
7559
+ callback = params;
7560
+ params = undefined;
7561
+
7562
+ // Otherwise, build a param string
7563
+ } else if ( params && typeof params === "object" ) {
7564
+ type = "POST";
7565
+ }
7566
+
7567
+ // If we have elements to modify, make the request
7568
+ if ( self.length > 0 ) {
7569
+ jQuery.ajax({
7570
+ url: url,
7571
+
7572
+ // if "type" variable is undefined, then "GET" method will be used
7573
+ type: type,
7574
+ dataType: "html",
7575
+ data: params
7576
+ }).done(function( responseText ) {
7577
+
7578
+ // Save response for use in complete callback
7579
+ response = arguments;
7580
+
7581
+ self.html( selector ?
7582
+
7583
+ // If a selector was specified, locate the right elements in a dummy div
7584
+ // Exclude scripts to avoid IE 'Permission Denied' errors
7585
+ jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
7586
+
7587
+ // Otherwise use the full result
7588
+ responseText );
7589
+
7590
+ }).complete( callback && function( jqXHR, status ) {
7591
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
7592
+ });
7593
+ }
7594
+
7595
+ return this;
7596
+ };
7597
+
7598
+ // Attach a bunch of functions for handling common AJAX events
7599
+ jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
7600
+ jQuery.fn[ type ] = function( fn ){
7601
+ return this.on( type, fn );
7602
+ };
7603
+ });
7604
+
7605
+ jQuery.each( [ "get", "post" ], function( i, method ) {
7606
+ jQuery[ method ] = function( url, data, callback, type ) {
7607
+ // shift arguments if data argument was omitted
7608
+ if ( jQuery.isFunction( data ) ) {
7609
+ type = type || callback;
7610
+ callback = data;
7611
+ data = undefined;
7612
+ }
7613
+
7614
+ return jQuery.ajax({
7615
+ url: url,
7616
+ type: method,
7617
+ dataType: type,
7618
+ data: data,
7619
+ success: callback
7620
+ });
7621
+ };
7622
+ });
7623
+
7624
+ jQuery.extend({
7625
+
7626
+ // Counter for holding the number of active queries
7627
+ active: 0,
7628
+
7629
+ // Last-Modified header cache for next request
7630
+ lastModified: {},
7631
+ etag: {},
7632
+
7633
+ ajaxSettings: {
7634
+ url: ajaxLocation,
7635
+ type: "GET",
7636
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
7637
+ global: true,
7638
+ processData: true,
7639
+ async: true,
7640
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
7641
+ /*
7642
+ timeout: 0,
7643
+ data: null,
7644
+ dataType: null,
7645
+ username: null,
7646
+ password: null,
7647
+ cache: null,
7648
+ throws: false,
7649
+ traditional: false,
7650
+ headers: {},
7651
+ */
7652
+
7653
+ accepts: {
7654
+ "*": allTypes,
7655
+ text: "text/plain",
7656
+ html: "text/html",
7657
+ xml: "application/xml, text/xml",
7658
+ json: "application/json, text/javascript"
7659
+ },
7660
+
7661
+ contents: {
7662
+ xml: /xml/,
7663
+ html: /html/,
7664
+ json: /json/
7665
+ },
7666
+
7667
+ responseFields: {
7668
+ xml: "responseXML",
7669
+ text: "responseText"
7670
+ },
7671
+
7672
+ // Data converters
7673
+ // Keys separate source (or catchall "*") and destination types with a single space
7674
+ converters: {
7675
+
7676
+ // Convert anything to text
7677
+ "* text": window.String,
7678
+
7679
+ // Text to html (true = no transformation)
7680
+ "text html": true,
7681
+
7682
+ // Evaluate text as a json expression
7683
+ "text json": jQuery.parseJSON,
7684
+
7685
+ // Parse text as xml
7686
+ "text xml": jQuery.parseXML
7687
+ },
7688
+
7689
+ // For options that shouldn't be deep extended:
7690
+ // you can add your own custom options here if
7691
+ // and when you create one that shouldn't be
7692
+ // deep extended (see ajaxExtend)
7693
+ flatOptions: {
7694
+ url: true,
7695
+ context: true
7696
+ }
7697
+ },
7698
+
7699
+ // Creates a full fledged settings object into target
7700
+ // with both ajaxSettings and settings fields.
7701
+ // If target is omitted, writes into ajaxSettings.
7702
+ ajaxSetup: function( target, settings ) {
7703
+ return settings ?
7704
+
7705
+ // Building a settings object
7706
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
7707
+
7708
+ // Extending ajaxSettings
7709
+ ajaxExtend( jQuery.ajaxSettings, target );
7710
+ },
7711
+
7712
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
7713
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
7714
+
7715
+ // Main method
7716
+ ajax: function( url, options ) {
7717
+
7718
+ // If url is an object, simulate pre-1.5 signature
7719
+ if ( typeof url === "object" ) {
7720
+ options = url;
7721
+ url = undefined;
7722
+ }
7723
+
7724
+ // Force options to be an object
7725
+ options = options || {};
7726
+
7727
+ var // Cross-domain detection vars
7728
+ parts,
7729
+ // Loop variable
7730
+ i,
7731
+ // URL without anti-cache param
7732
+ cacheURL,
7733
+ // Response headers as string
7734
+ responseHeadersString,
7735
+ // timeout handle
7736
+ timeoutTimer,
7737
+
7738
+ // To know if global events are to be dispatched
7739
+ fireGlobals,
7740
+
7741
+ transport,
7742
+ // Response headers
7743
+ responseHeaders,
7744
+ // Create the final options object
7745
+ s = jQuery.ajaxSetup( {}, options ),
7746
+ // Callbacks context
7747
+ callbackContext = s.context || s,
7748
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
7749
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
7750
+ jQuery( callbackContext ) :
7751
+ jQuery.event,
7752
+ // Deferreds
7753
+ deferred = jQuery.Deferred(),
7754
+ completeDeferred = jQuery.Callbacks("once memory"),
7755
+ // Status-dependent callbacks
7756
+ statusCode = s.statusCode || {},
7757
+ // Headers (they are sent all at once)
7758
+ requestHeaders = {},
7759
+ requestHeadersNames = {},
7760
+ // The jqXHR state
7761
+ state = 0,
7762
+ // Default abort message
7763
+ strAbort = "canceled",
7764
+ // Fake xhr
7765
+ jqXHR = {
7766
+ readyState: 0,
7767
+
7768
+ // Builds headers hashtable if needed
7769
+ getResponseHeader: function( key ) {
7770
+ var match;
7771
+ if ( state === 2 ) {
7772
+ if ( !responseHeaders ) {
7773
+ responseHeaders = {};
7774
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
7775
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
7776
+ }
7777
+ }
7778
+ match = responseHeaders[ key.toLowerCase() ];
7779
+ }
7780
+ return match == null ? null : match;
7781
+ },
7782
+
7783
+ // Raw string
7784
+ getAllResponseHeaders: function() {
7785
+ return state === 2 ? responseHeadersString : null;
7786
+ },
7787
+
7788
+ // Caches the header
7789
+ setRequestHeader: function( name, value ) {
7790
+ var lname = name.toLowerCase();
7791
+ if ( !state ) {
7792
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
7793
+ requestHeaders[ name ] = value;
7794
+ }
7795
+ return this;
7796
+ },
7797
+
7798
+ // Overrides response content-type header
7799
+ overrideMimeType: function( type ) {
7800
+ if ( !state ) {
7801
+ s.mimeType = type;
7802
+ }
7803
+ return this;
7804
+ },
7805
+
7806
+ // Status-dependent callbacks
7807
+ statusCode: function( map ) {
7808
+ var code;
7809
+ if ( map ) {
7810
+ if ( state < 2 ) {
7811
+ for ( code in map ) {
7812
+ // Lazy-add the new callback in a way that preserves old ones
7813
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
7814
+ }
7815
+ } else {
7816
+ // Execute the appropriate callbacks
7817
+ jqXHR.always( map[ jqXHR.status ] );
7818
+ }
7819
+ }
7820
+ return this;
7821
+ },
7822
+
7823
+ // Cancel the request
7824
+ abort: function( statusText ) {
7825
+ var finalText = statusText || strAbort;
7826
+ if ( transport ) {
7827
+ transport.abort( finalText );
7828
+ }
7829
+ done( 0, finalText );
7830
+ return this;
7831
+ }
7832
+ };
7833
+
7834
+ // Attach deferreds
7835
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
7836
+ jqXHR.success = jqXHR.done;
7837
+ jqXHR.error = jqXHR.fail;
7838
+
7839
+ // Remove hash character (#7531: and string promotion)
7840
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
7841
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
7842
+ // We also use the url parameter if available
7843
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
7844
+
7845
+ // Alias method option to type as per ticket #12004
7846
+ s.type = options.method || options.type || s.method || s.type;
7847
+
7848
+ // Extract dataTypes list
7849
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
7850
+
7851
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
7852
+ if ( s.crossDomain == null ) {
7853
+ parts = rurl.exec( s.url.toLowerCase() );
7854
+ s.crossDomain = !!( parts &&
7855
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
7856
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
7857
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
7858
+ );
7859
+ }
7860
+
7861
+ // Convert data if not already a string
7862
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
7863
+ s.data = jQuery.param( s.data, s.traditional );
7864
+ }
7865
+
7866
+ // Apply prefilters
7867
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
7868
+
7869
+ // If request was aborted inside a prefilter, stop there
7870
+ if ( state === 2 ) {
7871
+ return jqXHR;
7872
+ }
7873
+
7874
+ // We can fire global events as of now if asked to
7875
+ fireGlobals = s.global;
7876
+
7877
+ // Watch for a new set of requests
7878
+ if ( fireGlobals && jQuery.active++ === 0 ) {
7879
+ jQuery.event.trigger("ajaxStart");
7880
+ }
7881
+
7882
+ // Uppercase the type
7883
+ s.type = s.type.toUpperCase();
7884
+
7885
+ // Determine if request has content
7886
+ s.hasContent = !rnoContent.test( s.type );
7887
+
7888
+ // Save the URL in case we're toying with the If-Modified-Since
7889
+ // and/or If-None-Match header later on
7890
+ cacheURL = s.url;
7891
+
7892
+ // More options handling for requests with no content
7893
+ if ( !s.hasContent ) {
7894
+
7895
+ // If data is available, append data to url
7896
+ if ( s.data ) {
7897
+ cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
7898
+ // #9682: remove data so that it's not used in an eventual retry
7899
+ delete s.data;
7900
+ }
7901
+
7902
+ // Add anti-cache in url if needed
7903
+ if ( s.cache === false ) {
7904
+ s.url = rts.test( cacheURL ) ?
7905
+
7906
+ // If there is already a '_' parameter, set its value
7907
+ cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
7908
+
7909
+ // Otherwise add one to the end
7910
+ cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
7911
+ }
7912
+ }
7913
+
7914
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
7915
+ if ( s.ifModified ) {
7916
+ if ( jQuery.lastModified[ cacheURL ] ) {
7917
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
7918
+ }
7919
+ if ( jQuery.etag[ cacheURL ] ) {
7920
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
7921
+ }
7922
+ }
7923
+
7924
+ // Set the correct header, if data is being sent
7925
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
7926
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
7927
+ }
7928
+
7929
+ // Set the Accepts header for the server, depending on the dataType
7930
+ jqXHR.setRequestHeader(
7931
+ "Accept",
7932
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
7933
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
7934
+ s.accepts[ "*" ]
7935
+ );
7936
+
7937
+ // Check for headers option
7938
+ for ( i in s.headers ) {
7939
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
7940
+ }
7941
+
7942
+ // Allow custom headers/mimetypes and early abort
7943
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
7944
+ // Abort if not done already and return
7945
+ return jqXHR.abort();
7946
+ }
7947
+
7948
+ // aborting is no longer a cancellation
7949
+ strAbort = "abort";
7950
+
7951
+ // Install callbacks on deferreds
7952
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
7953
+ jqXHR[ i ]( s[ i ] );
7954
+ }
7955
+
7956
+ // Get transport
7957
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
7958
+
7959
+ // If no transport, we auto-abort
7960
+ if ( !transport ) {
7961
+ done( -1, "No Transport" );
7962
+ } else {
7963
+ jqXHR.readyState = 1;
7964
+
7965
+ // Send global event
7966
+ if ( fireGlobals ) {
7967
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
7968
+ }
7969
+ // Timeout
7970
+ if ( s.async && s.timeout > 0 ) {
7971
+ timeoutTimer = setTimeout(function() {
7972
+ jqXHR.abort("timeout");
7973
+ }, s.timeout );
7974
+ }
7975
+
7976
+ try {
7977
+ state = 1;
7978
+ transport.send( requestHeaders, done );
7979
+ } catch ( e ) {
7980
+ // Propagate exception as error if not done
7981
+ if ( state < 2 ) {
7982
+ done( -1, e );
7983
+ // Simply rethrow otherwise
7984
+ } else {
7985
+ throw e;
7986
+ }
7987
+ }
7988
+ }
7989
+
7990
+ // Callback for when everything is done
7991
+ function done( status, nativeStatusText, responses, headers ) {
7992
+ var isSuccess, success, error, response, modified,
7993
+ statusText = nativeStatusText;
7994
+
7995
+ // Called once
7996
+ if ( state === 2 ) {
7997
+ return;
7998
+ }
7999
+
8000
+ // State is "done" now
8001
+ state = 2;
8002
+
8003
+ // Clear timeout if it exists
8004
+ if ( timeoutTimer ) {
8005
+ clearTimeout( timeoutTimer );
8006
+ }
8007
+
8008
+ // Dereference transport for early garbage collection
8009
+ // (no matter how long the jqXHR object will be used)
8010
+ transport = undefined;
8011
+
8012
+ // Cache response headers
8013
+ responseHeadersString = headers || "";
8014
+
8015
+ // Set readyState
8016
+ jqXHR.readyState = status > 0 ? 4 : 0;
8017
+
8018
+ // Get response data
8019
+ if ( responses ) {
8020
+ response = ajaxHandleResponses( s, jqXHR, responses );
8021
+ }
8022
+
8023
+ // If successful, handle type chaining
8024
+ if ( status >= 200 && status < 300 || status === 304 ) {
8025
+
8026
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
8027
+ if ( s.ifModified ) {
8028
+ modified = jqXHR.getResponseHeader("Last-Modified");
8029
+ if ( modified ) {
8030
+ jQuery.lastModified[ cacheURL ] = modified;
8031
+ }
8032
+ modified = jqXHR.getResponseHeader("etag");
8033
+ if ( modified ) {
8034
+ jQuery.etag[ cacheURL ] = modified;
8035
+ }
8036
+ }
8037
+
8038
+ // if no content
8039
+ if ( status === 204 ) {
8040
+ isSuccess = true;
8041
+ statusText = "nocontent";
8042
+
8043
+ // if not modified
8044
+ } else if ( status === 304 ) {
8045
+ isSuccess = true;
8046
+ statusText = "notmodified";
8047
+
8048
+ // If we have data, let's convert it
8049
+ } else {
8050
+ isSuccess = ajaxConvert( s, response );
8051
+ statusText = isSuccess.state;
8052
+ success = isSuccess.data;
8053
+ error = isSuccess.error;
8054
+ isSuccess = !error;
8055
+ }
8056
+ } else {
8057
+ // We extract error from statusText
8058
+ // then normalize statusText and status for non-aborts
8059
+ error = statusText;
8060
+ if ( status || !statusText ) {
8061
+ statusText = "error";
8062
+ if ( status < 0 ) {
8063
+ status = 0;
8064
+ }
8065
+ }
8066
+ }
8067
+
8068
+ // Set data for the fake xhr object
8069
+ jqXHR.status = status;
8070
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
8071
+
8072
+ // Success/Error
8073
+ if ( isSuccess ) {
8074
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
8075
+ } else {
8076
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
8077
+ }
8078
+
8079
+ // Status-dependent callbacks
8080
+ jqXHR.statusCode( statusCode );
8081
+ statusCode = undefined;
8082
+
8083
+ if ( fireGlobals ) {
8084
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
8085
+ [ jqXHR, s, isSuccess ? success : error ] );
8086
+ }
8087
+
8088
+ // Complete
8089
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
8090
+
8091
+ if ( fireGlobals ) {
8092
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
8093
+ // Handle the global AJAX counter
8094
+ if ( !( --jQuery.active ) ) {
8095
+ jQuery.event.trigger("ajaxStop");
8096
+ }
8097
+ }
8098
+ }
8099
+
8100
+ return jqXHR;
8101
+ },
8102
+
8103
+ getScript: function( url, callback ) {
8104
+ return jQuery.get( url, undefined, callback, "script" );
8105
+ },
8106
+
8107
+ getJSON: function( url, data, callback ) {
8108
+ return jQuery.get( url, data, callback, "json" );
8109
+ }
8110
+ });
8111
+
8112
+ /* Handles responses to an ajax request:
8113
+ * - sets all responseXXX fields accordingly
8114
+ * - finds the right dataType (mediates between content-type and expected dataType)
8115
+ * - returns the corresponding response
8116
+ */
8117
+ function ajaxHandleResponses( s, jqXHR, responses ) {
8118
+ var firstDataType, ct, finalDataType, type,
8119
+ contents = s.contents,
8120
+ dataTypes = s.dataTypes,
8121
+ responseFields = s.responseFields;
8122
+
8123
+ // Fill responseXXX fields
8124
+ for ( type in responseFields ) {
8125
+ if ( type in responses ) {
8126
+ jqXHR[ responseFields[type] ] = responses[ type ];
8127
+ }
8128
+ }
8129
+
8130
+ // Remove auto dataType and get content-type in the process
8131
+ while( dataTypes[ 0 ] === "*" ) {
8132
+ dataTypes.shift();
8133
+ if ( ct === undefined ) {
8134
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
8135
+ }
8136
+ }
8137
+
8138
+ // Check if we're dealing with a known content-type
8139
+ if ( ct ) {
8140
+ for ( type in contents ) {
8141
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
8142
+ dataTypes.unshift( type );
8143
+ break;
8144
+ }
8145
+ }
8146
+ }
8147
+
8148
+ // Check to see if we have a response for the expected dataType
8149
+ if ( dataTypes[ 0 ] in responses ) {
8150
+ finalDataType = dataTypes[ 0 ];
8151
+ } else {
8152
+ // Try convertible dataTypes
8153
+ for ( type in responses ) {
8154
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
8155
+ finalDataType = type;
8156
+ break;
8157
+ }
8158
+ if ( !firstDataType ) {
8159
+ firstDataType = type;
8160
+ }
8161
+ }
8162
+ // Or just use first one
8163
+ finalDataType = finalDataType || firstDataType;
8164
+ }
8165
+
8166
+ // If we found a dataType
8167
+ // We add the dataType to the list if needed
8168
+ // and return the corresponding response
8169
+ if ( finalDataType ) {
8170
+ if ( finalDataType !== dataTypes[ 0 ] ) {
8171
+ dataTypes.unshift( finalDataType );
8172
+ }
8173
+ return responses[ finalDataType ];
8174
+ }
8175
+ }
8176
+
8177
+ // Chain conversions given the request and the original response
8178
+ function ajaxConvert( s, response ) {
8179
+ var conv2, current, conv, tmp,
8180
+ converters = {},
8181
+ i = 0,
8182
+ // Work with a copy of dataTypes in case we need to modify it for conversion
8183
+ dataTypes = s.dataTypes.slice(),
8184
+ prev = dataTypes[ 0 ];
8185
+
8186
+ // Apply the dataFilter if provided
8187
+ if ( s.dataFilter ) {
8188
+ response = s.dataFilter( response, s.dataType );
8189
+ }
8190
+
8191
+ // Create converters map with lowercased keys
8192
+ if ( dataTypes[ 1 ] ) {
8193
+ for ( conv in s.converters ) {
8194
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
8195
+ }
8196
+ }
8197
+
8198
+ // Convert to each sequential dataType, tolerating list modification
8199
+ for ( ; (current = dataTypes[++i]); ) {
8200
+
8201
+ // There's only work to do if current dataType is non-auto
8202
+ if ( current !== "*" ) {
8203
+
8204
+ // Convert response if prev dataType is non-auto and differs from current
8205
+ if ( prev !== "*" && prev !== current ) {
8206
+
8207
+ // Seek a direct converter
8208
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
8209
+
8210
+ // If none found, seek a pair
8211
+ if ( !conv ) {
8212
+ for ( conv2 in converters ) {
8213
+
8214
+ // If conv2 outputs current
8215
+ tmp = conv2.split(" ");
8216
+ if ( tmp[ 1 ] === current ) {
8217
+
8218
+ // If prev can be converted to accepted input
8219
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
8220
+ converters[ "* " + tmp[ 0 ] ];
8221
+ if ( conv ) {
8222
+ // Condense equivalence converters
8223
+ if ( conv === true ) {
8224
+ conv = converters[ conv2 ];
8225
+
8226
+ // Otherwise, insert the intermediate dataType
8227
+ } else if ( converters[ conv2 ] !== true ) {
8228
+ current = tmp[ 0 ];
8229
+ dataTypes.splice( i--, 0, current );
8230
+ }
8231
+
8232
+ break;
8233
+ }
8234
+ }
8235
+ }
8236
+ }
8237
+
8238
+ // Apply converter (if not an equivalence)
8239
+ if ( conv !== true ) {
8240
+
8241
+ // Unless errors are allowed to bubble, catch and return them
8242
+ if ( conv && s["throws"] ) {
8243
+ response = conv( response );
8244
+ } else {
8245
+ try {
8246
+ response = conv( response );
8247
+ } catch ( e ) {
8248
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
8249
+ }
8250
+ }
8251
+ }
8252
+ }
8253
+
8254
+ // Update prev for next iteration
8255
+ prev = current;
8256
+ }
8257
+ }
8258
+
8259
+ return { state: "success", data: response };
8260
+ }
8261
+ // Install script dataType
8262
+ jQuery.ajaxSetup({
8263
+ accepts: {
8264
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
8265
+ },
8266
+ contents: {
8267
+ script: /(?:java|ecma)script/
8268
+ },
8269
+ converters: {
8270
+ "text script": function( text ) {
8271
+ jQuery.globalEval( text );
8272
+ return text;
8273
+ }
8274
+ }
8275
+ });
8276
+
8277
+ // Handle cache's special case and global
8278
+ jQuery.ajaxPrefilter( "script", function( s ) {
8279
+ if ( s.cache === undefined ) {
8280
+ s.cache = false;
8281
+ }
8282
+ if ( s.crossDomain ) {
8283
+ s.type = "GET";
8284
+ s.global = false;
8285
+ }
8286
+ });
8287
+
8288
+ // Bind script tag hack transport
8289
+ jQuery.ajaxTransport( "script", function(s) {
8290
+
8291
+ // This transport only deals with cross domain requests
8292
+ if ( s.crossDomain ) {
8293
+
8294
+ var script,
8295
+ head = document.head || jQuery("head")[0] || document.documentElement;
8296
+
8297
+ return {
8298
+
8299
+ send: function( _, callback ) {
8300
+
8301
+ script = document.createElement("script");
8302
+
8303
+ script.async = true;
8304
+
8305
+ if ( s.scriptCharset ) {
8306
+ script.charset = s.scriptCharset;
8307
+ }
8308
+
8309
+ script.src = s.url;
8310
+
8311
+ // Attach handlers for all browsers
8312
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
8313
+
8314
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
8315
+
8316
+ // Handle memory leak in IE
8317
+ script.onload = script.onreadystatechange = null;
8318
+
8319
+ // Remove the script
8320
+ if ( script.parentNode ) {
8321
+ script.parentNode.removeChild( script );
8322
+ }
8323
+
8324
+ // Dereference the script
8325
+ script = null;
8326
+
8327
+ // Callback if not abort
8328
+ if ( !isAbort ) {
8329
+ callback( 200, "success" );
8330
+ }
8331
+ }
8332
+ };
8333
+
8334
+ // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
8335
+ // Use native DOM manipulation to avoid our domManip AJAX trickery
8336
+ head.insertBefore( script, head.firstChild );
8337
+ },
8338
+
8339
+ abort: function() {
8340
+ if ( script ) {
8341
+ script.onload( undefined, true );
8342
+ }
8343
+ }
8344
+ };
8345
+ }
8346
+ });
8347
+ var oldCallbacks = [],
8348
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
8349
+
8350
+ // Default jsonp settings
8351
+ jQuery.ajaxSetup({
8352
+ jsonp: "callback",
8353
+ jsonpCallback: function() {
8354
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
8355
+ this[ callback ] = true;
8356
+ return callback;
8357
+ }
8358
+ });
8359
+
8360
+ // Detect, normalize options and install callbacks for jsonp requests
8361
+ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
8362
+
8363
+ var callbackName, overwritten, responseContainer,
8364
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
8365
+ "url" :
8366
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
8367
+ );
8368
+
8369
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
8370
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
8371
+
8372
+ // Get callback name, remembering preexisting value associated with it
8373
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
8374
+ s.jsonpCallback() :
8375
+ s.jsonpCallback;
8376
+
8377
+ // Insert callback into url or form data
8378
+ if ( jsonProp ) {
8379
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
8380
+ } else if ( s.jsonp !== false ) {
8381
+ s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
8382
+ }
8383
+
8384
+ // Use data converter to retrieve json after script execution
8385
+ s.converters["script json"] = function() {
8386
+ if ( !responseContainer ) {
8387
+ jQuery.error( callbackName + " was not called" );
8388
+ }
8389
+ return responseContainer[ 0 ];
8390
+ };
8391
+
8392
+ // force json dataType
8393
+ s.dataTypes[ 0 ] = "json";
8394
+
8395
+ // Install callback
8396
+ overwritten = window[ callbackName ];
8397
+ window[ callbackName ] = function() {
8398
+ responseContainer = arguments;
8399
+ };
8400
+
8401
+ // Clean-up function (fires after converters)
8402
+ jqXHR.always(function() {
8403
+ // Restore preexisting value
8404
+ window[ callbackName ] = overwritten;
8405
+
8406
+ // Save back as free
8407
+ if ( s[ callbackName ] ) {
8408
+ // make sure that re-using the options doesn't screw things around
8409
+ s.jsonpCallback = originalSettings.jsonpCallback;
8410
+
8411
+ // save the callback name for future use
8412
+ oldCallbacks.push( callbackName );
8413
+ }
8414
+
8415
+ // Call if it was a function and we have a response
8416
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
8417
+ overwritten( responseContainer[ 0 ] );
8418
+ }
8419
+
8420
+ responseContainer = overwritten = undefined;
8421
+ });
8422
+
8423
+ // Delegate to script
8424
+ return "script";
8425
+ }
8426
+ });
8427
+ var xhrCallbacks, xhrSupported,
8428
+ xhrId = 0,
8429
+ // #5280: Internet Explorer will keep connections alive if we don't abort on unload
8430
+ xhrOnUnloadAbort = window.ActiveXObject && function() {
8431
+ // Abort all pending requests
8432
+ var key;
8433
+ for ( key in xhrCallbacks ) {
8434
+ xhrCallbacks[ key ]( undefined, true );
8435
+ }
8436
+ };
8437
+
8438
+ // Functions to create xhrs
8439
+ function createStandardXHR() {
8440
+ try {
8441
+ return new window.XMLHttpRequest();
8442
+ } catch( e ) {}
8443
+ }
8444
+
8445
+ function createActiveXHR() {
8446
+ try {
8447
+ return new window.ActiveXObject("Microsoft.XMLHTTP");
8448
+ } catch( e ) {}
8449
+ }
8450
+
8451
+ // Create the request object
8452
+ // (This is still attached to ajaxSettings for backward compatibility)
8453
+ jQuery.ajaxSettings.xhr = window.ActiveXObject ?
8454
+ /* Microsoft failed to properly
8455
+ * implement the XMLHttpRequest in IE7 (can't request local files),
8456
+ * so we use the ActiveXObject when it is available
8457
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
8458
+ * we need a fallback.
8459
+ */
8460
+ function() {
8461
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
8462
+ } :
8463
+ // For all other browsers, use the standard XMLHttpRequest object
8464
+ createStandardXHR;
8465
+
8466
+ // Determine support properties
8467
+ xhrSupported = jQuery.ajaxSettings.xhr();
8468
+ jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
8469
+ xhrSupported = jQuery.support.ajax = !!xhrSupported;
8470
+
8471
+ // Create transport if the browser can provide an xhr
8472
+ if ( xhrSupported ) {
8473
+
8474
+ jQuery.ajaxTransport(function( s ) {
8475
+ // Cross domain only allowed if supported through XMLHttpRequest
8476
+ if ( !s.crossDomain || jQuery.support.cors ) {
8477
+
8478
+ var callback;
8479
+
8480
+ return {
8481
+ send: function( headers, complete ) {
8482
+
8483
+ // Get a new xhr
8484
+ var handle, i,
8485
+ xhr = s.xhr();
8486
+
8487
+ // Open the socket
8488
+ // Passing null username, generates a login popup on Opera (#2865)
8489
+ if ( s.username ) {
8490
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
8491
+ } else {
8492
+ xhr.open( s.type, s.url, s.async );
8493
+ }
8494
+
8495
+ // Apply custom fields if provided
8496
+ if ( s.xhrFields ) {
8497
+ for ( i in s.xhrFields ) {
8498
+ xhr[ i ] = s.xhrFields[ i ];
8499
+ }
8500
+ }
8501
+
8502
+ // Override mime type if needed
8503
+ if ( s.mimeType && xhr.overrideMimeType ) {
8504
+ xhr.overrideMimeType( s.mimeType );
8505
+ }
8506
+
8507
+ // X-Requested-With header
8508
+ // For cross-domain requests, seeing as conditions for a preflight are
8509
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
8510
+ // (it can always be set on a per-request basis or even using ajaxSetup)
8511
+ // For same-domain requests, won't change header if already provided.
8512
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
8513
+ headers["X-Requested-With"] = "XMLHttpRequest";
8514
+ }
8515
+
8516
+ // Need an extra try/catch for cross domain requests in Firefox 3
8517
+ try {
8518
+ for ( i in headers ) {
8519
+ xhr.setRequestHeader( i, headers[ i ] );
8520
+ }
8521
+ } catch( err ) {}
8522
+
8523
+ // Do send the request
8524
+ // This may raise an exception which is actually
8525
+ // handled in jQuery.ajax (so no try/catch here)
8526
+ xhr.send( ( s.hasContent && s.data ) || null );
8527
+
8528
+ // Listener
8529
+ callback = function( _, isAbort ) {
8530
+ var status, responseHeaders, statusText, responses;
8531
+
8532
+ // Firefox throws exceptions when accessing properties
8533
+ // of an xhr when a network error occurred
8534
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
8535
+ try {
8536
+
8537
+ // Was never called and is aborted or complete
8538
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
8539
+
8540
+ // Only called once
8541
+ callback = undefined;
8542
+
8543
+ // Do not keep as active anymore
8544
+ if ( handle ) {
8545
+ xhr.onreadystatechange = jQuery.noop;
8546
+ if ( xhrOnUnloadAbort ) {
8547
+ delete xhrCallbacks[ handle ];
8548
+ }
8549
+ }
8550
+
8551
+ // If it's an abort
8552
+ if ( isAbort ) {
8553
+ // Abort it manually if needed
8554
+ if ( xhr.readyState !== 4 ) {
8555
+ xhr.abort();
8556
+ }
8557
+ } else {
8558
+ responses = {};
8559
+ status = xhr.status;
8560
+ responseHeaders = xhr.getAllResponseHeaders();
8561
+
8562
+ // When requesting binary data, IE6-9 will throw an exception
8563
+ // on any attempt to access responseText (#11426)
8564
+ if ( typeof xhr.responseText === "string" ) {
8565
+ responses.text = xhr.responseText;
8566
+ }
8567
+
8568
+ // Firefox throws an exception when accessing
8569
+ // statusText for faulty cross-domain requests
8570
+ try {
8571
+ statusText = xhr.statusText;
8572
+ } catch( e ) {
8573
+ // We normalize with Webkit giving an empty statusText
8574
+ statusText = "";
8575
+ }
8576
+
8577
+ // Filter status for non standard behaviors
8578
+
8579
+ // If the request is local and we have data: assume a success
8580
+ // (success with no data won't get notified, that's the best we
8581
+ // can do given current implementations)
8582
+ if ( !status && s.isLocal && !s.crossDomain ) {
8583
+ status = responses.text ? 200 : 404;
8584
+ // IE - #1450: sometimes returns 1223 when it should be 204
8585
+ } else if ( status === 1223 ) {
8586
+ status = 204;
8587
+ }
8588
+ }
8589
+ }
8590
+ } catch( firefoxAccessException ) {
8591
+ if ( !isAbort ) {
8592
+ complete( -1, firefoxAccessException );
8593
+ }
8594
+ }
8595
+
8596
+ // Call complete if needed
8597
+ if ( responses ) {
8598
+ complete( status, statusText, responses, responseHeaders );
8599
+ }
8600
+ };
8601
+
8602
+ if ( !s.async ) {
8603
+ // if we're in sync mode we fire the callback
8604
+ callback();
8605
+ } else if ( xhr.readyState === 4 ) {
8606
+ // (IE6 & IE7) if it's in cache and has been
8607
+ // retrieved directly we need to fire the callback
8608
+ setTimeout( callback );
8609
+ } else {
8610
+ handle = ++xhrId;
8611
+ if ( xhrOnUnloadAbort ) {
8612
+ // Create the active xhrs callbacks list if needed
8613
+ // and attach the unload handler
8614
+ if ( !xhrCallbacks ) {
8615
+ xhrCallbacks = {};
8616
+ jQuery( window ).unload( xhrOnUnloadAbort );
8617
+ }
8618
+ // Add to list of active xhrs callbacks
8619
+ xhrCallbacks[ handle ] = callback;
8620
+ }
8621
+ xhr.onreadystatechange = callback;
8622
+ }
8623
+ },
8624
+
8625
+ abort: function() {
8626
+ if ( callback ) {
8627
+ callback( undefined, true );
8628
+ }
8629
+ }
8630
+ };
8631
+ }
8632
+ });
8633
+ }
8634
+ var fxNow, timerId,
8635
+ rfxtypes = /^(?:toggle|show|hide)$/,
8636
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
8637
+ rrun = /queueHooks$/,
8638
+ animationPrefilters = [ defaultPrefilter ],
8639
+ tweeners = {
8640
+ "*": [function( prop, value ) {
8641
+ var end, unit,
8642
+ tween = this.createTween( prop, value ),
8643
+ parts = rfxnum.exec( value ),
8644
+ target = tween.cur(),
8645
+ start = +target || 0,
8646
+ scale = 1,
8647
+ maxIterations = 20;
8648
+
8649
+ if ( parts ) {
8650
+ end = +parts[2];
8651
+ unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
8652
+
8653
+ // We need to compute starting value
8654
+ if ( unit !== "px" && start ) {
8655
+ // Iteratively approximate from a nonzero starting point
8656
+ // Prefer the current property, because this process will be trivial if it uses the same units
8657
+ // Fallback to end or a simple constant
8658
+ start = jQuery.css( tween.elem, prop, true ) || end || 1;
8659
+
8660
+ do {
8661
+ // If previous iteration zeroed out, double until we get *something*
8662
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
8663
+ scale = scale || ".5";
8664
+
8665
+ // Adjust and apply
8666
+ start = start / scale;
8667
+ jQuery.style( tween.elem, prop, start + unit );
8668
+
8669
+ // Update scale, tolerating zero or NaN from tween.cur()
8670
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
8671
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
8672
+ }
8673
+
8674
+ tween.unit = unit;
8675
+ tween.start = start;
8676
+ // If a +=/-= token was provided, we're doing a relative animation
8677
+ tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
8678
+ }
8679
+ return tween;
8680
+ }]
8681
+ };
8682
+
8683
+ // Animations created synchronously will run synchronously
8684
+ function createFxNow() {
8685
+ setTimeout(function() {
8686
+ fxNow = undefined;
8687
+ });
8688
+ return ( fxNow = jQuery.now() );
8689
+ }
8690
+
8691
+ function createTweens( animation, props ) {
8692
+ jQuery.each( props, function( prop, value ) {
8693
+ var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
8694
+ index = 0,
8695
+ length = collection.length;
8696
+ for ( ; index < length; index++ ) {
8697
+ if ( collection[ index ].call( animation, prop, value ) ) {
8698
+
8699
+ // we're done with this property
8700
+ return;
8701
+ }
8702
+ }
8703
+ });
8704
+ }
8705
+
8706
+ function Animation( elem, properties, options ) {
8707
+ var result,
8708
+ stopped,
8709
+ index = 0,
8710
+ length = animationPrefilters.length,
8711
+ deferred = jQuery.Deferred().always( function() {
8712
+ // don't match elem in the :animated selector
8713
+ delete tick.elem;
8714
+ }),
8715
+ tick = function() {
8716
+ if ( stopped ) {
8717
+ return false;
8718
+ }
8719
+ var currentTime = fxNow || createFxNow(),
8720
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
8721
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
8722
+ temp = remaining / animation.duration || 0,
8723
+ percent = 1 - temp,
8724
+ index = 0,
8725
+ length = animation.tweens.length;
8726
+
8727
+ for ( ; index < length ; index++ ) {
8728
+ animation.tweens[ index ].run( percent );
8729
+ }
8730
+
8731
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
8732
+
8733
+ if ( percent < 1 && length ) {
8734
+ return remaining;
8735
+ } else {
8736
+ deferred.resolveWith( elem, [ animation ] );
8737
+ return false;
8738
+ }
8739
+ },
8740
+ animation = deferred.promise({
8741
+ elem: elem,
8742
+ props: jQuery.extend( {}, properties ),
8743
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
8744
+ originalProperties: properties,
8745
+ originalOptions: options,
8746
+ startTime: fxNow || createFxNow(),
8747
+ duration: options.duration,
8748
+ tweens: [],
8749
+ createTween: function( prop, end ) {
8750
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
8751
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
8752
+ animation.tweens.push( tween );
8753
+ return tween;
8754
+ },
8755
+ stop: function( gotoEnd ) {
8756
+ var index = 0,
8757
+ // if we are going to the end, we want to run all the tweens
8758
+ // otherwise we skip this part
8759
+ length = gotoEnd ? animation.tweens.length : 0;
8760
+ if ( stopped ) {
8761
+ return this;
8762
+ }
8763
+ stopped = true;
8764
+ for ( ; index < length ; index++ ) {
8765
+ animation.tweens[ index ].run( 1 );
8766
+ }
8767
+
8768
+ // resolve when we played the last frame
8769
+ // otherwise, reject
8770
+ if ( gotoEnd ) {
8771
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
8772
+ } else {
8773
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
8774
+ }
8775
+ return this;
8776
+ }
8777
+ }),
8778
+ props = animation.props;
8779
+
8780
+ propFilter( props, animation.opts.specialEasing );
8781
+
8782
+ for ( ; index < length ; index++ ) {
8783
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
8784
+ if ( result ) {
8785
+ return result;
8786
+ }
8787
+ }
8788
+
8789
+ createTweens( animation, props );
8790
+
8791
+ if ( jQuery.isFunction( animation.opts.start ) ) {
8792
+ animation.opts.start.call( elem, animation );
8793
+ }
8794
+
8795
+ jQuery.fx.timer(
8796
+ jQuery.extend( tick, {
8797
+ elem: elem,
8798
+ anim: animation,
8799
+ queue: animation.opts.queue
8800
+ })
8801
+ );
8802
+
8803
+ // attach callbacks from options
8804
+ return animation.progress( animation.opts.progress )
8805
+ .done( animation.opts.done, animation.opts.complete )
8806
+ .fail( animation.opts.fail )
8807
+ .always( animation.opts.always );
8808
+ }
8809
+
8810
+ function propFilter( props, specialEasing ) {
8811
+ var value, name, index, easing, hooks;
8812
+
8813
+ // camelCase, specialEasing and expand cssHook pass
8814
+ for ( index in props ) {
8815
+ name = jQuery.camelCase( index );
8816
+ easing = specialEasing[ name ];
8817
+ value = props[ index ];
8818
+ if ( jQuery.isArray( value ) ) {
8819
+ easing = value[ 1 ];
8820
+ value = props[ index ] = value[ 0 ];
8821
+ }
8822
+
8823
+ if ( index !== name ) {
8824
+ props[ name ] = value;
8825
+ delete props[ index ];
8826
+ }
8827
+
8828
+ hooks = jQuery.cssHooks[ name ];
8829
+ if ( hooks && "expand" in hooks ) {
8830
+ value = hooks.expand( value );
8831
+ delete props[ name ];
8832
+
8833
+ // not quite $.extend, this wont overwrite keys already present.
8834
+ // also - reusing 'index' from above because we have the correct "name"
8835
+ for ( index in value ) {
8836
+ if ( !( index in props ) ) {
8837
+ props[ index ] = value[ index ];
8838
+ specialEasing[ index ] = easing;
8839
+ }
8840
+ }
8841
+ } else {
8842
+ specialEasing[ name ] = easing;
8843
+ }
8844
+ }
8845
+ }
8846
+
8847
+ jQuery.Animation = jQuery.extend( Animation, {
8848
+
8849
+ tweener: function( props, callback ) {
8850
+ if ( jQuery.isFunction( props ) ) {
8851
+ callback = props;
8852
+ props = [ "*" ];
8853
+ } else {
8854
+ props = props.split(" ");
8855
+ }
8856
+
8857
+ var prop,
8858
+ index = 0,
8859
+ length = props.length;
8860
+
8861
+ for ( ; index < length ; index++ ) {
8862
+ prop = props[ index ];
8863
+ tweeners[ prop ] = tweeners[ prop ] || [];
8864
+ tweeners[ prop ].unshift( callback );
8865
+ }
8866
+ },
8867
+
8868
+ prefilter: function( callback, prepend ) {
8869
+ if ( prepend ) {
8870
+ animationPrefilters.unshift( callback );
8871
+ } else {
8872
+ animationPrefilters.push( callback );
8873
+ }
8874
+ }
8875
+ });
8876
+
8877
+ function defaultPrefilter( elem, props, opts ) {
8878
+ /*jshint validthis:true */
8879
+ var prop, index, length,
8880
+ value, dataShow, toggle,
8881
+ tween, hooks, oldfire,
8882
+ anim = this,
8883
+ style = elem.style,
8884
+ orig = {},
8885
+ handled = [],
8886
+ hidden = elem.nodeType && isHidden( elem );
8887
+
8888
+ // handle queue: false promises
8889
+ if ( !opts.queue ) {
8890
+ hooks = jQuery._queueHooks( elem, "fx" );
8891
+ if ( hooks.unqueued == null ) {
8892
+ hooks.unqueued = 0;
8893
+ oldfire = hooks.empty.fire;
8894
+ hooks.empty.fire = function() {
8895
+ if ( !hooks.unqueued ) {
8896
+ oldfire();
8897
+ }
8898
+ };
8899
+ }
8900
+ hooks.unqueued++;
8901
+
8902
+ anim.always(function() {
8903
+ // doing this makes sure that the complete handler will be called
8904
+ // before this completes
8905
+ anim.always(function() {
8906
+ hooks.unqueued--;
8907
+ if ( !jQuery.queue( elem, "fx" ).length ) {
8908
+ hooks.empty.fire();
8909
+ }
8910
+ });
8911
+ });
8912
+ }
8913
+
8914
+ // height/width overflow pass
8915
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
8916
+ // Make sure that nothing sneaks out
8917
+ // Record all 3 overflow attributes because IE does not
8918
+ // change the overflow attribute when overflowX and
8919
+ // overflowY are set to the same value
8920
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
8921
+
8922
+ // Set display property to inline-block for height/width
8923
+ // animations on inline elements that are having width/height animated
8924
+ if ( jQuery.css( elem, "display" ) === "inline" &&
8925
+ jQuery.css( elem, "float" ) === "none" ) {
8926
+
8927
+ // inline-level elements accept inline-block;
8928
+ // block-level elements need to be inline with layout
8929
+ if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
8930
+ style.display = "inline-block";
8931
+
8932
+ } else {
8933
+ style.zoom = 1;
8934
+ }
8935
+ }
8936
+ }
8937
+
8938
+ if ( opts.overflow ) {
8939
+ style.overflow = "hidden";
8940
+ if ( !jQuery.support.shrinkWrapBlocks ) {
8941
+ anim.always(function() {
8942
+ style.overflow = opts.overflow[ 0 ];
8943
+ style.overflowX = opts.overflow[ 1 ];
8944
+ style.overflowY = opts.overflow[ 2 ];
8945
+ });
8946
+ }
8947
+ }
8948
+
8949
+
8950
+ // show/hide pass
8951
+ for ( index in props ) {
8952
+ value = props[ index ];
8953
+ if ( rfxtypes.exec( value ) ) {
8954
+ delete props[ index ];
8955
+ toggle = toggle || value === "toggle";
8956
+ if ( value === ( hidden ? "hide" : "show" ) ) {
8957
+ continue;
8958
+ }
8959
+ handled.push( index );
8960
+ }
8961
+ }
8962
+
8963
+ length = handled.length;
8964
+ if ( length ) {
8965
+ dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
8966
+ if ( "hidden" in dataShow ) {
8967
+ hidden = dataShow.hidden;
8968
+ }
8969
+
8970
+ // store state if its toggle - enables .stop().toggle() to "reverse"
8971
+ if ( toggle ) {
8972
+ dataShow.hidden = !hidden;
8973
+ }
8974
+ if ( hidden ) {
8975
+ jQuery( elem ).show();
8976
+ } else {
8977
+ anim.done(function() {
8978
+ jQuery( elem ).hide();
8979
+ });
8980
+ }
8981
+ anim.done(function() {
8982
+ var prop;
8983
+ jQuery._removeData( elem, "fxshow" );
8984
+ for ( prop in orig ) {
8985
+ jQuery.style( elem, prop, orig[ prop ] );
8986
+ }
8987
+ });
8988
+ for ( index = 0 ; index < length ; index++ ) {
8989
+ prop = handled[ index ];
8990
+ tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
8991
+ orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
8992
+
8993
+ if ( !( prop in dataShow ) ) {
8994
+ dataShow[ prop ] = tween.start;
8995
+ if ( hidden ) {
8996
+ tween.end = tween.start;
8997
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
8998
+ }
8999
+ }
9000
+ }
9001
+ }
9002
+ }
9003
+
9004
+ function Tween( elem, options, prop, end, easing ) {
9005
+ return new Tween.prototype.init( elem, options, prop, end, easing );
9006
+ }
9007
+ jQuery.Tween = Tween;
9008
+
9009
+ Tween.prototype = {
9010
+ constructor: Tween,
9011
+ init: function( elem, options, prop, end, easing, unit ) {
9012
+ this.elem = elem;
9013
+ this.prop = prop;
9014
+ this.easing = easing || "swing";
9015
+ this.options = options;
9016
+ this.start = this.now = this.cur();
9017
+ this.end = end;
9018
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
9019
+ },
9020
+ cur: function() {
9021
+ var hooks = Tween.propHooks[ this.prop ];
9022
+
9023
+ return hooks && hooks.get ?
9024
+ hooks.get( this ) :
9025
+ Tween.propHooks._default.get( this );
9026
+ },
9027
+ run: function( percent ) {
9028
+ var eased,
9029
+ hooks = Tween.propHooks[ this.prop ];
9030
+
9031
+ if ( this.options.duration ) {
9032
+ this.pos = eased = jQuery.easing[ this.easing ](
9033
+ percent, this.options.duration * percent, 0, 1, this.options.duration
9034
+ );
9035
+ } else {
9036
+ this.pos = eased = percent;
9037
+ }
9038
+ this.now = ( this.end - this.start ) * eased + this.start;
9039
+
9040
+ if ( this.options.step ) {
9041
+ this.options.step.call( this.elem, this.now, this );
9042
+ }
9043
+
9044
+ if ( hooks && hooks.set ) {
9045
+ hooks.set( this );
9046
+ } else {
9047
+ Tween.propHooks._default.set( this );
9048
+ }
9049
+ return this;
9050
+ }
9051
+ };
9052
+
9053
+ Tween.prototype.init.prototype = Tween.prototype;
9054
+
9055
+ Tween.propHooks = {
9056
+ _default: {
9057
+ get: function( tween ) {
9058
+ var result;
9059
+
9060
+ if ( tween.elem[ tween.prop ] != null &&
9061
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
9062
+ return tween.elem[ tween.prop ];
9063
+ }
9064
+
9065
+ // passing an empty string as a 3rd parameter to .css will automatically
9066
+ // attempt a parseFloat and fallback to a string if the parse fails
9067
+ // so, simple values such as "10px" are parsed to Float.
9068
+ // complex values such as "rotate(1rad)" are returned as is.
9069
+ result = jQuery.css( tween.elem, tween.prop, "" );
9070
+ // Empty strings, null, undefined and "auto" are converted to 0.
9071
+ return !result || result === "auto" ? 0 : result;
9072
+ },
9073
+ set: function( tween ) {
9074
+ // use step hook for back compat - use cssHook if its there - use .style if its
9075
+ // available and use plain properties where available
9076
+ if ( jQuery.fx.step[ tween.prop ] ) {
9077
+ jQuery.fx.step[ tween.prop ]( tween );
9078
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
9079
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
9080
+ } else {
9081
+ tween.elem[ tween.prop ] = tween.now;
9082
+ }
9083
+ }
9084
+ }
9085
+ };
9086
+
9087
+ // Remove in 2.0 - this supports IE8's panic based approach
9088
+ // to setting things on disconnected nodes
9089
+
9090
+ Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
9091
+ set: function( tween ) {
9092
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
9093
+ tween.elem[ tween.prop ] = tween.now;
9094
+ }
9095
+ }
9096
+ };
9097
+
9098
+ jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
9099
+ var cssFn = jQuery.fn[ name ];
9100
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
9101
+ return speed == null || typeof speed === "boolean" ?
9102
+ cssFn.apply( this, arguments ) :
9103
+ this.animate( genFx( name, true ), speed, easing, callback );
9104
+ };
9105
+ });
9106
+
9107
+ jQuery.fn.extend({
9108
+ fadeTo: function( speed, to, easing, callback ) {
9109
+
9110
+ // show any hidden elements after setting opacity to 0
9111
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
9112
+
9113
+ // animate to the value specified
9114
+ .end().animate({ opacity: to }, speed, easing, callback );
9115
+ },
9116
+ animate: function( prop, speed, easing, callback ) {
9117
+ var empty = jQuery.isEmptyObject( prop ),
9118
+ optall = jQuery.speed( speed, easing, callback ),
9119
+ doAnimation = function() {
9120
+ // Operate on a copy of prop so per-property easing won't be lost
9121
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
9122
+ doAnimation.finish = function() {
9123
+ anim.stop( true );
9124
+ };
9125
+ // Empty animations, or finishing resolves immediately
9126
+ if ( empty || jQuery._data( this, "finish" ) ) {
9127
+ anim.stop( true );
9128
+ }
9129
+ };
9130
+ doAnimation.finish = doAnimation;
9131
+
9132
+ return empty || optall.queue === false ?
9133
+ this.each( doAnimation ) :
9134
+ this.queue( optall.queue, doAnimation );
9135
+ },
9136
+ stop: function( type, clearQueue, gotoEnd ) {
9137
+ var stopQueue = function( hooks ) {
9138
+ var stop = hooks.stop;
9139
+ delete hooks.stop;
9140
+ stop( gotoEnd );
9141
+ };
9142
+
9143
+ if ( typeof type !== "string" ) {
9144
+ gotoEnd = clearQueue;
9145
+ clearQueue = type;
9146
+ type = undefined;
9147
+ }
9148
+ if ( clearQueue && type !== false ) {
9149
+ this.queue( type || "fx", [] );
9150
+ }
9151
+
9152
+ return this.each(function() {
9153
+ var dequeue = true,
9154
+ index = type != null && type + "queueHooks",
9155
+ timers = jQuery.timers,
9156
+ data = jQuery._data( this );
9157
+
9158
+ if ( index ) {
9159
+ if ( data[ index ] && data[ index ].stop ) {
9160
+ stopQueue( data[ index ] );
9161
+ }
9162
+ } else {
9163
+ for ( index in data ) {
9164
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
9165
+ stopQueue( data[ index ] );
9166
+ }
9167
+ }
9168
+ }
9169
+
9170
+ for ( index = timers.length; index--; ) {
9171
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
9172
+ timers[ index ].anim.stop( gotoEnd );
9173
+ dequeue = false;
9174
+ timers.splice( index, 1 );
9175
+ }
9176
+ }
9177
+
9178
+ // start the next in the queue if the last step wasn't forced
9179
+ // timers currently will call their complete callbacks, which will dequeue
9180
+ // but only if they were gotoEnd
9181
+ if ( dequeue || !gotoEnd ) {
9182
+ jQuery.dequeue( this, type );
9183
+ }
9184
+ });
9185
+ },
9186
+ finish: function( type ) {
9187
+ if ( type !== false ) {
9188
+ type = type || "fx";
9189
+ }
9190
+ return this.each(function() {
9191
+ var index,
9192
+ data = jQuery._data( this ),
9193
+ queue = data[ type + "queue" ],
9194
+ hooks = data[ type + "queueHooks" ],
9195
+ timers = jQuery.timers,
9196
+ length = queue ? queue.length : 0;
9197
+
9198
+ // enable finishing flag on private data
9199
+ data.finish = true;
9200
+
9201
+ // empty the queue first
9202
+ jQuery.queue( this, type, [] );
9203
+
9204
+ if ( hooks && hooks.cur && hooks.cur.finish ) {
9205
+ hooks.cur.finish.call( this );
9206
+ }
9207
+
9208
+ // look for any active animations, and finish them
9209
+ for ( index = timers.length; index--; ) {
9210
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
9211
+ timers[ index ].anim.stop( true );
9212
+ timers.splice( index, 1 );
9213
+ }
9214
+ }
9215
+
9216
+ // look for any animations in the old queue and finish them
9217
+ for ( index = 0; index < length; index++ ) {
9218
+ if ( queue[ index ] && queue[ index ].finish ) {
9219
+ queue[ index ].finish.call( this );
9220
+ }
9221
+ }
9222
+
9223
+ // turn off finishing flag
9224
+ delete data.finish;
9225
+ });
9226
+ }
9227
+ });
9228
+
9229
+ // Generate parameters to create a standard animation
9230
+ function genFx( type, includeWidth ) {
9231
+ var which,
9232
+ attrs = { height: type },
9233
+ i = 0;
9234
+
9235
+ // if we include width, step value is 1 to do all cssExpand values,
9236
+ // if we don't include width, step value is 2 to skip over Left and Right
9237
+ includeWidth = includeWidth? 1 : 0;
9238
+ for( ; i < 4 ; i += 2 - includeWidth ) {
9239
+ which = cssExpand[ i ];
9240
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
9241
+ }
9242
+
9243
+ if ( includeWidth ) {
9244
+ attrs.opacity = attrs.width = type;
9245
+ }
9246
+
9247
+ return attrs;
9248
+ }
9249
+
9250
+ // Generate shortcuts for custom animations
9251
+ jQuery.each({
9252
+ slideDown: genFx("show"),
9253
+ slideUp: genFx("hide"),
9254
+ slideToggle: genFx("toggle"),
9255
+ fadeIn: { opacity: "show" },
9256
+ fadeOut: { opacity: "hide" },
9257
+ fadeToggle: { opacity: "toggle" }
9258
+ }, function( name, props ) {
9259
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
9260
+ return this.animate( props, speed, easing, callback );
9261
+ };
9262
+ });
9263
+
9264
+ jQuery.speed = function( speed, easing, fn ) {
9265
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
9266
+ complete: fn || !fn && easing ||
9267
+ jQuery.isFunction( speed ) && speed,
9268
+ duration: speed,
9269
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
9270
+ };
9271
+
9272
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
9273
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
9274
+
9275
+ // normalize opt.queue - true/undefined/null -> "fx"
9276
+ if ( opt.queue == null || opt.queue === true ) {
9277
+ opt.queue = "fx";
9278
+ }
9279
+
9280
+ // Queueing
9281
+ opt.old = opt.complete;
9282
+
9283
+ opt.complete = function() {
9284
+ if ( jQuery.isFunction( opt.old ) ) {
9285
+ opt.old.call( this );
9286
+ }
9287
+
9288
+ if ( opt.queue ) {
9289
+ jQuery.dequeue( this, opt.queue );
9290
+ }
9291
+ };
9292
+
9293
+ return opt;
9294
+ };
9295
+
9296
+ jQuery.easing = {
9297
+ linear: function( p ) {
9298
+ return p;
9299
+ },
9300
+ swing: function( p ) {
9301
+ return 0.5 - Math.cos( p*Math.PI ) / 2;
9302
+ }
9303
+ };
9304
+
9305
+ jQuery.timers = [];
9306
+ jQuery.fx = Tween.prototype.init;
9307
+ jQuery.fx.tick = function() {
9308
+ var timer,
9309
+ timers = jQuery.timers,
9310
+ i = 0;
9311
+
9312
+ fxNow = jQuery.now();
9313
+
9314
+ for ( ; i < timers.length; i++ ) {
9315
+ timer = timers[ i ];
9316
+ // Checks the timer has not already been removed
9317
+ if ( !timer() && timers[ i ] === timer ) {
9318
+ timers.splice( i--, 1 );
9319
+ }
9320
+ }
9321
+
9322
+ if ( !timers.length ) {
9323
+ jQuery.fx.stop();
9324
+ }
9325
+ fxNow = undefined;
9326
+ };
9327
+
9328
+ jQuery.fx.timer = function( timer ) {
9329
+ if ( timer() && jQuery.timers.push( timer ) ) {
9330
+ jQuery.fx.start();
9331
+ }
9332
+ };
9333
+
9334
+ jQuery.fx.interval = 13;
9335
+
9336
+ jQuery.fx.start = function() {
9337
+ if ( !timerId ) {
9338
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
9339
+ }
9340
+ };
9341
+
9342
+ jQuery.fx.stop = function() {
9343
+ clearInterval( timerId );
9344
+ timerId = null;
9345
+ };
9346
+
9347
+ jQuery.fx.speeds = {
9348
+ slow: 600,
9349
+ fast: 200,
9350
+ // Default speed
9351
+ _default: 400
9352
+ };
9353
+
9354
+ // Back Compat <1.8 extension point
9355
+ jQuery.fx.step = {};
9356
+
9357
+ if ( jQuery.expr && jQuery.expr.filters ) {
9358
+ jQuery.expr.filters.animated = function( elem ) {
9359
+ return jQuery.grep(jQuery.timers, function( fn ) {
9360
+ return elem === fn.elem;
9361
+ }).length;
9362
+ };
9363
+ }
9364
+ jQuery.fn.offset = function( options ) {
9365
+ if ( arguments.length ) {
9366
+ return options === undefined ?
9367
+ this :
9368
+ this.each(function( i ) {
9369
+ jQuery.offset.setOffset( this, options, i );
9370
+ });
9371
+ }
9372
+
9373
+ var docElem, win,
9374
+ box = { top: 0, left: 0 },
9375
+ elem = this[ 0 ],
9376
+ doc = elem && elem.ownerDocument;
9377
+
9378
+ if ( !doc ) {
9379
+ return;
9380
+ }
9381
+
9382
+ docElem = doc.documentElement;
9383
+
9384
+ // Make sure it's not a disconnected DOM node
9385
+ if ( !jQuery.contains( docElem, elem ) ) {
9386
+ return box;
9387
+ }
9388
+
9389
+ // If we don't have gBCR, just use 0,0 rather than error
9390
+ // BlackBerry 5, iOS 3 (original iPhone)
9391
+ if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
9392
+ box = elem.getBoundingClientRect();
9393
+ }
9394
+ win = getWindow( doc );
9395
+ return {
9396
+ top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
9397
+ left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
9398
+ };
9399
+ };
9400
+
9401
+ jQuery.offset = {
9402
+
9403
+ setOffset: function( elem, options, i ) {
9404
+ var position = jQuery.css( elem, "position" );
9405
+
9406
+ // set position first, in-case top/left are set even on static elem
9407
+ if ( position === "static" ) {
9408
+ elem.style.position = "relative";
9409
+ }
9410
+
9411
+ var curElem = jQuery( elem ),
9412
+ curOffset = curElem.offset(),
9413
+ curCSSTop = jQuery.css( elem, "top" ),
9414
+ curCSSLeft = jQuery.css( elem, "left" ),
9415
+ calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
9416
+ props = {}, curPosition = {}, curTop, curLeft;
9417
+
9418
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
9419
+ if ( calculatePosition ) {
9420
+ curPosition = curElem.position();
9421
+ curTop = curPosition.top;
9422
+ curLeft = curPosition.left;
9423
+ } else {
9424
+ curTop = parseFloat( curCSSTop ) || 0;
9425
+ curLeft = parseFloat( curCSSLeft ) || 0;
9426
+ }
9427
+
9428
+ if ( jQuery.isFunction( options ) ) {
9429
+ options = options.call( elem, i, curOffset );
9430
+ }
9431
+
9432
+ if ( options.top != null ) {
9433
+ props.top = ( options.top - curOffset.top ) + curTop;
9434
+ }
9435
+ if ( options.left != null ) {
9436
+ props.left = ( options.left - curOffset.left ) + curLeft;
9437
+ }
9438
+
9439
+ if ( "using" in options ) {
9440
+ options.using.call( elem, props );
9441
+ } else {
9442
+ curElem.css( props );
9443
+ }
9444
+ }
9445
+ };
9446
+
9447
+
9448
+ jQuery.fn.extend({
9449
+
9450
+ position: function() {
9451
+ if ( !this[ 0 ] ) {
9452
+ return;
9453
+ }
9454
+
9455
+ var offsetParent, offset,
9456
+ parentOffset = { top: 0, left: 0 },
9457
+ elem = this[ 0 ];
9458
+
9459
+ // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
9460
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
9461
+ // we assume that getBoundingClientRect is available when computed position is fixed
9462
+ offset = elem.getBoundingClientRect();
9463
+ } else {
9464
+ // Get *real* offsetParent
9465
+ offsetParent = this.offsetParent();
9466
+
9467
+ // Get correct offsets
9468
+ offset = this.offset();
9469
+ if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
9470
+ parentOffset = offsetParent.offset();
9471
+ }
9472
+
9473
+ // Add offsetParent borders
9474
+ parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
9475
+ parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
9476
+ }
9477
+
9478
+ // Subtract parent offsets and element margins
9479
+ // note: when an element has margin: auto the offsetLeft and marginLeft
9480
+ // are the same in Safari causing offset.left to incorrectly be 0
9481
+ return {
9482
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
9483
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
9484
+ };
9485
+ },
9486
+
9487
+ offsetParent: function() {
9488
+ return this.map(function() {
9489
+ var offsetParent = this.offsetParent || document.documentElement;
9490
+ while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
9491
+ offsetParent = offsetParent.offsetParent;
9492
+ }
9493
+ return offsetParent || document.documentElement;
9494
+ });
9495
+ }
9496
+ });
9497
+
9498
+
9499
+ // Create scrollLeft and scrollTop methods
9500
+ jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
9501
+ var top = /Y/.test( prop );
9502
+
9503
+ jQuery.fn[ method ] = function( val ) {
9504
+ return jQuery.access( this, function( elem, method, val ) {
9505
+ var win = getWindow( elem );
9506
+
9507
+ if ( val === undefined ) {
9508
+ return win ? (prop in win) ? win[ prop ] :
9509
+ win.document.documentElement[ method ] :
9510
+ elem[ method ];
9511
+ }
9512
+
9513
+ if ( win ) {
9514
+ win.scrollTo(
9515
+ !top ? val : jQuery( win ).scrollLeft(),
9516
+ top ? val : jQuery( win ).scrollTop()
9517
+ );
9518
+
9519
+ } else {
9520
+ elem[ method ] = val;
9521
+ }
9522
+ }, method, val, arguments.length, null );
9523
+ };
9524
+ });
9525
+
9526
+ function getWindow( elem ) {
9527
+ return jQuery.isWindow( elem ) ?
9528
+ elem :
9529
+ elem.nodeType === 9 ?
9530
+ elem.defaultView || elem.parentWindow :
9531
+ false;
9532
+ }
9533
+ // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
9534
+ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
9535
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
9536
+ // margin is only for outerHeight, outerWidth
9537
+ jQuery.fn[ funcName ] = function( margin, value ) {
9538
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
9539
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
9540
+
9541
+ return jQuery.access( this, function( elem, type, value ) {
9542
+ var doc;
9543
+
9544
+ if ( jQuery.isWindow( elem ) ) {
9545
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
9546
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
9547
+ // https://github.com/jquery/jquery/pull/764
9548
+ return elem.document.documentElement[ "client" + name ];
9549
+ }
9550
+
9551
+ // Get document width or height
9552
+ if ( elem.nodeType === 9 ) {
9553
+ doc = elem.documentElement;
9554
+
9555
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
9556
+ // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
9557
+ return Math.max(
9558
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
9559
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
9560
+ doc[ "client" + name ]
9561
+ );
9562
+ }
9563
+
9564
+ return value === undefined ?
9565
+ // Get width or height on the element, requesting but not forcing parseFloat
9566
+ jQuery.css( elem, type, extra ) :
9567
+
9568
+ // Set width or height on the element
9569
+ jQuery.style( elem, type, value, extra );
9570
+ }, type, chainable ? margin : undefined, chainable, null );
9571
+ };
9572
+ });
9573
+ });
9574
+ // Limit scope pollution from any deprecated API
9575
+ // (function() {
9576
+
9577
+ // })();
9578
+ // Expose jQuery to the global object
9579
+ window.jQuery = window.$ = jQuery;
9580
+
9581
+ // Expose jQuery as an AMD module, but only for AMD loaders that
9582
+ // understand the issues with loading multiple versions of jQuery
9583
+ // in a page that all might call define(). The loader will indicate
9584
+ // they have special allowances for multiple jQuery versions by
9585
+ // specifying define.amd.jQuery = true. Register as a named module,
9586
+ // since jQuery can be concatenated with other files that may use define,
9587
+ // but not use a proper concatenation script that understands anonymous
9588
+ // AMD modules. A named AMD is safest and most robust way to register.
9589
+ // Lowercase jquery is used because AMD module names are derived from
9590
+ // file names, and jQuery is normally delivered in a lowercase file name.
9591
+ // Do this after creating the global so that if an AMD module wants to call
9592
+ // noConflict to hide this version of jQuery, it will work.
9593
+ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
9594
+ define( "jquery", [], function () { return jQuery; } );
9595
+ }
9596
+
9597
+ })( window );
js/jquery.rating.min.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if(window.jQuery){(function($){if((!$.support.opacity&&!$.support.style)){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}$.fn.rating=function(options){if(this.length==0){return this;}if(typeof arguments[0]=="string"){if(this.length>1){var args=arguments;return this.each(function(){$.fn.rating.apply($(this),args);});}$.fn.rating[arguments[0]].apply(this,$.makeArray(arguments).slice(1)||[]);return this;}var options=$.extend({},$.fn.rating.options,options||{});$.fn.rating.calls++;this.not(".star-rating-applied").addClass("star-rating-applied").each(function(){var control,input=$(this);var eid=(this.name||"unnamed-rating").replace(/\[|\]/g,"_").replace(/^\_+|\_+$/g,"");var context=$(this.form||document.body);var raters=context.data("rating");if(!raters||raters.call!=$.fn.rating.calls){raters={count:0,call:$.fn.rating.calls};}var rater=raters[eid]||context.data("rating"+eid);if(rater){control=rater.data("rating");}if(rater&&control){control.count++;}else{control=$.extend({},options||{},($.metadata?input.metadata():($.meta?input.data():null))||{},{count:0,stars:[],inputs:[]});control.serial=raters.count++;rater=$('<span class="star-rating-control"/>');input.before(rater);rater.addClass("rating-to-be-drawn");if(input.attr("disabled")||input.hasClass("disabled")){control.readOnly=true;}if(input.hasClass("required")){control.required=true;}rater.append(control.cancel=$('<div class="rating-cancel"><a title="'+control.cancel+'">'+control.cancelValue+"</a></div>").on("mouseover",function(){$(this).rating("drain");$(this).addClass("star-rating-hover");}).on("mouseout",function(){$(this).rating("draw");$(this).removeClass("star-rating-hover");}).on("click",function(){$(this).rating("select");}).data("rating",control));}var star=$('<div role="text" aria-label="'+this.title+'" class="star-rating rater-'+control.serial+'"><a title="'+(this.title||this.value)+'">'+this.value+"</a></div>");rater.append(star);if(this.id){star.attr("id",this.id);}if(this.className){star.addClass(this.className);}if(control.half){control.split=2;}if(typeof control.split=="number"&&control.split>0){var stw=($.fn.width?star.width():0)||control.starWidth;var spi=(control.count%control.split),spw=Math.floor(stw/control.split);star.width(spw).find("a").css({"margin-left":"-"+(spi*spw)+"px"});}if(control.readOnly){star.addClass("star-rating-readonly");}else{star.addClass("star-rating-live").on("mouseover",function(){$(this).rating("fill");$(this).rating("focus");}).on("mouseout",function(){$(this).rating("draw");$(this).rating("blur");}).on("click",function(){$(this).rating("select");});}if(this.checked){control.current=star;}if(this.nodeName=="A"){if($(this).hasClass("selected")){control.current=star;}}input.hide();input.on("change.rating",function(event){if(event.selfTriggered){return false;}$(this).rating("select");});star.data("rating.input",input.data("rating.star",star));control.stars[control.stars.length]=star[0];control.inputs[control.inputs.length]=input[0];control.rater=raters[eid]=rater;control.context=context;input.data("rating",control);rater.data("rating",control);star.data("rating",control);context.data("rating",raters);context.data("rating"+eid,rater);});$(".rating-to-be-drawn").rating("draw").removeClass("rating-to-be-drawn");return this;};$.extend($.fn.rating,{calls:0,focus:function(){var control=this.data("rating");if(!control){return this;}if(!control.focus){return this;}var input=$(this).data("rating.input")||$(this.tagName=="INPUT"?this:null);if(control.focus){control.focus.apply(input[0],[input.val(),$("a",input.data("rating.star"))[0]]);}},blur:function(){var control=this.data("rating");if(!control){return this;}if(!control.blur){return this;}var input=$(this).data("rating.input")||$(this.tagName=="INPUT"?this:null);if(control.blur){control.blur.apply(input[0],[input.val(),$("a",input.data("rating.star"))[0]]);}},fill:function(){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}this.rating("drain");this.prevAll().addBack().filter(".rater-"+control.serial).addClass("star-rating-hover");},drain:function(){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}control.rater.children().filter(".rater-"+control.serial).removeClass("star-rating-on").removeClass("star-rating-hover");},draw:function(){var control=this.data("rating");if(!control){return this;}this.rating("drain");var current=$(control.current);var starson=current.length?current.prevAll().addBack().filter(".rater-"+control.serial):null;if(starson){starson.addClass("star-rating-on");}control.cancel[control.readOnly||control.required?"hide":"show"]();this.siblings()[control.readOnly?"addClass":"removeClass"]("star-rating-readonly");},select:function(value,wantCallBack){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}control.current=null;if(typeof value!="undefined"||this.length>1){if(typeof value=="number"){return $(control.stars[value]).rating("select",undefined,wantCallBack);}if(typeof value=="string"){$.each(control.stars,function(){if($(this).data("rating.input").val()==value){$(this).rating("select",undefined,wantCallBack);}});return this;}}else{control.current=this[0].tagName=="INPUT"?this.data("rating.star"):(this.is(".rater-"+control.serial)?this:null);}this.data("rating",control);this.rating("draw");var current=$(control.current?control.current.data("rating.input"):null);var lastipt=$(control.inputs).filter(":checked");var deadipt=$(control.inputs).not(current);deadipt.prop("checked",false);current.prop("checked",true);$(current.length?current:lastipt).trigger({type:"change",selfTriggered:true});if((wantCallBack||wantCallBack==undefined)&&control.callback){control.callback.apply(current[0],[current.val(),$("a",control.current)[0]]);}return this;},readOnly:function(toggle,disable){var control=this.data("rating");if(!control){return this;}control.readOnly=toggle||toggle==undefined?true:false;if(disable){$(control.inputs).attr("disabled","disabled");}else{$(control.inputs).removeAttr("disabled");}this.data("rating",control);this.rating("draw");},disable:function(){this.rating("readOnly",true,true);},enable:function(){this.rating("readOnly",false,false);}});$.fn.rating.options={cancel:"Cancel Rating",cancelValue:"",split:0,starWidth:16};$(function(){$("input[type=radio].star").rating();});})(jQuery);}(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata";}var data=$.data(elem,settings.single);if(data){return data;}data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1];}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return;}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML);}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr;}}}}if(data.indexOf("{")<0){data="{"+data+"}";}data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);
2
+ /*!
3
+ * jQuery Form Plugin
4
+ * version: 3.27.0-2013.02.06
5
+ * @requires jQuery v1.5 or later
6
+ *
7
+ * Examples and documentation at: http://malsup.com/jquery/form/
8
+ * Project repository: https://github.com/malsup/form
9
+ * Dual licensed under the MIT and GPL licenses:
10
+ * http://malsup.github.com/mit-license.txt
11
+ * http://malsup.github.com/gpl-license-v2.txt
12
+ */
13
+ (function($){var feature={};feature.fileapi=$("<input type='file'/>").get(0).files!==undefined;feature.formdata=window.FormData!==undefined;$.fn.ajaxSubmit=function(options){if(!this.length){log("ajaxSubmit: skipping submit process - no element selected");return this;}var method,action,url,$form=this;if(typeof options=="function"){options={success:options};}method=this.attr("method");action=this.attr("action");url=(typeof action==="string")?$.trim(action):"";url=url||window.location.href||"";if(url){url=(url.match(/^([^#]+)/)||[])[1];}options=$.extend(true,{url:url,success:$.ajaxSettings.success,type:method||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},options);var veto={};this.trigger("form-pre-serialize",[this,options,veto]);if(veto.veto){log("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this;}if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log("ajaxSubmit: submit aborted via beforeSerialize callback");return this;}var traditional=options.traditional;if(traditional===undefined){traditional=$.ajaxSettings.traditional;}var elements=[];var qx,a=this.formToArray(options.semantic,elements);if(options.data){options.extraData=options.data;qx=$.param(options.data,traditional);}if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log("ajaxSubmit: submit aborted via beforeSubmit callback");return this;}this.trigger("form-submit-validate",[a,this,options,veto]);if(veto.veto){log("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this;}var q=$.param(a,traditional);if(qx){q=(q?(q+"&"+qx):qx);}if(options.type.toUpperCase()=="GET"){options.url+=(options.url.indexOf("?")>=0?"&":"?")+q;options.data=null;}else{options.data=q;}var callbacks=[];if(options.resetForm){callbacks.push(function(){$form.resetForm();});}if(options.clearForm){callbacks.push(function(){$form.clearForm(options.includeHidden);});}if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?"replaceWith":"html";$(options.target)[fn](data).each(oldSuccess,arguments);});}else{if(options.success){callbacks.push(options.success);}}options.success=function(data,status,xhr){var context=options.context||this;for(var i=0,max=callbacks.length;i<max;i++){callbacks[i].apply(context,[data,status,xhr||$form,$form]);}};var fileInputs=$('input[type=file]:enabled[value!=""]',this);var hasFileInputs=fileInputs.length>0;var mp="multipart/form-data";var multipart=($form.attr("enctype")==mp||$form.attr("encoding")==mp);var fileAPI=feature.fileapi&&feature.formdata;log("fileAPI :"+fileAPI);var shouldUseFrame=(hasFileInputs||multipart)&&!fileAPI;var jqxhr;if(options.iframe!==false&&(options.iframe||shouldUseFrame)){if(options.closeKeepAlive){$.get(options.closeKeepAlive,function(){jqxhr=fileUploadIframe(a);});}else{jqxhr=fileUploadIframe(a);}}else{if((hasFileInputs||multipart)&&fileAPI){jqxhr=fileUploadXhr(a);}else{jqxhr=$.ajax(options);}}$form.removeData("jqxhr").data("jqxhr",jqxhr);for(var k=0;k<elements.length;k++){elements[k]=null;}this.trigger("form-submit-notify",[this,options]);return this;function deepSerialize(extraData){var serialized=$.param(extraData).split("&");var len=serialized.length;var result=[];var i,part;for(i=0;i<len;i++){serialized[i]=serialized[i].replace(/\+/g," ");part=serialized[i].split("=");result.push([decodeURIComponent(part[0]),decodeURIComponent(part[1])]);}return result;}function fileUploadXhr(a){var formdata=new FormData();for(var i=0;i<a.length;i++){formdata.append(a[i].name,a[i].value);}if(options.extraData){var serializedData=deepSerialize(options.extraData);for(i=0;i<serializedData.length;i++){if(serializedData[i]){formdata.append(serializedData[i][0],serializedData[i][1]);}}}options.data=null;var s=$.extend(true,{},$.ajaxSettings,options,{contentType:false,processData:false,cache:false,type:method||"POST"});if(options.uploadProgress){s.xhr=function(){var xhr=jQuery.ajaxSettings.xhr();if(xhr.upload){xhr.upload.addEventListener("progress",function(event){var percent=0;var position=event.loaded||event.position;var total=event.total;if(event.lengthComputable){percent=Math.ceil(position/total*100);}options.uploadProgress(event,position,total,percent);},false);}return xhr;};}s.data=null;var beforeSend=s.beforeSend;s.beforeSend=function(xhr,o){o.data=formdata;if(beforeSend){beforeSend.call(this,xhr,o);}};return $.ajax(s);}function fileUploadIframe(a){var form=$form[0],el,i,s,g,id,$io,io,xhr,sub,n,timedOut,timeoutHandle;var useProp=!!$.fn.prop;var deferred=$.Deferred();if(a){for(i=0;i<elements.length;i++){el=$(elements[i]);if(useProp){el.prop("disabled",false);}else{el.removeAttr("disabled");}}}s=$.extend(true,{},$.ajaxSettings,options);s.context=s.context||s;id="jqFormIO"+(new Date().getTime());if(s.iframeTarget){$io=$(s.iframeTarget);n=$io.attr("name");if(!n){$io.attr("name",id);}else{id=n;}}else{$io=$('<iframe name="'+id+'" src="'+s.iframeSrc+'" />');$io.css({position:"absolute",top:"-1000px",left:"-1000px"});}io=$io[0];xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e=(status==="timeout"?"timeout":"aborted");log("aborting upload... "+e);this.aborted=1;try{if(io.contentWindow.document.execCommand){io.contentWindow.document.execCommand("Stop");}}catch(ignore){}$io.attr("src",s.iframeSrc);xhr.error=e;if(s.error){s.error.call(s.context,xhr,e,status);}if(g){$.event.trigger("ajaxError",[xhr,s,e]);}if(s.complete){s.complete.call(s.context,xhr,e);}}};g=s.global;if(g&&0===$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,s]);}if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===false){if(s.global){$.active--;}deferred.reject();return deferred;}if(xhr.aborted){deferred.reject();return deferred;}sub=form.clk;if(sub){n=sub.name;if(n&&!sub.disabled){s.extraData=s.extraData||{};s.extraData[n]=sub.value;if(sub.type=="image"){s.extraData[n+".x"]=form.clk_x;s.extraData[n+".y"]=form.clk_y;}}}var CLIENT_TIMEOUT_ABORT=1;var SERVER_ABORT=2;function getDoc(frame){var doc=frame.contentWindow?frame.contentWindow.document:frame.contentDocument?frame.contentDocument:frame.document;return doc;}var csrf_token=$("meta[name=csrf-token]").attr("content");var csrf_param=$("meta[name=csrf-param]").attr("content");if(csrf_param&&csrf_token){s.extraData=s.extraData||{};s.extraData[csrf_param]=csrf_token;}function doSubmit(){var t=$form.attr("target"),a=$form.attr("action");form.setAttribute("target",id);if(!method){form.setAttribute("method","POST");}if(a!=s.url){form.setAttribute("action",s.url);}if(!s.skipEncodingOverride&&(!method||/post/i.test(method))){$form.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});}if(s.timeout){timeoutHandle=setTimeout(function(){timedOut=true;cb(CLIENT_TIMEOUT_ABORT);},s.timeout);}function checkState(){try{var state=getDoc(io).readyState;log("state = "+state);if(state&&state.toLowerCase()=="uninitialized"){setTimeout(checkState,50);}}catch(e){log("Server abort: ",e," (",e.name,")");cb(SERVER_ABORT);if(timeoutHandle){clearTimeout(timeoutHandle);}timeoutHandle=undefined;}}var extraInputs=[];try{if(s.extraData){for(var n in s.extraData){if(s.extraData.hasOwnProperty(n)){if($.isPlainObject(s.extraData[n])&&s.extraData[n].hasOwnProperty("name")&&s.extraData[n].hasOwnProperty("value")){extraInputs.push($('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value).appendTo(form)[0]);}else{extraInputs.push($('<input type="hidden" name="'+n+'">').val(s.extraData[n]).appendTo(form)[0]);}}}}if(!s.iframeTarget){$io.appendTo("body");if(io.attachEvent){io.attachEvent("onload",cb);}else{io.addEventListener("load",cb,false);}}setTimeout(checkState,15);var submitFn=document.createElement("form").submit;submitFn.apply(form);}finally{form.setAttribute("action",a);if(t){form.setAttribute("target",t);}else{$form.removeAttr("target");}$(extraInputs).remove();}}if(s.forceSync){doSubmit();}else{setTimeout(doSubmit,10);}var data,doc,domCheckCount=50,callbackProcessed;function cb(e){if(xhr.aborted||callbackProcessed){return;}try{doc=getDoc(io);}catch(ex){log("cannot access response document: ",ex);e=SERVER_ABORT;}if(e===CLIENT_TIMEOUT_ABORT&&xhr){xhr.abort("timeout");deferred.reject(xhr,"timeout");return;}else{if(e==SERVER_ABORT&&xhr){xhr.abort("server abort");deferred.reject(xhr,"error","server abort");return;}}if(!doc||doc.location.href==s.iframeSrc){if(!timedOut){return;}}if(io.detachEvent){io.detachEvent("onload",cb);}else{io.removeEventListener("load",cb,false);}var status="success",errMsg;try{if(timedOut){throw"timeout";}var isXml=s.dataType=="xml"||doc.XMLDocument||$.isXMLDoc(doc);log("isXml="+isXml);if(!isXml&&window.opera&&(doc.body===null||!doc.body.innerHTML)){if(--domCheckCount){log("requeing onLoad callback, DOM not available");setTimeout(cb,250);return;}}var docRoot=doc.body?doc.body:doc.documentElement;xhr.responseText=docRoot?docRoot.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(isXml){s.dataType="xml";}xhr.getResponseHeader=function(header){var headers={"content-type":s.dataType};return headers[header];};if(docRoot){xhr.status=Number(docRoot.getAttribute("status"))||xhr.status;xhr.statusText=docRoot.getAttribute("statusText")||xhr.statusText;}var dt=(s.dataType||"").toLowerCase();var scr=/(json|script|text)/.test(dt);if(scr||s.textarea){var ta=doc.getElementsByTagName("textarea")[0];if(ta){xhr.responseText=ta.value;xhr.status=Number(ta.getAttribute("status"))||xhr.status;xhr.statusText=ta.getAttribute("statusText")||xhr.statusText;}else{if(scr){var pre=doc.getElementsByTagName("pre")[0];var b=doc.getElementsByTagName("body")[0];if(pre){xhr.responseText=pre.textContent?pre.textContent:pre.innerText;}else{if(b){xhr.responseText=b.textContent?b.textContent:b.innerText;}}}}}else{if(dt=="xml"&&!xhr.responseXML&&xhr.responseText){xhr.responseXML=toXml(xhr.responseText);}}try{data=httpData(xhr,dt,s);}catch(e){status="parsererror";xhr.error=errMsg=(e||status);}}catch(e){log("error caught: ",e);status="error";xhr.error=errMsg=(e||status);}if(xhr.aborted){log("upload aborted");status=null;}if(xhr.status){status=(xhr.status>=200&&xhr.status<300||xhr.status===304)?"success":"error";}if(status==="success"){if(s.success){s.success.call(s.context,data,"success",xhr);}deferred.resolve(xhr.responseText,"success",xhr);if(g){$.event.trigger("ajaxSuccess",[xhr,s]);}}else{if(status){if(errMsg===undefined){errMsg=xhr.statusText;}if(s.error){s.error.call(s.context,xhr,status,errMsg);}deferred.reject(xhr,"error",errMsg);if(g){$.event.trigger("ajaxError",[xhr,s,errMsg]);}}}if(g){$.event.trigger("ajaxComplete",[xhr,s]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(s.complete){s.complete.call(s.context,xhr,status);}callbackProcessed=true;if(s.timeout){clearTimeout(timeoutHandle);}setTimeout(function(){if(!s.iframeTarget){$io.remove();}xhr.responseXML=null;},100);}var toXml=$.parseXML||function(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return(doc&&doc.documentElement&&doc.documentElement.nodeName!="parsererror")?doc:null;};var parseJSON=$.parseJSON||function(s){return window["eval"]("("+s+")");};var httpData=function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){if($.error){$.error("parsererror");}}if(s&&s.dataFilter){data=s.dataFilter(data,type);}if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){data=parseJSON(data);}else{if(type==="script"||!type&&ct.indexOf("javascript")>=0){$.globalEval(data);}}}return data;};return deferred;}};$.fn.ajaxForm=function(options){options=options||{};options.delegation=options.delegation&&$.isFunction($.fn.on);if(!options.delegation&&this.length===0){var o={s:this.selector,c:this.context};if(!$.isReady&&o.s){log("DOM not ready, queuing ajaxForm");$(function(){$(o.s,o.c).ajaxForm(options);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}if(options.delegation){$(document).off("submit.form-plugin",this.selector,doAjaxSubmit).off("click.form-plugin",this.selector,captureSubmittingElement).on("submit.form-plugin",this.selector,options,doAjaxSubmit).on("click.form-plugin",this.selector,options,captureSubmittingElement);return this;}return this.ajaxFormUnbind().bind("submit.form-plugin",options,doAjaxSubmit).bind("click.form-plugin",options,captureSubmittingElement);};function doAjaxSubmit(e){var options=e.data;if(!e.isDefaultPrevented()){e.preventDefault();$(this).ajaxSubmit(options);}}function captureSubmittingElement(e){var target=e.target;var $el=$(target);if(!($el.is("[type=submit],[type=image]"))){var t=$el.closest("[type=submit]");if(t.length===0){return;}target=t[0];}var form=this;form.clk=target;if(target.type=="image"){if(e.offsetX!==undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}}}setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);}$.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin");};$.fn.formToArray=function(semantic,elements){var a=[];if(this.length===0){return a;}var form=this[0];var els=semantic?form.getElementsByTagName("*"):form.elements;if(!els){return a;}var i,j,n,v,el,max,jmax;for(i=0,max=els.length;i<max;i++){el=els[i];n=el.name;if(!n){continue;}if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n,value:$(el).val(),type:el.type});a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y});}continue;}v=$.fieldValue(el,true);if(v&&v.constructor==Array){if(elements){elements.push(el);}for(j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}else{if(feature.fileapi&&el.type=="file"&&!el.disabled){if(elements){elements.push(el);}var files=el.files;if(files.length){for(j=0;j<files.length;j++){a.push({name:n,value:files[j],type:el.type});}}else{a.push({name:n,value:"",type:el.type});}}else{if(v!==null&&typeof v!="undefined"){if(elements){elements.push(el);}a.push({name:n,value:v,type:el.type,required:el.required});}}}}if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0];n=input.name;if(n&&!input.disabled&&input.type=="image"){a.push({name:n,value:$input.val()});a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y});}}return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n){return;}var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v});}}});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue;}if(v.constructor==Array){$.merge(val,v);}else{val.push(v);}}return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(successful===undefined){successful=true;}if(successful&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null;}if(tag=="select"){var index=el.selectedIndex;if(index<0){return null;}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v){v=(op.attributes&&op.attributes.value&&!(op.attributes.value.specified))?op.text:op.value;}if(one){return v;}a.push(v);}}return a;}return $(el).val();};$.fn.clearForm=function(includeHidden){return this.each(function(){$("input,select,textarea",this).clearFields(includeHidden);});};$.fn.clearFields=$.fn.clearInputs=function(includeHidden){var re=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(re.test(t)||tag=="textarea"){this.value="";}else{if(t=="checkbox"||t=="radio"){this.checked=false;}else{if(tag=="select"){this.selectedIndex=-1;}else{if(t=="file"){if(/MSIE/.test(navigator.userAgent)){$(this).replaceWith($(this).clone());}else{$(this).val("");}}else{if(includeHidden){if((includeHidden===true&&/hidden/.test(t))||(typeof includeHidden=="string"&&$(this).is(includeHidden))){this.value="";}}}}}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};$.fn.enable=function(b){if(b===undefined){b=true;}return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select===undefined){select=true;}return this.each(function(){var t=this.type;if(t=="checkbox"||t=="radio"){this.checked=select;}else{if(this.tagName.toLowerCase()=="option"){var $sel=$(this).parent("select");if(select&&$sel[0]&&$sel[0].type=="select-one"){$sel.find("option").selected(false);}this.selected=select;}}});};$.fn.ajaxSubmit.debug=false;function log(){if(!$.fn.ajaxSubmit.debug){return;}var msg="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(msg);}else{if(window.opera&&window.opera.postError){window.opera.postError(msg);}}}})(jQuery);eval(function(p,a,c,k,e,r){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36));};if(!"".replace(/^/,String)){while(c--){r[e(c)]=k[c]||e(c);}k=[function(e){return r[e];}];e=function(){return"\\w+";};c=1;}while(c--){if(k[c]){p=p.replace(new RegExp("\\b"+e(c)+"\\b","g"),k[c]);}}return p;}(";5(1W.1C)(8($){5((!$.1s.1V&&!$.1s.1U))2d{1j.1X(\"1T\",C,s)}1R(e){};$.o.4=8(j){5(3.u==0)9 3;5(M V[0]=='1m'){5(3.u>1){7 k=V;9 3.18(8(){$.o.4.K($(3),k)})};$.o.4[V[0]].K(3,$.27(V).26(1)||[]);9 3};7 j=$.1b({},$.o.4.1w,j||{});$.o.4.P++;3.1y('.l-4-1g').p('l-4-1g').18(8(){7 b,m=$(3);7 c=(3.2g||'28-4').1f(/\\[|\\]/g,'Y').1f(/^\\Y+|\\Y+$/g,'');7 d=$(3.2h||1j.1H);7 e=d.6('4');5(!e||e.1o!=$.o.4.P)e={E:0,1o:$.o.4.P};7 f=e[c]||d.6('4'+c);5(f)b=f.6('4');5(f&&b)b.E++;R{b=$.1b({},j||{},($.1d?m.1d():($.25?m.6():w))||{},{E:0,L:[],v:[]});b.z=e.E++;f=$('<1G 13=\"l-4-1I\"/>');m.1J(f);f.p('4-12-11-10');5(m.Z('G')||m.14('G'))b.n=s;5(m.14('1c'))b.1c=s;f.1r(b.D=$('<W 13=\"4-D\"><a U=\"'+b.D+'\">'+b.1B+'</a></W>').q('1e',8(){$(3).4('N');$(3).p('l-4-T')}).q('1h',8(){$(3).4('x');$(3).I('l-4-T')}).q('1i',8(){$(3).4('y')}).6('4',b))};7 g=$('<W 20=\"21\" 22-24=\"'+3.U+'\" 13=\"l-4 t-'+b.z+'\"><a U=\"'+(3.U||3.1k)+'\">'+3.1k+'</a></W>');f.1r(g);5(3.X)g.Z('X',3.X);5(3.1x)g.p(3.1x);5(b.29)b.B=2;5(M b.B=='1l'&&b.B>0){7 h=($.o.15?g.15():0)||b.1n;7 i=(b.E%b.B),17=1K.1L(h/b.B);g.15(17).1M('a').1N({'1O-1P':'-'+(i*17)+'1Q'})};5(b.n)g.p('l-4-1p');R g.p('l-4-1S').q('1e',8(){$(3).4('1q');$(3).4('J')}).q('1h',8(){$(3).4('x');$(3).4('H')}).q('1i',8(){$(3).4('y')});5(3.S)b.r=g;5(3.1Y==\"A\"){5($(3).14('1Z'))b.r=g};m.1t();m.q('1u.4',8(a){5(a.1v)9 C;$(3).4('y')});g.6('4.m',m.6('4.l',g));b.L[b.L.u]=g[0];b.v[b.v.u]=m[0];b.t=e[c]=f;b.23=d;m.6('4',b);f.6('4',b);g.6('4',b);d.6('4',e);d.6('4'+c,f)});$('.4-12-11-10').4('x').I('4-12-11-10');9 3};$.1b($.o.4,{P:0,J:8(){7 a=3.6('4');5(!a)9 3;5(!a.J)9 3;7 b=$(3).6('4.m')||$(3.19=='1a'?3:w);5(a.J)a.J.K(b[0],[b.Q(),$('a',b.6('4.l'))[0]])},H:8(){7 a=3.6('4');5(!a)9 3;5(!a.H)9 3;7 b=$(3).6('4.m')||$(3.19=='1a'?3:w);5(a.H)a.H.K(b[0],[b.Q(),$('a',b.6('4.l'))[0]])},1q:8(){7 a=3.6('4');5(!a)9 3;5(a.n)9;3.4('N');3.1z().1A().O('.t-'+a.z).p('l-4-T')},N:8(){7 a=3.6('4');5(!a)9 3;5(a.n)9;a.t.2a().O('.t-'+a.z).I('l-4-q').I('l-4-T')},x:8(){7 a=3.6('4');5(!a)9 3;3.4('N');7 b=$(a.r);7 c=b.u?b.1z().1A().O('.t-'+a.z):w;5(c)c.p('l-4-q');a.D[a.n||a.1c?'1t':'2b']();3.2c()[a.n?'p':'I']('l-4-1p')},y:8(a,b){7 c=3.6('4');5(!c)9 3;5(c.n)9;c.r=w;5(M a!='F'||3.u>1){5(M a=='1l')9 $(c.L[a]).4('y',F,b);5(M a=='1m'){$.18(c.L,8(){5($(3).6('4.m').Q()==a)$(3).4('y',F,b)});9 3}}R{c.r=3[0].19=='1a'?3.6('4.l'):(3.2e('.t-'+c.z)?3:w)};3.6('4',c);3.4('x');7 d=$(c.r?c.r.6('4.m'):w);7 e=$(c.v).O(':S');7 f=$(c.v).1y(d);f.1D('S',C);d.1D('S',s);$(d.u?d:e).2f({1E:'1u',1v:s});5((b||b==F)&&c.1F)c.1F.K(d[0],[d.Q(),$('a',c.r)[0]]);9 3},n:8(a,b){7 c=3.6('4');5(!c)9 3;c.n=a||a==F?s:C;5(b)$(c.v).Z(\"G\",\"G\");R $(c.v).2i(\"G\");3.6('4',c);3.4('x')},2j:8(){3.4('n',s,s)},2k:8(){3.4('n',C,C)}});$.o.4.1w={D:'2l 2m',1B:'',B:0,1n:16};$(8(){$('m[1E=2n].l').4()})})(1C);",62,148,"|||this|rating|if|data|var|function|return||||||||||||star|input|readOnly|fn|addClass|on|current|true|rater|length|inputs|null|draw|select|serial||split|false|cancel|count|undefined|disabled|blur|removeClass|focus|apply|stars|typeof|drain|filter|calls|val|else|checked|hover|title|arguments|div|id|_|attr|drawn|be|to|class|hasClass|width||spw|each|tagName|INPUT|extend|required|metadata|mouseover|replace|applied|mouseout|click|document|value|number|string|starWidth|call|readonly|fill|append|support|hide|change|selfTriggered|options|className|not|prevAll|addBack|cancelValue|jQuery|prop|type|callback|span|body|control|before|Math|floor|find|css|margin|left|px|catch|live|BackgroundImageCache|style|opacity|window|execCommand|nodeName|selected|role|text|aria|context|label|meta|slice|makeArray|unnamed|half|children|show|siblings|try|is|trigger|name|form|removeAttr|disable|enable|Cancel|Rating|radio".split("|"),0,{}));
js/jquery.timePicker.min.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * A time picker for jQuery.
3
+ *
4
+ * Dual licensed under the MIT and GPL licenses.
5
+ * Copyright (c) 2009 Anders Fajerson
6
+ *
7
+ * @name timePicker
8
+ * @author Anders Fajerson (http://perifer.se)
9
+ * @see http://github.com/perifer/timePicker
10
+ * @example $("#mytime").timePicker();
11
+ * @example $("#mytime").timePicker({step:30, startTime:"15:00", endTime:"18:00"});
12
+ */
13
+ (function(a){function g(a){a.setFullYear(2001),a.setMonth(0),a.setDate(0);return a}function f(a,b){if(a){var c=a.split(b.separator),d=parseFloat(c[0]),e=parseFloat(c[1]);b.show24Hours||(d===12&&a.indexOf("AM")!==-1?d=0:d!==12&&a.indexOf("PM")!==-1&&(d+=12));var f=new Date(0,0,0,d,e,0);return g(f)}return null}function e(a,b){return typeof a=="object"?g(a):f(a,b)}function d(a){return(a<10?"0":"")+a}function c(a,b){var c=a.getHours(),e=b.show24Hours?c:(c+11)%12+1,f=a.getMinutes();return d(e)+b.separator+d(f)+(b.show24Hours?"":c<12?" AM":" PM")}function b(b,c,d,e){b.value=a(c).text(),a(b).change(),a.browser.msie||b.focus(),d.hide()}a.fn.timePicker=function(b){var c=a.extend({},a.fn.timePicker.defaults,b);return this.each(function(){a.timePicker(this,c)})},a.timePicker=function(b,c){var d=a(b)[0];return d.timePicker||(d.timePicker=new jQuery._timePicker(d,c))},a.timePicker.version="0.3",a._timePicker=function(d,h){var i=!1,j=!1,k=e(h.startTime,h),l=e(h.endTime,h),m="selected",n="li."+m;a(d).attr("autocomplete","OFF");var o=[],p=new Date(k);while(p<=l)o[o.length]=c(p,h),p=new Date(p.setMinutes(p.getMinutes()+h.step));var q=a('<div class="time-picker'+(h.show24Hours?"":" time-picker-12hours")+'"></div>'),r=a("<ul></ul>");for(var s=0;s<o.length;s++)r.append("<li>"+o[s]+"</li>");q.append(r),q.appendTo("body").hide(),q.mouseover(function(){i=!0}).mouseout(function(){i=!1}),a("li",r).mouseover(function(){j||(a(n,q).removeClass(m),a(this).addClass(m))}).mousedown(function(){i=!0}).click(function(){b(d,this,q,h),i=!1});var t=function(){if(q.is(":visible"))return!1;a("li",q).removeClass(m);var b=a(d).offset();q.css({top:b.top+d.offsetHeight,left:b.left}),q.show();var e=d.value?f(d.value,h):k,i=k.getHours()*60+k.getMinutes(),j=e.getHours()*60+e.getMinutes()-i,n=Math.round(j/h.step),o=g(new Date(0,0,0,0,n*h.step+i,0));o=k<o&&o<=l?o:k;var p=a("li:contains("+c(o,h)+")",q);p.length&&(p.addClass(m),q[0].scrollTop=p[0].offsetTop);return!0};a(d).focus(t).click(t),a(d).blur(function(){i||q.hide()});var u=a.browser.opera||a.browser.mozilla?"keypress":"keydown";a(d)[u](function(c){var e;j=!0;var f=q[0].scrollTop;switch(c.keyCode){case 38:if(t())return!1;e=a(n,r);var g=e.prev().addClass(m)[0];g?(e.removeClass(m),g.offsetTop<f&&(q[0].scrollTop=f-g.offsetHeight)):(e.removeClass(m),g=a("li:last",r).addClass(m)[0],q[0].scrollTop=g.offsetTop-g.offsetHeight);return!1;case 40:if(t())return!1;e=a(n,r);var i=e.next().addClass(m)[0];i?(e.removeClass(m),i.offsetTop+i.offsetHeight>f+q[0].offsetHeight&&(q[0].scrollTop=f+i.offsetHeight)):(e.removeClass(m),i=a("li:first",r).addClass(m)[0],q[0].scrollTop=0);return!1;case 13:if(q.is(":visible")){var k=a(n,r)[0];b(d,k,q,h)}return!1;case 27:q.hide();return!1}return!0}),a(d).keyup(function(a){j=!1}),this.getTime=function(){return f(d.value,h)},this.setTime=function(b){d.value=c(e(b,h),h),a(d).change()}},a.fn.timePicker.defaults={step:30,startTime:new Date(0,0,0,0,0,0),endTime:new Date(0,0,0,23,30,0),separator:":",show24Hours:!0}})(jQuery)
js/toggle.js ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function() {
2
+ var selected = jQuery("#_bsf_post_type").val();
3
+ if(selected == "0")
4
+ hidden();
5
+ else
6
+ expand_default(selected);
7
+ //Function to hide all the snippet blocks
8
+ function hidden() {
9
+ jQuery(".review").hide();
10
+ jQuery(".events").hide();
11
+ jQuery(".music").hide();
12
+ jQuery(".organization").hide();
13
+ jQuery(".people").hide();
14
+ jQuery(".product").hide();
15
+ jQuery(".recipes").hide();
16
+ jQuery(".software").hide();
17
+ jQuery(".video").hide();
18
+ }
19
+ //Function to expand the updated snippet block
20
+ function expand_default(selected) {
21
+ jQuery("#_bsf_post_type").attr("disabled",true);
22
+ hidden();
23
+ if(selected == '1')
24
+ {
25
+ jQuery(".review").show(500);
26
+ }
27
+ else if(selected == '2')
28
+ {
29
+ jQuery(".events").show(500);
30
+ }
31
+ else if(selected == '3')
32
+ {
33
+ jQuery(".music").show(500);
34
+ }
35
+ else if(selected == '4')
36
+ {
37
+ jQuery(".organization").show(500);
38
+ }
39
+ else if(selected == '5')
40
+ {
41
+ jQuery(".people").show(500);
42
+ }
43
+ else if(selected == '6')
44
+ {
45
+ jQuery(".product").show(500);
46
+ }
47
+ else if(selected == '7')
48
+ {
49
+ jQuery(".recipes").show(500);
50
+ }
51
+ else if(selected == '8')
52
+ {
53
+ jQuery(".software").show(500);
54
+ }
55
+ else if(selected == '9')
56
+ {
57
+ jQuery(".video").show(500);
58
+ }
59
+ }
60
+
61
+ jQuery("#_bsf_post_type").change(function() {
62
+ hidden();
63
+ var type=jQuery(this).val();
64
+ if(type == '1')
65
+ {
66
+ jQuery(".review").show(500);
67
+ }
68
+ else if(type == '2')
69
+ {
70
+ jQuery(".events").show(500);
71
+ }
72
+ else if(type == '3')
73
+ {
74
+ jQuery(".music").show(500);
75
+ }
76
+ else if(type == '4')
77
+ {
78
+ jQuery(".organization").show(500);
79
+ }
80
+ else if(type == '5')
81
+ {
82
+ jQuery(".people").show(500);
83
+ }
84
+ else if(type == '6')
85
+ {
86
+ jQuery(".product").show(500);
87
+ }
88
+ else if(type == '7')
89
+ {
90
+ jQuery(".recipes").show(500);
91
+ }
92
+ else if(type == '8')
93
+ {
94
+ jQuery(".software").show(500);
95
+ }
96
+ else if(type == '9')
97
+ {
98
+ jQuery(".video").show(500);
99
+ }
100
+ });
101
+ });
meta-boxes.php ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Metabox for review
3
+ function bsf_metaboxes( array $meta_boxes ) {
4
+
5
+ // Start with an underscore to hide fields from custom fields list
6
+ $prefix = '_bsf_';
7
+
8
+ $meta_boxes[] = array(
9
+ 'id' => 'review_metabox',
10
+ 'title' => __('Configure Rich Snippet','rich-snippets'),
11
+ 'pages' => array( 'post','page' ), // Post type
12
+ 'context' => 'normal',
13
+ 'priority' => 'high',
14
+ 'show_names' => true, // Show field names on the left
15
+ 'fields' => array(
16
+ array(
17
+ 'name' => __('','rich-snippets'),
18
+ 'desc' => __('','rich-snippets'),
19
+ 'id' => $prefix . 'post_type',
20
+ 'class' => 'snippet-type',
21
+ 'type' => 'select',
22
+ 'options' => array(
23
+ array( 'name' => __('Select what this post is about','rich-snippets'), 'value' => '0', ),
24
+ array( 'name' => __('Item Review','rich-snippets'), 'value' => '1', ),
25
+ array( 'name' => __('Event','rich-snippets'), 'value' => '2', ),
26
+ // array( 'name' => __('Music','rich-snippets'), 'value' => '3', ),
27
+ array( 'name' => __('Organization','rich-snippets'), 'value' => '4', ),
28
+ array( 'name' => __('People','rich-snippets'), 'value' => '5', ),
29
+ array( 'name' => __('Product','rich-snippets'), 'value' => '6', ),
30
+ array( 'name' => __('Recipe','rich-snippets'), 'value' => '7', ),
31
+ array( 'name' => __('Software Application','rich-snippets'), 'value' => '8', ),
32
+ array( 'name' => __('Video','rich-snippets'), 'value' => '9', ),
33
+ ),
34
+ ),
35
+ // Meta Settings for Item Review
36
+ array(
37
+ 'name' => __('Rich Snippets - Item Review','rich-snippets'),
38
+ 'desc' => __('Please provide the following information.','rich-snippets'),
39
+ 'id' => $prefix . 'review_title',
40
+ 'class' => 'review',
41
+ 'type' => 'title',
42
+ ),
43
+ array(
44
+ 'name' => __('Reviewer&rsquo;s Name ','rich-snippets'),
45
+ 'desc' => __('Enter the name of Item Reviewer or The Post Author.','rich-snippets'),
46
+ 'id' => $prefix . 'item_reviewer',
47
+ 'class' => 'review',
48
+ 'type' => 'text_medium',
49
+ ),
50
+ array(
51
+ 'name' => __('Item to be reviewed','rich-snippets'),
52
+ 'desc' => __('Enter the name of the item, you are writing review about.','rich-snippets'),
53
+ 'id' => $prefix . 'item_name',
54
+ 'class' => 'review',
55
+ 'type' => 'text',
56
+ ),
57
+ array(
58
+ 'name' => __('Your Rating','rich-snippets'),
59
+ 'desc' => __('&nbsp;&nbsp;Rate this item (1-5)','rich-snippets'),
60
+ 'id' => $prefix . 'rating',
61
+ 'class' => 'star review',
62
+ 'type' => 'radio',
63
+ 'options' => array(
64
+ array( 'name' => __('','rich-snippets'), 'value' => '1', ),
65
+ array( 'name' => __('','rich-snippets'), 'value' => '2', ),
66
+ array( 'name' => __('','rich-snippets'), 'value' => '3', ),
67
+ array( 'name' => __('','rich-snippets'), 'value' => '4', ),
68
+ array( 'name' => __('','rich-snippets'), 'value' => '5', ),
69
+ ),
70
+ ),
71
+ array(
72
+ 'name' => __('Item Description','rich-snippets'),
73
+ 'desc' => __('Enter the item description here','rich-snippets'),
74
+ 'id' => $prefix . 'item_desc',
75
+ 'class' => 'review',
76
+ 'type' => 'textarea_small',
77
+ ),
78
+ // Meta Settings for Events
79
+ array(
80
+ 'name' => __('Rich Snippets - Events','rich-snippets'),
81
+ 'desc' => __('Please provide the following information.','rich-snippets'),
82
+ 'id' => $prefix . 'events',
83
+ 'class' => 'events',
84
+ 'type' => 'title',
85
+ ),
86
+ array(
87
+ 'name' => __('Event Title ','rich-snippets'),
88
+ 'desc' => __('What would be the name of the event?','rich-snippets'),
89
+ 'id' => $prefix . 'event_title',
90
+ 'class' => 'events',
91
+ 'type' => 'text',
92
+ ),
93
+ array(
94
+ 'name' => __('Location ','rich-snippets'),
95
+ 'desc' => __('Organization Name Here','rich-snippets'),
96
+ 'id' => $prefix . 'event_organization',
97
+ 'class' => 'events',
98
+ 'type' => 'text_medium',
99
+ ),
100
+ array(
101
+ 'name' => __('','rich-snippets'),
102
+ 'desc' => __('Street Address','rich-snippets'),
103
+ 'id' => $prefix . 'event_street',
104
+ 'class' => 'events',
105
+ 'type' => 'text_medium',
106
+ ),
107
+ array(
108
+ 'name' => __('','rich-snippets'),
109
+ 'desc' => __('Locality','rich-snippets'),
110
+ 'id' => $prefix . 'event_local',
111
+ 'class' => 'events',
112
+ 'type' => 'text_medium',
113
+ ),
114
+ array(
115
+ 'name' => __('','rich-snippets'),
116
+ 'desc' => __('Region','rich-snippets'),
117
+ 'id' => $prefix . 'event_region',
118
+ 'class' => 'events',
119
+ 'type' => 'text_medium',
120
+ ),
121
+ array(
122
+ 'name' => __('Description ','rich-snippets'),
123
+ 'desc' => __('Describe the event in short.','rich-snippets'),
124
+ 'id' => $prefix . 'event_desc',
125
+ 'class' => 'events',
126
+ 'type' => 'textarea_small',
127
+ ),
128
+ array(
129
+ 'name' => __('Start Date ','rich-snippets'),
130
+ 'desc' => __('Provide the Event Start Date.','rich-snippets'),
131
+ 'id' => $prefix . 'event_start_date',
132
+ 'class' => 'events',
133
+ 'type' => 'text_date',
134
+ ),
135
+ array(
136
+ 'name' => __('End Date ','rich-snippets'),
137
+ 'desc' => __('Provide the Event End Date.','rich-snippets'),
138
+ 'id' => $prefix . 'event_end_date',
139
+ 'class' => 'events',
140
+ 'type' => 'text_date',
141
+ ),
142
+ array(
143
+ 'name' => __('GEO Location ','rich-snippets'),
144
+ 'desc' => __('Enter Latitude. <a href="http://universimmedia.pagesperso-orange.fr/geo/loc.htm" target="_blank">Find Here.</a>','rich-snippets'),
145
+ 'id' => $prefix . 'event_geo_latitude',
146
+ 'class' => 'events',
147
+ 'type' => 'text_medium',
148
+ ),
149
+ array(
150
+ 'name' => __('','rich-snippets'),
151
+ 'desc' => __('Enter Longitude','rich-snippets'),
152
+ 'id' => $prefix . 'event_geo_longitude',
153
+ 'class' => 'events',
154
+ 'type' => 'text_medium',
155
+ ),
156
+ array(
157
+ 'name' => __('Event Photo ','rich-snippets'),
158
+ 'desc' => __('Upload or Select from media gallery','rich-snippets'),
159
+ 'id' => $prefix . 'event_photo',
160
+ 'class' => 'events',
161
+ 'type' => 'file',
162
+ ),
163
+ // Meta Settings for Music
164
+ array(
165
+ 'name' => __('Rich Snippets - Music','rich-snippets'),
166
+ 'desc' => __('Please provide the following information.','rich-snippets'),
167
+ 'id' => $prefix . 'music',
168
+ 'class' => 'music',
169
+ 'type' => 'title',
170
+ ),
171
+ // Meta Settings for Organization
172
+ array(
173
+ 'name' => __('Rich Snippets - Organization','rich-snippets'),
174
+ 'desc' => __('Please provide the following information.','rich-snippets'),
175
+ 'id' => $prefix . 'organization',
176
+ 'class' => 'organization',
177
+ 'type' => 'title',
178
+ ),
179
+ array(
180
+ 'name' => __('Organization Name ','rich-snippets'),
181
+ 'desc' => __('Enter the Company or Organization Name.','rich-snippets'),
182
+ 'id' => $prefix . 'organization_name',
183
+ 'class' => 'organization',
184
+ 'type' => 'text',
185
+ ),
186
+ array(
187
+ 'name' => __('Website URL ','rich-snippets'),
188
+ 'desc' => __('Enter the Organization homepage url.','rich-snippets'),
189
+ 'id' => $prefix . 'organization_url',
190
+ 'class' => 'organization',
191
+ 'type' => 'text_medium',
192
+ ),
193
+ array(
194
+ 'name' => __('Contact No. ','rich-snippets'),
195
+ 'desc' => __('Enter the Telephone No.','rich-snippets'),
196
+ 'id' => $prefix . 'organization_tel',
197
+ 'class' => 'organization',
198
+ 'type' => 'text_medium',
199
+ ),
200
+ array(
201
+ 'name' => __('Address ','rich-snippets'),
202
+ 'desc' => __('Street Name.','rich-snippets'),
203
+ 'id' => $prefix . 'organization_street',
204
+ 'class' => 'organization',
205
+ 'type' => 'text_medium',
206
+ ),
207
+ array(
208
+ 'name' => __('','rich-snippets'),
209
+ 'desc' => __('Locality.','rich-snippets'),
210
+ 'id' => $prefix . 'organization_local',
211
+ 'class' => 'organization',
212
+ 'type' => 'text_medium',
213
+ ),
214
+ array(
215
+ 'name' => __('','rich-snippets'),
216
+ 'desc' => __('Region.','rich-snippets'),
217
+ 'id' => $prefix . 'organization_region',
218
+ 'class' => 'organization',
219
+ 'type' => 'text_medium',
220
+ ),
221
+ array(
222
+ 'name' => __('','rich-snippets'),
223
+ 'desc' => __('Postal Code','rich-snippets'),
224
+ 'id' => $prefix . 'organization_zip',
225
+ 'class' => 'organization',
226
+ 'type' => 'text_medium',
227
+ ),
228
+ array(
229
+ 'name' => __('','rich-snippets'),
230
+ 'desc' => __('Country Name','rich-snippets'),
231
+ 'id' => $prefix . 'organization_country',
232
+ 'class' => 'organization',
233
+ 'type' => 'text_medium',
234
+ ),
235
+ array(
236
+ 'name' => __('GEO Location','rich-snippets'),
237
+ 'desc' => __('Latitude. <a href="http://universimmedia.pagesperso-orange.fr/geo/loc.htm" target="_blank">Find Here.</a>','rich-snippets'),
238
+ 'id' => $prefix . 'organization_latitide',
239
+ 'class' => 'organization',
240
+ 'type' => 'text_medium',
241
+ ),
242
+ array(
243
+ 'name' => __('','rich-snippets'),
244
+ 'desc' => __('Longitude.','rich-snippets'),
245
+ 'id' => $prefix . 'organization_longitude',
246
+ 'class' => 'organization',
247
+ 'type' => 'text_medium',
248
+ ),
249
+ // Meta Settings for People
250
+ array(
251
+ 'name' => __('Rich Snippets - People','rich-snippets'),
252
+ 'desc' => __('Please provide the following information.','rich-snippets'),
253
+ 'id' => $prefix . 'people',
254
+ 'class' => 'people',
255
+ 'type' => 'title',
256
+ ),
257
+ array(
258
+ 'name' => __('Person&lsquo;s Name','rich-snippets'),
259
+ 'desc' => __('Enter the relative person&lsquo;s name.','rich-snippets'),
260
+ 'id' => $prefix . 'people_fn',
261
+ 'class' => 'people',
262
+ 'type' => 'text_medium',
263
+ ),
264
+ array(
265
+ 'name' => __('Nickname','rich-snippets'),
266
+ 'desc' => __('Enter the nickname (if any).','rich-snippets'),
267
+ 'id' => $prefix . 'people_nickname',
268
+ 'class' => 'people',
269
+ 'type' => 'text_medium',
270
+ ),
271
+ array(
272
+ 'name' => __('Photograph','rich-snippets'),
273
+ 'desc' => __('Upload the photo or select from media library.','rich-snippets'),
274
+ 'id' => $prefix . 'people_photo',
275
+ 'class' => 'people',
276
+ 'type' => 'file',
277
+ ),
278
+ array(
279
+ 'name' => __('Job Title ','rich-snippets'),
280
+ 'desc' => __('Enter job title.','rich-snippets'),
281
+ 'id' => $prefix . 'people_job_title',
282
+ 'class' => 'people',
283
+ 'type' => 'text_medium',
284
+ ),
285
+ array(
286
+ 'name' => __('Homepage URL','rich-snippets'),
287
+ 'desc' => __('Enter homepage URL(if any).','rich-snippets'),
288
+ 'id' => $prefix . 'people_website',
289
+ 'class' => 'people',
290
+ 'type' => 'text_medium',
291
+ ),
292
+ array(
293
+ 'name' => __('Company / Organization','rich-snippets'),
294
+ 'desc' => __('Enter Company or Organization name in affiliation.','rich-snippets'),
295
+ 'id' => $prefix . 'people_company',
296
+ 'class' => 'people',
297
+ 'type' => 'text_medium',
298
+ ),
299
+ array(
300
+ 'name' => __('Address','rich-snippets'),
301
+ 'desc' => __('Enter Locality','rich-snippets'),
302
+ 'id' => $prefix . 'people_local',
303
+ 'class' => 'people',
304
+ 'type' => 'text_medium',
305
+ ),
306
+ array(
307
+ 'name' => __('','rich-snippets'),
308
+ 'desc' => __('Region','rich-snippets'),
309
+ 'id' => $prefix . 'people_region',
310
+ 'class' => 'people',
311
+ 'type' => 'text_medium',
312
+ ),
313
+ // Meta Settings for Products
314
+ array(
315
+ 'name' => __('Rich Snippets - Products','rich-snippets'),
316
+ 'desc' => __('Please provide the following information.','rich-snippets'),
317
+ 'id' => $prefix . 'product',
318
+ 'class' => 'product',
319
+ 'type' => 'title',
320
+ ),
321
+ array(
322
+ 'name' => __('Your Rating','rich-snippets'),
323
+ 'desc' => __('Rate this product or aggregate rating.','rich-snippets'),
324
+ 'id' => $prefix . 'product_rating',
325
+ 'class' => 'star product',
326
+ 'type' => 'radio',
327
+ 'options' => array(
328
+ array( 'name' => __('','rich-snippets'), 'value' => '1', ),
329
+ array( 'name' => __('','rich-snippets'), 'value' => '2', ),
330
+ array( 'name' => __('','rich-snippets'), 'value' => '3', ),
331
+ array( 'name' => __('','rich-snippets'), 'value' => '4', ),
332
+ array( 'name' => __('','rich-snippets'), 'value' => '5', ),
333
+ ),
334
+ ),
335
+ array(
336
+ 'name' => __('Brand Name','rich-snippets'),
337
+ 'desc' => __('Enter the products brand name','rich-snippets'),
338
+ 'id' => $prefix . 'product_brand',
339
+ 'class' => 'product',
340
+ 'type' => 'text_medium',
341
+ ),
342
+ array(
343
+ 'name' => __('Product Name','rich-snippets'),
344
+ 'desc' => __('Enter the product name.','rich-snippets'),
345
+ 'id' => $prefix . 'product_name',
346
+ 'class' => 'product',
347
+ 'type' => 'text_medium',
348
+ ),
349
+ array(
350
+ 'name' => __('Product Image','rich-snippets'),
351
+ 'desc' => __('Upload the product image or select from library','rich-snippets'),
352
+ 'id' => $prefix . 'product_image',
353
+ 'class' => 'product',
354
+ 'type' => 'file',
355
+ ),
356
+ array(
357
+ 'name' => __('Product Category','rich-snippets'),
358
+ 'desc' => __('Select the product category.','rich-snippets'),
359
+ 'id' => $prefix . 'product_cat',
360
+ 'class' => 'product',
361
+ 'type' => 'text_medium',
362
+ ),
363
+ array(
364
+ 'name' => __('Product Price','rich-snippets'),
365
+ 'desc' => __('Enter the product Price.','rich-snippets'),
366
+ 'id' => $prefix . 'product_price',
367
+ 'class' => 'product',
368
+ 'type' => 'text_money',
369
+ ),
370
+ array(
371
+ 'name' => __('Availability','rich-snippets'),
372
+ 'desc' => __('Select the products availability.','rich-snippets'),
373
+ 'id' => $prefix . 'product_status',
374
+ 'class' => 'product',
375
+ 'type' => 'select',
376
+ 'options' => array(
377
+ array('name' => __('__ Please Select __','rich-snippets'), 'value' => ''),
378
+ array('name' => __('Out of Stock','rich-snippets'), 'value' => 'out_of_stock'),
379
+ array('name' => __('In Stock','rich-snippets'), 'value' => 'in_stock'),
380
+ array('name' => __('In Store Only','rich-snippets'), 'value' => 'instore_only'),
381
+ array('name' => __('Pre-Order','rich-snippets'), 'value' => 'preorder'),
382
+ ),
383
+ ),
384
+ // Meta Settings for Recipes
385
+ array(
386
+ 'name' => __('Rich Snippets - Recipes','rich-snippets'),
387
+ 'desc' => __('Please provide the following information.','rich-snippets'),
388
+ 'id' => $prefix . 'recipes',
389
+ 'class' => 'recipes',
390
+ 'type' => 'title',
391
+ ),
392
+ array(
393
+ 'name' => __('Recipe Name ','rich-snippets'),
394
+ 'desc' => __('Enter the recipe name.','rich-snippets'),
395
+ 'id' => $prefix . 'recipes_name',
396
+ 'class' => 'recipes',
397
+ 'type' => 'text_medium',
398
+ ),
399
+ array(
400
+ 'name' => __('Time Required ','rich-snippets'),
401
+ 'desc' => __('Preperation time','rich-snippets'),
402
+ 'id' => $prefix . 'recipes_preptime',
403
+ 'class' => 'recipes',
404
+ 'type' => 'text_small',
405
+ ),
406
+ array(
407
+ 'name' => __('','rich-snippets'),
408
+ 'desc' => __('Cook Time.','rich-snippets'),
409
+ 'id' => $prefix . 'recipes_cooktime',
410
+ 'class' => 'recipes',
411
+ 'type' => 'text_small',
412
+ ),
413
+ array(
414
+ 'name' => __('','rich-snippets'),
415
+ 'desc' => __('Total Time','rich-snippets'),
416
+ 'id' => $prefix . 'recipes_totaltime',
417
+ 'class' => 'recipes',
418
+ 'type' => 'text_small',
419
+ ),
420
+ array(
421
+ 'name' => __('Recipe Photo','rich-snippets'),
422
+ 'desc' => __('Upload or Select recipe photo','rich-snippets'),
423
+ 'id' => $prefix . 'recipes_photo',
424
+ 'class' => 'recipes',
425
+ 'type' => 'file',
426
+ ),
427
+ array(
428
+ 'name' => __('Ingredients','rich-snippets'),
429
+ 'desc' => __('Enter the ingredients used','rich-snippets'),
430
+ 'id' => $prefix . 'recipes_ingredient',
431
+ 'class' => 'recipes',
432
+ 'type' => 'textarea_small',
433
+ ),
434
+ array(
435
+ 'name' => __('Recipe Summary','rich-snippets'),
436
+ 'desc' => __('Describe the recipe in short.','rich-snippets'),
437
+ 'id' => $prefix . 'recipes_desc',
438
+ 'class' => 'recipes',
439
+ 'type' => 'textarea_small',
440
+ ),
441
+ // Meta Settings for Software Application
442
+ array(
443
+ 'name' => __('Rich Snippets - Software Application','rich-snippets'),
444
+ 'desc' => __('Please provide the following information.','rich-snippets'),
445
+ 'id' => $prefix . 'software',
446
+ 'class' => 'software',
447
+ 'type' => 'title',
448
+ ),
449
+ array(
450
+ 'name' => __('Software Rating','rich-snippets'),
451
+ 'desc' => __('Rate this software.','rich-snippets'),
452
+ 'id' => $prefix . 'software_rating',
453
+ 'class' => 'star software',
454
+ 'type' => 'radio',
455
+ 'options' => array(
456
+ array( 'name' => __('','rich-snippets'), 'value' => '1', ),
457
+ array( 'name' => __('','rich-snippets'), 'value' => '2', ),
458
+ array( 'name' => __('','rich-snippets'), 'value' => '3', ),
459
+ array( 'name' => __('','rich-snippets'), 'value' => '4', ),
460
+ array( 'name' => __('','rich-snippets'), 'value' => '5', ),
461
+ ),
462
+ ),
463
+ array(
464
+ 'name' => __('Price','rich-snippets'),
465
+ 'desc' => __('Enter the Price of Software','rich-snippets'),
466
+ 'id' => $prefix . 'software_price',
467
+ 'class' => 'software',
468
+ 'type' => 'text_money',
469
+ ),
470
+ array(
471
+ 'name' => __('Software Name ','rich-snippets'),
472
+ 'desc' => __('Enter the Software Name.','rich-snippets'),
473
+ 'id' => $prefix . 'software_name',
474
+ 'class' => 'software',
475
+ 'type' => 'text_medium',
476
+ ),
477
+ array(
478
+ 'name' => __('Operating System','rich-snippets'),
479
+ 'desc' => __('Enter the software Operating System.','rich-snippets'),
480
+ 'id' => $prefix . 'software_os',
481
+ 'class' => 'software',
482
+ 'type' => 'text_medium',
483
+ ),
484
+ array(
485
+ 'name' => __('Software Image','rich-snippets'),
486
+ 'desc' => __('Upload or select image of software','rich-snippets'),
487
+ 'id' => $prefix . 'software_image',
488
+ 'class' => 'software',
489
+ 'type' => 'file',
490
+ ),
491
+ array(
492
+ 'name' => __('Landing Page','rich-snippets'),
493
+ 'desc' => __('Enter the landing page url for software','rich-snippets'),
494
+ 'id' => $prefix . 'software_landing',
495
+ 'class' => 'software',
496
+ 'type' => 'text',
497
+ ),
498
+ array(
499
+ 'name' => __('Software Description','rich-snippets'),
500
+ 'desc' => __('Enter the software description.','rich-snippets'),
501
+ 'id' => $prefix . 'software_desc',
502
+ 'class' => 'software',
503
+ 'type' => 'textarea_small',
504
+ ),
505
+ // Meta Settings for Video
506
+ array(
507
+ 'name' => __('Rich Snippets - Videos','rich-snippets'),
508
+ 'desc' => __('Please provide the following information.','rich-snippets'),
509
+ 'id' => $prefix . 'video',
510
+ 'class' => 'video',
511
+ 'type' => 'title',
512
+ ),
513
+ array(
514
+ 'name' => __('Video Title','rich-snippets'),
515
+ 'desc' => __('Enter the title for this video','rich-snippets'),
516
+ 'id' => $prefix . 'video_title',
517
+ 'class' => 'video',
518
+ 'type' => 'text',
519
+ ),
520
+ array(
521
+ 'name' => __('Video Description','rich-snippets'),
522
+ 'desc' => __('Enter the brief description for this video','rich-snippets'),
523
+ 'id' => $prefix . 'video_desc',
524
+ 'class' => 'video',
525
+ 'type' => 'textarea_small',
526
+ ),
527
+ array(
528
+ 'name' => __('Video Thumbnail','rich-snippets'),
529
+ 'desc' => __('Upload or select video thumbnail from gallery','rich-snippets'),
530
+ 'id' => $prefix . 'video_thumb',
531
+ 'class' => 'video',
532
+ 'type' => 'file',
533
+ ),
534
+ array(
535
+ 'name' => __('Video','rich-snippets'),
536
+ 'desc' => __('Upload Video or enter the video file url','rich-snippets'),
537
+ 'id' => $prefix . 'video_url',
538
+ 'class' => 'video',
539
+ 'type' => 'file',
540
+ ),
541
+ array(
542
+ 'name' => __('Video Duration','rich-snippets'),
543
+ 'desc' => __('Enter the duration for this video','rich-snippets'),
544
+ 'id' => $prefix . 'video_duration',
545
+ 'class' => 'video',
546
+ 'type' => 'text_small',
547
+ ),
548
+ array(
549
+ 'name' => __('Upload Date','rich-snippets'),
550
+ 'desc' => __('Provide the date when the video is uploaded','rich-snippets'),
551
+ 'id' => $prefix . 'video_date',
552
+ 'class' => 'video',
553
+ 'type' => 'text_date',
554
+ ),
555
+ ),
556
+ );
557
+
558
+ // Add other metaboxes as needed
559
+
560
+ return $meta_boxes;
561
+ }
562
+ ?>
readme.txt ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === All In One Schema.org Rich Snippets ===
2
+ Contributors: yawalkarm, brainstormforce
3
+ Donate link: http://www.brainstormforce.com
4
+ Tags: Review, Event, Organization, People, Product, Recipe, Software Application, Video, rdfa, rich snippet, schema.org, schema, microdata, microformat, SERP, Google, Yahoo, Bing
5
+ Requires at least: 3.0
6
+ Tested up to: 3.5.1
7
+ Stable tag: 1.0
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ Boost CTR. Improve SEO & Rankings. Supports most of the content type. Works perfectly with Google, Bing, Yahoo & Facebook.
12
+
13
+ == Description ==
14
+
15
+ What is a Rich Snippet?
16
+
17
+ It is basically a short summary of your page in the search results of Google, Yahoo, Bing and sometimes in the News feed of Facebook in nice format with star ratings, author photo, image, etc.
18
+
19
+ [See Examples of Rich Snippets Here.](http://www.seomoz.org/blog/schema-examples/ "Rich Snippets Examples")
20
+
21
+
22
+ How does a Rich Snippet help?
23
+
24
+ - It gives search engines only the important & precise information to display in search result snippets.
25
+ - Rich Snippets are very interactive (photos, star ratings, price, author, etc.) to let you stand out from competition
26
+ - [See what difference it makes](http://dashburst.com/google-search-what-are-rich-snippets/ "See the difference") in CTR (Click Through Rate)
27
+ - Helps you rank higher in search results
28
+ - Helps Facebook display proper information when users share your links on Facebook
29
+
30
+
31
+ Supported Content Types -
32
+
33
+ This plugin supports almost all of the content types that are released by Schema.org at one place.
34
+ Review, Event, Organization, People, Product, Recipe, Software Application, Video, etc.
35
+
36
+
37
+ Future release would include -
38
+
39
+ * Breadcrumb
40
+ * Author
41
+
42
+ == Installation ==
43
+
44
+ = Through Dashboard =
45
+
46
+ 1. Go to Plugins -> Add New -> Search for "All in One Schema.org Rich Snippets" Or Upload the plugins zip file
47
+
48
+ = Through FTP =
49
+ 1. Upload the plugin into `wp-content/plugins` directory
50
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
51
+ 3. That's It.
52
+
53
+ Now go and create a new post. There you will find a meta box, select the type of post from dropdown and fill out the details, publish the post.
54
+
55
+ Google will start showing rich snippets in the search results, as soon as your post is crawled.
56
+
57
+ You can test the rich snippet on Google Webmasters Rich Snippets Testing Tool
58
+
59
+ == Frequently Asked Questions ==
60
+
61
+ = What is a Rich Snippet? =
62
+
63
+ It is basically a short summary of your page in the search results of Google, Yahoo, Bing and sometimes in the News feed of Facebook in nice format with star ratings, author photo, image, etc.
64
+
65
+ = How does a Rich Snippet help? =
66
+
67
+ - It gives search engines only the important & precise information to display in search result snippets.
68
+ - Rich Snippets are very interactive (photos, star ratings, price, author, etc.) to let you stand out from competition
69
+ - [See what difference it makes](http://dashburst.com/google-search-what-are-rich-snippets/ "See the difference") in CTR (Click Through Rate)
70
+ - Helps you rank higher in search results
71
+ - Helps Facebook display proper information when users share your links on Facebook
72
+
73
+ = Which Content Types are Supported? =
74
+
75
+ This plugin currently supports almost all of the content types that are released by Schema.org at one place.
76
+ Review, Event, Organization, People, Product, Recipe, Software Application, Video, etc.
77
+
78
+ == Screenshots ==
79
+
80
+ 1. Meta box in post-new under the editor screen.
81
+
82
+ 2. Select content type from dropdown
83
+
84
+ 3. Fill the details as much as you can
85
+
86
+ 4. Test the post or page URL in Google Rich Snippets Testing
87
+
88
+ == Changelog ==
89
+
90
+ = 1.0 =
91
+ * Initial Release.
92
+
93
+ == Upgrade Notice ==
94
+ N/A
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file