ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

5f7301b96249455d17f29eaca847b2c1.js
Go to the documentation of this file.
1 var ultimix = {};
2
8 if( !ultimix.lang )
9 {
10 ultimix.lang = {};
11 }
12
18 ultimix.lang.Locale = 'ru';
19
25 ultimix.lang.Strings = new Object();
26
32 ultimix.lang.Strings[ ultimix.lang.Locale ] = new Object();
33
47 ultimix.get_string = function( StringAlias , Default , Value )
48 {
49 if( !Value )
50 {
51 Value = 'default';
52 }
53
54 if( ultimix.lang.Strings[ ultimix.lang.Locale ] )
55 {
56 if( ultimix.lang.Strings[ ultimix.lang.Locale ][ StringAlias ] )
57 {
58 if( Value == 'default' )
59 {
60 return( ultimix.lang.Strings[ ultimix.lang.Locale ][ StringAlias ][ 'default' ] );
61 }
62 else
63 {
64 for( Condition in ultimix.lang.Strings[ ultimix.lang.Locale ][ StringAlias ] )
65 {
66 if( ( new RegExp( Condition ) ).test( String( Value ) ) )
67 {
68 return( ultimix.lang.Strings[ ultimix.lang.Locale ][ StringAlias ][ Condition ] );
69 }
70 }
71 }
72 }
73 }
74 if( Default )
75 {
76 return( Default );
77 }
78 return( StringAlias );
79 }
80 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'name_ru' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'name_ru' ] = {};
81 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'name_ru' ][ 'default' ] = 'рус';
82 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'name_en' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'name_en' ] = {};
83 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'name_en' ][ 'default' ] = 'eng';
84 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'name_jp' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'name_jp' ] = {};
85 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'name_jp' ][ 'default' ] = 'jap';
86
87 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'main_page' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'main_page' ] = {};
88 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'main_page' ][ 'default' ] = 'Главная[nbsp]страница';
89 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'menu_main_admin_page' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'menu_main_admin_page' ] = {};
90 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'menu_main_admin_page' ][ 'default' ] = 'Главная[nbsp]страница';
91 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'menu_user_management' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'menu_user_management' ] = {};
92 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'menu_user_management' ][ 'default' ] = 'Управление[nbsp]пользователями';
93 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'menu_page_manager' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'menu_page_manager' ] = {};
94 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'menu_page_manager' ][ 'default' ] = 'Управление[nbsp]страницами';
95 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'menu_package_manager' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'menu_package_manager' ] = {};
96 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'menu_package_manager' ][ 'default' ] = 'Управление[nbsp]пакетами';
97 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'admin_console' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'admin_console' ] = {};
98 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'admin_console' ][ 'default' ] = 'Консоль администратора';
99 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'no_permits' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'no_permits' ] = {};
100 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'no_permits' ][ 'default' ] = 'Нет доступа';
101 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'an_error_occured' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'an_error_occured' ] = {};
102 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'an_error_occured' ][ 'default' ] = 'Произошла ошибка';
103 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'profile' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'profile' ] = {};
104 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'profile' ][ 'default' ] = 'Профиль';
105 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'today_is' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'today_is' ] = {};
106 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'today_is' ][ 'default' ] = 'Системная дата';
107 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'page_was_not_found' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'page_was_not_found' ] = {};
108 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'page_was_not_found' ][ 'default' ] = 'Страница не найдена';
109 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'page_was_generated_in' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'page_was_generated_in' ] = {};
110 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'page_was_generated_in' ][ 'default' ] = 'Страница была сгенерирована за[nbsp]:[nbsp]';
111 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'passes_count' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'passes_count' ] = {};
112 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'passes_count' ][ 'default' ] = 'Количество[nbsp]проходов[nbsp]:[nbsp]';
113 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'nbsp' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'nbsp' ] = {};
114 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'nbsp' ][ 'default' ] = '[nbsp]';
115 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'no_text' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'no_text' ] = {};
116 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'no_text' ][ 'default' ] = '';
117 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'save' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'save' ] = {};
118 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'save' ][ 'default' ] = 'сохранить';
119 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'shure_to_delete_all_selected_records' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'shure_to_delete_all_selected_records' ] = {};
120 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'shure_to_delete_all_selected_records' ][ 'default' ] = 'Вы уверены, что хотите удалить все выбранные записи?';
121 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'edit' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'edit' ] = {};
122 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'edit' ][ 'default' ] = 'редактировать';
123 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cancel' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cancel' ] = {};
124 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cancel' ][ 'default' ] = 'отмена';
125 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'create' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'create' ] = {};
126 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'create' ][ 'default' ] = 'создать';
127 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'shure_that_you_want_to_do_it' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'shure_that_you_want_to_do_it' ] = {};
128 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'shure_that_you_want_to_do_it' ][ 'default' ] = 'Вы уверены, что хотите сделать это?';
129 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Next' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Next' ] = {};
130 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Next' ][ 'default' ] = 'Далее';
131 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Back' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Back' ] = {};
132 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Back' ][ 'default' ] = 'Назад';
133 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Finish' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Finish' ] = {};
134 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Finish' ][ 'default' ] = 'Завершить';
135 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Cancel' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Cancel' ] = {};
136 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Cancel' ][ 'default' ] = 'Отмена';
137 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'step' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'step' ] = {};
138 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'step' ][ 'default' ] = 'шаг';
139 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'of' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'of' ] = {};
140 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'of' ][ 'default' ] = 'из';
141 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'delete' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'delete' ] = {};
142 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'delete' ][ 'default' ] = 'удалить';
143 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Delete' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Delete' ] = {};
144 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Delete' ][ 'default' ] = 'Удалить';
145 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Help' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Help' ] = {};
146 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Help' ][ 'default' ] = 'Помощь';
147 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Ignore' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Ignore' ] = {};
148 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Ignore' ][ 'default' ] = 'Игнорировать';
149 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Retry' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Retry' ] = {};
150 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Retry' ][ 'default' ] = 'Повторить';
151 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Abort' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Abort' ] = {};
152 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Abort' ][ 'default' ] = 'Прервать';
153 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Cancel' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Cancel' ] = {};
154 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Cancel' ][ 'default' ] = 'Отмена';
155 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'OK' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'OK' ] = {};
156 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'OK' ][ 'default' ] = 'ОК';
157 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'No' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'No' ] = {};
158 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'No' ][ 'default' ] = 'Нет';
159 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Yes' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Yes' ] = {};
160 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Yes' ][ 'default' ] = 'Да';
161 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Question' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Question' ] = {};
162 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Question' ][ 'default' ] = 'Вопрос';
163 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Error' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Error' ] = {};
164 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Error' ][ 'default' ] = 'Ошибка';
165 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Info' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Info' ] = {};
166 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Info' ][ 'default' ] = 'Информация';
167 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'wait_please' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'wait_please' ] = {};
168 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'wait_please' ][ 'default' ] = 'Операция выполняется. Пожалуйста подождите...';
169 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'print' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'print' ] = {};
170 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'print' ][ 'default' ] = 'печать';
171 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Print' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Print' ] = {};
172 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'Print' ][ 'default' ] = 'Печать';
173 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'not_set' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'not_set' ] = {};
174 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'not_set' ][ 'default' ] = 'не установлено';
175 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'admin_console_short' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'admin_console_short' ] = {};
176 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'admin_console_short' ][ 'default' ] = 'Админка';
177 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'main' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'main' ] = {};
178 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'main' ][ 'default' ] = 'Главная<br>страница';
179 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'not_defined' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'not_defined' ] = {};
180 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'not_defined' ][ 'default' ] = 'не определено';
181 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'details' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'details' ] = {};
182 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'details' ][ 'default' ] = 'подробнее';
183 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'grid_waiting_message' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'grid_waiting_message' ] = {};
184 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'grid_waiting_message' ][ 'default' ] = 'Операция выполняется. Подождите пожалуйста...';
185 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'view' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'view' ] = {};
186 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'view' ][ 'default' ] = 'просмотр';
187 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'about_us' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'about_us' ] = {};
188 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'about_us' ][ 'default' ] = 'О нас';
189 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'contacts' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'contacts' ] = {};
190 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'contacts' ][ 'default' ] = 'Контакты';
191 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'info' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'info' ] = {};
192 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'info' ][ 'default' ] = 'Информация';
193 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'forum' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'forum' ] = {};
194 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'forum' ][ 'default' ] = 'Форум';
195 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'photogallery' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'photogallery' ] = {};
196 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'photogallery' ][ 'default' ] = 'Фотогалерея';
197 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'video' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'video' ] = {};
198 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'video' ][ 'default' ] = 'Видео';
199 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_1' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_1' ] = {};
200 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_1' ][ 'default' ] = 'Январь';
201 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_2' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_2' ] = {};
202 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_2' ][ 'default' ] = 'Февраль';
203 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_3' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_3' ] = {};
204 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_3' ][ 'default' ] = 'Март';
205 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_4' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_4' ] = {};
206 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_4' ][ 'default' ] = 'Апрель';
207 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_5' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_5' ] = {};
208 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_5' ][ 'default' ] = 'Май';
209 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_6' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_6' ] = {};
210 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_6' ][ 'default' ] = 'Июнь';
211 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_7' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_7' ] = {};
212 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_7' ][ 'default' ] = 'Июль';
213 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_8' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_8' ] = {};
214 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_8' ][ 'default' ] = 'Август';
215 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_9' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_9' ] = {};
216 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_9' ][ 'default' ] = 'Сентябрь';
217 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_10' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_10' ] = {};
218 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_10' ][ 'default' ] = 'Октябрь';
219 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_11' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_11' ] = {};
220 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_11' ][ 'default' ] = 'Ноябрь';
221 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_12' ] = {};
222 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month_12' ][ 'default' ] = 'Декабрь';
223 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'auto_submit_protection' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'auto_submit_protection' ] = {};
224 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'auto_submit_protection' ][ 'default' ] = 'Защита&nbsp;от&nbsp;ботов';
225 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'numbers_on_the_image' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'numbers_on_the_image' ] = {};
226 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'numbers_on_the_image' ][ 'default' ] = 'Цифры&nbsp;на&nbsp;картинке';
227 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'send' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'send' ] = {};
228 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'send' ][ 'default' ] = 'отправить';
229 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'captcha_error' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'captcha_error' ] = {};
230 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'captcha_error' ][ 'default' ] = 'Неправильно введён код с картинки';
231 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'navigation' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'navigation' ] = {};
232 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'navigation' ][ 'default' ] = 'Навигация';
233 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'advertisement' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'advertisement' ] = {};
234 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'advertisement' ][ 'default' ] = 'Реклама';
235 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'update' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'update' ] = {};
236 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'update' ][ 'default' ] = 'обновить';
237 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'download' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'download' ] = {};
238 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'download' ][ 'default' ] = 'скачать';
239 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'report' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'report' ] = {};
240 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'report' ][ 'default' ] = 'отчёт';
241 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'generate' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'generate' ] = {};
242 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'generate' ][ 'default' ] = 'сгенерировать';
243 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'copy' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'copy' ] = {};
244 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'copy' ][ 'default' ] = 'копировать';
245 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'report_is_generating' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'report_is_generating' ] = {};
246 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'report_is_generating' ][ 'default' ] = 'Осуществляется генерация отчета. Пожалуйста подождите...';
247 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'at_least_one_record_must_be_selected' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'at_least_one_record_must_be_selected' ] = {};
248 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'at_least_one_record_must_be_selected' ][ 'default' ] = 'Ни одной записи не выборано. Должна быть выбрана хотя бы одна запись.';
249 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'total_records_count' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'total_records_count' ] = {};
250 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'total_records_count' ][ 'default' ] = 'Общее число записей';
251 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'more_info' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'more_info' ] = {};
252 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'more_info' ][ 'default' ] = 'Подробнее';
253 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'number_to_words' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'number_to_words' ] = {};
254 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'number_to_words' ][ '/^[0-9]{1,9}$/' ] = '{lang:digit10;value={value};default=}{lang:digit9;value={value};default=}{lang:digit8;value={value};default=}{lang:digit78;value={value};default=}{lang:digit7;value={value};default=}{lang:digit6;value={value};default=}{lang:digit5;value={value};default=}{lang:digit45;value={value};default=}{lang:digit4;value={value};default=}{lang:digit3;value={value};default=}{lang:digit2;value={value};default=}{lang:digit12;value={value};default=}';
255 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit10' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit10' ] = {};
256 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit10' ][ '/[0-9]{10}$/' ] = 'Откуда такие деньги? ';
257 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] = {};
258 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ][ '/9[0-9]{8}$/' ] = 'девятьсот ';
259 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] = {};
260 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ][ '/8[0-9]{8}$/' ] = 'восемьсот ';
261 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] = {};
262 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ][ '/7[0-9]{8}$/' ] = 'семьсот ';
263 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] = {};
264 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ][ '/6[0-9]{8}$/' ] = 'шестьсот ';
265 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] = {};
266 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ][ '/5[0-9]{8}$/' ] = 'пятьсот ';
267 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] = {};
268 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ][ '/4[0-9]{8}$/' ] = 'четыреста ';
269 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] = {};
270 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ][ '/3[0-9]{8}$/' ] = 'триста ';
271 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] = {};
272 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ][ '/2[0-9]{8}$/' ] = 'двести ';
273 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ] = {};
274 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit9' ][ '/1[0-9]{8}$/' ] = 'сто ';
275 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] = {};
276 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ][ '/9[0-9]{7}$/' ] = 'девяносто ';
277 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] = {};
278 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ][ '/8[0-9]{7}$/' ] = 'восемьдесят ';
279 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] = {};
280 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ][ '/7[0-9]{7}$/' ] = 'семьдесят ';
281 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] = {};
282 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ][ '/6[0-9]{7}$/' ] = 'шестьдесят ';
283 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] = {};
284 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ][ '/5[0-9]{7}$/' ] = 'пятьдесят ';
285 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] = {};
286 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ][ '/4[0-9]{7}$/' ] = 'сорок ';
287 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] = {};
288 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ][ '/3[0-9]{7}$/' ] = 'тридцать ';
289 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ] = {};
290 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit8' ][ '/2[0-9]{7}$/' ] = 'двадцать ';
291 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
292 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/10[0-9]{6}$/' ] = 'десять ';
293 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
294 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/11[0-9]{6}$/' ] = 'одинадцать ';
295 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
296 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/12[0-9]{6}$/' ] = 'двенадцать ';
297 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
298 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/13[0-9]{6}$/' ] = 'тринадцать ';
299 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
300 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/14[0-9]{6}$/' ] = 'четырнадцать ';
301 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
302 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/15[0-9]{6}$/' ] = 'пятнадцать ';
303 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
304 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/16[0-9]{6}$/' ] = 'шестнадцать ';
305 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
306 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/17[0-9]{6}$/' ] = 'семнадцать ';
307 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
308 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/18[0-9]{6}$/' ] = 'восемнадцать ';
309 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
310 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/19[0-9]{6}$/' ] = 'девятнадцать ';
311 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
312 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/0[0-9]{6}$/' ] = '';
313 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
314 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/1[0-9]{6}$/' ] = 'один ';
315 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
316 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/2[0-9]{6}$/' ] = 'два ';
317 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
318 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/3[0-9]{6}$/' ] = 'три ';
319 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
320 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/4[0-9]{6}$/' ] = 'четыре ';
321 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
322 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/5[0-9]{6}$/' ] = 'пять ';
323 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
324 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/6[0-9]{6}$/' ] = 'шесть ';
325 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
326 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/7[0-9]{6}$/' ] = 'семь ';
327 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
328 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/8[0-9]{6}$/' ] = 'восемь ';
329 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ] = {};
330 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit78' ][ '/9[0-9]{6}$/' ] = 'девять ';
331 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ] = {};
332 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ][ '/[2-9]0[0-9]{6}$/' ] = 'миллионов ';
333 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ] = {};
334 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ][ '/1[0-9][0-9]{6}$/' ] = 'миллионов ';
335 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ] = {};
336 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ][ '/[5-9][0-9]{6}$/' ] = 'миллионов ';
337 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ] = {};
338 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ][ '/[2-4][0-9]{6}$/' ] = 'миллиона ';
339 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ] = {};
340 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit7' ][ '/1[0-9]{6}$/' ] = 'миллион ';
341 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] = {};
342 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ][ '/9[0-9]{5}$/' ] = 'девятьсот ';
343 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] = {};
344 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ][ '/8[0-9]{5}$/' ] = 'восемьсот ';
345 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] = {};
346 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ][ '/7[0-9]{5}$/' ] = 'семьсот ';
347 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] = {};
348 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ][ '/6[0-9]{5}$/' ] = 'шестьсот ';
349 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] = {};
350 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ][ '/5[0-9]{5}$/' ] = 'пятьсот ';
351 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] = {};
352 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ][ '/4[0-9]{5}$/' ] = 'четыреста ';
353 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] = {};
354 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ][ '/3[0-9]{5}$/' ] = 'триста ';
355 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] = {};
356 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ][ '/2[0-9]{5}$/' ] = 'двести ';
357 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ] = {};
358 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit6' ][ '/1[0-9]{5}$/' ] = 'сто ';
359 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] = {};
360 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ][ '/9[0-9]{4}$/' ] = 'девяносто ';
361 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] = {};
362 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ][ '/8[0-9]{4}$/' ] = 'восемьдесят ';
363 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] = {};
364 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ][ '/7[0-9]{4}$/' ] = 'семьдесят ';
365 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] = {};
366 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ][ '/6[0-9]{4}$/' ] = 'шестьдесят ';
367 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] = {};
368 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ][ '/5[0-9]{4}$/' ] = 'пятьдесят ';
369 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] = {};
370 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ][ '/4[0-9]{4}$/' ] = 'сорок ';
371 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] = {};
372 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ][ '/3[0-9]{4}$/' ] = 'тридцать ';
373 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ] = {};
374 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit5' ][ '/2[0-9]{4}$/' ] = 'двадцать ';
375 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
376 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/19[0-9]{3}$/' ] = 'девятнадцать ';
377 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
378 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/18[0-9]{3}$/' ] = 'восемнадцать ';
379 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
380 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/17[0-9]{3}$/' ] = 'семнадцать ';
381 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
382 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/16[0-9]{3}$/' ] = 'шестнадцать ';
383 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
384 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/15[0-9]{3}$/' ] = 'пятнадцать ';
385 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
386 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/14[0-9]{3}$/' ] = 'четырнадцать ';
387 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
388 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/13[0-9]{3}$/' ] = 'тридцать ';
389 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
390 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/12[0-9]{3}$/' ] = 'двенадцать ';
391 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
392 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/11[0-9]{3}$/' ] = 'одинадцать ';
393 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
394 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/10[0-9]{3}$/' ] = 'десять ';
395 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
396 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/9[0-9]{3}$/' ] = 'девять ';
397 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
398 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/8[0-9]{3}$/' ] = 'восемь ';
399 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
400 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/7[0-9]{3}$/' ] = 'семь ';
401 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
402 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/6[0-9]{3}$/' ] = 'шесть ';
403 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
404 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/5[0-9]{3}$/' ] = 'пять ';
405 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
406 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/4[0-9]{3}$/' ] = 'четыре ';
407 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
408 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/3[0-9]{3}$/' ] = 'три ';
409 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
410 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/2[0-9]{3}$/' ] = 'две ';
411 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ] = {};
412 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit45' ][ '/1[0-9]{3}$/' ] = 'одна ';
413 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ] = {};
414 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ][ '/[2-9]0[0-9]{3}$/' ] = 'тысяч ';
415 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ] = {};
416 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ][ '/1[0-9][0-9]{3}$/' ] = 'тысяч ';
417 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ] = {};
418 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ][ '/[5-9][0-9]{3}$/' ] = 'тысяч ';
419 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ] = {};
420 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ][ '/[2-4][0-9]{3}$/' ] = 'тысячи ';
421 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ] = {};
422 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit4' ][ '/1[0-9]{3}$/' ] = 'тысяча ';
423 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] = {};
424 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ][ '/9[0-9]{2}$/' ] = 'девятьсот ';
425 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] = {};
426 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ][ '/8[0-9]{2}$/' ] = 'восемьсот ';
427 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] = {};
428 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ][ '/7[0-9]{2}$/' ] = 'семьсот ';
429 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] = {};
430 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ][ '/6[0-9]{2}$/' ] = 'шестьсот ';
431 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] = {};
432 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ][ '/5[0-9]{2}$/' ] = 'пятьсот ';
433 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] = {};
434 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ][ '/4[0-9]{2}$/' ] = 'четыреста ';
435 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] = {};
436 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ][ '/3[0-9]{2}$/' ] = 'триста ';
437 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] = {};
438 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ][ '/2[0-9]{2}$/' ] = 'двести ';
439 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ] = {};
440 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit3' ][ '/1[0-9]{2}$/' ] = 'сто ';
441 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] = {};
442 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ][ '/9[0-9]$/' ] = 'девяносто ';
443 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] = {};
444 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ][ '/8[0-9]$/' ] = 'восемьдесят ';
445 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] = {};
446 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ][ '/7[0-9]$/' ] = 'семьдесят ';
447 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] = {};
448 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ][ '/6[0-9]$/' ] = 'шестьдесят ';
449 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] = {};
450 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ][ '/5[0-9]$/' ] = 'пятьдесят ';
451 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] = {};
452 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ][ '/4[0-9]$/' ] = 'сорок ';
453 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] = {};
454 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ][ '/3[0-9]$/' ] = 'тридцать ';
455 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ] = {};
456 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit2' ][ '/2[0-9]$/' ] = 'двадцать ';
457 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
458 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/10$/' ] = 'десять ';
459 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
460 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/11$/' ] = 'одинадцать ';
461 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
462 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/12$/' ] = 'двенадцать ';
463 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
464 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/13$/' ] = 'тринадцать ';
465 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
466 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/14$/' ] = 'четырнадцать ';
467 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
468 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/15$/' ] = 'пятнадцать ';
469 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
470 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/16$/' ] = 'шестнадцать ';
471 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
472 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/17$/' ] = 'семнадцать ';
473 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
474 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/18$/' ] = 'восемнадцать ';
475 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
476 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/19$/' ] = 'девятнадцать ';
477 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
478 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/^0$/' ] = 'ноль ';
479 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
480 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/^f[0-9]{0,9}1$/' ] = 'одна ';
481 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
482 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/1$/' ] = 'один ';
483 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
484 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/^f[0-9]{0,9}1$/' ] = 'две ';
485 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
486 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/2$/' ] = 'два ';
487 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
488 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/3$/' ] = 'три ';
489 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
490 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/4$/' ] = 'четыре ';
491 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
492 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/5$/' ] = 'пять ';
493 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
494 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/6$/' ] = 'шесть ';
495 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
496 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/7$/' ] = 'семь ';
497 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
498 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/8$/' ] = 'восемь ';
499 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ] = {};
500 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'digit12' ][ '/9$/' ] = 'девять ';
501 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'are_you_shure' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'are_you_shure' ] = {};
502 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'are_you_shure' ][ 'default' ] = 'Вы уверены, что хотите выполнить это действие?';
503 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'user_does_not_exist' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'user_does_not_exist' ] = {};
504 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'user_does_not_exist' ][ 'default' ] = 'Пользователь с указанным логином не существует';
505 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'all_rights_reserved' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'all_rights_reserved' ] = {};
506 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'all_rights_reserved' ][ 'default' ] = 'Все права защищены';
507 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'slide_panel' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'slide_panel' ] = {};
508 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'slide_panel' ][ 'default' ] = 'Выдвинуть панель';
509 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'close_panel' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'close_panel' ] = {};
510 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'close_panel' ][ 'default' ] = 'Закрыть панель';
511 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'open_panel' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'open_panel' ] = {};
512 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'open_panel' ][ 'default' ] = 'Открыть панель';
513 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'resize_panel' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'resize_panel' ] = {};
514 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'resize_panel' ][ 'default' ] = 'Иземнить ширину панели';
515 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'create_button' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'create_button' ] = {};
516 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'create_button' ][ 'default' ] = 'Создать';
517 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'delete_button' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'delete_button' ] = {};
518 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'delete_button' ][ 'default' ] = 'Удалить';
519 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'update_button' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'update_button' ] = {};
520 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'update_button' ][ 'default' ] = 'Редактировать';
521 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'copy_button' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'copy_button' ] = {};
522 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'copy_button' ][ 'default' ] = 'Копировать';
523 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'search_button' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'search_button' ] = {};
524 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'search_button' ][ 'default' ] = 'Искать';
525 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'contact_us' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'contact_us' ] = {};
526 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'contact_us' ][ 'default' ] = 'Свяжитесь с нами';
527 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'from' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'from' ] = {};
528 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'from' ][ 'default' ] = 'с';
529 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'to' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'to' ] = {};
530 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'to' ][ 'default' ] = 'по';
531 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'week' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'week' ] = {};
532 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'week' ][ 'default' ] = 'неделя';
533 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ '2weeks' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ '2weeks' ] = {};
534 ultimix.lang.Strings[ ultimix.lang.Locale ][ '2weeks' ][ 'default' ] = '2 недели';
535 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month' ] = {};
536 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'month' ][ 'default' ] = 'месяц';
537 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ '3months' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ '3months' ] = {};
538 ultimix.lang.Strings[ ultimix.lang.Locale ][ '3months' ][ 'default' ] = '3 месяца';
539 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'half_year' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'half_year' ] = {};
540 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'half_year' ][ 'default' ] = 'полгода';
541 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'year' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'year' ] = {};
542 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'year' ][ 'default' ] = 'год';
543
545 (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};
546 f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function()
547 {for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
557 (function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16",
558 keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=
559 this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,
560 "overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":
561 "mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,
562 outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,
563 "tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&
564 a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&
565 c.ui.isOverAxis(b,e,i)}})}})(jQuery);
566 ;
575 (function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(d){}});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=
576 function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):
577 d;if(e&&d.charAt(0)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=
578 b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
579 "-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",
580 c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
581 ;
593 (function(b){var d=false;b(document).mouseup(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
594 this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"&&a.target.nodeName?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
595 this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
596 !(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
597 false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
598 ;/*
599 * jQuery UI Position 1.8.16
600 *
601 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
602 * Dual licensed under the MIT or GPL Version 2 licenses.
603 * http://jquery.org/license
604 *
605 * http://docs.jquery.com/UI/Position
606 */
607 (function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,
608 left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+=
609 k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=
610 m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=
611 d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=
612 a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),
613 g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
614 ;/*
615 * jQuery UI Draggable 1.8.16
616 *
617 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
618 * Dual licensed under the MIT or GPL Version 2 licenses.
619 * http://jquery.org/license
620 *
621 * http://docs.jquery.com/UI/Draggables
622 *
623 * Depends:
624 * jquery.ui.core.js
625 * jquery.ui.mouse.js
626 * jquery.ui.widget.js
627 */
628 (function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
629 "original"&&!/^(?: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(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
630 this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;if(b.iframeFix)d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('<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(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;
631 this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.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};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
632 this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true},
633 _mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=
634 false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
635 10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||
636 !d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&
637 a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
638 this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
639 10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else 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"),
640 10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,
641 (a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!=
642 "hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),
643 10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+
644 this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&
645 !(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.left<g[0])e=g[0]+this.offset.click.left;
646 if(a.pageY-this.offset.click.top<g[1])h=g[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>g[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.top<g[1]||h-this.offset.click.top>g[3])?h:!(h-this.offset.click.top<g[1])?h-b.grid[1]:h+b.grid[1]:h;e=b.grid[0]?this.originalPageX+Math.round((e-this.originalPageX)/
647 b.grid[0])*b.grid[0]:this.originalPageX;e=g?!(e-this.offset.click.left<g[0]||e-this.offset.click.left>g[2])?e:!(e-this.offset.click.left<g[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<
648 526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.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=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,
649 c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.16"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var h=d.data(this,"sortable");if(h&&!h.options.disabled){c.sortables.push({instance:h,shouldRevert:h.options.revert});
650 h.refreshPositions();h._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=
651 false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);
652 this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;
653 c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&
654 this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=
655 a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!=
656 "x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<
657 c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-
658 c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,
659 width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,h=b.offset.left,g=h+c.helperProportions.width,n=b.offset.top,o=n+c.helperProportions.height,i=c.snapElements.length-1;i>=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e<h&&h<l+e&&k-e<n&&n<m+e||j-e<h&&h<l+e&&k-e<o&&o<m+e||j-e<g&&g<l+e&&k-e<n&&n<m+e||j-e<g&&g<l+e&&k-e<o&&
660 o<m+e){if(f.snapMode!="inner"){var p=Math.abs(k-o)<=e,q=Math.abs(m-n)<=e,r=Math.abs(j-g)<=e,s=Math.abs(l-h)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l}).left-c.margins.left}var t=
661 p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(k-n)<=e;q=Math.abs(m-o)<=e;r=Math.abs(j-h)<=e;s=Math.abs(l-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[i].snapping&&
662 (p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=p||q||r||s||t}else{c.snapElements[i].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),
663 10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
664 ;/*
665 * jQuery UI Droppable 1.8.16
666 *
667 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
668 * Dual licensed under the MIT or GPL Version 2 licenses.
669 * http://jquery.org/license
670 *
671 * http://docs.jquery.com/UI/Droppables
672 *
673 * Depends:
674 * jquery.ui.core.js
675 * jquery.ui.widget.js
676 * jquery.ui.mouse.js
677 * jquery.ui.draggable.js
678 */
679 (function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this);
680 a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&
681 this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
682 this._trigger("over",a,this.ui(b))}},_out:function(a){var b=d.ui.ddmanager.current;if(!(!b||(b.currentItem||b.element)[0]==this.element[0]))if(this.accept.call(this.element[0],b.currentItem||b.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",a,this.ui(b))}},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return false;var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=
683 d.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==c.options.scope&&g.accept.call(g.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(g,{offset:g.element.offset()}),g.options.tolerance)){e=true;return false}});if(e)return false;if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
684 a,this.ui(c));return this.element}return false},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.16"});d.ui.intersect=function(a,b,c){if(!b.offset)return false;var e=(a.positionAbs||a.position.absolute).left,g=e+a.helperProportions.width,f=(a.positionAbs||a.position.absolute).top,h=f+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height;
685 switch(c){case "fit":return i<=e&&g<=k&&j<=f&&h<=l;case "intersect":return i<e+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<f+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(f>=j&&f<=l||h>=j&&h<=l||f<j&&h>l)&&(e>=
686 i&&e<=k||g>=i&&g<=k||e<i&&g>k);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f<c.length;f++)if(!(c[f].options.disabled||a&&!c[f].accept.call(c[f].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[f].element[0]){c[f].proportions.height=0;continue a}c[f].visible=c[f].element.css("display")!=
687 "none";if(c[f].visible){e=="mousedown"&&c[f]._activate.call(c[f],b);c[f].offset=c[f].element.offset();c[f].proportions={width:c[f].element[0].offsetWidth,height:c[f].element[0].offsetHeight}}}},drop:function(a,b){var c=false;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&d.ui.intersect(a,this,this.options.tolerance))c=c||this._drop.call(this,b);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||
688 a.element)){this.isout=1;this.isover=0;this._deactivate.call(this,b)}}});return c},dragStart:function(a,b){a.element.parents(":not(body,html)").bind("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var c=d.ui.intersect(a,this,this.options.tolerance);
689 if(c=!c&&this.isover==1?"isout":c&&this.isover==0?"isover":null){var e;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){e=d.data(g[0],"droppable");e.greedyChild=c=="isover"?1:0}}if(e&&c=="isover"){e.isover=0;e.isout=1;e._out.call(e,b)}this[c]=1;this[c=="isout"?"isover":"isout"]=0;this[c=="isover"?"_over":"_out"].call(this,b);if(e&&c=="isout"){e.isout=0;e.isover=1;e._over.call(e,b)}}}})},dragStop:function(a,b){a.element.parents(":not(body,html)").unbind("scroll.droppable");
690 a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)}}})(jQuery);
691 ;/*
692 * jQuery UI Resizable 1.8.16
693 *
694 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
695 * Dual licensed under the MIT or GPL Version 2 licenses.
696 * http://jquery.org/license
697 *
698 * http://docs.jquery.com/UI/Resizables
699 *
700 * Depends:
701 * jquery.ui.core.js
702 * jquery.ui.mouse.js
703 * jquery.ui.widget.js
704 */
705 (function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
706 _proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});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(),
707 top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;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=
708 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=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{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",
709 nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==
710 String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();
711 this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();
712 var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=
713 false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});
714 this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff=
715 {width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];
716 if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},
717 _mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,
718 {top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight:
719 Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(c<a.maxWidth)a.maxWidth=c;if(f<a.maxHeight)a.maxHeight=f}this._vBoundaries=a},_updateCache:function(b){this.offset=this.helper.offset();if(k(b.left))this.position.left=b.left;if(k(b.top))this.position.top=b.top;if(k(b.height))this.size.height=b.height;if(k(b.width))this.size.width=
720 b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(k(b.height))b.width=b.height*this.aspectRatio;else if(k(b.width))b.height=b.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this._vBoundaries,c=this.axis,d=k(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=k(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=k(b.width)&&a.minWidth&&
721 a.minWidth>b.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=
722 null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=[c.css("borderTopWidth"),c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)||
723 0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+
724 a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+
725 c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);
726 b!="resize"&&this._trigger(b,a,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.extend(e.ui.resizable,{version:"1.8.16"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),
727 10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-
728 f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?
729 e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=
730 e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,
731 step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=
732 e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;
733 var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:
734 a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-
735 d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,
736 f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,
737 display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=
738 e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=
739 d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
740 ;/*
741 * jQuery UI Selectable 1.8.16
742 *
743 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
744 * Dual licensed under the MIT or GPL Version 2 licenses.
745 * http://jquery.org/license
746 *
747 * http://docs.jquery.com/UI/Selectables
748 *
749 * Depends:
750 * jquery.ui.core.js
751 * jquery.ui.mouse.js
752 * jquery.ui.widget.js
753 */
754 (function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),
755 selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.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").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX,
756 c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting",
757 c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d=
758 this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.right<b||a.top>i||a.bottom<g);else if(d.tolerance=="fit")k=a.left>b&&a.right<h&&a.top>g&&a.bottom<i;if(k){if(a.selected){a.$element.removeClass("ui-selected");a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting");
759 a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&&
760 !a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d=
761 e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.16"})})(jQuery);
762 ;/*
763 * jQuery UI Sortable 1.8.16
764 *
765 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
766 * Dual licensed under the MIT or GPL Version 2 licenses.
767 * http://jquery.org/license
768 *
769 * http://docs.jquery.com/UI/Sortables
770 *
771 * Depends:
772 * jquery.ui.core.js
773 * jquery.ui.mouse.js
774 * jquery.ui.widget.js
775 */
776 (function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable");
777 this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a===
778 "disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&
779 !b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,
780 left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};
781 this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=
782 document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);
783 return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<
784 b.scrollSensitivity)this.scrollParent[0].scrollTop=c=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=c=this.scrollParent[0].scrollLeft-b.scrollSpeed}else{if(a.pageY-d(document).scrollTop()<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()-
785 b.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<b.scrollSensitivity)c=d(document).scrollTop(d(document).scrollTop()+b.scrollSpeed);if(a.pageX-d(document).scrollLeft()<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()-b.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<b.scrollSensitivity)c=d(document).scrollLeft(d(document).scrollLeft()+b.scrollSpeed)}c!==false&&d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,
786 a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],
787 e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();
788 c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):
789 this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,
790 dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},
791 toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+j<k&&b+l>g&&b+l<h;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||
792 this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?j:g<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<h&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<k},_intersectsWithPointer:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width);b=b&&a;a=this._getDragVerticalDirection();
793 var c=this._getDragHorizontalDirection();if(!b)return false;return this.floating?c&&c=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=d.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height);a=d.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width);var c=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:c&&(c=="down"&&b||c=="up"&&!b)},
794 _getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();
795 if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),
796 this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,c=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):d(this.options.items,this.element),
797 this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h<g;h++){i=d(e[h]);i.data("sortable-item",a);b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}}},refreshPositions:function(a){if(this.offsetParent&&
798 this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=
799 this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=
800 d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||
801 0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",
802 a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-
803 f)<b){b=Math.abs(h-f);e=this.items[g]}}if(e||this.options.dropOnEmpty){this.currentContainer=this.containers[c];e?this._rearrange(a,e,null,true):this._rearrange(a,null,this.containers[c].element,true);this._trigger("change",a,this._uiHash());this.containers[c]._trigger("change",a,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}}},_createHelper:function(a){var b=
804 this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||d(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[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")};if(a[0].style.width==
805 ""||b.forceHelperSize)a.width(this.currentItem.width());if(a[0].style.height==""||b.forceHelperSize)a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=
806 this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a=
807 {top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),
808 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 a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?
809 document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=d(a.containment)[0];a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),
810 10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=
811 this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&
812 this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(c[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();
813 var f=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])f=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-
814 this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*b.grid[0];f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f}}return{top:g-
815 this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:c.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:c.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],
816 this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=false;var c=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]=
817 "";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!b)c.push(function(f){this._trigger("update",f,this._uiHash())});if(!d.ui.contains(this.element[0],this.currentItem[0])){b||c.push(function(f){this._trigger("remove",
818 f,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,
819 this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",
820 a,this._uiHash());for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}return false}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=0;e<c.length;e++)c[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},
821 _uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||d([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});d.extend(d.ui.sortable,{version:"1.8.16"})})(jQuery);
822 ;/*
823 * jQuery UI Accordion 1.8.16
824 *
825 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
826 * Dual licensed under the MIT or GPL Version 2 licenses.
827 * http://jquery.org/license
828 *
829 * http://docs.jquery.com/UI/Accordion
830 *
831 * Depends:
832 * jquery.ui.core.js
833 * jquery.ui.widget.js
834 */
835 (function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
836 a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
837 if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var h=d.closest(".ui-accordion-header");a.active=h.length?h:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",
838 function(f){return a._keydown(f)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(f){a._clickHandler.call(a,f,this);f.preventDefault()})},_createIcons:function(){var a=
839 this.options;if(a.icons){c("<span></span>").addClass("ui-icon "+a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");
840 this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons();
841 b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,h=this.headers.index(a.target),f=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:f=this.headers[(h+1)%d];break;case b.LEFT:case b.UP:f=this.headers[(h-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target);
842 a.preventDefault()}if(f){c(a.target).attr("tabIndex",-1);c(f).attr("tabIndex",0);f.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+
843 c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options;
844 if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){var h=this.active;j=a.next();g=this.active.next();e={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):j,oldContent:g};var f=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(j,g,e,b,f);h.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
845 if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);a.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var g=this.active.next(),
846 e={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:g},j=this.active=c([]);this._toggle(j,g,e)}},_toggle:function(a,b,d,h,f){var g=this,e=g.options;g.toShow=a;g.toHide=b;g.data=d;var j=function(){if(g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data);g.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&h?{toShow:c([]),toHide:b,complete:j,down:f,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:f,autoHeight:e.autoHeight||
847 e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;h=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!h[k]&&!c.easing[k])k="slide";h[k]||(h[k]=function(l){this.slide(l,{easing:k,duration:i||700})});h[k](d)}else{if(e.collapsible&&h)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",
848 "aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.16",
849 animations:{slide:function(a,b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),h=0,f={},g={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){g[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);
850 f[i]={value:j[1],unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(g,{step:function(j,i){if(i.prop=="height")h=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=h*f[i.prop].value+f[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",
851 paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
852 ;/*
853 * jQuery UI Autocomplete 1.8.16
854 *
855 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
856 * Dual licensed under the MIT or GPL Version 2 licenses.
857 * http://jquery.org/license
858 *
859 * http://docs.jquery.com/UI/Autocomplete
860 *
861 * Depends:
862 * jquery.ui.core.js
863 * jquery.ui.widget.js
864 * jquery.ui.position.js
865 */
866 (function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.propAttr("readOnly"))){g=
867 false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=
868 a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};
869 this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&
870 a.element.val(f.value)},selected:function(c,f){var h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");
871 d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&
872 b&&this.xhr&&this.xhr.abort()},_initSource:function(){var a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else this.source=
873 this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==false)return this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else this.close();
874 this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return a;return d.map(a,function(b){if(typeof b==="string")return{label:b,value:b};return d.extend({label:b.label||
875 b.value,value:b.value||b.label},b)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,b){var g=this;
876 d.each(b,function(c,f){g._renderItem(a,f)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
877 "\\$&")},filter:function(a,b){var g=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return g.test(c.label||c.value||c)})}})})(jQuery);
878 (function(d){d.widget("ui.menu",{_create:function(){var e=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
879 -1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,g=this.element.scrollTop(),c=this.element.height();if(b<0)this.element.scrollTop(g+b);else b>=c&&this.element.scrollTop(g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");
880 this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else this.activate(b,
881 this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,g)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
882 this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var g=d(this).offset().top-a+b-d(this).height();return g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(e,result)}else this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||
883 this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[d.fn.prop?"prop":"attr"]("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})})(jQuery);
884 ;/*
885 * jQuery UI Button 1.8.16
886 *
887 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
888 * Dual licensed under the MIT or GPL Version 2 licenses.
889 * http://jquery.org/license
890 *
891 * http://docs.jquery.com/UI/Button
892 *
893 * Depends:
894 * jquery.ui.core.js
895 * jquery.ui.widget.js
896 */
897 (function(b){var h,i,j,g,l=function(){var a=b(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},k=function(a){var c=a.name,e=a.form,f=b([]);if(c)f=e?b(e).find("[name='"+c+"']"):b("[name='"+c+"']",a.ownerDocument).filter(function(){return!this.form});return f};b.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l);if(typeof this.options.disabled!==
898 "boolean")this.options.disabled=this.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var a=this,c=this.options,e=this.type==="checkbox"||this.type==="radio",f="ui-state-hover"+(!e?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){b(this).addClass("ui-state-hover");
899 this===h&&b(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){c.disabled||b(this).removeClass(f)}).bind("click.button",function(d){if(c.disabled){d.preventDefault();d.stopImmediatePropagation()}});this.element.bind("focus.button",function(){a.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){a.buttonElement.removeClass("ui-state-focus")});if(e){this.element.bind("change.button",function(){g||a.refresh()});this.buttonElement.bind("mousedown.button",function(d){if(!c.disabled){g=
900 false;i=d.pageX;j=d.pageY}}).bind("mouseup.button",function(d){if(!c.disabled)if(i!==d.pageX||j!==d.pageY)g=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).toggleClass("ui-state-active");a.buttonElement.attr("aria-pressed",a.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(c.disabled||g)return false;b(this).addClass("ui-state-active");a.buttonElement.attr("aria-pressed","true");
901 var d=a.element[0];k(d).not(d).map(function(){return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")});else{this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;b(this).addClass("ui-state-active");h=this;b(document).one("mouseup",function(){h=null})}).bind("mouseup.button",function(){if(c.disabled)return false;b(this).removeClass("ui-state-active")}).bind("keydown.button",function(d){if(c.disabled)return false;if(d.keyCode==b.ui.keyCode.SPACE||
902 d.keyCode==b.ui.keyCode.ENTER)b(this).addClass("ui-state-active")}).bind("keyup.button",function(){b(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(d){d.keyCode===b.ui.keyCode.SPACE&&b(this).click()})}this._setOption("disabled",c.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type===
903 "radio"){var a=this.element.parents().filter(":last"),c="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(c);if(!this.buttonElement.length){a=a.length?a.siblings():this.element.siblings();this.buttonElement=a.filter(c);if(!this.buttonElement.length)this.buttonElement=a.find(c)}this.element.addClass("ui-helper-hidden-accessible");(a=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",a)}else this.buttonElement=this.element},
904 widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active 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").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");
905 b.Widget.prototype.destroy.call(this)},_setOption:function(a,c){b.Widget.prototype._setOption.apply(this,arguments);if(a==="disabled")c?this.element.propAttr("disabled",true):this.element.propAttr("disabled",false);else this._resetButton()},refresh:function(){var a=this.element.is(":disabled");a!==this.options.disabled&&this._setOption("disabled",a);if(this.type==="radio")k(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
906 "true"):b(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")});else if(this.type==="checkbox")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(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var a=this.buttonElement.removeClass("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"),
907 c=b("<span></span>").addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),e=this.options.icons,f=e.primary&&e.secondary,d=[];if(e.primary||e.secondary){if(this.options.text)d.push("ui-button-text-icon"+(f?"s":e.primary?"-primary":"-secondary"));e.primary&&a.prepend("<span class='ui-button-icon-primary ui-icon "+e.primary+"'></span>");e.secondary&&a.append("<span class='ui-button-icon-secondary ui-icon "+e.secondary+"'></span>");if(!this.options.text){d.push(f?"ui-button-icons-only":
908 "ui-button-icon-only");this.hasTitle||a.attr("title",c)}}else d.push("ui-button-text-only");a.addClass(d.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){a==="disabled"&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a=this.element.css("direction")===
909 "ltr";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-left":"ui-corner-right").end().filter(":last").addClass(a?"ui-corner-right":"ui-corner-left").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");
910 b.Widget.prototype.destroy.call(this)}})})(jQuery);
911 ;/*
912 * jQuery UI Dialog 1.8.16
913 *
914 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
915 * Dual licensed under the MIT or GPL Version 2 licenses.
916 * http://jquery.org/license
917 *
918 * http://docs.jquery.com/UI/Dialog
919 *
920 * Depends:
921 * jquery.ui.core.js
922 * jquery.ui.widget.js
923 * jquery.ui.button.js
924 * jquery.ui.draggable.js
925 * jquery.ui.mouse.js
926 * jquery.ui.position.js
927 * jquery.ui.resizable.js
928 */
929 (function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,
930 position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||"&#160;",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+
931 b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),
932 h=c('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-title").attr("id",
933 e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");
934 a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==
935 b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()};c.ui.dialog.maxZ+=1;
936 d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===
937 f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,
938 function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('<button type="button"></button>').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",
939 handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,
940 originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",
941 f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):
942 [a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);
943 if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):
944 e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||"&#160;"));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=
945 this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-
946 b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),
947 create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overlay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&!d.isDefaultPrevented()&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||
948 c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&
949 c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+
950 "px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,function(){a=a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
951 ;/*
952 * jQuery UI Slider 1.8.16
953 *
954 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
955 * Dual licensed under the MIT or GPL Version 2 licenses.
956 * http://jquery.org/license
957 *
958 * http://docs.jquery.com/UI/Slider
959 *
960 * Depends:
961 * jquery.ui.core.js
962 * jquery.ui.mouse.js
963 * jquery.ui.widget.js
964 */
965 (function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
966 this.orientation+" ui-widget ui-widget-content ui-corner-all"+(b.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(b.range===true){if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
967 this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle",
968 g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.options.values&&a.options.values.length?
969 (h=a.values(l)):(h=a.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(i-
970 m);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
971 return this},_mouseCapture:function(a){var b=this.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min){g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false;
972 this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b=
973 this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b=
974 this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);
975 c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>f||b===1&&c<f))c=f;if(c!==this.values(b)){f=this.values();f[b]=c;a=this._trigger("slide",a,{handle:this.handles[b],value:c,values:f});this.values(b?0:1);a!==false&&this.values(b,c,true)}}else if(c!==this.value()){a=this._trigger("slide",a,{handle:this.handles[b],value:c});
976 a!==false&&this.value(c)}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=
977 this._trimAlignValue(a);this._refreshValue();this._change(null,0)}else return this._value()},values:function(a,b){var c,f,e;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a):
978 this.value();else return this._values()},_setOption:function(a,b){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled")}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
979 this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length){b=this.options.values[a];
980 return b=this._trimAlignValue(b)}else{b=this.options.values.slice();for(c=0;c<b.length;c+=1)b[c]=this._trimAlignValue(b[c]);return b}},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a=
981 this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({width:e-
982 g+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"},
983 b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery);
984 ;/*
985 * jQuery UI Tabs 1.8.16
986 *
987 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
988 * Dual licensed under the MIT or GPL Version 2 licenses.
989 * http://jquery.org/license
990 *
991 * http://docs.jquery.com/UI/Tabs
992 *
993 * Depends:
994 * jquery.ui.core.js
995 * jquery.ui.widget.js
996 */
997 (function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&&
998 e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=
999 d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]||
1000 (q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
1001 this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected=
1002 this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
1003 if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
1004 this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+
1005 g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",
1006 function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")};
1007 this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected=
1008 -1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
1009 d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=
1010 d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b,
1011 e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]);
1012 j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();
1013 if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(h){return h!=b}),function(h){return h>=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null,
1014 this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this},
1015 load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c,
1016 "cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
1017 url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.16"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k<a.anchors.length?k:0)},b);j&&j.stopPropagation()});e=a._unrotate||(a._unrotate=!e?function(j){j.clientX&&
1018 a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow",h);this.anchors.bind(c.event+".tabs",e);h()}else{clearTimeout(a.rotation);this.element.unbind("tabsshow",h);this.anchors.unbind(c.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
1019 ;/*
1020 * jQuery UI Datepicker 1.8.16
1021 *
1022 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1023 * Dual licensed under the MIT or GPL Version 2 licenses.
1024 * http://jquery.org/license
1025 *
1026 * http://docs.jquery.com/UI/Datepicker
1027 *
1028 * Depends:
1029 * jquery.ui.core.js
1030 */
1031 (function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;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=
1032 "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",
1033 "Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
1034 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:true,showButtonPanel:false,autoSize:false,disabled:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function N(a){return a.bind("mouseout",
1035 function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
1036 b.addClass("ui-state-hover");b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},
1037 setDefaults:function(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,
1038 "\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",
1039 function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c==
1040 "focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():
1041 d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,
1042 b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=
1043 1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/
1044 2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=
1045 d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=
1046 a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,
1047 "datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==
1048 a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?
1049 d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");H(e.settings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C)e.settings.minDate=this._formatDate(e,i);if(g!==null&&f.dateFormat!==C&&f.maxDate===C)e.settings.maxDate=this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e);
1050 this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");
1051 b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]&&d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]);if(a=d.datepicker._get(b,"onSelect")){c=d.datepicker._formatDate(b);a.apply(b.input?b.input[0]:null,[c,b])}else d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,
1052 a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=
1053 a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,
1054 "stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==C?a.keyCode:a.charCode);
1055 return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",
1056 a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value=
1057 "";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);
1058 c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=
1059 true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});
1060 a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&
1061 !a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),
1062 h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=
1063 this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);
1064 this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},
1065 _checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):
1066 0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"?
1067 "Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);
1068 this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");
1069 if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?
1070 b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1<a.length&&a.charAt(A+1)==p)&&A++;return p},m=function(p){var D=
1071 o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).match(p);if(!p)throw"Missing number at position "+q;q+=p[0].length;return parseInt(p[0],10)},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]]}).sort(function(w,x){return-(w[1].length-x[1].length)});var E=-1;d.each(p,function(w,x){w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.length;return false}});if(E!=-1)return E+1;else throw"Unknown name at position "+q;},s=
1072 function(){if(b.charAt(q)!=a.charAt(A))throw"Unexpected literal at position "+q;q++},q=0,A=0;A<a.length;A++)if(k)if(a.charAt(A)=="'"&&!o("'"))k=false;else s();else switch(a.charAt(A)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();j=v.getMonth()+
1073 1;l=v.getDate();break;case "'":if(o("'"))s();else k=true;break;default:s()}if(q<b.length)throw"Extra/unparsed characters found in date: "+b.substring(q);if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",
1074 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:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:
1075 null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},j=function(o,m,n,s){return i(o)?s[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-
1076 (new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=
1077 0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==C?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);
1078 var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;
1079 i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g=
1080 Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>
1081 12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&
1082 a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?
1083 new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));
1084 n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m,
1085 g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&&
1086 a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+B+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
1087 B+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x<i[0];x++){var O=
1088 "";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='<div class="ui-datepicker-group';if(i[1]>1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&
1089 x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+s[r]+'">'+q[r]+"</span></th>"}y+=z+"</tr></thead><tbody>";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,
1090 z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(r.getTime()==
1091 P.getTime()&&g==a.selectedMonth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?"":" "+I[1]+(r.getTime()==u.getTime()?" "+this._currentClass:"")+(r.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+B+".datepicker._selectDay('#"+a.id+"',"+r.getMonth()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?"&#xa0;":L?'<span class="ui-state-default">'+
1092 r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" ui-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+r.getDate()+"</a>")+"</td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+"</tr>"}g++;if(g>11){g=0;m++}y+="</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
1093 "");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" >";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&
1094 (!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&l)?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,
1095 e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" >";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?"&#xa0;":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+
1096 (c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input?
1097 a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c,
1098 e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,
1099 "dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this;
1100 if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a==
1101 "string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery);
1102 ;/*
1103 * jQuery UI Progressbar 1.8.16
1104 *
1105 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1106 * Dual licensed under the MIT or GPL Version 2 licenses.
1107 * http://jquery.org/license
1108 *
1109 * http://docs.jquery.com/UI/Progressbar
1110 *
1111 * Depends:
1112 * jquery.ui.core.js
1113 * jquery.ui.widget.js
1114 */
1115 (function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();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");
1116 this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*
1117 this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.16"})})(jQuery);
1118 ;/*
1119 * jQuery UI Effects 1.8.16
1120 *
1121 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1122 * Dual licensed under the MIT or GPL Version 2 licenses.
1123 * http://jquery.org/license
1124 *
1125 * http://docs.jquery.com/UI/Effects/
1126 */
1127 jQuery.effects||function(f,j){function m(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],
1128 16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return n.transparent;return n[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return m(b)}function o(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
1129 a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function p(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=
1130 a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function l(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor",
1131 "borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=m(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var n={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,
1132 0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,
1133 211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},q=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,
1134 d){if(f.isFunction(b)){d=b;b=null}return this.queue(function(){var e=f(this),g=e.attr("style")||" ",h=p(o.call(this)),r,v=e.attr("class");f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});r=p(o.call(this));e.attr("class",v);e.animate(u(h,r),{queue:false,duration:a,easing:b,complete:function(){f.each(q,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments);f.dequeue(this)}})})};
1135 f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,
1136 [{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.16",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case "top":b=
1137 0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),
1138 d=document.activeElement;c.wrap(b);if(c[0]===d||f.contains(c[0],d))f(d).focus();b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(e,g){a[g]=c.css(g);if(isNaN(parseInt(a[g],10)))a[g]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){var a,b=document.activeElement;
1139 if(c.parent().is(".ui-effects-wrapper")){a=c.parent().replaceWith(c);if(c[0]===b||f.contains(c[0],b))f(b).focus();return a}return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});
1140 return d.call(this,b)},_show:f.fn.show,show:function(c){if(l(c))return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(l(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(l(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,
1141 arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/
1142 2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,
1143 d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,
1144 a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,
1145 d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=
1146 0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;
1147 if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,
1148 a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
1149 ;/*
1150 * jQuery UI Effects Blind 1.8.16
1151 *
1152 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1153 * Dual licensed under the MIT or GPL Version 2 licenses.
1154 * http://jquery.org/license
1155 *
1156 * http://docs.jquery.com/UI/Effects/Blind
1157 *
1158 * Depends:
1159 * jquery.effects.core.js
1160 */
1161 (function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,
1162 g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
1163 ;/*
1164 * jQuery UI Effects Bounce 1.8.16
1165 *
1166 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1167 * Dual licensed under the MIT or GPL Version 2 licenses.
1168 * http://jquery.org/license
1169 *
1170 * http://docs.jquery.com/UI/Effects/Bounce
1171 *
1172 * Depends:
1173 * jquery.effects.core.js
1174 */
1175 (function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/
1176 3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
1177 b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)})}a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery);
1178 ;/*
1179 * jQuery UI Effects Clip 1.8.16
1180 *
1181 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1182 * Dual licensed under the MIT or GPL Version 2 licenses.
1183 * http://jquery.org/license
1184 *
1185 * http://docs.jquery.com/UI/Effects/Clip
1186 *
1187 * Depends:
1188 * jquery.effects.core.js
1189 */
1190 (function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","bottom","left","right","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position,
1191 c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);
1192 ;/*
1193 * jQuery UI Effects Drop 1.8.16
1194 *
1195 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1196 * Dual licensed under the MIT or GPL Version 2 licenses.
1197 * http://jquery.org/license
1198 *
1199 * http://docs.jquery.com/UI/Effects/Drop
1200 *
1201 * Depends:
1202 * jquery.effects.core.js
1203 */
1204 (function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e==
1205 "show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
1206 ;/*
1207 * jQuery UI Effects Explode 1.8.16
1208 *
1209 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1210 * Dual licensed under the MIT or GPL Version 2 licenses.
1211 * http://jquery.org/license
1212 *
1213 * http://docs.jquery.com/UI/Effects/Explode
1214 *
1215 * Depends:
1216 * jquery.effects.core.js
1217 */
1218 (function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop"),10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true),i=b.outerHeight(true),e=0;e<c;e++)for(var f=
1219 0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+
1220 e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery);
1221 ;/*
1222 * jQuery UI Effects Fade 1.8.16
1223 *
1224 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1225 * Dual licensed under the MIT or GPL Version 2 licenses.
1226 * http://jquery.org/license
1227 *
1228 * http://docs.jquery.com/UI/Effects/Fade
1229 *
1230 * Depends:
1231 * jquery.effects.core.js
1232 */
1233 (function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
1234 ;/*
1235 * jQuery UI Effects Fold 1.8.16
1236 *
1237 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1238 * Dual licensed under the MIT or GPL Version 2 licenses.
1239 * http://jquery.org/license
1240 *
1241 * http://docs.jquery.com/UI/Effects/Fold
1242 *
1243 * Depends:
1244 * jquery.effects.core.js
1245 */
1246 (function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],
1247 10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
1248 ;/*
1249 * jQuery UI Effects Highlight 1.8.16
1250 *
1251 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1252 * Dual licensed under the MIT or GPL Version 2 licenses.
1253 * http://jquery.org/license
1254 *
1255 * http://docs.jquery.com/UI/Effects/Highlight
1256 *
1257 * Depends:
1258 * jquery.effects.core.js
1259 */
1260 (function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&
1261 this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
1262 ;/*
1263 * jQuery UI Effects Pulsate 1.8.16
1264 *
1265 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1266 * Dual licensed under the MIT or GPL Version 2 licenses.
1267 * http://jquery.org/license
1268 *
1269 * http://docs.jquery.com/UI/Effects/Pulsate
1270 *
1271 * Depends:
1272 * jquery.effects.core.js
1273 */
1274 (function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
1275 a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
1276 ;/*
1277 * jQuery UI Effects Scale 1.8.16
1278 *
1279 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1280 * Dual licensed under the MIT or GPL Version 2 licenses.
1281 * http://jquery.org/license
1282 *
1283 * http://docs.jquery.com/UI/Effects/Scale
1284 *
1285 * Depends:
1286 * jquery.effects.core.js
1287 */
1288 (function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options.percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.options,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c.extend(true,{},b.options),g=c.effects.setMode(a,
1289 b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||["middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b.options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i!="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options.fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity=
1290 1;a.to.opacity=0}}e.from=a.from;e.to=a.to;e.mode=g;a.effect("size",e,b.duration,b.callback);a.dequeue()})};c.effects.size=function(b){return this.queue(function(){var a=c(this),e=["position","top","bottom","left","right","width","height","overflow","opacity"],g=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],i=["fontSize"],f=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],k=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],
1291 p=c.effects.setMode(a,b.options.mode||"effect"),n=b.options.restore||false,m=b.options.scale||"both",l=b.options.origin,j={height:a.height(),width:a.width()};a.from=b.options.from||j;a.to=b.options.to||j;if(l){l=c.effects.getBaseline(l,j);a.from.top=(j.height-a.from.height)*l.y;a.from.left=(j.width-a.from.width)*l.x;a.to.top=(j.height-a.to.height)*l.y;a.to.left=(j.width-a.to.width)*l.x}var d={from:{y:a.from.height/j.height,x:a.from.width/j.width},to:{y:a.to.height/j.height,x:a.to.width/j.width}};
1292 if(m=="box"||m=="both"){if(d.from.y!=d.to.y){e=e.concat(f);a.from=c.effects.setTransition(a,f,d.from.y,a.from);a.to=c.effects.setTransition(a,f,d.to.y,a.to)}if(d.from.x!=d.to.x){e=e.concat(k);a.from=c.effects.setTransition(a,k,d.from.x,a.from);a.to=c.effects.setTransition(a,k,d.to.x,a.to)}}if(m=="content"||m=="both")if(d.from.y!=d.to.y){e=e.concat(i);a.from=c.effects.setTransition(a,i,d.from.y,a.from);a.to=c.effects.setTransition(a,i,d.to.y,a.to)}c.effects.save(a,n?e:g);a.show();c.effects.createWrapper(a);
1293 a.css("overflow","hidden").css(a.from);if(m=="content"||m=="both"){f=f.concat(["marginTop","marginBottom"]).concat(i);k=k.concat(["marginLeft","marginRight"]);h=e.concat(f).concat(k);a.find("*[width]").each(function(){child=c(this);n&&c.effects.save(child,h);var o={height:child.height(),width:child.width()};child.from={height:o.height*d.from.y,width:o.width*d.from.x};child.to={height:o.height*d.to.y,width:o.width*d.to.x};if(d.from.y!=d.to.y){child.from=c.effects.setTransition(child,f,d.from.y,child.from);
1294 child.to=c.effects.setTransition(child,f,d.to.y,child.to)}if(d.from.x!=d.to.x){child.from=c.effects.setTransition(child,k,d.from.x,child.from);child.to=c.effects.setTransition(child,k,d.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){n&&c.effects.restore(child,h)})})}a.animate(a.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity",a.from.opacity);p=="hide"&&a.hide();c.effects.restore(a,
1295 n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
1296 ;/*
1297 * jQuery UI Effects Shake 1.8.16
1298 *
1299 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1300 * Dual licensed under the MIT or GPL Version 2 licenses.
1301 * http://jquery.org/license
1302 *
1303 * http://docs.jquery.com/UI/Effects/Shake
1304 *
1305 * Depends:
1306 * jquery.effects.core.js
1307 */
1308 (function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]=
1309 (h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);
1310 ;/*
1311 * jQuery UI Effects Slide 1.8.16
1312 *
1313 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1314 * Dual licensed under the MIT or GPL Version 2 licenses.
1315 * http://jquery.org/license
1316 *
1317 * http://docs.jquery.com/UI/Effects/Slide
1318 *
1319 * Depends:
1320 * jquery.effects.core.js
1321 */
1322 (function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e);
1323 var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
1324 ;/*
1325 * jQuery UI Effects Transfer 1.8.16
1326 *
1327 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
1328 * Dual licensed under the MIT or GPL Version 2 licenses.
1329 * http://jquery.org/license
1330 *
1331 * http://docs.jquery.com/UI/Effects/Transfer
1332 *
1333 * Depends:
1334 * jquery.effects.core.js
1335 */
1336 (function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments);
1337 b.dequeue()})})}})(jQuery);
1338 ;
1357 (function($) {
1358 if ($.browser.mozilla) {
1359 $.fn.disableTextSelect = function() {
1360 return this.each(function() {
1361 $(this).css({
1362 'MozUserSelect' : 'none'
1363 });
1364 });
1365 };
1366 $.fn.enableTextSelect = function() {
1367 return this.each(function() {
1368 $(this).css({
1369 'MozUserSelect' : ''
1370 });
1371 });
1372 };
1373 } else if ($.browser.msie) {
1374 $.fn.disableTextSelect = function() {
1375 return this.each(function() {
1376 $(this).bind('selectstart.disableTextSelect', function() {
1377 return false;
1378 });
1379 });
1380 };
1381 $.fn.enableTextSelect = function() {
1382 return this.each(function() {
1383 $(this).unbind('selectstart.disableTextSelect');
1384 });
1385 };
1386 } else {
1387 $.fn.disableTextSelect = function() {
1388 return this.each(function() {
1389 $(this).bind('mousedown.disableTextSelect', function() {
1390 return false;
1391 });
1392 });
1393 };
1394 $.fn.enableTextSelect = function() {
1395 return this.each(function() {
1396 $(this).unbind('mousedown.disableTextSelect');
1397 });
1398 };
1399 }
1400 })(jQuery);
1401 var dropdown_block_class = function( element , options )
1402 {
1403 this._element = jQuery( element );
1404 this._block_name = 'block-' + ( ++dropdown_block_class.blockId );
1405 this.init( options );
1406 }
1407
1408 dropdown_block_class.blockId = 0;
1409
1410 dropdown_block_class.prototype.init = function( options )
1411 {
1412 var obj = this;
1413
1414 var ExtClass = '';
1415 if( options.ext_class )
1416 {
1417 ExtClass = ' ' + options.ext_class;
1418 }
1419
1420 jQuery( this._element ).after( '<div class="popup_block_panel' + ExtClass + '" style="position:absolute; display:none;" id="' + this._block_name + '">' + options.content + '</div>' );
1421
1422 jQuery( this._element ).mouseover(
1423 function( evt )
1424 {
1425 var position = jQuery( obj._element ).position();
1426 var height = jQuery( obj._element ).outerHeight( true );
1427
1428 jQuery( '#' + obj._block_name ).css( 'left' , position.left );
1429 jQuery( '#' + obj._block_name ).css( 'top' , position.top + height - 1 );
1430 jQuery( '#' + obj._block_name ).css( 'display' , 'block' );
1431 }
1432 );
1433
1434 jQuery( document ).mousemove(
1435 function( evt )
1436 {
1437 var offset = jQuery( obj._element ).offset();
1438 var height = jQuery( obj._element ).outerHeight( true );
1439 var width = jQuery( obj._element ).outerWidth( true );
1440
1441 if( offset.left <= evt.pageX && evt.pageX <= offset.left + width && offset.top <= evt.pageY && evt.pageY <= offset.top + height )
1442 {
1443 return;
1444 }
1445
1446 offset = jQuery( obj._element ).next().offset();
1447 height = jQuery( obj._element ).next().outerHeight( true );
1448 width = jQuery( obj._element ).next().outerWidth( true );
1449
1450 if( offset.left <= evt.pageX && evt.pageX <= offset.left + width && offset.top <= evt.pageY && evt.pageY <= offset.top + height )
1451 {
1452 return;
1453 }
1454
1455 jQuery( obj._element ).next().css( 'display' , 'none' );
1456 }
1457 );
1458 }
1459
1460 jQuery.fn.dropdown_block = function( options )
1461 {
1462 options = jQuery.extend(
1463 {
1464 content : 'empty'
1465 } ,
1466 options
1467 );
1468
1469 if( this.length == 0 )
1470 {
1471 result = false;
1472 }
1473 else if( this.length == 1 )
1474 {
1475 result = new dropdown_block_class( jQuery( this ) , options );
1476 }
1477 else
1478 {
1479 result = [];
1480
1481 for( i = 0 ; i < this.length ; i++ )
1482 {
1483 result.push( new dropdown_block_class( jQuery( this[ i ] ) , options ) );
1484 }
1485 }
1486
1487 return( result );
1488 }
1494 if( !ultimix )
1495 {
1496 var ultimix = {};
1497 }
1498
1499 jQuery.extend(
1500 ultimix ,
1501 {
1502 timer_widget : function( element , options )
1503 {
1504 this._element = element;
1505 this.timeout = options.timeout;
1506 this.timeout_callback = options.timeout_callback;
1507
1508 this.init();
1509 }
1510 }
1511 );
1512
1513 ultimix.timer_widget.prototype._prepending_zero = function( Value )
1514 {
1515 if( Value < 10 )
1516 {
1517 return( '0' + Value );
1518 }
1519 else
1520 {
1521 return( '' + Value );
1522 }
1523 }
1524
1525 ultimix.timer_widget.prototype.init = function()
1526 {
1527 obj = this;
1528 this.set_timer( this.timeout );
1529 this.timeout_callback_was_launched = false;
1530
1531 this.start_time = Math.floor( ( new Date() ).getTime() / 1000 );
1532 window.setInterval( function(){ obj.on_tick( obj ) } , 1000 );
1533 }
1534
1535 ultimix.timer_widget.prototype.set_timer = function( Time )
1536 {
1537 Hours = Math.floor( Time / ( 60 * 60 ) );
1538 Minutes = Math.floor( Time / 60 - Hours * 60 );
1539 Seconds = Math.floor( Time - Hours * 60 * 60 - Minutes * 60 );
1540 jQuery( this._element ).empty();
1541 jQuery( this._element ).append( '<span class="hours">' + this._prepending_zero( Hours ) + '</span>:<span class="minutes">' + this._prepending_zero( Minutes ) + '</span>:<span class="seconds">' + this._prepending_zero( Seconds ) + '</span>' );
1542 }
1543
1544 ultimix.timer_widget.prototype.on_tick = function( obj )
1545 {
1546 Diff = Math.floor( ( new Date() ).getTime() / 1000 ) - obj.start_time;
1547 if( obj.timeout - Diff > 0 )
1548 {
1549 obj.set_timer( obj.timeout - Diff );
1550 }
1551 else
1552 {
1553 obj.set_timer( 0 );
1554 if( obj.timeout_callback_was_launched == false )
1555 {
1556 if( obj.timeout_callback )
1557 {
1558 obj.timeout_callback();
1559 }
1560 obj.timeout_callback_was_launched = true;
1561 }
1562 }
1563 }
1564
1565 jQuery.fn.timer_widget = function( options )
1566 {
1567 options = jQuery.extend(
1568 {
1569 timeout : 600 , /*in seconds*/
1570 timeout_callback : false
1571 } ,
1572 options
1573 );
1574
1575 return this.each(
1576 function()
1577 {
1578 new ultimix.timer_widget( jQuery( this ) , options );
1579 }
1580 );
1581 }
1582
1583 function create_timer( element , options )
1584 {
1585 jQuery( document ).ready(
1586 function()
1587 {
1588 new ultimix.timer_widget( jQuery( element ) , options );
1589 }
1590 );
1591 }
1597 if( !ultimix )
1598 {
1599 ultimix = {};
1600 }
1601
1611 ultimix.ToggleElement = function( ElementId , Speed )
1612 {
1613 jQuery( '#' + ElementId ).toggle( Speed );
1614 }
1620 if( !ultimix.select_extractor )
1621 {
1622 ultimix.select_extractor = {};
1623 }
1624
1636 ultimix.select_extractor.SetData = function( Items , Value )
1637 {
1638 for( var i = 0 ; i < Items.length ; i++ )
1639 {
1640 if( jQuery( Items[ i ] ).prop( 'tagName' ) == 'INPUT' ||
1641 jQuery( Items[ i ] ).prop( 'tagName' ) == 'TEXTAREA' )
1642 {
1643 jQuery( Items[ i ] ).val( Value );
1644 continue;
1645 }
1646 if( jQuery( Items[ i ] ).prop( 'tagName' ) == 'SPAN' ||
1647 jQuery( Items[ i ] ).prop( 'tagName' ) == 'DIV' ||
1648 jQuery( Items[ i ] ).prop( 'tagName' ) == 'A' )
1649 {
1650 jQuery( Items[ i ] ).html( Value );
1651 continue;
1652 }
1653 }
1654 }
1655
1667 ultimix.select_extractor.ExtractSimpleSelectResult = function( AcceptorSelector , StatusSelector , DataSource )
1668 {
1669 var Radios = jQuery( 'input[name=' + DataSource + ']:radio' );
1670
1671 for( var i = 0 ; i < Radios.length ; i++ )
1672 {
1673 if( jQuery( Radios[ i ] ).attr( 'checked' ) )
1674 {
1675 Value = jQuery( Radios[ i ] ).attr( 'value' );
1676 var Items = jQuery( AcceptorSelector );
1677 ultimix.SetData( Items , Value );
1678
1679 Status = jQuery( '[for=' + jQuery( Radios[ i ] ).attr( 'id' ) + ']' ).html();
1680 Items = jQuery( StatusSelector );
1681 ultimix.SetData( Items , Status );
1682
1683 return( true );
1684 }
1685 }
1686
1687 return( false );
1688 }
1689
1690 jQuery(
1691 function()
1692 {
1693 jQuery( ".accordion" ).accordion(
1694 {
1695 'fillSpace' : true
1696 }
1697 );
1698 }
1699 );
1700 /* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
1701 /* Written by Andrew Stromnov (stromnov@gmail.com). */
1702 jQuery(function($){
1703 $.datepicker.regional['ru'] = {
1704 closeText: 'Закрыть',
1705 prevText: '&#x3c;Пред',
1706 nextText: 'След&#x3e;',
1707 currentText: 'Сегодня',
1708 monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
1709 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
1710 monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
1711 'Июл','Авг','Сен','Окт','Ноя','Дек'],
1712 dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
1713 dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
1714 dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
1715 dateFormat: 'dd.mm.yy', firstDay: 1,
1716 isRTL: false};
1717 $.datepicker.setDefaults($.datepicker.regional['ru']);
1718 });
1724 if( !ultimix )
1725 {
1726 ultimix = {};
1727 }
1728
1734 if( !ultimix.wizard )
1735 {
1736 ultimix.wizard = {};
1737 }
1738
1744 ultimix.wizard.Steps = new Array();
1745
1751 ultimix.wizard.CurrentStep = -1;
1752
1764 ultimix.wizard._CreateWizardDialogs = function( RawSteps , SuccessFunction , DialogOptions )
1765 {
1766 ultimix.wizard.Steps = RawSteps;
1767
1768 DialogOptions = jQuery.extend(
1769 {
1770 width : 640 ,
1771 height : 480 ,
1772 modal : true ,
1773 autoOpen : true ,
1774 resizable : false ,
1775 closeOnEscape : false ,
1776 title : ''
1777 } ,
1778 DialogOptions
1779 );
1780 DialogOptions.autoOpen = false;
1781 if( DialogOptions.title )
1782 {
1783 DialogOptions.title = ultimix.get_string( DialogOptions.title );
1784 }
1785
1786 for( var i = 0 ; i < ultimix.wizard.Steps.length ; i++ )
1787 {
1788 var Buttons = new Array();
1789 var CurrentSelector = ultimix.wizard.Steps[ i ].selector;
1790
1791 if( i + 1 < ultimix.wizard.Steps.length )
1792 {
1793 var CreateNextButton = function( i , CurrentSelector )
1794 {
1795 return(
1796 function()
1797 {
1798 jQuery( CurrentSelector ).dialog( 'close' );
1799 jQuery( ultimix.wizard.Steps[ i + 1 ].selector ).dialog( 'open' );
1800 jQuery( ultimix.wizard.Steps[ i + 1 ].selector ).dialog( 'option' , 'title' , DialogOptions.title + ' ' + ultimix.get_string( 'step' ) + ' ' + ( i + 2 ) + ' ' + ultimix.get_string( 'of' ) + ' ' + ultimix.wizard.Steps.length );
1801 }
1802 );
1803 }
1804 Buttons[ ultimix.get_string( 'Next' ) ] = CreateNextButton( i , CurrentSelector );
1805 }
1806
1807 if( i + 1 == ultimix.wizard.Steps.length )
1808 {
1809 var CreateFinishButton = function( i , CurrentSelector )
1810 {
1811 return(
1812 function()
1813 {
1814 SuccessFunction();
1815 jQuery( CurrentSelector ).dialog( 'close' );
1816 }
1817 );
1818 }
1819 Buttons[ ultimix.get_string( 'Finish' ) ] = CreateFinishButton( i , CurrentSelector );
1820 }
1821
1822 if( i > 0 )
1823 {
1824 var CreateBackButton = function( i , CurrentSelector )
1825 {
1826 return(
1827 function()
1828 {
1829 jQuery( CurrentSelector ).dialog( 'close' );
1830 jQuery( ultimix.wizard.Steps[ i - 1 ].selector ).dialog( 'open' );
1831 jQuery( ultimix.wizard.Steps[ i - 1 ].selector ).dialog( 'option' , 'title' , DialogOptions.title + ' ' + ultimix.get_string( 'step' ) + ' ' + i + ' ' + ultimix.get_string( 'of' ) + ' ' + ultimix.wizard.Steps.length );
1832 }
1833 );
1834 }
1835 Buttons[ ultimix.get_string( 'Back' ) ] = CreateBackButton( i , CurrentSelector );
1836 }
1837
1838 var CreateCancelButton = function( CurrentSelector )
1839 {
1840 return(
1841 function()
1842 {
1843 jQuery( CurrentSelector ).dialog( 'close' );
1844 }
1845 );
1846 };
1847 Buttons[ ultimix.get_string( 'Cancel' ) ] = CreateCancelButton( CurrentSelector );
1848
1849 DialogOptions.buttons = Buttons;
1850
1851 jQuery( ultimix.wizard.Steps[ i ].selector ).dialog( DialogOptions );
1852 }
1853 }
1854
1866 ultimix.wizard.Wizard = function( RawSteps , SuccessFunction , DialogOptions )
1867 {
1868 ultimix.wizard.CurrentStep = -1;
1869
1870 ultimix.wizard._CreateWizardDialogs( RawSteps , SuccessFunction , DialogOptions );
1871
1872 jQuery( ultimix.wizard.Steps[ 0 ].selector ).dialog( 'open' );
1873
1874 jQuery( ultimix.wizard.Steps[ 0 ].selector ).dialog( 'option' , 'title' , DialogOptions.title + ' ' + ultimix.get_string( 'step' ) + ' ' + 1 + ' ' + ultimix.get_string( 'of' ) + ' ' + ultimix.wizard.Steps.length );
1875 }
1876
1882 if( !ultimix )
1883 {
1884 ultimix = {};
1885 }
1886
1896 ultimix.IframeDialogInit = function( DivSelector , Url )
1897 {
1898 jQuery( '#' + DivSelector ).html( '<iframe style="border:0px; width: 100%; height: 100%;" src="' + Url + '"></iframe>' );
1899
1900 return( true );
1901 }
1902
1910 ultimix.IframeDialogOnOpen = function( DivSelector )
1911 {
1912 jQuery( '#' + DivSelector ).attr( 'style' , 'padding: 0px; ' + jQuery( '#' + DivSelector ).attr( 'style' ) );
1913 }
1919 if( !ultimix )
1920 {
1921 ultimix = {};
1922 }
1923
1929 if( !ultimix.dialog )
1930 {
1931 ultimix.dialog = {};
1932 }
1933
1951 ultimix.dialog.AddOpener = function( Opener , Selector , DataAcceptor , StatusAcceptor , DataSource , BeforeOpenValidation )
1952 {
1953 if( Opener )
1954 {
1955 if( jQuery( Opener ).length )
1956 {
1957 var Items = jQuery( Opener );
1958
1959 for( var i = 0 ; i < Items.length ; i++ )
1960 {
1961 var OpenDialogFunction = function()
1962 {
1963 ultimix.dialog.OpenDialog( Selector , DataAcceptor , StatusAcceptor , DataSource , BeforeOpenValidation );
1964 }
1965
1966 jQuery( Items[ i ] ).unbind( 'click' );
1967 jQuery( Items[ i ] ).click( OpenDialogFunction );
1968
1969 if( jQuery( Items[ i ] ).attr( 'tagName' ) == 'A' )
1970 {
1971 jQuery( Items[ i ] ).attr( 'href' , '#' );
1972 }
1973
1974 if( jQuery( Items[ i ] ).attr( 'tagName' ) == 'INPUT' || jQuery( Items[ i ] ).attr( 'tagName' ) == 'TEXTAREA' )
1975 {
1976 jQuery( Items[ i ] ).unbind( 'focus' );
1977 jQuery( Items[ i ] ).focus( OpenDialogFunction );
1978 }
1979 }
1980 }
1981 }
1982 }
1983
1999 ultimix.dialog.OpenDialog = function( Selector , DataAcceptor , StatusAcceptor , DataSource , BeforeOpenValidation )
2000 {
2001 jQuery( Selector ).attr( 'data_acceptor' , DataAcceptor );
2002 jQuery( Selector ).attr( 'status_acceptor' , StatusAcceptor );
2003 jQuery( Selector ).attr( 'data_source' , DataSource );
2004
2005 if( BeforeOpenValidation && BeforeOpenValidation() == false )
2006 {
2007 return;
2008 }
2009
2010 scroll( 0 , 0 );
2011 jQuery( Selector ).dialog( 'open' );
2012 jQuery( Selector ).dialog( { position: [ 'center' , 'center' ] } );
2013 }
2014
2024 ultimix.dialog.ShowDomInDialog = function( Selector , Title )
2025 {
2026 jQuery( Selector ).dialog(
2027 {
2028 'title' : Title ,
2029 'width' : 'auto' ,
2030 'maxWidth' : '960' ,
2031 'height' : '500' ,
2032 'modal' : true ,
2033 'buttons' : [
2034 {
2035 text: "OK",
2036 click: function()
2037 {
2038 jQuery( this ).dialog( 'close' );
2039 }
2040 }
2041 ]
2042 }
2043 );
2044 }
2050 if( !ultimix )
2051 {
2052 ultimix = {};
2053 }
2054
2060 if( !ultimix.tab_control )
2061 {
2062 ultimix.tab_control = {};
2063 ultimix.tab_control.TabCounter = 1;
2064 ultimix.tab_control.AddTabFlag = 0;
2065 ultimix.tab_control.AddContentId = '_unexisting_id';
2066 ultimix.tab_control.InitialTabWasDeleted = new Array();
2067 }
2068
2076 ultimix.tab_control.TabControlCreateSetup = function( ControlId )
2077 {
2078 jQuery( '#' + ControlId ).tabs(
2079 {
2080 select : function( event , ui )
2081 {
2082 if( ultimix.tab_control.AddTabFlag == 0 )
2083 {
2084 SetCookie( ControlId + '-active-tab-id' , ui.tab.hash.replace( '#' , '' ) , 365 );
2085 return;
2086 }
2087 ultimix.tab_control.AddTabFlag = 0;
2088 }
2089 }
2090 );
2091
2092 ultimix.tab_control.SetAddTabHandler( ControlId );
2093 }
2094
2102 ultimix.tab_control.CreateTab = function( ControlId )
2103 {
2104 var TabId = 'tabs' + ultimix.tab_control.TabCounter++;
2105 jQuery( '#' + ControlId ).html( '<ul><li><a href="#' + TabId + '"></a></li></ul><div id="' + TabId + '"></div>' );
2106
2107 jQuery( '#' + ControlId ).tabs();
2108
2109 ultimix.tab_control.TabControlCreateSetup( ControlId );
2110
2111 ultimix.tab_control.InitialTabWasDeleted[ ControlId ] = false;
2112 }
2113
2121 ultimix.tab_control.OnCloseTab = function( ControlId )
2122 {
2123 var index = jQuery( 'li' , jQuery( '#' + ControlId ) ).index( jQuery( this ).parent() );
2124 jQuery( '#' + ControlId ).tabs( 'remove' , index );
2125 }
2126
2136 ultimix.tab_control.SetClosable = function( ControlId , TabCursor )
2137 {
2138 if( TabCursor )
2139 {
2140 var Item = jQuery( '#' + ControlId + '>.ui-tabs-nav>li>a' ).eq( TabCursor );
2141 }
2142 else
2143 {
2144 var Item = jQuery( '#' + ControlId + '>.ui-tabs-nav>li>a' ).last();
2145 }
2146
2147 if( jQuery( Item ).next().length )
2148 {
2149 jQuery( Item ).next().remove();
2150 }
2151
2152 jQuery( Item ).after( '<span class="ui-icon ui-icon-close" onclick="ultimix.tab_control.OnCloseTab( \''+ControlId+'\' );">Remove Tab</span>' );
2153 }
2154
2162 ultimix.tab_control.TryAutoSelectTab = function( ControlId )
2163 {
2164 var ActiveTabId = GetCookie( ControlId + '-active-tab-id' , 'tabs1' );
2165
2166 if( jQuery( '#' + ControlId ).find( '#' + ActiveTabId ).length )
2167 {
2168 var Items = jQuery( '#' + ControlId + '>.ui-tabs-nav>li>a' );
2169 for( var i = 0 ; i < Items.length ; i++ )
2170 {
2171 if( jQuery( Items[ i ] ).attr( 'href' ) == '#' + ActiveTabId )
2172 {
2173 jQuery( '#' + ControlId ).tabs( "select" , i );
2174 ultimix.tab_control.AddTabFlag = 0;
2175 }
2176 }
2177 }
2178 }
2179
2187 ultimix.tab_control.SetAddTabHandler = function( ControlId )
2188 {
2189 jQuery( '#' + ControlId ).tabs(
2190 'option' , 'add' ,
2191 function( event , ui )
2192 {
2193 jQuery( ui.panel ).append( jQuery( '#' + ultimix.tab_control.AddContentId ) );
2194
2195 ultimix.tab_control.TryAutoSelectTab( ControlId );
2196 }
2197 );
2198 }
2199
2213 ultimix.tab_control.AddSimpleTab = function( ControlId , Title , Index , ContentId )
2214 {
2215 /* Informing the script that we are additing tabs and there is no need to update cookie */
2216 ultimix.tab_control.AddTabFlag = 1;
2217 ultimix.tab_control.AddContentId = ContentId;
2218
2219 var TabSelector = '#tabs' + ( ultimix.tab_control.TabCounter++ );
2220
2221 if( Index >= 0 )
2222 {
2223 jQuery( '#' + ControlId ).tabs( 'add' , TabSelector , ultimix.get_string( Title ) , Index );
2224 }
2225 else
2226 {
2227 jQuery( '#' + ControlId ).tabs( 'add' , TabSelector , ultimix.get_string( Title ) );
2228 }
2229 }
2230
2244 ultimix.tab_control.AddSimpleTabFromContent = function( ControlId , Title , Index , Content )
2245 {
2246 var ContentId = "content_" + ultimix.core.GetCurrentMilliseconds();
2247
2248 jQuery( 'body' ).append( '<div id="' + ContentId + '">' + Content + '</div>' );
2249
2250 ultimix.tab_control.AddSimpleTab( ControlId , Title , Index , ContentId );
2251 }
2252
2268 ultimix.tab_control.AddTab = function( ControlId , Title , Index , ContentId , Closable )
2269 {
2270 ultimix.tab_control.AddSimpleTab( ControlId , Title , Index , ContentId );
2271
2272 if( ultimix.tab_control.InitialTabWasDeleted[ ControlId ] == false )
2273 {
2274 jQuery( '#' + ControlId ).tabs( 'remove' , 0 );
2275 ultimix.tab_control.InitialTabWasDeleted[ ControlId ] = true;
2276 }
2277
2278 if( Closable )
2279 {
2280 ultimix.tab_control.SetClosable( ControlId );
2281 }
2282 }
2283
2299 ultimix.tab_control.AddTabFromContent = function( ControlId , Title , Index , Content , Closable )
2300 {
2301 var ContentId = "content_" + ultimix.core.GetCurrentMilliseconds();
2302
2303 jQuery( 'body' ).append( '<div id="' + ContentId + '">' + Content + '</div>' );
2304
2305 ultimix.tab_control.AddTab( ControlId , Title , Index , ContentId , Closable );
2306 }
2307
2325 ultimix.tab_control.AddIFrameTab = function( ControlId , Title , Index , URL , Closable , Height )
2326 {
2327 var TabFrameId = ultimix.tab_control.TabCounter++;
2328
2329 jQuery( 'body' ).append( '<iframe style="width: 100%; border: 0px; height: ' + Height + ';" id="tab_frame_' +
2330 TabFrameId + '" src="' + URL + '"></iframe>' );
2331
2332 ultimix.tab_control.AddTab( ControlId , Title , Index , "tab_frame_" + TabFrameId , Closable )
2333 }
2334
2342 ultimix.tab_control.CreateTabControlFromMarkup = function( ControlId )
2343 {
2344 jQuery( '#' + ControlId ).tabs();
2345
2346 ultimix.tab_control.TabControlCreateSetup( ControlId );
2347 }
2348
2364 ultimix.tab_control.CreateTabControlWithTab = function( ParentSelector , ControlId , Title , Content , Closable )
2365 {
2366 /* preparing markup */
2367 jQuery( ParentSelector ).append(
2368 '<div id="' + ControlId +
2369 '"><ul><li><a href="#tabs-1">' + Title + '</a></li></ul><div id="tabs-1">' + Content + '</div></div>'
2370 );
2371
2372 /* creating tab */
2373 ultimix.tab_control.CreateTabControlFromMarkup( ControlId );
2374
2375 if( Closable )
2376 {
2377 ultimix.tab_control.SetClosable( ControlId );
2378 }
2379 }
2380
2398 ultimix.tab_control.AddTabForExistingControl = function( ParentSelector , ControlId , Title , Index , Content , Closable )
2399 {
2400 if( jQuery( '#' + ControlId ).length )
2401 {
2402 /* control exists */
2403 ultimix.tab_control.AddTabFromContent( ControlId , Title , Index , Content , Closable );
2404 }
2405 else
2406 {
2407 /* control does not exist */
2408 ultimix.tab_control.CreateTabControlWithTab( ParentSelector , ControlId , Title , Content , Closable );
2409 }
2410 }
2411
2431 ultimix.tab_control.AddIFrameTabForExistingControl = function( ParentSelector , ControlId , Title , Index , URL , Closable , Height )
2432 {
2433 if( jQuery( '#' + ControlId ).length )
2434 {
2435 /* control exists */
2436 ultimix.tab_control.AddIFrameTab( ControlId , Title , Index , URL , Closable , Height );
2437 }
2438 else
2439 {
2440 var ContentId = "content_" + ultimix.core.GetCurrentMilliseconds();
2441
2442 /* control does not exist */
2443 var Content = '<iframe style="width: 100%; border: 0px; height: ' + Height + ';" id="tab_frame_' +
2444 TabFrameId + '" src="' + URL + '"></iframe>';
2445
2446 ultimix.tab_control.CreateTabControlWithTab( ParentSelector , ControlId , Title , Content , Closable );
2447 }
2448 }
2454 if( !ultimix )
2455 {
2456 ultimix = {};
2457 }
2458
2464 if( !ultimix.print )
2465 {
2466 ultimix.print = {};
2467 }
2468
2474 ultimix.print.PrintPage = function()
2475 {
2476 window.print();
2477 }
2478
2479 jQuery(
2480 function()
2481 {
2482 if( jQuery( '.auto_print' ).length > 0 )
2483 {
2484 ultimix.print.PrintPage();
2485 }
2486 }
2487 );
2543 jQuery.cookie = function(name, value, options) {
2544 if (typeof value != 'undefined') { // name and value given, set cookie
2545 options = options || {};
2546 if (value === null) {
2547 value = '';
2548 options.expires = -1;
2549 }
2550 var expires = '';
2551 if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
2552 var date;
2553 if (typeof options.expires == 'number') {
2554 date = new Date();
2555 date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
2556 } else {
2557 date = options.expires;
2558 }
2559 expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
2560 }
2561 // CAUTION: Needed to parenthesize options.path and options.domain
2562 // in the following expressions, otherwise they evaluate to undefined
2563 // in the packed version for some reason...
2564 var path = options.path ? '; path=' + (options.path) : '';
2565 var domain = options.domain ? '; domain=' + (options.domain) : '';
2566 var secure = options.secure ? '; secure' : '';
2567 document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
2568 } else { // only name given, get cookie
2569 var cookieValue = null;
2570 if (document.cookie && document.cookie != '') {
2571 var cookies = document.cookie.split(';');
2572 for (var i = 0; i < cookies.length; i++) {
2573 var cookie = jQuery.trim(cookies[i]);
2574 // Does this cookie string begin with the name we want?
2575 if (cookie.substring(0, name.length + 1) == (name + '=')) {
2576 cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
2577 break;
2578 }
2579 }
2580 }
2581 return cookieValue;
2582 }
2583 };
2584 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'system_settings' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'system_settings' ] = {};
2585 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'system_settings' ][ 'default' ] = 'Настройки системы';
2586 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'system_settings_label' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'system_settings_label' ] = {};
2587 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'system_settings_label' ][ 'default' ] = 'Настройки<br>системы';
2588 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'settings_were_saved' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'settings_were_saved' ] = {};
2589 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'settings_were_saved' ][ 'default' ] = 'Настройки были сохранены';
2590 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'form_manifest_was_not_found' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'form_manifest_was_not_found' ] = {};
2591 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'form_manifest_was_not_found' ][ 'default' ] = 'Манифест не был найден';
2592 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'illegal_setting_type' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'illegal_setting_type' ] = {};
2593 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'illegal_setting_type' ][ 'default' ] = 'Некорректный тип настройки';
2594 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'settings_site_title' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'settings_site_title' ] = {};
2595 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'settings_site_title' ][ 'default' ] = 'Название сайта';
2596 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'welcome_text_title' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'welcome_text_title' ] = {};
2597 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'welcome_text_title' ][ 'default' ] = 'Заголовок приветствия';
2598 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'welcome_text_demo' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'welcome_text_demo' ] = {};
2599 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'welcome_text_demo' ][ 'default' ] = 'Демо приветствия';
2600 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'company_name' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'company_name' ] = {};
2601 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'company_name' ][ 'default' ] = 'Название компании';
2602 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'front_page_welcome_title' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'front_page_welcome_title' ] = {};
2603 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'front_page_welcome_title' ][ 'default' ] = 'Заголовок приветствия на главной';
2604 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'front_page_welcome_text' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'front_page_welcome_text' ] = {};
2605 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'front_page_welcome_text' ][ 'default' ] = 'Приветствие на главной';
2606 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'user_settings' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'user_settings' ] = {};
2607 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'user_settings' ][ 'default' ] = 'Регистрация';
2608 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'site_settings' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'site_settings' ] = {};
2609 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'site_settings' ][ 'default' ] = 'Сайт';
2610 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'template_settings' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'template_settings' ] = {};
2611 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'template_settings' ][ 'default' ] = 'Шаблоны';
2612 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'default_template_name' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'default_template_name' ] = {};
2613 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'default_template_name' ][ 'default' ] = 'Пакет шаблона сайта';
2614 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'default_template_version' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'default_template_version' ] = {};
2615 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'default_template_version' ][ 'default' ] = 'Версия шаблона сайта';
2616 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'default_admin_template_name' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'default_admin_template_name' ] = {};
2617 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'default_admin_template_name' ][ 'default' ] = 'Пакет шаблона админки';
2618 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'default_admin_template_version' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'default_admin_template_version' ] = {};
2619 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'default_admin_template_version' ][ 'default' ] = 'Версия шаблона админки';
2620 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'email_sender' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'email_sender' ] = {};
2621 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'email_sender' ][ 'default' ] = 'Отправитель';
2622 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'system_email' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'system_email' ] = {};
2623 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'system_email' ][ 'default' ] = 'Системный email';
2624
2625 /*
2626 * jQuery Media Plugin for converting elements into rich media content.
2627 *
2628 * Examples and documentation at: http://malsup.com/jquery/media/
2629 * Copyright (c) 2007-2010 M. Alsup
2630 * Dual licensed under the MIT and GPL licenses:
2631 * http://www.opensource.org/licenses/mit-license.php
2632 * http://www.gnu.org/licenses/gpl.html
2633 *
2634 * @author: M. Alsup
2635 * @version: 0.97 (20-MAY-2011)
2636 * @requires jQuery v1.1.2 or later
2637 * $Id: jquery.media.js 2460 2007-07-23 02:53:15Z malsup $
2638 *
2639 * Supported Media Players:
2640 * - Flash
2641 * - Quicktime
2642 * - Real Player
2643 * - Silverlight
2644 * - Windows Media Player
2645 * - iframe
2646 *
2647 * Supported Media Formats:
2648 * Any types supported by the above players, such as:
2649 * Video: asf, avi, flv, mov, mpg, mpeg, mp4, qt, smil, swf, wmv, 3g2, 3gp
2650 * Audio: aif, aac, au, gsm, mid, midi, mov, mp3, m4a, snd, rm, wav, wma
2651 * Other: bmp, html, pdf, psd, qif, qtif, qti, tif, tiff, xaml
2652 *
2653 * Thanks to Mark Hicken and Brent Pedersen for helping me debug this on the Mac!
2654 * Thanks to Dan Rossi for numerous bug reports and code bits!
2655 * Thanks to Skye Giordano for several great suggestions!
2656 * Thanks to Richard Connamacher for excellent improvements to the non-IE behavior!
2657 */
2658 ;(function($) {
2659
2660 var lameIE = $.browser.msie && $.browser.version < 9;
2661
2669 $.fn.media = function(options, f1, f2) {
2670 if (options == 'undo') {
2671 return this.each(function() {
2672 var $this = $(this);
2673 var html = $this.data('media.origHTML');
2674 if (html)
2675 $this.replaceWith(html);
2676 });
2677 }
2678
2679 return this.each(function() {
2680 if (typeof options == 'function') {
2681 f2 = f1;
2682 f1 = options;
2683 options = {};
2684 }
2685 var o = getSettings(this, options);
2686 // pre-conversion callback, passes original element and fully populated options
2687 if (typeof f1 == 'function') f1(this, o);
2688
2689 var r = getTypesRegExp();
2690 var m = r.exec(o.src.toLowerCase()) || [''];
2691
2692 o.type ? m[0] = o.type : m.shift();
2693 for (var i=0; i < m.length; i++) {
2694 fn = m[i].toLowerCase();
2695 if (isDigit(fn[0])) fn = 'fn' + fn; // fns can't begin with numbers
2696 if (!$.fn.media[fn])
2697 continue; // unrecognized media type
2698 // normalize autoplay settings
2699 var player = $.fn.media[fn+'_player'];
2700 if (!o.params) o.params = {};
2701 if (player) {
2702 var num = player.autoplayAttr == 'autostart';
2703 o.params[player.autoplayAttr || 'autoplay'] = num ? (o.autoplay ? 1 : 0) : o.autoplay ? true : false;
2704 }
2705 var $div = $.fn.media[fn](this, o);
2706
2707 $div.css('backgroundColor', o.bgColor).width(o.width);
2708
2709 if (o.canUndo) {
2710 var $temp = $('<div></div>').append(this);
2711 $div.data('media.origHTML', $temp.html()); // store original markup
2712 }
2713
2714 // post-conversion callback, passes original element, new div element and fully populated options
2715 if (typeof f2 == 'function') f2(this, $div[0], o, player.name);
2716 break;
2717 }
2718 });
2719 };
2720
2727 $.fn.media.mapFormat = function(format, player) {
2728 if (!format || !player || !$.fn.media.defaults.players[player]) return; // invalid
2729 format = format.toLowerCase();
2730 if (isDigit(format[0])) format = 'fn' + format;
2731 $.fn.media[format] = $.fn.media[player];
2732 $.fn.media[format+'_player'] = $.fn.media.defaults.players[player];
2733 };
2734
2735 // global defautls; override as needed
2736 $.fn.media.defaults = {
2737 standards: true, // use object tags only (no embeds for non-IE browsers)
2738 canUndo: true, // tells plugin to store the original markup so it can be reverted via: $(sel).mediaUndo()
2739 width: 400,
2740 height: 400,
2741 autoplay: 0, // normalized cross-player setting
2742 bgColor: '#ffffff', // background color
2743 params: { wmode: 'transparent'}, // added to object element as param elements; added to embed element as attrs
2744 attrs: {}, // added to object and embed elements as attrs
2745 flvKeyName: 'file', // key used for object src param (thanks to Andrea Ercolino)
2746 flashvars: {}, // added to flash content as flashvars param/attr
2747 flashVersion: '7', // required flash version
2748 expressInstaller: null, // src for express installer
2749
2750 // default flash video and mp3 player (@see: http://jeroenwijering.com/?item=Flash_Media_Player)
2751 flvPlayer: 'mediaplayer.swf',
2752 mp3Player: 'mediaplayer.swf',
2753
2754 // @see http://msdn2.microsoft.com/en-us/library/bb412401.aspx
2755 silverlight: {
2756 inplaceInstallPrompt: 'true', // display in-place install prompt?
2757 isWindowless: 'true', // windowless mode (false for wrapping markup)
2758 framerate: '24', // maximum framerate
2759 version: '0.9', // Silverlight version
2760 onError: null, // onError callback
2761 onLoad: null, // onLoad callback
2762 initParams: null, // object init params
2763 userContext: null // callback arg passed to the load callback
2764 }
2765 };
2766
2767 // Media Players; think twice before overriding
2768 $.fn.media.defaults.players = {
2769 flash: {
2770 name: 'flash',
2771 title: 'Flash',
2772 types: 'flv,mp3,swf',
2773 mimetype: 'application/x-shockwave-flash',
2774 pluginspage: 'http://www.adobe.com/go/getflashplayer',
2775 ieAttrs: {
2776 classid: 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
2777 type: 'application/x-oleobject',
2778 codebase: 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + $.fn.media.defaults.flashVersion
2779 }
2780 },
2781 quicktime: {
2782 name: 'quicktime',
2783 title: 'QuickTime',
2784 mimetype: 'video/quicktime',
2785 pluginspage: 'http://www.apple.com/quicktime/download/',
2786 types: 'aif,aiff,aac,au,bmp,gsm,mov,mid,midi,mpg,mpeg,mp4,m4a,psd,qt,qtif,qif,qti,snd,tif,tiff,wav,3g2,3gp',
2787 ieAttrs: {
2788 classid: 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
2789 codebase: 'http://www.apple.com/qtactivex/qtplugin.cab'
2790 }
2791 },
2792 realplayer: {
2793 name: 'real',
2794 title: 'RealPlayer',
2795 types: 'ra,ram,rm,rpm,rv,smi,smil',
2796 mimetype: 'audio/x-pn-realaudio-plugin',
2797 pluginspage: 'http://www.real.com/player/',
2798 autoplayAttr: 'autostart',
2799 ieAttrs: {
2800 classid: 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'
2801 }
2802 },
2803 winmedia: {
2804 name: 'winmedia',
2805 title: 'Windows Media',
2806 types: 'asx,asf,avi,wma,wmv',
2807 mimetype: $.browser.mozilla && isFirefoxWMPPluginInstalled() ? 'application/x-ms-wmp' : 'application/x-mplayer2',
2808 pluginspage: 'http://www.microsoft.com/Windows/MediaPlayer/',
2809 autoplayAttr: 'autostart',
2810 oUrl: 'url',
2811 ieAttrs: {
2812 classid: 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6',
2813 type: 'application/x-oleobject'
2814 }
2815 },
2816 // special cases
2817 img: {
2818 name: 'img',
2819 title: 'Image',
2820 types: 'gif,png,jpg'
2821 },
2822 iframe: {
2823 name: 'iframe',
2824 types: 'html,pdf'
2825 },
2826 silverlight: {
2827 name: 'silverlight',
2828 types: 'xaml'
2829 }
2830 };
2831
2832 //
2833 // everything below here is private
2834 //
2835
2836
2837 // detection script for FF WMP plugin (http://www.therossman.org/experiments/wmp_play.html)
2838 // (hat tip to Mark Ross for this script)
2839 function isFirefoxWMPPluginInstalled() {
2840 var plugs = navigator.plugins;
2841 for (var i = 0; i < plugs.length; i++) {
2842 var plugin = plugs[i];
2843 if (plugin['filename'] == 'np-mswmp.dll')
2844 return true;
2845 }
2846 return false;
2847 }
2848
2849 var counter = 1;
2850
2851 for (var player in $.fn.media.defaults.players) {
2852 var types = $.fn.media.defaults.players[player].types;
2853 $.each(types.split(','), function(i,o) {
2854 if (isDigit(o[0])) o = 'fn' + o;
2855 $.fn.media[o] = $.fn.media[player] = getGenerator(player);
2856 $.fn.media[o+'_player'] = $.fn.media.defaults.players[player];
2857 });
2858 };
2859
2860 function getTypesRegExp() {
2861 var types = '';
2862 for (var player in $.fn.media.defaults.players) {
2863 if (types.length) types += ',';
2864 types += $.fn.media.defaults.players[player].types;
2865 };
2866 return new RegExp('\\.(' + types.replace(/,/ig,'|') + ')\\b');
2867 };
2868
2869 function getGenerator(player) {
2870 return function(el, options) {
2871 return generate(el, options, player);
2872 };
2873 };
2874
2875 function isDigit(c) {
2876 return '0123456789'.indexOf(c) > -1;
2877 };
2878
2879 // flatten all possible options: global defaults, meta, option obj
2880 function getSettings(el, options) {
2881 options = options || {};
2882 var $el = $(el);
2883 var cls = el.className || '';
2884 // support metadata plugin (v1.0 and v2.0)
2885 var meta = $.metadata ? $el.metadata() : $.meta ? $el.data() : {};
2886 meta = meta || {};
2887 var w = meta.width || parseInt(((cls.match(/\bw:(\d+)/)||[])[1]||0)) || parseInt(((cls.match(/\bwidth:(\d+)/)||[])[1]||0));
2888 var h = meta.height || parseInt(((cls.match(/\bh:(\d+)/)||[])[1]||0)) || parseInt(((cls.match(/\bheight:(\d+)/)||[])[1]||0))
2889
2890 if (w) meta.width = w;
2891 if (h) meta.height = h;
2892 if (cls) meta.cls = cls;
2893
2894 // crank html5 style data attributes
2895 var dataName = 'data-';
2896 for (var i=0; i < el.attributes.length; i++) {
2897 var a = el.attributes[i], n = $.trim(a.name);
2898 var index = n.indexOf(dataName);
2899 if (index === 0) {
2900 n = n.substring(dataName.length);
2901 meta[n] = a.value;
2902 }
2903 }
2904
2905 var a = $.fn.media.defaults;
2906 var b = options;
2907 var c = meta;
2908
2909 var p = { params: { bgColor: options.bgColor || $.fn.media.defaults.bgColor } };
2910 var opts = $.extend({}, a, b, c);
2911 $.each(['attrs','params','flashvars','silverlight'], function(i,o) {
2912 opts[o] = $.extend({}, p[o] || {}, a[o] || {}, b[o] || {}, c[o] || {});
2913 });
2914
2915 if (typeof opts.caption == 'undefined') opts.caption = $el.text();
2916
2917 // make sure we have a source!
2918 opts.src = opts.src || $el.attr('href') || $el.attr('src') || 'unknown';
2919 return opts;
2920 };
2921
2922 //
2923 // Flash Player
2924 //
2925
2926 // generate flash using SWFObject library if possible
2927 $.fn.media.swf = function(el, opts) {
2928 if (!window.SWFObject && !window.swfobject) {
2929 // roll our own
2930 if (opts.flashvars) {
2931 var a = [];
2932 for (var f in opts.flashvars)
2933 a.push(f + '=' + opts.flashvars[f]);
2934 if (!opts.params) opts.params = {};
2935 opts.params.flashvars = a.join('&');
2936 }
2937 return generate(el, opts, 'flash');
2938 }
2939
2940 var id = el.id ? (' id="'+el.id+'"') : '';
2941 var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
2942 var $div = $('<div' + id + cls + '>');
2943
2944 // swfobject v2+
2945 if (window.swfobject) {
2946 $(el).after($div).appendTo($div);
2947 if (!el.id) el.id = 'movie_player_' + counter++;
2948
2949 // replace el with swfobject content
2950 swfobject.embedSWF(opts.src, el.id, opts.width, opts.height, opts.flashVersion,
2951 opts.expressInstaller, opts.flashvars, opts.params, opts.attrs);
2952 }
2953 // swfobject < v2
2954 else {
2955 $(el).after($div).remove();
2956 var so = new SWFObject(opts.src, 'movie_player_' + counter++, opts.width, opts.height, opts.flashVersion, opts.bgColor);
2957 if (opts.expressInstaller) so.useExpressInstall(opts.expressInstaller);
2958
2959 for (var p in opts.params)
2960 if (p != 'bgColor') so.addParam(p, opts.params[p]);
2961 for (var f in opts.flashvars)
2962 so.addVariable(f, opts.flashvars[f]);
2963 so.write($div[0]);
2964 }
2965
2966 if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
2967 return $div;
2968 };
2969
2970 // map flv and mp3 files to the swf player by default
2971 $.fn.media.flv = $.fn.media.mp3 = function(el, opts) {
2972 var src = opts.src;
2973 var player = /\.mp3\b/i.test(src) ? opts.mp3Player : opts.flvPlayer;
2974 var key = opts.flvKeyName;
2975 src = encodeURIComponent(src);
2976 opts.src = player;
2977 opts.src = opts.src + '?'+key+'=' + (src);
2978 var srcObj = {};
2979 srcObj[key] = src;
2980 opts.flashvars = $.extend({}, srcObj, opts.flashvars );
2981 return $.fn.media.swf(el, opts);
2982 };
2983
2984 //
2985 // Silverlight
2986 //
2987 $.fn.media.xaml = function(el, opts) {
2988 if (!window.Sys || !window.Sys.Silverlight) {
2989 if ($.fn.media.xaml.warning) return;
2990 $.fn.media.xaml.warning = 1;
2991 alert('You must include the Silverlight.js script.');
2992 return;
2993 }
2994
2995 var props = {
2996 width: opts.width,
2997 height: opts.height,
2998 background: opts.bgColor,
2999 inplaceInstallPrompt: opts.silverlight.inplaceInstallPrompt,
3000 isWindowless: opts.silverlight.isWindowless,
3001 framerate: opts.silverlight.framerate,
3002 version: opts.silverlight.version
3003 };
3004 var events = {
3005 onError: opts.silverlight.onError,
3006 onLoad: opts.silverlight.onLoad
3007 };
3008
3009 var id1 = el.id ? (' id="'+el.id+'"') : '';
3010 var id2 = opts.id || 'AG' + counter++;
3011 // convert element to div
3012 var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
3013 var $div = $('<div' + id1 + cls + '>');
3014 $(el).after($div).remove();
3015
3016 Sys.Silverlight.createObjectEx({
3017 source: opts.src,
3018 initParams: opts.silverlight.initParams,
3019 userContext: opts.silverlight.userContext,
3020 id: id2,
3021 parentElement: $div[0],
3022 properties: props,
3023 events: events
3024 });
3025
3026 if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
3027 return $div;
3028 };
3029
3030 //
3031 // generate object/embed markup
3032 //
3033 function generate(el, opts, player) {
3034 var $el = $(el);
3035 var o = $.fn.media.defaults.players[player];
3036
3037 if (player == 'iframe') {
3038 o = $('<iframe' + ' width="' + opts.width + '" height="' + opts.height + '" >');
3039 o.attr('src', opts.src);
3040 o.css('backgroundColor', o.bgColor);
3041 }
3042 else if (player == 'img') {
3043 o = $('<img>');
3044 o.attr('src', opts.src);
3045 opts.width && o.attr('width', opts.width);
3046 opts.height && o.attr('height', opts.height);
3047 o.css('backgroundColor', o.bgColor);
3048 }
3049 else if (lameIE) {
3050 var a = ['<object width="' + opts.width + '" height="' + opts.height + '" '];
3051 for (var key in opts.attrs)
3052 a.push(key + '="'+opts.attrs[key]+'" ');
3053 for (var key in o.ieAttrs || {}) {
3054 var v = o.ieAttrs[key];
3055 if (key == 'codebase' && window.location.protocol == 'https:')
3056 v = v.replace('http','https');
3057 a.push(key + '="'+v+'" ');
3058 }
3059 a.push('></ob'+'ject'+'>');
3060 var p = ['<param name="' + (o.oUrl || 'src') +'" value="' + opts.src + '">'];
3061 for (var key in opts.params)
3062 p.push('<param name="'+ key +'" value="' + opts.params[key] + '">');
3063 var o = document.createElement(a.join(''));
3064 for (var i=0; i < p.length; i++)
3065 o.appendChild(document.createElement(p[i]));
3066 }
3067 else if (opts.standards) {
3068 // Rewritten to be standards compliant by Richard Connamacher
3069 var a = ['<object type="' + o.mimetype +'" width="' + opts.width + '" height="' + opts.height +'"'];
3070 if (opts.src) a.push(' data="' + opts.src + '" ');
3071 if ($.browser.msie) {
3072 for (var key in o.ieAttrs || {}) {
3073 var v = o.ieAttrs[key];
3074 if (key == 'codebase' && window.location.protocol == 'https:')
3075 v = v.replace('http','https');
3076 a.push(key + '="'+v+'" ');
3077 }
3078 }
3079 a.push('>');
3080 a.push('<param name="' + (o.oUrl || 'src') +'" value="' + opts.src + '">');
3081 for (var key in opts.params) {
3082 if (key == 'wmode' && player != 'flash') // FF3/Quicktime borks on wmode
3083 continue;
3084 a.push('<param name="'+ key +'" value="' + opts.params[key] + '">');
3085 }
3086 // Alternate HTML
3087 a.push('<div><p><strong>'+o.title+' Required</strong></p><p>'+o.title+' is required to view this media. <a href="'+o.pluginspage+'">Download Here</a>.</p></div>');
3088 a.push('</ob'+'ject'+'>');
3089 }
3090 else {
3091 var a = ['<embed width="' + opts.width + '" height="' + opts.height + '" style="display:block"'];
3092 if (opts.src) a.push(' src="' + opts.src + '" ');
3093 for (var key in opts.attrs)
3094 a.push(key + '="'+opts.attrs[key]+'" ');
3095 for (var key in o.eAttrs || {})
3096 a.push(key + '="'+o.eAttrs[key]+'" ');
3097 for (var key in opts.params) {
3098 if (key == 'wmode' && player != 'flash') // FF3/Quicktime borks on wmode
3099 continue;
3100 a.push(key + '="'+opts.params[key]+'" ');
3101 }
3102 a.push('></em'+'bed'+'>');
3103 }
3104 // convert element to div
3105 var id = el.id ? (' id="'+el.id+'"') : '';
3106 var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
3107 var $div = $('<div' + id + cls + '>');
3108 $el.after($div).remove();
3109 (lameIE || player == 'iframe' || player == 'img') ? $div.append(o) : $div.html(a.join(''));
3110 if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
3111 return $div;
3112 };
3113
3114 })(jQuery);
3115 jQuery(
3116 function()
3117 {
3118 jQuery( '.media' ).each(
3119 function( i , Object )
3120 {
3121 jQuery( Object ).media(
3122 {
3123 width : jQuery( Object ).attr( 'width' ) ,
3124 height : jQuery( Object ).attr( 'height' ) ,
3125 mp3Player : './packages/jquery/packages/jquery_media/include/swf/mediaplayer.swf' ,
3126 flvPlayer : './packages/jquery/packages/jquery_media/include/swf/mediaplayer.swf'
3127 }
3128 );
3129 }
3130 );
3131 }
3132 );
3133 /*
3134 * SimpleModal 1.2.2 - jQuery Plugin
3135 * http://www.ericmmartin.com/projects/simplemodal/
3136 * Copyright (c) 2008 Eric Martin
3137 * Dual licensed under the MIT and GPL licenses
3138 * Revision: $Id: jquery.simplemodal.js 181 2008-12-16 16:51:44Z emartin24 $
3139 */
3140 (function($){var ie6=$.browser.msie&&parseInt($.browser.version)==6&&!window['XMLHttpRequest'],ieQuirks=$.browser.msie&&!$.boxModel,w=[];$.modal=function(data,options){return $.modal.impl.init(data,options);};$.modal.close=function(){$.modal.impl.close();};$.fn.modal=function(options){return $.modal.impl.init(this,options);};$.modal.defaults={opacity:50,overlayId:'simplemodal-overlay',overlayCss:{},containerId:'simplemodal-container',containerCss:{},dataCss:{},zIndex:1000,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:'simplemodal-close',position:null,persist:false,onOpen:null,onShow:null,onClose:null};$.modal.impl={opts:null,dialog:{},init:function(data,options){if(this.dialog.data){return false;}this.opts=$.extend({},$.modal.defaults,options);this.zIndex=this.opts.zIndex;this.occb=false;if(typeof data=='object'){data=data instanceof jQuery?data:$(data);if(data.parent().parent().size()>0){this.dialog.parentNode=data.parent();if(!this.opts.persist){this.dialog.orig=data.clone(true);}}}else if(typeof data=='string'||typeof data=='number'){data=$('<div/>').html(data);}else{alert('SimpleModal Error: Unsupported data type: '+typeof data);return false;}this.dialog.data=data.addClass('simplemodal-data').css(this.opts.dataCss);data=null;this.create();this.open();if($.isFunction(this.opts.onShow)){this.opts.onShow.apply(this,[this.dialog]);}return this;},create:function(){w=this.getDimensions();if(ie6){this.dialog.iframe=$('<iframe src="javascript:false;"/>').css($.extend(this.opts.iframeCss,{display:'none',opacity:0,position:'fixed',height:w[0],width:w[1],zIndex:this.opts.zIndex,top:0,left:0})).appendTo('body');}this.dialog.overlay=$('<div/>').attr('id',this.opts.overlayId).addClass('simplemodal-overlay').css($.extend(this.opts.overlayCss,{display:'none',opacity:this.opts.opacity/100,height:w[0],width:w[1],position:'fixed',left:0,top:0,zIndex:this.opts.zIndex+1})).appendTo('body');this.dialog.container=$('<div/>').attr('id',this.opts.containerId).addClass('simplemodal-container').css($.extend(this.opts.containerCss,{display:'none',position:'fixed',zIndex:this.opts.zIndex+2})).append(this.opts.close?$(this.opts.closeHTML).addClass(this.opts.closeClass):'').appendTo('body');this.setPosition();if(ie6||ieQuirks){this.fixIE();}this.dialog.container.append(this.dialog.data.hide());},bindEvents:function(){var self=this;$('.'+this.opts.closeClass).bind('click.simplemodal',function(e){e.preventDefault();self.close();});$(window).bind('resize.simplemodal',function(){w=self.getDimensions();self.setPosition();if(ie6||ieQuirks){self.fixIE();}else{self.dialog.iframe&&self.dialog.iframe.css({height:w[0],width:w[1]});self.dialog.overlay.css({height:w[0],width:w[1]});}});},unbindEvents:function(){$('.'+this.opts.closeClass).unbind('click.simplemodal');$(window).unbind('resize.simplemodal');},fixIE:function(){var p=this.opts.position;$.each([this.dialog.iframe||null,this.dialog.overlay,this.dialog.container],function(i,el){if(el){var bch='document.body.clientHeight',bcw='document.body.clientWidth',bsh='document.body.scrollHeight',bsl='document.body.scrollLeft',bst='document.body.scrollTop',bsw='document.body.scrollWidth',ch='document.documentElement.clientHeight',cw='document.documentElement.clientWidth',sl='document.documentElement.scrollLeft',st='document.documentElement.scrollTop',s=el[0].style;s.position='absolute';if(i<2){s.removeExpression('height');s.removeExpression('width');s.setExpression('height',''+bsh+' > '+bch+' ? '+bsh+' : '+bch+' + "px"');s.setExpression('width',''+bsw+' > '+bcw+' ? '+bsw+' : '+bcw+' + "px"');}else{var te,le;if(p&&p.constructor==Array){if(p[0]){var top=typeof p[0]=='number'?p[0].toString():p[0].replace(/px/,'');te=top.indexOf('%')==-1?top+' + (t = '+st+' ? '+st+' : '+bst+') + "px"':parseInt(top.replace(/%/,''))+' * (('+ch+' || '+bch+') / 100) + (t = '+st+' ? '+st+' : '+bst+') + "px"';}if(p[1]){var left=typeof p[1]=='number'?p[1].toString():p[1].replace(/px/,'');le=left.indexOf('%')==-1?left+' + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"':parseInt(left.replace(/%/,''))+' * (('+cw+' || '+bcw+') / 100) + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"';}}else{te='('+ch+' || '+bch+') / 2 - (this.offsetHeight / 2) + (t = '+st+' ? '+st+' : '+bst+') + "px"';le='('+cw+' || '+bcw+') / 2 - (this.offsetWidth / 2) + (t = '+sl+' ? '+sl+' : '+bsl+') + "px"';}s.removeExpression('top');s.removeExpression('left');s.setExpression('top',te);s.setExpression('left',le);}}});},getDimensions:function(){var el=$(window);var h=$.browser.opera&&$.browser.version>'9.5'&&$.fn.jquery<='1.2.6'?document.documentElement['clientHeight']:el.height();return[h,el.width()];},setPosition:function(){var top,left,hCenter=(w[0]/2)-((this.dialog.container.height()||this.dialog.data.height())/2),vCenter=(w[1]/2)-((this.dialog.container.width()||this.dialog.data.width())/2);if(this.opts.position&&this.opts.position.constructor==Array){top=this.opts.position[0]||hCenter;left=this.opts.position[1]||vCenter;}else{top=hCenter;left=vCenter;}this.dialog.container.css({left:left,top:top});},open:function(){this.dialog.iframe&&this.dialog.iframe.show();if($.isFunction(this.opts.onOpen)){this.opts.onOpen.apply(this,[this.dialog]);}else{this.dialog.overlay.show();this.dialog.container.show();this.dialog.data.show();}this.bindEvents();},close:function(){if(!this.dialog.data){return false;}if($.isFunction(this.opts.onClose)&&!this.occb){this.occb=true;this.opts.onClose.apply(this,[this.dialog]);}else{if(this.dialog.parentNode){if(this.opts.persist){this.dialog.data.hide().appendTo(this.dialog.parentNode);}else{this.dialog.data.remove();this.dialog.orig.appendTo(this.dialog.parentNode);}}else{this.dialog.data.remove();}this.dialog.container.remove();this.dialog.overlay.remove();this.dialog.iframe&&this.dialog.iframe.remove();this.dialog={};}this.unbindEvents();}};})(jQuery);
3146 if( !ultimix )
3147 {
3148 ultimix = {};
3149 }
3150
3156 if( !ultimix.data_form )
3157 {
3158 ultimix.data_form = {};
3159 }
3160
3170 ultimix.data_form.CreateForm = function( Action , Method )
3171 {
3172 if( !Method )
3173 {
3174 Method = 'post';
3175 }
3176
3177 if( jQuery( '#data_form' ).length )
3178 {
3179 jQuery( '#data_form' ).remove();
3180 }
3181
3182 jQuery( 'body' ).append( '<form id="data_form" method="' + Method + '" style="display: none;"></form>' );
3183
3184 if( Action )
3185 {
3186 jQuery( '#data_form' ).attr( 'action' , Action );
3187 }
3188 }
3189
3197 ultimix.data_form.AppendData = function( Data )
3198 {
3199 for( i in Data )
3200 {
3201 jQuery( '#data_form' ).append( '<textarea name="' + i + '">' + Data[ i ] + '</textarea>' );
3202 }
3203 }
3204
3212 ultimix.data_form.MoveFormData = function( SourceFormSelector )
3213 {
3214 var Data = ultimix.forms.ExtractFormData( SourceFormSelector );
3215
3216 ultimix.data_form.AppendData( Data );
3217 }
3218
3228 ultimix.data_form.SuccessFunction = function( SourceFormSelector , Waiting )
3229 {
3230 return(
3231 function( Result )
3232 {
3233 if( Result == ultimix.std_dialogs.MB_YES )
3234 {
3235 ultimix.data_form.MoveFormData( SourceFormSelector );
3236
3237 document.getElementById( 'data_form' ).submit();
3238
3239 if( Waiting )
3240 {
3241 ultimix.std_dialogs.MessageBox(
3242 ultimix.get_string( 'wait_please' ) , ultimix.get_string( 'Info' ) ,
3243 ultimix.std_dialogs.MB_ICONLOADING | ultimix.std_dialogs.MB_MODAL
3244 );
3245 }
3246 }
3247 }
3248 );
3249 }
3250
3266 ultimix.data_form.SubmitDataForm = function( SourceFormSelector , ConfirmString , Action , Waiting , Method )
3267 {
3268 ultimix.data_form.CreateForm( Action , Method );
3269
3270 Success = ultimix.data_form.SuccessFunction( SourceFormSelector , Waiting );
3271
3272 if( ConfirmString )
3273 {
3274 ultimix.std_dialogs.MessageBox( ConfirmString , ultimix.get_string( 'Question' ) , ultimix.std_dialogs.MB_YESNO | ultimix.std_dialogs.MB_ICONQUESTION | ultimix.std_dialogs.MB_MODAL , Success );
3275 return;
3276 }
3277
3278 Success( ultimix.std_dialogs.MB_YES );
3279 }
3280
3296 ultimix.data_form.SubmitDataFormN = function( Data , ConfirmString , Action , Waiting , Method )
3297 {
3298 ultimix.data_form.CreateForm( Action , Method );
3299
3300 Success = function( Result )
3301 {
3302 if( Result == ultimix.std_dialogs.MB_YES )
3303 {
3304 ultimix.data_form.AppendData( Data );
3305
3306 ultimix.data_form.WaitForSubmit( Waiting );
3307 }
3308 }
3309
3310 if( ConfirmString )
3311 {
3312 ultimix.std_dialogs.MessageBox(
3313 ultimix.get_string( ConfirmString ) , ultimix.get_string( 'Question' ) ,
3314 ultimix.std_dialogs.MB_YESNO | ultimix.std_dialogs.MB_ICONQUESTION | ultimix.std_dialogs.MB_MODAL , Success
3315 );
3316 return;
3317 }
3318
3319 Success( ultimix.std_dialogs.MB_YES );
3320 }
3321
3329 ultimix.data_form.WaitForSubmit = function( Waiting )
3330 {
3331 document.getElementById( 'data_form' ).submit();
3332
3333 if( Waiting )
3334 {
3335 ultimix.std_dialogs.MessageBox(
3336 ultimix.get_string( 'wait_please' ) , ultimix.get_string( 'Info' ) ,
3337 ultimix.std_dialogs.MB_ICONLOADING | ultimix.std_dialogs.MB_MODAL
3338 );
3339 }
3340 }
3341
3355 ultimix.data_form.SubmitDataForm0 = function( ConfirmString , Action , Waiting , Method )
3356 {
3357 ultimix.data_form.CreateForm( Action , Method );
3358
3359 Success = function( Result )
3360 {
3361 if( Result == ultimix.std_dialogs.MB_YES )
3362 {
3363 ultimix.data_form.WaitForSubmit( Waiting );
3364 }
3365 }
3366
3367 if( ConfirmString )
3368 {
3369 ultimix.std_dialogs.MessageBox(
3370 ultimix.get_string( ConfirmString ) , ultimix.get_string( 'Question' ) ,
3371 ultimix.std_dialogs.MB_YESNO | ultimix.std_dialogs.MB_ICONQUESTION | ultimix.std_dialogs.MB_MODAL , Success
3372 );
3373 return;
3374 }
3375
3376 Success( ultimix.std_dialogs.MB_YES );
3377 }
3378
3396 ultimix.data_form.SubmitDataForm1 = function( Param1 , Value1 , ConfirmString , Action , Waiting , Method )
3397 {
3398 ultimix.data_form.CreateForm( Action , Method );
3399
3400 Success = function( Result )
3401 {
3402 if( Result == ultimix.std_dialogs.MB_YES )
3403 {
3404 var Data = {};
3405 Data[ Param1 ] = Value1;
3406
3407 ultimix.data_form.AppendData( Data );
3408
3409 ultimix.data_form.WaitForSubmit( Waiting );
3410 }
3411 }
3412
3413 if( ConfirmString )
3414 {
3415 ultimix.std_dialogs.MessageBox(
3416 ultimix.get_string( ConfirmString ) , ultimix.get_string( 'Question' ) ,
3417 ultimix.std_dialogs.MB_YESNO | ultimix.std_dialogs.MB_ICONQUESTION | ultimix.std_dialogs.MB_MODAL , Success
3418 );
3419 return;
3420 }
3421
3422 Success( ultimix.std_dialogs.MB_YES );
3423 }
3424
3446 ultimix.data_form.SubmitDataForm2 = function( Param1 , Value1 , Param2, Value2 , ConfirmString , Action , Waiting , Method )
3447 {
3448 ultimix.data_form.CreateForm( Action , Method );
3449
3450 Success = function( Result )
3451 {
3452 if( Result == ultimix.std_dialogs.MB_YES )
3453 {
3454 var Data = {};
3455 Data[ Param1 ] = Value1;
3456 Data[ Param2 ] = Value2;
3457
3458 ultimix.data_form.AppendData( Data );
3459
3460 ultimix.data_form.WaitForSubmit( Waiting );
3461 }
3462 }
3463
3464 if( ConfirmString )
3465 {
3466 ultimix.std_dialogs.MessageBox(
3467 ultimix.get_string( ConfirmString ) , ultimix.get_string( 'Question' ) ,
3468 ultimix.std_dialogs.MB_YESNO | ultimix.std_dialogs.MB_ICONQUESTION | ultimix.std_dialogs.MB_MODAL , Success
3469 );
3470 return;
3471 }
3472
3473 Success( ultimix.std_dialogs.MB_YES );
3474 }
3475
3501 ultimix.data_form.SubmitDataForm3 = function( Param1 , Value1 , Param2 , Value2 , Param3 , Value3 , ConfirmString , Action , Waiting , Method )
3502 {
3503 ultimix.data_form.CreateForm( Action , Method );
3504
3505 Success = function( Result )
3506 {
3507 if( Result == ultimix.std_dialogs.MB_YES )
3508 {
3509 var Data = {};
3510 Data[ Param1 ] = Value1;
3511 Data[ Param2 ] = Value2;
3512 Data[ Param3 ] = Value3;
3513
3514 ultimix.data_form.AppendData( Data );
3515
3516 ultimix.data_form.WaitForSubmit( Waiting );
3517 }
3518 }
3519
3520 if( ConfirmString )
3521 {
3522 ultimix.std_dialogs.MessageBox(
3523 ultimix.get_string( ConfirmString ) , ultimix.get_string( 'Question' ) ,
3524 ultimix.std_dialogs.MB_YESNO | ultimix.std_dialogs.MB_ICONQUESTION | ultimix.std_dialogs.MB_MODAL , Success
3525 );
3526 return;
3527 }
3528
3529 Success( ultimix.std_dialogs.MB_YES );
3530 }
3531
3537 if( !ultimix )
3538 {
3539 ultimix = {};
3540 }
3541
3547 if( !ultimix.multiple_line )
3548 {
3549 ultimix.multiple_line = {};
3550 }
3551
3559 ultimix.multiple_line.CreateMultypleLineControl = function( Object )
3560 {
3561 jQuery( Object ).wrap( '<div></div>' );
3562 jQuery( Object ).css( 'display' , 'none' );
3563 }
3564
3574 ultimix.multiple_line.GetElementCode = function( Control , Object )
3575 {
3576 var Template = Control.html();
3577
3578 if( Object )
3579 {
3580 eval( 'var Data = ' + jQuery( Object ).html() );
3581 Template = ultimix.string_utilities.PrintRecord( Template , Data );
3582 }
3583
3584 return( Template );
3585 }
3586
3594 ultimix.multiple_line.ReviseDeleteButtons = function( Selector )
3595 {
3596 var Container = jQuery( Selector ).parent();
3597
3598 var Lines = jQuery( Container ).find( 'table.multiple_line_single_line' );
3599
3600 if( Lines.length == 1 )
3601 {
3602 Lines.find( 'span.multiple_line_delete_button' ).html( '&nbsp;' );
3603 }
3604 else
3605 {
3606 Lines.find( 'span.multiple_line_delete_button' ).html( ultimix.multiple_line.CreateDelButton( Selector ) );
3607 }
3608 }
3609
3619 ultimix.multiple_line.OnAddElement = function( Button , Selector )
3620 {
3621 ultimix.multiple_line.AddLineForSelector(
3622 Selector , false , jQuery( Button ).parents( 'table.multiple_line_single_line' )
3623 );
3624
3625 ultimix.multiple_line.ReviseDeleteButtons( Selector );
3626 }
3627
3637 ultimix.multiple_line.OnDelElement = function( Button , Selector )
3638 {
3639 jQuery( Button ).parents( 'table.multiple_line_single_line' ).remove();
3640
3641 var Control = jQuery( Selector );
3642
3643 /* calling event handler */
3644 if( jQuery( Control ).attr( 'ondeleteline' ) )
3645 {
3646 eval( jQuery( Control ).attr( 'ondeleteline' ) );
3647 }
3648
3649 ultimix.multiple_line.ReviseDeleteButtons( Selector );
3650 }
3651
3661 ultimix.multiple_line.GetAddButtonTemplate = function( Selector )
3662 {
3663 var CustomTemplate = jQuery( Selector ).find( '.add_button_template' ).first();
3664
3665 if( CustomTemplate.length == 0 )
3666 {
3667 /* custom template was not found */
3668 return(
3669 "<span class=\"multiple_line_add_button\"><a class=\"pointer\" style=\"text-decoration: none; " +
3670 "font-weight: bold;\" onclick=\"ultimix.multiple_line.OnAddElement( this , '" + Selector +
3671 "' );\">+</a></span>"
3672 );
3673 }
3674 else
3675 {
3676 CustomTemplate = CustomTemplate.html();
3677
3678 CustomTemplate = ultimix.string_utilities.StrReplace( '[selector]' , Selector , CustomTemplate );
3679
3680 return( CustomTemplate );
3681 }
3682 }
3683
3691 ultimix.multiple_line.CreateAddButton = function( Selector )
3692 {
3693 return(
3694 ultimix.multiple_line.GetAddButtonTemplate( Selector )
3695 );
3696 }
3697
3707 ultimix.multiple_line.GetDeleteButtonTemplate = function( Selector )
3708 {
3709 var CustomTemplate = jQuery( Selector ).find( '.delete_button_template' ).first();
3710
3711 if( CustomTemplate.length == 0 )
3712 {
3713 /* custom template was not found */
3714 return(
3715 "<span class=\"multiple_line_delete_button\"><a class=\"pointer\" style=\"text-decoration: none; " +
3716 "font-weight: bold;\" onclick=\"ultimix.multiple_line.OnDelElement( this , '" +
3717 Selector + "' );\">-</a></span>"
3718 );
3719 }
3720 else
3721 {
3722 CustomTemplate = CustomTemplate.html();
3723
3724 CustomTemplate = ultimix.string_utilities.StrReplace( '[selector]' , Selector , CustomTemplate );
3725
3726 return( CustomTemplate );
3727 }
3728 }
3729
3737 ultimix.multiple_line.CreateDelButton = function( Selector )
3738 {
3739 return(
3740 ultimix.multiple_line.GetDeleteButtonTemplate( Selector )
3741 );
3742 }
3743
3757 ultimix.multiple_line.AppendLine = function( Selector , Line , AfterLine )
3758 {
3759 var Container = jQuery( Selector ).parent();
3760 var Code = '<table class="multiple_line_single_line"><tr><td style="width: 10px; font-family:' +
3761 'Courier New;">' + ultimix.multiple_line.CreateAddButton( Selector ) + '</td><td style="width: 10px; ' +
3762 'font-family: Courier New;">' + ultimix.multiple_line.CreateDelButton( Selector ) + '</td><td style="width: ' +
3763 '100%;">' + Line + '</td></tr></table>';
3764 var AddedLine = false;
3765 if( AfterLine )
3766 {
3767 jQuery( AfterLine ).after( Code );
3768 AddedLine = jQuery( AfterLine ).next();
3769 }
3770 else
3771 {
3772 jQuery( Container ).append( Code );
3773 AddedLine = jQuery( Container ).find( 'table.multiple_line_single_line' ).last();
3774 }
3775 jQuery( AddedLine ).find( '.add_button_template,.delete_button_template' ).remove();
3776 ultimix.multiple_line.ReviseDeleteButtons( Selector );
3777 return( AddedLine );
3778 }
3779
3793 ultimix.multiple_line.AddLineInDOM = function( Selector , Object , AfterLine )
3794 {
3795 var Control = jQuery( Selector );
3796 if( Control.length )
3797 {
3798 var Line = ultimix.multiple_line.GetElementCode( Control , Object );
3799 var AddedLine = ultimix.multiple_line.AppendLine( Selector , Line , AfterLine );
3800 if( Object )
3801 {
3802 jQuery( Object ).remove();
3803 }
3804 return( AddedLine );
3805 }
3806 else
3807 {
3808 if( !Object )return;
3809
3810 jQuery( Object ).replaceWith(
3811 ultimix.get_string( 'dom_element' ) + ' "' + jQuery( Object ).attr( 'control' ) + '" ' +
3812 ultimix.get_string( 'was_not_found' )
3813 );
3814 }
3815 }
3816
3826 ultimix.multiple_line.OnAddLine = function( AddedLine , Data )
3827 {
3828 for( FieldName in Data )
3829 {
3830 var Element = jQuery( AddedLine ).find( '[name^=' + FieldName + ']' );
3831 if( Element.prop( 'tagName' ) == 'TEXTAREA' )
3832 {
3833 Element.html( Data[ FieldName ] );
3834 }
3835 else
3836 {
3837 Element.val( Data[ FieldName ] );
3838 }
3839 }
3840 }
3841
3853 ultimix.multiple_line.TriggerOnAddEvent = function( Selector , AddedLine , Data )
3854 {
3855 var Control = jQuery( Selector );
3856
3857 /* calling event handler */
3858 if( jQuery( Control ).attr( 'onaddline' ) )
3859 {
3860 eval( jQuery( Control ).attr( 'onaddline' ) + '( AddedLine , Data );' );
3861 }
3862 else
3863 {
3864 eval( 'ultimix.multiple_line.OnAddLine( AddedLine , Data );' );
3865 }
3866 }
3867
3879 ultimix.multiple_line.AddLineForSelector = function( Selector , Object , AfterLine )
3880 {
3881 if( Object && jQuery( Object ).html() )
3882 {
3883 eval( 'var Data = ' + jQuery( Object ).html() );
3884 }
3885 else
3886 {
3887 eval( 'var Data = {}' );
3888 }
3889
3890 var AddedLine = ultimix.multiple_line.AddLineInDOM( Selector , Object , AfterLine );
3891
3892 ultimix.multiple_line.TriggerOnAddEvent( Selector , AddedLine , Data );
3893 }
3894
3902 ultimix.multiple_line.AddLine = function( Object )
3903 {
3904 ultimix.multiple_line.AddLineForSelector( jQuery( Object ).attr( 'control' ) , Object );
3905 }
3906
3914 ultimix.multiple_line.AddLineInEmptyControl = function( Control )
3915 {
3916 if( jQuery( Control ).find( 'table.multiple_line_single_line' ).length == 0 )
3917 {
3918 ultimix.multiple_line.AddLineForSelector( jQuery( Control ).children().first().attr( 'control' ) );
3919 }
3920 }
3921
3927 jQuery(
3928 function()
3929 {
3930 /* processing templates */
3931 jQuery( '.multiple_line_template' ).each(
3932 function( Index , Object )
3933 {
3934 ultimix.multiple_line.CreateMultypleLineControl( Object );
3935 }
3936 );
3937
3938 /* processing lines */
3939 jQuery( '.multiple_line_element' ).each(
3940 function( Index , Object )
3941 {
3942 ultimix.multiple_line.AddLine( Object );
3943 }
3944 );
3945
3946 /* additing empty lines if necessary */
3947 jQuery( '.multiple_line_template' ).each(
3948 function( Index , Object )
3949 {
3950 ultimix.multiple_line.AddLineInEmptyControl( jQuery( Object ).parent() );
3951 }
3952 );
3953 }
3954 );
3960 if( !ultimix )
3961 {
3962 ultimix = {};
3963 }
3964
3970 if( !ultimix.report )
3971 {
3972 ultimix.report = {};
3973 }
3974
3988 ultimix.report.CreateFrame = function( PackageName , PackageVersion , ReportName , Data )
3989 {
3990 if( jQuery( '#report_generation_id' ).length )
3991 {
3992 jQuery( '#report_generation_id' ).remove();
3993 }
3994
3995 var ReportGenerationParameters = '';
3996 if( !Data )
3997 {
3998 Data = {};
3999 }
4000 for( i in Data )
4001 {
4002 ReportGenerationParameters = '&' + i + "=" + new String( Data[ i ] ) + ReportGenerationParameters;
4003 }
4004
4005 IFrameCode = '<iframe id="report_generation_id" style="display: none;" src="./report.html?report_package_name=';
4006 IFrameCode = IFrameCode + PackageName + '&report_package_version=' + PackageVersion;
4007 IFrameCode = IFrameCode + '&report_name=' + ReportName + '&' + ( new Date() ).getTime();
4008 IFrameCode = IFrameCode + ReportGenerationParameters + '"></iframe>';
4009 jQuery( 'body' ).append( IFrameCode );
4010 }
4011
4021 ultimix.report.ReportGenerationProcess = function( OnGenerate , ShowProgress )
4022 {
4023 if( ShowProgress )
4024 {
4025 var LoadingId = ultimix.std_dialogs.MessageBox(
4026 ultimix.get_string( 'report_is_generating' ) ,
4027 ultimix.get_string( 'report' ) ,
4028 ultimix.std_dialogs.MB_ICONLOADING
4029 );
4030 }
4031
4032 jQuery( '#report_generation_id' ).load(
4033 function()
4034 {
4035 if( ShowProgress )
4036 {
4037 ultimix.std_dialogs.CloseMessageBox( LoadingId );
4038 }
4039 if( OnGenerate )
4040 {
4041 OnGenerate();
4042 }
4043 }
4044 );
4045 }
4046
4064 ultimix.report.GenerateReport = function( PackageName , PackageVersion , ReportName , Data , OnGenerate , ShowProgress )
4065 {
4066 ultimix.report.CreateFrame( PackageName , PackageVersion , ReportName , Data );
4067
4068 ultimix.report.ReportGenerationProcess( OnGenerate , ShowProgress );
4069 }
4070
4082 ultimix.report.OnRunReportGeneration = function( DataAcceptor , StatusAcceptor , DataSource )
4083 {
4084 var PackageName = jQuery( DataSource ).find( 'span.package_name' ).html();
4085 var PackageVersion = jQuery( DataSource ).find( 'span.package_version' ).html();
4086 var ReportName = jQuery( DataSource ).find( 'span.report_name' ).html();
4087 var Data = ultimix.forms.ExtractFormData( DataSource );
4088
4089 ultimix.report.GenerateReport( PackageName , PackageVersion , ReportName , Data , false , true );
4090 }
4091
4097 if( !ultimix )
4098 {
4099 ultimix = {};
4100 }
4101
4107 if( !ultimix.std_dialogs )
4108 {
4109 ultimix.std_dialogs = {};
4110 }
4111
4117 ultimix.std_dialogs.MB_ABORT = 1;
4118 ultimix.std_dialogs.MB_RETRY = 2;
4119 ultimix.std_dialogs.MB_IGNORE = 4;
4120 ultimix.std_dialogs.MB_ABORTRETRYIGNORE = 7;
4121 ultimix.std_dialogs.MB_CANCEL = 8;
4122 ultimix.std_dialogs.MB_TRY = 16;
4123 ultimix.std_dialogs.MB_CONTINUE = 32;
4124 ultimix.std_dialogs.MB_CANCELTRYCONTINUE = 56;
4125 ultimix.std_dialogs.MB_HELP = 64;
4126 ultimix.std_dialogs.MB_OK = 128;
4127 ultimix.std_dialogs.MB_OKCANCEL = 136;
4128 ultimix.std_dialogs.MB_RETRYCANCEL = 10;
4129 ultimix.std_dialogs.MB_YES = 256;
4130 ultimix.std_dialogs.MB_NO = 512;
4131 ultimix.std_dialogs.MB_YESNO = 768;
4132 ultimix.std_dialogs.MB_YESNOCANCEL = 776;
4133
4139 ultimix.std_dialogs.MB_ICONEXCLAMATION = 2048;
4140 ultimix.std_dialogs.MB_ICONWARNING = 4096;
4141 ultimix.std_dialogs.MB_ICONINFORMATION = 8192;
4142 ultimix.std_dialogs.MB_ICONASTERISK = 16384;
4143 ultimix.std_dialogs.MB_ICONQUESTION = 32768;
4144 ultimix.std_dialogs.MB_ICONSTOP = 65536;
4145 ultimix.std_dialogs.MB_ICONERROR = 131072;
4146 ultimix.std_dialogs.MB_ICONHAND = 262144;
4147 ultimix.std_dialogs.MB_ICONLOADING = 524288;
4148 ultimix.std_dialogs.MB_ICONWAIT = 524288;
4149 ultimix.std_dialogs.MB_MODAL = 1048576;
4150
4151 ultimix.std_dialogs.MessageBoxCounter = 0;
4152
4160 ultimix.std_dialogs.CloseMessageBox = function( Selector )
4161 {
4162 jQuery( Selector ).dialog( "close" );
4163 jQuery( Selector ).remove();
4164 }
4165
4183 ultimix.std_dialogs.MessageBox = function( Text , Caption , Style , AcceptResult )
4184 {
4185 if( !Caption )
4186 {
4187 Caption = 'MessageBox';
4188 }
4189 if( !Style )
4190 {
4191 Style = ultimix.std_dialogs.MB_OK;
4192 }
4193
4194 Class = 'jsdialogs-default';
4195 if( Style & ultimix.std_dialogs.MB_ICONEXCLAMATION ) Class = 'jsdialogs-exclamation';
4196 if( Style & ultimix.std_dialogs.MB_ICONWARNING ) Class = 'jsdialogs-warning';
4197 if( Style & ultimix.std_dialogs.MB_ICONINFORMATION ) Class = 'jsdialogs-information';
4198 if( Style & ultimix.std_dialogs.MB_ICONASTERISK ) Class = 'jsdialogs-asterisk';
4199 if( Style & ultimix.std_dialogs.MB_ICONQUESTION ) Class = 'jsdialogs-question';
4200 if( Style & ultimix.std_dialogs.MB_ICONSTOP ) Class = 'jsdialogs-stop';
4201 if( Style & ultimix.std_dialogs.MB_ICONERROR ) Class = 'jsdialogs-error';
4202 if( Style & ultimix.std_dialogs.MB_ICONHAND ) Class = 'jsdialogs-hand';
4203 if( Style & ultimix.std_dialogs.MB_ICONLOADING ) Class = 'jsdialogs-loading';
4204
4205 var id = "ultimix-MessageBox-span-" + ultimix.std_dialogs.MessageBoxCounter++;
4206
4207 var Modal = false;
4208 if( Style & ultimix.std_dialogs.MB_MODAL ) Modal = true;
4209
4210 if( !jQuery( "#" + id ).length )
4211 {
4212 jQuery( "body" ).append( '<span id="' + id + '" style="display:none"></span>' );
4213 }
4214
4215 var ExitOnEscape = true;
4216 if( Style & ultimix.std_dialogs.MB_ICONLOADING ) ExitOnEscape = false;
4217
4218 var Buttons = {};
4219 if( Style & ultimix.std_dialogs.MB_ABORT )
4220 {
4221 Buttons[ ultimix.get_string( 'Abort' ) ] = function(){ if( AcceptResult )AcceptResult( ultimix.std_dialogs.MB_ABORT ); ultimix.std_dialogs.CloseMessageBox( "#" + id ); };
4222 }
4223 if( Style & ultimix.std_dialogs.MB_RETRY )
4224 {
4225 Buttons[ ultimix.get_string( 'Retry' ) ] = function(){ if( AcceptResult )AcceptResult( ultimix.std_dialogs.MB_RETRY ); ultimix.std_dialogs.CloseMessageBox( "#" + id ); };
4226 }
4227 if( Style & ultimix.std_dialogs.MB_IGNORE )
4228 {
4229 Buttons[ ultimix.get_string( 'Ignore' ) ] = function(){ if( AcceptResult )AcceptResult( ultimix.std_dialogs.MB_IGNORE ); ultimix.std_dialogs.CloseMessageBox( "#" + id ); };
4230 }
4231 if( Style & ultimix.std_dialogs.MB_NO )
4232 {
4233 Buttons[ ultimix.get_string( 'No' ) ] = function(){ if( AcceptResult )AcceptResult( ultimix.std_dialogs.MB_NO ); ultimix.std_dialogs.CloseMessageBox( "#" + id ); };
4234 }
4235 if( Style & ultimix.std_dialogs.MB_YES )
4236 {
4237 Buttons[ ultimix.get_string( 'Yes' ) ] = function(){ if( AcceptResult )AcceptResult( ultimix.std_dialogs.MB_YES ); ultimix.std_dialogs.CloseMessageBox( "#" + id ); };
4238 }
4239 if( Style & ultimix.std_dialogs.MB_CANCEL )
4240 {
4241 Buttons[ ultimix.get_string( 'Cancel' ) ] = function(){ if( AcceptResult )AcceptResult( ultimix.std_dialogs.MB_CANCEL ); ultimix.std_dialogs.CloseMessageBox( "#" + id ); };
4242 }
4243 if( Style & ultimix.std_dialogs.MB_OK )
4244 {
4245 Buttons[ ultimix.get_string( 'OK' ) ] = function(){ if( AcceptResult )AcceptResult( ultimix.std_dialogs.MB_OK ); ultimix.std_dialogs.CloseMessageBox( "#" + id ); };
4246 }
4247 if( Style & ultimix.std_dialogs.MB_HELP )
4248 {
4249 Buttons[ ultimix.get_string( 'Help' ) ] = function(){ if( AcceptResult )AcceptResult( ultimix.std_dialogs.MB_HELP ); ultimix.std_dialogs.CloseMessageBox( "#" + id ); };
4250 }
4251 if( Style & ultimix.std_dialogs.MB_CONTINUE )
4252 {
4253 Buttons[ ultimix.get_string( 'Continue' ) ] = function(){ if( AcceptResult )AcceptResult( ultimix.std_dialogs.MB_CONTINUE ); ultimix.std_dialogs.CloseMessageBox( "#" + id ); };
4254 }
4255
4256 jQuery( "#" + id ).dialog( { width: 480 , modal : Modal , title : ultimix.get_string( Caption ) , buttons : Buttons , resizable : false , closeOnEscape : ExitOnEscape } )
4257 jQuery( "#" + id ).html( '<div class="ultimix-MessageBox-content"><div class="' + Class + '"></div>' + ultimix.get_string( Text ) + '</div>' );
4258 jQuery( "#" + id ).parent().find( '.ui-dialog-titlebar-close' ).remove();
4259
4260 return( "#" + id );
4261 }
4262
4270 ultimix.std_dialogs.WaitingMessageBox = function()
4271 {
4272 return(
4273 ultimix.std_dialogs.MessageBox(
4274 ultimix.get_string( 'wait_please' ) ,
4275 ultimix.get_string( 'Info' ) ,
4276 ultimix.std_dialogs.MB_ICONLOADING | ultimix.std_dialogs.MB_MODAL
4277 )
4278 );
4279 }
4280
4290 ultimix.std_dialogs.ErrorMessageBox = function( Text )
4291 {
4292 return(
4293 ultimix.std_dialogs.MessageBox(
4294 ultimix.get_string( Text ) ,
4295 ultimix.get_string( 'Error' ) ,
4296 ultimix.std_dialogs.MB_OK | ultimix.std_dialogs.MB_ICONERROR | ultimix.std_dialogs.MB_MODAL
4297 )
4298 );
4299 }
4300
4312 ultimix.std_dialogs.QuestionMessageBox = function( Text , Success )
4313 {
4314 return(
4315 ultimix.std_dialogs.MessageBox(
4316 ultimix.get_string( Text ) ,
4317 ultimix.get_string( 'Question' ) ,
4318 ultimix.std_dialogs.MB_YESNO | ultimix.std_dialogs.MB_ICONQUESTION | ultimix.std_dialogs.MB_MODAL , Success
4319 )
4320 );
4321 }
4327 if( !ultimix )
4328 {
4329 ultimix = {};
4330 }
4331
4337 if( !ultimix.ajax_gate )
4338 {
4339 ultimix.ajax_gate = {};
4340 }
4341
4353 ultimix.ajax_gate.DirectController = function( Data , Success , Options )
4354 {
4355 if( !Options )Options = {};
4356 jQuery.extend( Options , { 'async' : true , 'dataType' : 'text' } );
4357 jQuery.extend( Data , { 'auto_redirect' : 0 , 'template' : 'ajax_result_template' } );
4358
4359 jQuery.ajax(
4360 {
4361 async : Options.async ,
4362 type : 'POST' ,
4363 url : 'direct_controller.html?' + ( new Date() ).getTime() ,
4364 data : Data ,
4365 success : Success
4366 }
4367 );
4368 }
4369
4389 ultimix.ajax_gate.DirectControllerMeta = function( PackageName , PackageVersion , Meta , DataSource , Success , Waiting , Options )
4390 {
4391
4392 var Data = ultimix.forms.ExtractFormData( DataSource );
4393
4394 jQuery.extend( Data , { 'package_name' : PackageName , 'package_version' : PackageVersion , 'meta' : Meta } );
4395
4396 var DialogSelector = false;
4397
4398 if( !Waiting )
4399 {
4400 DialogSelector = ultimix.std_dialogs.WaitingMessageBox();
4401 }
4402
4403 var AtuoSuccess = function( Result )
4404 {
4405 if( !Waiting )
4406 {
4407 ultimix.std_dialogs.CloseMessageBox( DialogSelector );
4408 }
4409
4410 Success( Result );
4411 }
4412
4413 ultimix.ajax_gate.DirectController( Data , AtuoSuccess , Options );
4414 }
4415
4427 ultimix.ajax_gate.DirectView = function( Data , Success , Options )
4428 {
4429 if( !Options )Options = {};
4430 jQuery.extend( { 'async' : true , 'dataType' : 'json' } , Options );
4431 jQuery.extend( { 'auto_redirect' : 0 , 'template' : 'ajax_result_template' } , Data );
4432
4433 jQuery.ajax(
4434 {
4435 async : Options.async ,
4436 type : 'POST' ,
4437 url : 'direct_view.html?' + ( new Date() ).getTime() ,
4438 data : Data ,
4439 success : Success
4440 }
4441 );
4442 }
4443
4457 ultimix.ajax_gate.DirectViewComposer = function( Selector , Data , Url , Options )
4458 {
4459 if( !Options )Options = {};
4460 jQuery.extend( { 'async' : true , 'template' : 'standalone_view' } , Options );
4461
4462 jQuery.ajax(
4463 {
4464 async : Options.async ,
4465 type : 'POST' ,
4466 url : Url + '?' + ( new Date() ).getTime() ,
4467 data : Data ,
4468 success : function( Content )
4469 {
4470 if( Options.replace )
4471 {
4472 jQuery( Selector ).replaceWith( Content );
4473 }
4474 else
4475 {
4476 jQuery( Selector ).html( Content );
4477 }
4478 }
4479 }
4480 );
4481 }
4482
4500 function SetCookie( Name , Value , Expiredays , Path , Domain , Secure )
4501 {
4502 if( Expiredays )
4503 {
4504 var Exdate = new Date();
4505 Exdate.setDate( Exdate.getDate() + Expiredays );
4506 var Expires = Exdate.toGMTString();
4507 }
4508
4509 document.cookie = Name + "=" + escape( Value ) +
4510 ( ( Expiredays ) ? "; expires=" + Expires : "" ) +
4511 ( ( Path ) ? "; path=" + Path : "" ) +
4512 ( ( Domain ) ? "; domain=" + Domain : "" ) +
4513 ( ( Secure ) ? "; secure" : "" );
4514 }
4515
4527 function GetCookie( Name , Default )
4528 {
4529 var Cookie = " " + document.cookie;
4530 var Search = " " + Name + "=";
4531 var SetStr = Default;
4532 var Offset = 0;
4533 var End = 0;
4534 if( Cookie.length > 0 )
4535 {
4536 Offset = Cookie.indexOf( Search );
4537 if( Offset != -1 )
4538 {
4539 Offset += Search.length;
4540 End = Cookie.indexOf( ";" , Offset )
4541 if( End == -1 )
4542 {
4543 End = Cookie.length;
4544 }
4545 SetStr = unescape( Cookie.substring( Offset , End ) );
4546 }
4547 }
4548
4549 return( SetStr );
4550 }
4551
4557 if( !ultimix )
4558 {
4559 ultimix = {};
4560 }
4561
4567 if( !ultimix.core )
4568 {
4569 ultimix.core = {};
4570 }
4571
4572
4578 function in_array( Element , Arr )
4579 {
4580 for( var i = 0 ; i < Arr.length ; i++ )
4581 {
4582 if( Element == Arr[ i ] )
4583 {
4584 return( true );
4585 }
4586 }
4587 return( false );
4588 }
4589
4595 function nop()
4596 {
4597 }
4598
4604 ultimix.DeleteParentItem = function( Selector )
4605 {
4606 jQuery( Selector ).parent().remove();
4607 }
4608
4620 ultimix.GetRandomInt = function( Min , Max )
4621 {
4622 if( !Min )Min = 0;
4623 if( !Max )Max = 1000000000;
4624
4625 return( Math.floor( Math.random() * ( Max - Min + 1 ) ) + Min );
4626 }
4627
4635 ultimix.core.GetCurrentMilliseconds = function()
4636 {
4637 var d = new Date();
4638 return( d.getTime() );
4639 }
4640
4650 ultimix.md5 = function( str )
4651 { /* Calculate the md5 hash of a string
4652
4653 + original by: Webtoolkit.info (http:/ /www.webtoolkit.info/)
4654 + namespaced by: Michael White (http:/ /crestidg.com)*/
4655
4656 var RotateLeft = function(lValue, iShiftBits) {
4657 return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits));
4658 };
4659
4660 var AddUnsigned = function(lX,lY) {
4661 var lX4,lY4,lX8,lY8,lResult;
4662 lX8 = (lX & 0x80000000);
4663 lY8 = (lY & 0x80000000);
4664 lX4 = (lX & 0x40000000);
4665 lY4 = (lY & 0x40000000);
4666 lResult = (lX & 0x3FFFFFFF)+(lY & 0x3FFFFFFF);
4667 if (lX4 & lY4) {
4668 return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
4669 }
4670 if (lX4 | lY4) {
4671 if (lResult & 0x40000000) {
4672 return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
4673 } else {
4674 return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
4675 }
4676 } else {
4677 return (lResult ^ lX8 ^ lY8);
4678 }
4679 };
4680
4681 var F = function(x,y,z) { return (x & y) | ((~x) & z); };
4682 var G = function(x,y,z) { return (x & z) | (y & (~z)); };
4683 var H = function(x,y,z) { return (x ^ y ^ z); };
4684 var I = function(x,y,z) { return (y ^ (x | (~z))); };
4685
4686 var FF = function(a,b,c,d,x,s,ac) {
4687 a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
4688 return AddUnsigned(RotateLeft(a, s), b);
4689 };
4690
4691 var GG = function(a,b,c,d,x,s,ac) {
4692 a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
4693 return AddUnsigned(RotateLeft(a, s), b);
4694 };
4695
4696 var HH = function(a,b,c,d,x,s,ac) {
4697 a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
4698 return AddUnsigned(RotateLeft(a, s), b);
4699 };
4700
4701 var II = function(a,b,c,d,x,s,ac) {
4702 a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
4703 return AddUnsigned(RotateLeft(a, s), b);
4704 };
4705
4706 var ConvertToWordArray = function(str) {
4707 var lWordCount;
4708 var lMessageLength = str.length;
4709 var lNumberOfWords_temp1=lMessageLength + 8;
4710 var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1 % 64))/64;
4711 var lNumberOfWords = (lNumberOfWords_temp2+1)*16;
4712 var lWordArray=Array(lNumberOfWords-1);
4713 var lBytePosition = 0;
4714 var lByteCount = 0;
4715 while ( lByteCount < lMessageLength ) {
4716 lWordCount = (lByteCount-(lByteCount % 4))/4;
4717 lBytePosition = (lByteCount % 4)*8;
4718 lWordArray[lWordCount] = (lWordArray[lWordCount] | (str.charCodeAt(lByteCount)<<lBytePosition));
4719 lByteCount++;
4720 }
4721 lWordCount = (lByteCount-(lByteCount % 4))/4;
4722 lBytePosition = (lByteCount % 4)*8;
4723 lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80<<lBytePosition);
4724 lWordArray[lNumberOfWords-2] = lMessageLength<<3;
4725 lWordArray[lNumberOfWords-1] = lMessageLength>>>29;
4726 return lWordArray;
4727 };
4728
4729 var WordToHex = function(lValue) {
4730 var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
4731 for (lCount = 0;lCount<=3;lCount++) {
4732 lByte = (lValue>>>(lCount*8)) & 255;
4733 WordToHexValue_temp = "0" + lByte.toString(16);
4734 WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
4735 }
4736 return WordToHexValue;
4737 };
4738
4739 var x = Array();
4740 var k , AA , BB , CC , DD , a , b , c , d;
4741 var S11 = 7 , S12 = 12 , S13 = 17 , S14 = 22;
4742 var S21 = 5 , S22 = 9 , S23 = 14 , S24 = 20;
4743 var S31 = 4 , S32 = 11 , S33 = 16 , S34 = 23;
4744 var S41 = 6 , S42 = 10 , S43 = 15 , S44 = 21;
4745
4746 str = this.utf8_encode( str );
4747 x = ConvertToWordArray( str );
4748 a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;
4749
4750 for( k = 0 ; k < x.length ; k += 16 )
4751 {
4752 AA = a; BB = b; CC = c; DD = d;
4753 a = FF(a,b,c,d,x[k+0], S11,0xD76AA478);
4754 d = FF(d,a,b,c,x[k+1], S12,0xE8C7B756);
4755 c = FF(c,d,a,b,x[k+2], S13,0x242070DB);
4756 b = FF(b,c,d,a,x[k+3], S14,0xC1BDCEEE);
4757 a = FF(a,b,c,d,x[k+4], S11,0xF57C0FAF);
4758 d = FF(d,a,b,c,x[k+5], S12,0x4787C62A);
4759 c = FF(c,d,a,b,x[k+6], S13,0xA8304613);
4760 b = FF(b,c,d,a,x[k+7], S14,0xFD469501);
4761 a = FF(a,b,c,d,x[k+8], S11,0x698098D8);
4762 d = FF(d,a,b,c,x[k+9], S12,0x8B44F7AF);
4763 c = FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);
4764 b = FF(b,c,d,a,x[k+11],S14,0x895CD7BE);
4765 a = FF(a,b,c,d,x[k+12],S11,0x6B901122);
4766 d = FF(d,a,b,c,x[k+13],S12,0xFD987193);
4767 c = FF(c,d,a,b,x[k+14],S13,0xA679438E);
4768 b = FF(b,c,d,a,x[k+15],S14,0x49B40821);
4769 a = GG(a,b,c,d,x[k+1], S21,0xF61E2562);
4770 d = GG(d,a,b,c,x[k+6], S22,0xC040B340);
4771 c = GG(c,d,a,b,x[k+11],S23,0x265E5A51);
4772 b = GG(b,c,d,a,x[k+0], S24,0xE9B6C7AA);
4773 a = GG(a,b,c,d,x[k+5], S21,0xD62F105D);
4774 d = GG(d,a,b,c,x[k+10],S22,0x2441453);
4775 c = GG(c,d,a,b,x[k+15],S23,0xD8A1E681);
4776 b = GG(b,c,d,a,x[k+4], S24,0xE7D3FBC8);
4777 a = GG(a,b,c,d,x[k+9], S21,0x21E1CDE6);
4778 d = GG(d,a,b,c,x[k+14],S22,0xC33707D6);
4779 c = GG(c,d,a,b,x[k+3], S23,0xF4D50D87);
4780 b = GG(b,c,d,a,x[k+8], S24,0x455A14ED);
4781 a = GG(a,b,c,d,x[k+13],S21,0xA9E3E905);
4782 d = GG(d,a,b,c,x[k+2], S22,0xFCEFA3F8);
4783 c = GG(c,d,a,b,x[k+7], S23,0x676F02D9);
4784 b = GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);
4785 a = HH(a,b,c,d,x[k+5], S31,0xFFFA3942);
4786 d = HH(d,a,b,c,x[k+8], S32,0x8771F681);
4787 c = HH(c,d,a,b,x[k+11],S33,0x6D9D6122);
4788 b = HH(b,c,d,a,x[k+14],S34,0xFDE5380C);
4789 a = HH(a,b,c,d,x[k+1], S31,0xA4BEEA44);
4790 d = HH(d,a,b,c,x[k+4], S32,0x4BDECFA9);
4791 c = HH(c,d,a,b,x[k+7], S33,0xF6BB4B60);
4792 b = HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);
4793 a = HH(a,b,c,d,x[k+13],S31,0x289B7EC6);
4794 d = HH(d,a,b,c,x[k+0], S32,0xEAA127FA);
4795 c = HH(c,d,a,b,x[k+3], S33,0xD4EF3085);
4796 b = HH(b,c,d,a,x[k+6], S34,0x4881D05);
4797 a = HH(a,b,c,d,x[k+9], S31,0xD9D4D039);
4798 d = HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);
4799 c = HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);
4800 b = HH(b,c,d,a,x[k+2], S34,0xC4AC5665);
4801 a = II(a,b,c,d,x[k+0], S41,0xF4292244);
4802 d = II(d,a,b,c,x[k+7], S42,0x432AFF97);
4803 c = II(c,d,a,b,x[k+14],S43,0xAB9423A7);
4804 b = II(b,c,d,a,x[k+5], S44,0xFC93A039);
4805 a = II(a,b,c,d,x[k+12],S41,0x655B59C3);
4806 d = II(d,a,b,c,x[k+3], S42,0x8F0CCC92);
4807 c = II(c,d,a,b,x[k+10],S43,0xFFEFF47D);
4808 b = II(b,c,d,a,x[k+1], S44,0x85845DD1);
4809 a = II(a,b,c,d,x[k+8], S41,0x6FA87E4F);
4810 d = II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);
4811 c = II(c,d,a,b,x[k+6], S43,0xA3014314);
4812 b = II(b,c,d,a,x[k+13],S44,0x4E0811A1);
4813 a = II(a,b,c,d,x[k+4], S41,0xF7537E82);
4814 d = II(d,a,b,c,x[k+11],S42,0xBD3AF235);
4815 c = II(c,d,a,b,x[k+2], S43,0x2AD7D2BB);
4816 b = II(b,c,d,a,x[k+9], S44,0xEB86D391);
4817 a = AddUnsigned(a,AA);
4818 b = AddUnsigned(b,BB);
4819 c = AddUnsigned(c,CC);
4820 d = AddUnsigned(d,DD);
4821 }
4822
4823 var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);
4824
4825 return temp.toLowerCase();
4826 }
4827
4831 function FirstToSecond( FirstPanel , SecondPanel , EntityName )
4832 {
4833 if( EntityName != '' )
4834 {
4835 document.getElementById( FirstPanel ).removeChild( document.getElementById( EntityName + '_hidden_id' ) );
4836 document.getElementById( FirstPanel ).removeChild( document.getElementById( EntityName + '_div_id_first' ) );
4837 document.getElementById( SecondPanel ).innerHTML += "<div onclick=\"javascript:SecondToFirst( '" + FirstPanel + "' , '" + SecondPanel + "' , '" + EntityName + "' );\" class='double_panel_row no_selection_text' id='" + EntityName + "_div_id_second'>" + EntityName + "</div>";
4838
4839 jQuery( '.no_selection_text' ).disableTextSelect();
4840 }
4841 }
4842
4846 function SecondToFirst( FirstPanel , SecondPanel , EntityName )
4847 {
4848 if( EntityName != '' )
4849 {
4850 document.getElementById( FirstPanel ).innerHTML += "<input type='hidden' name='entities[]' id='" + EntityName + "_hidden_id' value='" + EntityName + "'>";
4851 document.getElementById( SecondPanel ).removeChild( document.getElementById( EntityName + '_div_id_second' ) );
4852 document.getElementById( FirstPanel ).innerHTML += "<div onclick=\"javascript:FirstToSecond( '" + FirstPanel + "' , '" + SecondPanel + "' , '" + EntityName + "' );\" class='double_panel_row no_selection_text' id='" + EntityName + "_div_id_first'>" + EntityName + "</div>";
4853
4854 jQuery( '.no_selection_text' ).disableTextSelect();
4855 }
4856 }
4857
4861 function InitPanels( FirstPanel , SecondPanel , FirstPanelEntities , SecondPanelEntities )
4862 {
4863 if( FirstPanelEntities != '' )
4864 {
4865 FirstPanelEntities = FirstPanelEntities.split( ',' );
4866
4867 for( i = 0 ; i < FirstPanelEntities.length ; i++ )
4868 {
4869 document.getElementById( FirstPanel ).innerHTML += "<div onclick=\"javascript:FirstToSecond( '" + FirstPanel + "' , '" + SecondPanel + "' , '" + FirstPanelEntities[ i ] + "' );\" class='double_panel_row no_selection_text' id='" + FirstPanelEntities[ i ] + "_div_id_first'>" + FirstPanelEntities[ i ] + "</div>";
4870 document.getElementById( FirstPanel ).innerHTML += "<input type='hidden' name='entities[]' id='" + FirstPanelEntities[ i ] + "_hidden_id' value='" + FirstPanelEntities[ i ] + "'>";
4871 }
4872 }
4873 else
4874 {
4875 FirstPanelEntities = new Array;
4876 }
4877
4878 if( SecondPanelEntities != '' )
4879 {
4880 SecondPanelEntities = SecondPanelEntities.split( ',' );
4881
4882 for( i = 0 ; i < SecondPanelEntities.length ; i++ )
4883 {
4884 if( in_array( SecondPanelEntities[ i ] , FirstPanelEntities ) == false )
4885 {
4886 document.getElementById( SecondPanel ).innerHTML += "<div onclick=\"javascript:SecondToFirst( '" + FirstPanel + "' , '" + SecondPanel + "' , '" + SecondPanelEntities[ i ] + "' );\" class='double_panel_row no_selection_text' id='" + SecondPanelEntities[ i ] + "_div_id_second'>" + SecondPanelEntities[ i ] + "</div>";
4887 }
4888 }
4889 }
4890 jQuery( function()
4891 {
4892 jQuery( '.no_selection_text' ).disableTextSelect();
4893 }
4894 );
4895 }
4896
4902 if( !ultimix )
4903 {
4904 ultimix = {};
4905 }
4906
4912 if( !ultimix.forms )
4913 {
4914 ultimix.forms = {};
4915 }
4916
4926 ultimix.forms.EnterProcessor = function( e , Id )
4927 {
4928 if( e.keyCode == 13 )
4929 {
4930 document.getElementById( Id ).submit();
4931 }
4932 }
4933
4943 ultimix.forms.TripleSetCheckboxClick = function( Id , Name )
4944 {
4945 Checkbox = document.getElementById( '_checkbox_' + Id );
4946 Value = document.getElementById( Id );
4947
4948 if( Value.value == 0 )
4949 {
4950 jQuery( Checkbox ).prop( 'checked' , true );
4951 Checkbox.disabled = false;
4952 Value.value = 1;
4953 return;
4954 }
4955
4956 if( Value.value == 1 )
4957 {
4958 jQuery( Checkbox ).prop( 'checked' , true );
4959 Checkbox.disabled = true;
4960 Value.value = 2;
4961 return;
4962 }
4963
4964 if( Value.value == 2 )
4965 {
4966 jQuery( Checkbox ).prop( 'checked' , false );
4967 Checkbox.disabled = false;
4968 Value.value = 0;
4969 return;
4970 }
4971 }
4972
4982 ultimix.forms.DoubleSetCheckboxClick = function( Id , Name )
4983 {
4984 Checkbox = document.getElementById( '_checkbox_' + Id );
4985 Value = document.getElementById( Id );
4986
4987 if( Value.value == 0 )
4988 {
4989 jQuery( Checkbox ).prop( 'checked' , true );
4990 Value.value = 1;
4991 return;
4992 }
4993
4994 if( Value.value == 1 )
4995 {
4996 jQuery( Checkbox ).prop( 'checked' , false );
4997 Value.value = 0;
4998 return;
4999 }
5000 }
5001
5017 ultimix.forms.SubmitForm0 = function( FormId , ConfirmString , Action , Waiting , Method )
5018 {
5019 if( document.getElementById( FormId ) == null )
5020 {
5021 ultimix.std_dialogs.ErrorMessageBox( 'Form ' + FormId + ' was not found' );
5022 return;
5023 }
5024
5025 Success = function( Result )
5026 {
5027 if( Result == ultimix.std_dialogs.MB_YES )
5028 {
5029 if( Action )
5030 {
5031 document.getElementById( FormId ).setAttribute( 'action' , Action );
5032 }
5033 if( Method )
5034 {
5035 document.getElementById( FormId ).setAttribute( 'method' , Method );
5036 }
5037
5038 document.getElementById( FormId ).submit();
5039
5040 if( Waiting )
5041 {
5042 ultimix.std_dialogs.WaitingMessageBox();
5043 }
5044 }
5045 }
5046
5047 if( ConfirmString )
5048 {
5049 ultimix.std_dialogs.QuestionMessageBox( ConfirmString , Success );
5050 return;
5051 }
5052
5053 Success( ultimix.std_dialogs.MB_YES );
5054 }
5055
5075 ultimix.forms.SubmitForm1 = function( FormId , Param1 , Value1 , ConfirmString , Action , Waiting , Method )
5076 {
5077 if( document.getElementById( FormId ) == null )
5078 {
5079 ultimix.std_dialogs.ErrorMessageBox( 'Form ' + FormId + ' was not found' );
5080 return;
5081 }
5082
5083 if( document.getElementById( Param1 ) == null )
5084 {
5085 ultimix.std_dialogs.ErrorMessageBox( 'Field ' + Param1 + ' was not found' );
5086 return;
5087 }
5088
5089 Success = function( Result )
5090 {
5091 if( Result == ultimix.std_dialogs.MB_YES )
5092 {
5093 document.getElementById( Param1 ).setAttribute( 'value' , Value1 );
5094 if( Action )
5095 {
5096 document.getElementById( FormId ).setAttribute( 'action' , Action );
5097 }
5098 if( Method )
5099 {
5100 document.getElementById( FormId ).setAttribute( 'method' , Method );
5101 }
5102
5103 document.getElementById( FormId ).submit();
5104
5105 if( Waiting )
5106 {
5107 ultimix.std_dialogs.WaitingMessageBox();
5108 }
5109 }
5110 }
5111
5112 if( ConfirmString )
5113 {
5114 ultimix.std_dialogs.QuestionMessageBox( ConfirmString , Success );
5115 return;
5116 }
5117
5118 Success( ultimix.std_dialogs.MB_YES );
5119 }
5120
5144 ultimix.forms.SubmitForm2 = function( FormId , Param1 , Value1 , Param2 , Value2 , ConfirmString , Action , Waiting , Method )
5145 {
5146 if( document.getElementById( FormId ) == null )
5147 {
5148 ultimix.std_dialogs.ErrorMessageBox( 'Form ' + FormId + ' was not found' );
5149 return;
5150 }
5151
5152 if( document.getElementById( Param1 ) == null )
5153 {
5154 ultimix.std_dialogs.ErrorMessageBox( 'Field ' + Param1 + ' was not found' );
5155 return;
5156 }
5157
5158 if( document.getElementById( Param2 ) == null )
5159 {
5160 ultimix.std_dialogs.ErrorMessageBox( 'Field ' + Param2 + ' was not found' );
5161 return;
5162 }
5163
5164 Success = function( Result )
5165 {
5166 if( Result == ultimix.std_dialogs.MB_YES )
5167 {
5168 document.getElementById( Param1 ).setAttribute( 'value' , Value1 );
5169 document.getElementById( Param2 ).setAttribute( 'value' , Value2 );
5170 if( Action )
5171 {
5172 document.getElementById( FormId ).setAttribute( 'action' , Action );
5173 }
5174 if( Method )
5175 {
5176 document.getElementById( FormId ).setAttribute( 'method' , Method );
5177 }
5178
5179 document.getElementById( FormId ).submit();
5180
5181 if( Waiting )
5182 {
5183 ultimix.std_dialogs.WaitingMessageBox();
5184 }
5185 }
5186 }
5187
5188 if( ConfirmString )
5189 {
5190 ultimix.std_dialogs.QuestionMessageBox( ConfirmString , Success );
5191 return;
5192 }
5193
5194 Success( ultimix.std_dialogs.MB_YES );
5195 }
5196
5224 ultimix.forms.SubmitForm3 = function( FormId , Param1 , Value1 , Param2 , Value2 , Param3 , Value3 , ConfirmString , Action , Waiting , Method )
5225 {
5226 if( document.getElementById( FormId ) == null )
5227 {
5228 ultimix.std_dialogs.ErrorMessageBox( 'Form ' + FormId + ' was not found' );
5229 return;
5230 }
5231
5232 if( document.getElementById( Param1 ) == null )
5233 {
5234 ultimix.std_dialogs.ErrorMessageBox( 'Field ' + Param1 + ' was not found' );
5235 return;
5236 }
5237
5238 if( document.getElementById( Param2 ) == null )
5239 {
5240 ultimix.std_dialogs.ErrorMessageBox( 'Field ' + Param2 + ' was not found' );
5241 return;
5242 }
5243
5244 if( document.getElementById( Param3 ) == null )
5245 {
5246 ultimix.std_dialogs.ErrorMessageBox( 'Field ' + Param3 + ' was not found' );
5247 return;
5248 }
5249
5250 Success = function( Result )
5251 {
5252 if( Result == ultimix.std_dialogs.MB_YES )
5253 {
5254 document.getElementById( Param1 ).setAttribute( 'value' , Value1 );
5255 document.getElementById( Param2 ).setAttribute( 'value' , Value2 );
5256 document.getElementById( Param3 ).setAttribute( 'value' , Value3 );
5257 if( Action )
5258 {
5259 document.getElementById( FormId ).setAttribute( 'action' , Action );
5260 }
5261 if( Method )
5262 {
5263 document.getElementById( FormId ).setAttribute( 'method' , Method );
5264 }
5265
5266 document.getElementById( FormId ).submit();
5267
5268 if( Waiting )
5269 {
5270 ultimix.std_dialogs.WaitingMessageBox();
5271 }
5272 }
5273 }
5274
5275 if( ConfirmString )
5276 {
5277 ultimix.std_dialogs.QuestionMessageBox( ConfirmString , Success );
5278 return;
5279 }
5280
5281 Success( ultimix.std_dialogs.MB_YES );
5282 }
5283
5293 ultimix.forms.ExtractFormData = function( Selector )
5294 {
5295 var Items = jQuery( Selector ).find( '*' ).andSelf();
5296 var Data = new Object();
5297
5298 for( var i = 0 ; i < Items.length ; i++ )
5299 {
5300 var TagName = jQuery( Items[ i ] ).prop( 'tagName' );
5301 TagName = TagName.toLowerCase();
5302
5303 if( TagName == 'input' )
5304 {
5305 var TagType = jQuery( Items[ i ] ).prop( 'type' );
5306 TagType = TagType.toLowerCase();
5307
5308 if( TagType == 'checkbox' )
5309 {
5310 if( jQuery( Items[ i ] ).prop( 'checked' ) )
5311 {
5312 Data[ jQuery( Items[ i ] ).attr( 'name' ) ] = 1;
5313 }
5314 else
5315 {
5316 Data[ jQuery( Items[ i ] ).attr( 'name' ) ] = 0;
5317 }
5318 continue;
5319 }
5320 if( TagType == 'radio' )
5321 {
5322 if( jQuery( Items[ i ] ).prop( 'checked' ) )
5323 {
5324 Data[ jQuery( Items[ i ] ).attr( 'name' ) ] = jQuery( Items[ i ] ).val();
5325 }
5326 continue;
5327 }
5328 if( TagType == 'text' || TagType == 'hidden' || TagType == 'password' )
5329 {
5330 Data[ jQuery( Items[ i ] ).attr( 'name' ) ] = jQuery( Items[ i ] ).val();
5331 continue;
5332 }
5333 }
5334 if( TagName == 'textarea' )
5335 {
5336 Data[ jQuery( Items[ i ] ).attr( 'name' ) ] = jQuery( Items[ i ] ).val();
5337 continue;
5338 }
5339 if( TagName == 'select' )
5340 {
5341 Data[ jQuery( Items[ i ] ).attr( 'name' ) ] = jQuery( Items[ i ] ).children( ':selected' ).eq( 0 ).val();
5342 continue;
5343 }
5344 }
5345
5346 return( Data );
5347 }
5348
5360 ultimix.forms.EditRecord = function( id , Prefix , Method )
5361 {
5362 ultimix.forms.SubmitForm2( Prefix + '_form' , Prefix + '_context_action' , 'update_record_form' , Prefix + '_record_id' , id , '' , '' , false , Method );
5363 }
5364
5374 ultimix.forms.CancelSearch = function( ElementId , Speed )
5375 {
5376 if( document.getElementById( 'search_string' ).value == '' )
5377 {
5378 ultimix.ToggleElement( ElementId , Speed );
5379 }
5380 else
5381 {
5382 document.getElementById( 'search_string' ).value = '';
5383 window.location.href = window.location.href;
5384 }
5385 }
5391 if( !ultimix )
5392 {
5393 ultimix = {};
5394 }
5395
5401 if( !ultimix.grids )
5402 {
5403 ultimix.grids = {};
5404 }
5405
5417 ultimix.grids.RecordSelected = function( Name , ErrorMessage )
5418 {
5419 return( ultimix.grids.RecordSelectedEx( '._' + Name + '_item_checkbox' , ErrorMessage ) );
5420 }
5421
5433 ultimix.grids.RecordSelectedEx = function( Selector , ErrorMessage )
5434 {
5435 var Items = jQuery( Selector );
5436
5437 for( i = 0 ; i < Items.length ; i++ )
5438 {
5439 if( jQuery( Items[ i ] ).prop( 'checked' ) )
5440 {
5441 return( true );
5442 }
5443 }
5444
5445 if( ErrorMessage )
5446 {
5447 ultimix.std_dialogs.MessageBox( ultimix.get_string( ErrorMessage ) , ultimix.get_string( 'Error' ) , ultimix.std_dialogs.MB_OK | ultimix.std_dialogs.MB_ICONERROR | ultimix.std_dialogs.MB_MODAL );
5448 }
5449
5450 return( false );
5451 }
5452
5462 ultimix.grids.GetIdentificators = function( Name )
5463 {
5464 return( ultimix.grids.GetIdentificatorsEx( '._' + Name + '_item_checkbox' ) );
5465 }
5466
5476 ultimix.grids.GetIdentificatorsEx = function( Selector )
5477 {
5478 var Identificators = new Array();
5479
5480 var Items = jQuery( Selector );
5481
5482 for( var i = 0 ; i < Items.length ; i++ )
5483 {
5484 if( jQuery( Items[ i ] ).prop( 'checked' ) )
5485 {
5486 Identificators.push( ( new String( jQuery( Items[ i ] ).attr( 'id' ) ) ).replace( '_id_' , '' ) );
5487 }
5488 }
5489
5490 return( Identificators );
5491 }
5492
5500 ultimix.grids.ToggleChildrenCheckboxes = function( Checkbox )
5501 {
5502 var ChildrenSelector = jQuery( Checkbox ).attr( 'children_selector' );
5503
5504 var Checked = jQuery( Checkbox ).prop( 'checked' );
5505
5506 jQuery( ChildrenSelector ).each(
5507 function()
5508 {
5509 jQuery( this ).prop( 'checked' , Checked );
5510
5511 /* if has children */
5512 if( jQuery( this ).attr( 'children_selector' ) )
5513 {
5514 /* ... then toggle children */
5515 ultimix.grids.ToggleChildrenCheckboxes( this );
5516 }
5517 }
5518 );
5519 }
5520
5528 ultimix.grids.TryToggleParentCheckbox = function( Checkbox )
5529 {
5530 var ParentSelector = jQuery( Checkbox ).attr( 'parent_selector' );
5531
5532 /* if has parent */
5533 if( ParentSelector )
5534 {
5535 /* ... then try to toggle it */
5536 var Checked = jQuery( Checkbox ).prop( 'checked' );
5537
5538 if( Checked )
5539 {
5540 var SiblingsSelector = jQuery( Checkbox ).attr( 'siblings_selector' );
5541 if( jQuery( SiblingsSelector ).length == jQuery( SiblingsSelector ).filter( ':checked' ).length )
5542 {
5543 jQuery( ParentSelector ).each(
5544 function()
5545 {
5546 jQuery( this ).prop( 'checked' , Checked );
5547 ultimix.grids.TryToggleParentCheckbox( this );
5548 }
5549 );
5550 }
5551 }
5552 else
5553 {
5554 jQuery( ParentSelector ).each(
5555 function()
5556 {
5557 jQuery( this ).prop( 'checked' , Checked );
5558 ultimix.grids.TryToggleParentCheckbox( this );
5559 }
5560 );
5561 }
5562 }
5563 }
5564
5572 ultimix.grids.ProcessLinkedCheckboxes = function( Checkbox )
5573 {
5574 ultimix.grids.ToggleChildrenCheckboxes( Checkbox );
5575 ultimix.grids.TryToggleParentCheckbox( Checkbox );
5576 }
5577
5597 ultimix.grids.SubmitForm0Mass = function( FormId , ConfirmString , Action , Name , NotSelectedErrorMessage , Waiting , Method )
5598 {
5599 if( ultimix.grids.RecordSelected( Name ) == false )
5600 {
5601 ultimix.std_dialogs.MessageBox( NotSelectedErrorMessage , ultimix.get_string( 'Error' ) , ultimix.std_dialogs.MB_OK | ultimix.std_dialogs.MB_ICONERROR | ultimix.std_dialogs.MB_MODAL );
5602 return;
5603 }
5604
5605 ultimix.forms.SubmitForm0( FormId , ConfirmString , Action , Waiting , Method );
5606 }
5607
5631 ultimix.grids.SubmitForm1Mass = function( FormId , Param1, Value1 , ConfirmString , Action , Name , NotSelectedErrorMessage , Waiting , Method )
5632 {
5633 if( ultimix.grids.RecordSelected( Name ) == false )
5634 {
5635 ultimix.std_dialogs.MessageBox( NotSelectedErrorMessage , ultimix.get_string( 'Error' ) , ultimix.std_dialogs.MB_OK | ultimix.std_dialogs.MB_ICONERROR | ultimix.std_dialogs.MB_MODAL );
5636 return;
5637 }
5638
5639 ultimix.forms.SubmitForm1( FormId , Param1, Value1 , ConfirmString , Action , Waiting , Method );
5640 }
5641
5669 ultimix.grids.SubmitForm2Mass = function( FormId , Param1, Value1 , Param2, Value2 , ConfirmString , Action , Name , NotSelectedErrorMessage , Waiting , Method )
5670 {
5671 if( ultimix.grids.RecordSelected( Name ) == false )
5672 {
5673 ultimix.std_dialogs.MessageBox( NotSelectedErrorMessage , ultimix.get_string( 'Error' ) , ultimix.std_dialogs.MB_OK | ultimix.std_dialogs.MB_ICONERROR | ultimix.std_dialogs.MB_MODAL );
5674 return;
5675 }
5676
5677 ultimix.forms.SubmitForm2( FormId , Param1, Value1 , Param2, Value2 , ConfirmString , Action , Waiting );
5678 }
5679
5711 ultimix.grids.SubmitForm3Mass = function( FormId , Param1, Value1 , Param2, Value2 , Param3, Value3 , ConfirmString , Action , Name , NotSelectedErrorMessage , Waiting , Method )
5712 {
5713 if( ultimix.grids.RecordSelected( Name ) == false )
5714 {
5715 ultimix.std_dialogs.MessageBox( NotSelectedErrorMessage , ultimix.get_string( 'Error' ) , ultimix.std_dialogs.MB_OK | ultimix.std_dialogs.MB_ICONERROR | ultimix.std_dialogs.MB_MODAL );
5716 return;
5717 }
5718
5719 ultimix.forms.SubmitForm3( FormId , Param1, Value1 , Param2, Value2 , Param3, Value3 , ConfirmString , Action , Waiting );
5720 }
5721
5727 if( !ultimix )
5728 {
5729 ultimix = {};
5730 }
5731
5737 if( !ultimix.inplace )
5738 {
5739 ultimix.inplace = {};
5740 }
5741
5749 ultimix.inplace.ReplaceWithTextarea = function( Event )
5750 {
5751 var Width = jQuery( Event.target ).outerWidth();
5752 var Height = jQuery( Event.target ).outerHeight();
5753 var Name = jQuery( Event.target ).attr( 'field_name' );
5754 var Class = jQuery( Event.target ).attr( 'field_class' );
5755 var Value = jQuery( Event.target ).html();
5756
5757 jQuery( Event.target ).hide();
5758 jQuery( Event.target ).after(
5759 '<textarea style="margin: 0px; width: ' + ( Width - 5 ) + 'px; height: ' + ( Height - 3 ) +
5760 'px" class="' + Class + '" name="' + Name + '">' + Value + '</textarea>'
5761 );
5762 }
5763
5771 ultimix.inplace.ReplaceWithInput = function( Event )
5772 {
5773 var Width = jQuery( Event.target ).outerWidth();
5774 var Name = jQuery( Event.target ).attr( 'field_name' );
5775 var Class = jQuery( Event.target ).attr( 'field_class' );
5776 var Value = jQuery( Event.target ).html();
5777
5778 jQuery( Event.target ).hide();
5779 jQuery( Event.target ).after(
5780 '<input style="margin: 0px; width: ' + ( Width - 5 ) + 'px;' +
5781 '" class="' + Class + '" name="' + Name + '" value="' + Value + '">'
5782 );
5783 }
5784
5790 jQuery(
5791 function()
5792 {
5793 jQuery( '.inplace_textarea' ).each(
5794 function( i , Element )
5795 {
5796 jQuery( Element ).dblclick( ultimix.inplace.ReplaceWithTextarea );
5797 }
5798 );
5799 jQuery( '.inplace_input' ).each(
5800 function( i , Element )
5801 {
5802 jQuery( Element ).dblclick( ultimix.inplace.ReplaceWithInput );
5803 }
5804 );
5805 }
5806 );
5812 if( !ultimix )
5813 {
5814 ultimix = {};
5815 }
5816
5822 if( !ultimix.string_utilities )
5823 {
5824 ultimix.string_utilities = {};
5825 }
5826
5836 ultimix.string_utilities.CompileTags = function( Str )
5837 {
5838 Str = ultimix.string_utilities.StrReplace( '[js_rand_0]' , ultimix.GetRandomInt() , Str );
5839 Str = ultimix.string_utilities.StrReplace( '[js_rand_1]' , ultimix.GetRandomInt() , Str );
5840 Str = ultimix.string_utilities.StrReplace( '[js_rand_2]' , ultimix.GetRandomInt() , Str );
5841 Str = ultimix.string_utilities.StrReplace( '[js_rand_3]' , ultimix.GetRandomInt() , Str );
5842 Str = ultimix.string_utilities.StrReplace( '[js_rand_4]' , ultimix.GetRandomInt() , Str );
5843 Str = ultimix.string_utilities.StrReplace( '[js_rand_5]' , ultimix.GetRandomInt() , Str );
5844 Str = ultimix.string_utilities.StrReplace( '[js_rand_6]' , ultimix.GetRandomInt() , Str );
5845 Str = ultimix.string_utilities.StrReplace( '[js_rand_7]' , ultimix.GetRandomInt() , Str );
5846 Str = ultimix.string_utilities.StrReplace( '[js_rand_8]' , ultimix.GetRandomInt() , Str );
5847 Str = ultimix.string_utilities.StrReplace( '[js_rand_9]' , ultimix.GetRandomInt() , Str );
5848
5849 return( Str );
5850 }
5851
5865 ultimix.string_utilities.StrReplace = function( Search , Replace , Subject )
5866 {
5867 return( Subject.split( Search ).join( Replace ) );
5868 }
5869
5881 ultimix.string_utilities.PrintRecord = function( Format , Record )
5882 {
5883 for( i in Record )
5884 {
5885 Format = ultimix.string_utilities.StrReplace( '[' + i + ']' , Record[ i ] , Format );
5886 }
5887
5888 return( Format );
5889 }
5890
5900 ultimix.string_utilities.Base64Encode = function( data )
5901 {
5902 /* Encodes data with MIME base64
5903
5904 + original by: Tyler Akins (http:/ /rumkin.com)
5905 + improved by: Bayron Guevara */
5906
5907 var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
5908 var o1 , o2 , o3 , h1 , h2 , h3 , h4 , bits , i = 0 , enc = '';
5909
5910 do
5911 {
5912 /* pack three octets into four hexets */
5913 o1 = data.charCodeAt( i++ );
5914 o2 = data.charCodeAt( i++ );
5915 o3 = data.charCodeAt( i++ );
5916
5917 bits = o1 << 16 | o2 << 8 | o3;
5918
5919 h1 = bits >> 18 & 0x3f;
5920 h2 = bits >> 12 & 0x3f;
5921 h3 = bits >> 6 & 0x3f;
5922 h4 = bits & 0x3f;
5923
5924 /* use hexets to index into b64, and append result to encoded string */
5925 enc += b64.charAt( h1 ) + b64.charAt( h2 ) + b64.charAt( h3 ) + b64.charAt( h4 );
5926 }
5927 while ( i < data.length );
5928
5929 switch( data.length % 3 )
5930 {
5931 case( 1 ):
5932 enc = enc.slice( 0 , -2 ) + '==';
5933 break;
5934 case( 2 ):
5935 enc = enc.slice( 0 , -1 ) + '=';
5936 break;
5937 }
5938
5939 return( enc );
5940 }
5941
5951 ultimix.string_utilities.Base64Decode = function( data )
5952 {
5953 /* Decodes data encoded with MIME base64
5954
5955 + original by: Tyler Akins (http:/ /rumkin.com) */
5956
5957 var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
5958 var o1 , o2 , o3 , h1 , h2 , h3 , h4 , bits , i = 0 , enc = '';
5959
5960 do
5961 {
5962 /* unpack four hexets into three octets using index points in b64 */
5963 h1 = b64.indexOf( data.charAt( i++ ) );
5964 h2 = b64.indexOf( data.charAt( i++ ) );
5965 h3 = b64.indexOf( data.charAt( i++ ) );
5966 h4 = b64.indexOf( data.charAt( i++ ) );
5967
5968 bits = h1<<18 | h2<<12 | h3<<6 | h4;
5969
5970 o1 = bits>>16 & 0xff;
5971 o2 = bits>>8 & 0xff;
5972 o3 = bits & 0xff;
5973
5974 if( h3 == 64 ) enc += String.fromCharCode( o1 );
5975 else if ( h4 == 64 ) enc += String.fromCharCode( o1 , o2 );
5976 else enc += String.fromCharCode( o1 , o2 , o3 );
5977 }
5978 while( i < data.length );
5979
5980 return( enc );
5981 }
5982
5988 if( !ultimix )
5989 {
5990 ultimix = {};
5991 }
5992
6004 ultimix.PopupHref = function( URL , Width , Height )
6005 {
6006 window.open( URL , "" , "width=" + Width + ", height=" + Height );
6007 }
6008
6014 ultimix.ReloadPage = function()
6015 {
6016 window.location.reload( true );
6017 }
6018
6033 /* ******************* */
6034 /* Constructor & Init */
6035 /* ******************* */
6036 var SWFUpload;
6037
6038 if (SWFUpload == undefined) {
6039 SWFUpload = function (settings) {
6040 this.initSWFUpload(settings);
6041 };
6042 }
6043
6044 SWFUpload.prototype.initSWFUpload = function (settings) {
6045 try {
6046 this.customSettings = {}; // A container where developers can place their own settings associated with this instance.
6047 this.settings = settings;
6048 this.eventQueue = [];
6049 this.movieName = "SWFUpload_" + SWFUpload.movieCount++;
6050 this.movieElement = null;
6051
6052
6053 // Setup global control tracking
6054 SWFUpload.instances[this.movieName] = this;
6055
6056 // Load the settings. Load the Flash movie.
6057 this.initSettings();
6058 this.loadFlash();
6059 this.displayDebugInfo();
6060 } catch (ex) {
6061 delete SWFUpload.instances[this.movieName];
6062 throw ex;
6063 }
6064 };
6065
6066 /* *************** */
6067 /* Static Members */
6068 /* *************** */
6069 SWFUpload.instances = {};
6070 SWFUpload.movieCount = 0;
6071 SWFUpload.version = "2.2.0 2009-03-25";
6072 SWFUpload.QUEUE_ERROR = {
6073 QUEUE_LIMIT_EXCEEDED : -100,
6074 FILE_EXCEEDS_SIZE_LIMIT : -110,
6075 ZERO_BYTE_FILE : -120,
6076 INVALID_FILETYPE : -130
6077 };
6078 SWFUpload.UPLOAD_ERROR = {
6079 HTTP_ERROR : -200,
6080 MISSING_UPLOAD_URL : -210,
6081 IO_ERROR : -220,
6082 SECURITY_ERROR : -230,
6083 UPLOAD_LIMIT_EXCEEDED : -240,
6084 UPLOAD_FAILED : -250,
6085 SPECIFIED_FILE_ID_NOT_FOUND : -260,
6086 FILE_VALIDATION_FAILED : -270,
6087 FILE_CANCELLED : -280,
6088 UPLOAD_STOPPED : -290
6089 };
6090 SWFUpload.FILE_STATUS = {
6091 QUEUED : -1,
6092 IN_PROGRESS : -2,
6093 ERROR : -3,
6094 COMPLETE : -4,
6095 CANCELLED : -5
6096 };
6097 SWFUpload.BUTTON_ACTION = {
6098 SELECT_FILE : -100,
6099 SELECT_FILES : -110,
6100 START_UPLOAD : -120
6101 };
6102 SWFUpload.CURSOR = {
6103 ARROW : -1,
6104 HAND : -2
6105 };
6106 SWFUpload.WINDOW_MODE = {
6107 WINDOW : "window",
6108 TRANSPARENT : "transparent",
6109 OPAQUE : "opaque"
6110 };
6111
6112 // Private: takes a URL, determines if it is relative and converts to an absolute URL
6113 // using the current site. Only processes the URL if it can, otherwise returns the URL untouched
6114 SWFUpload.completeURL = function(url) {
6115 if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) {
6116 return url;
6117 }
6118
6119 var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
6120
6121 var indexSlash = window.location.pathname.lastIndexOf("/");
6122 if (indexSlash <= 0) {
6123 path = "/";
6124 } else {
6125 path = window.location.pathname.substr(0, indexSlash) + "/";
6126 }
6127
6128 return /*currentURL +*/ path + url;
6129
6130 };
6131
6132
6133 /* ******************** */
6134 /* Instance Members */
6135 /* ******************** */
6136
6137 // Private: initSettings ensures that all the
6138 // settings are set, getting a default value if one was not assigned.
6139 SWFUpload.prototype.initSettings = function () {
6140 this.ensureDefault = function (settingName, defaultValue) {
6141 this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
6142 };
6143
6144 // Upload backend settings
6145 this.ensureDefault("upload_url", "");
6146 this.ensureDefault("preserve_relative_urls", false);
6147 this.ensureDefault("file_post_name", "Filedata");
6148 this.ensureDefault("post_params", {});
6149 this.ensureDefault("use_query_string", false);
6150 this.ensureDefault("requeue_on_error", false);
6151 this.ensureDefault("http_success", []);
6152 this.ensureDefault("assume_success_timeout", 0);
6153
6154 // File Settings
6155 this.ensureDefault("file_types", "*.*");
6156 this.ensureDefault("file_types_description", "All Files");
6157 this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited"
6158 this.ensureDefault("file_upload_limit", 0);
6159 this.ensureDefault("file_queue_limit", 0);
6160
6161 // Flash Settings
6162 this.ensureDefault("flash_url", "swfupload.swf");
6163 this.ensureDefault("prevent_swf_caching", true);
6164
6165 // Button Settings
6166 this.ensureDefault("button_image_url", "");
6167 this.ensureDefault("button_width", 1);
6168 this.ensureDefault("button_height", 1);
6169 this.ensureDefault("button_text", "");
6170 this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;");
6171 this.ensureDefault("button_text_top_padding", 0);
6172 this.ensureDefault("button_text_left_padding", 0);
6173 this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES);
6174 this.ensureDefault("button_disabled", false);
6175 this.ensureDefault("button_placeholder_id", "");
6176 this.ensureDefault("button_placeholder", null);
6177 this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW);
6178 this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW);
6179
6180 // Debug Settings
6181 this.ensureDefault("debug", false);
6182 this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API
6183
6184 // Event Handlers
6185 this.settings.return_upload_start_handler = this.returnUploadStart;
6186 this.ensureDefault("swfupload_loaded_handler", null);
6187 this.ensureDefault("file_dialog_start_handler", null);
6188 this.ensureDefault("file_queued_handler", null);
6189 this.ensureDefault("file_queue_error_handler", null);
6190 this.ensureDefault("file_dialog_complete_handler", null);
6191
6192 this.ensureDefault("upload_start_handler", null);
6193 this.ensureDefault("upload_progress_handler", null);
6194 this.ensureDefault("upload_error_handler", null);
6195 this.ensureDefault("upload_success_handler", null);
6196 this.ensureDefault("upload_complete_handler", null);
6197
6198 this.ensureDefault("debug_handler", this.debugMessage);
6199
6200 this.ensureDefault("custom_settings", {});
6201
6202 // Other settings
6203 this.customSettings = this.settings.custom_settings;
6204
6205 // Update the flash url if needed
6206 if (!!this.settings.prevent_swf_caching) {
6207 this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
6208 }
6209
6210 if (!this.settings.preserve_relative_urls) {
6211 //this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url); // Don't need to do this one since flash doesn't look at it
6212 this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);
6213 this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);
6214 }
6215
6216 delete this.ensureDefault;
6217 };
6218
6219 // Private: loadFlash replaces the button_placeholder element with the flash movie.
6220 SWFUpload.prototype.loadFlash = function () {
6221 var targetElement, tempParent;
6222
6223 // Make sure an element with the ID we are going to use doesn't already exist
6224 if (document.getElementById(this.movieName) !== null) {
6225 throw "ID " + this.movieName + " is already in use. The Flash Object could not be added";
6226 }
6227
6228 // Get the element where we will be placing the flash movie
6229 targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder;
6230
6231 if (targetElement == undefined) {
6232 throw "Could not find the placeholder element: " + this.settings.button_placeholder_id;
6233 }
6234
6235 // Append the container and load the flash
6236 tempParent = document.createElement("div");
6237 tempParent.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
6238 targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement);
6239
6240 // Fix IE Flash/Form bug
6241 if (window[this.movieName] == undefined) {
6242 window[this.movieName] = this.getMovieElement();
6243 }
6244
6245 };
6246
6247 // Private: getFlashHTML generates the object tag needed to embed the flash in to the document
6248 SWFUpload.prototype.getFlashHTML = function () {
6249 // Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
6250 return ['<object id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
6251 '<param name="wmode" value="', this.settings.button_window_mode, '" />',
6252 '<param name="movie" value="', this.settings.flash_url, '" />',
6253 '<param name="quality" value="high" />',
6254 '<param name="menu" value="false" />',
6255 '<param name="allowScriptAccess" value="always" />',
6256 '<param name="flashvars" value="' + this.getFlashVars() + '" />',
6257 '</object>'].join("");
6258 };
6259
6260 // Private: getFlashVars builds the parameter string that will be passed
6261 // to flash in the flashvars param.
6262 SWFUpload.prototype.getFlashVars = function () {
6263 // Build a string from the post param object
6264 var paramString = this.buildParamString();
6265 var httpSuccessString = this.settings.http_success.join(",");
6266
6267 // Build the parameter string
6268 return ["movieName=", encodeURIComponent(this.movieName),
6269 "&amp;uploadURL=", encodeURIComponent(this.settings.upload_url),
6270 "&amp;useQueryString=", encodeURIComponent(this.settings.use_query_string),
6271 "&amp;requeueOnError=", encodeURIComponent(this.settings.requeue_on_error),
6272 "&amp;httpSuccess=", encodeURIComponent(httpSuccessString),
6273 "&amp;assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout),
6274 "&amp;params=", encodeURIComponent(paramString),
6275 "&amp;filePostName=", encodeURIComponent(this.settings.file_post_name),
6276 "&amp;fileTypes=", encodeURIComponent(this.settings.file_types),
6277 "&amp;fileTypesDescription=", encodeURIComponent(this.settings.file_types_description),
6278 "&amp;fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit),
6279 "&amp;fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit),
6280 "&amp;fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit),
6281 "&amp;debugEnabled=", encodeURIComponent(this.settings.debug_enabled),
6282 "&amp;buttonImageURL=", encodeURIComponent(this.settings.button_image_url),
6283 "&amp;buttonWidth=", encodeURIComponent(this.settings.button_width),
6284 "&amp;buttonHeight=", encodeURIComponent(this.settings.button_height),
6285 "&amp;buttonText=", encodeURIComponent(this.settings.button_text),
6286 "&amp;buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding),
6287 "&amp;buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding),
6288 "&amp;buttonTextStyle=", encodeURIComponent(this.settings.button_text_style),
6289 "&amp;buttonAction=", encodeURIComponent(this.settings.button_action),
6290 "&amp;buttonDisabled=", encodeURIComponent(this.settings.button_disabled),
6291 "&amp;buttonCursor=", encodeURIComponent(this.settings.button_cursor)
6292 ].join("");
6293 };
6294
6295 // Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload
6296 // The element is cached after the first lookup
6297 SWFUpload.prototype.getMovieElement = function () {
6298 if (this.movieElement == undefined) {
6299 this.movieElement = document.getElementById(this.movieName);
6300 }
6301
6302 if (this.movieElement === null) {
6303 throw "Could not find Flash element";
6304 }
6305
6306 return this.movieElement;
6307 };
6308
6309 // Private: buildParamString takes the name/value pairs in the post_params setting object
6310 // and joins them up in to a string formatted "name=value&amp;name=value"
6311 SWFUpload.prototype.buildParamString = function () {
6312 var postParams = this.settings.post_params;
6313 var paramStringPairs = [];
6314
6315 if (typeof(postParams) === "object") {
6316 for (var name in postParams) {
6317 if (postParams.hasOwnProperty(name)) {
6318 paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString()));
6319 }
6320 }
6321 }
6322
6323 return paramStringPairs.join("&amp;");
6324 };
6325
6326 // Public: Used to remove a SWFUpload instance from the page. This method strives to remove
6327 // all references to the SWF, and other objects so memory is properly freed.
6328 // Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state.
6329 // Credits: Major improvements provided by steffen
6330 SWFUpload.prototype.destroy = function () {
6331 try {
6332 // Make sure Flash is done before we try to remove it
6333 this.cancelUpload(null, false);
6334
6335
6336 // Remove the SWFUpload DOM nodes
6337 var movieElement = null;
6338 movieElement = this.getMovieElement();
6339
6340 if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
6341 // Loop through all the movie's properties and remove all function references (DOM/JS IE 6/7 memory leak workaround)
6342 for (var i in movieElement) {
6343 try {
6344 if (typeof(movieElement[i]) === "function") {
6345 movieElement[i] = null;
6346 }
6347 } catch (ex1) {}
6348 }
6349
6350 // Remove the Movie Element from the page
6351 try {
6352 movieElement.parentNode.removeChild(movieElement);
6353 } catch (ex) {}
6354 }
6355
6356 // Remove IE form fix reference
6357 window[this.movieName] = null;
6358
6359 // Destroy other references
6360 SWFUpload.instances[this.movieName] = null;
6361 delete SWFUpload.instances[this.movieName];
6362
6363 this.movieElement = null;
6364 this.settings = null;
6365 this.customSettings = null;
6366 this.eventQueue = null;
6367 this.movieName = null;
6368
6369
6370 return true;
6371 } catch (ex2) {
6372 return false;
6373 }
6374 };
6375
6376
6377 // Public: displayDebugInfo prints out settings and configuration
6378 // information about this SWFUpload instance.
6379 // This function (and any references to it) can be deleted when placing
6380 // SWFUpload in production.
6381 SWFUpload.prototype.displayDebugInfo = function () {
6382 this.debug(
6383 [
6384 "---SWFUpload Instance Info---\n",
6385 "Version: ", SWFUpload.version, "\n",
6386 "Movie Name: ", this.movieName, "\n",
6387 "Settings:\n",
6388 "\t", "upload_url: ", this.settings.upload_url, "\n",
6389 "\t", "flash_url: ", this.settings.flash_url, "\n",
6390 "\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n",
6391 "\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n",
6392 "\t", "http_success: ", this.settings.http_success.join(", "), "\n",
6393 "\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n",
6394 "\t", "file_post_name: ", this.settings.file_post_name, "\n",
6395 "\t", "post_params: ", this.settings.post_params.toString(), "\n",
6396 "\t", "file_types: ", this.settings.file_types, "\n",
6397 "\t", "file_types_description: ", this.settings.file_types_description, "\n",
6398 "\t", "file_size_limit: ", this.settings.file_size_limit, "\n",
6399 "\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n",
6400 "\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n",
6401 "\t", "debug: ", this.settings.debug.toString(), "\n",
6402
6403 "\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n",
6404
6405 "\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n",
6406 "\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n",
6407 "\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n",
6408 "\t", "button_width: ", this.settings.button_width.toString(), "\n",
6409 "\t", "button_height: ", this.settings.button_height.toString(), "\n",
6410 "\t", "button_text: ", this.settings.button_text.toString(), "\n",
6411 "\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n",
6412 "\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n",
6413 "\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n",
6414 "\t", "button_action: ", this.settings.button_action.toString(), "\n",
6415 "\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n",
6416
6417 "\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n",
6418 "Event Handlers:\n",
6419 "\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n",
6420 "\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n",
6421 "\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n",
6422 "\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n",
6423 "\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n",
6424 "\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n",
6425 "\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n",
6426 "\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n",
6427 "\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n",
6428 "\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n"
6429 ].join("")
6430 );
6431 };
6432
6433 /* Note: addSetting and getSetting are no longer used by SWFUpload but are included
6434 the maintain v2 API compatibility
6435 */
6436 // Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used.
6437 SWFUpload.prototype.addSetting = function (name, value, default_value) {
6438 if (value == undefined) {
6439 return (this.settings[name] = default_value);
6440 } else {
6441 return (this.settings[name] = value);
6442 }
6443 };
6444
6445 // Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found.
6446 SWFUpload.prototype.getSetting = function (name) {
6447 if (this.settings[name] != undefined) {
6448 return this.settings[name];
6449 }
6450
6451 return "";
6452 };
6453
6454
6455
6456 // Private: callFlash handles function calls made to the Flash element.
6457 // Calls are made with a setTimeout for some functions to work around
6458 // bugs in the ExternalInterface library.
6459 SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
6460 argumentArray = argumentArray || [];
6461
6462 var movieElement = this.getMovieElement();
6463 var returnValue, returnString;
6464
6465 // Flash's method if calling ExternalInterface methods (code adapted from MooTools).
6466 try {
6467 returnString = movieElement.CallFunction('<invoke name="' + functionName + '" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + '</invoke>');
6468 returnValue = eval(returnString);
6469 } catch (ex) {
6470 throw "Call to " + functionName + " failed";
6471 }
6472
6473 // Unescape file post param values
6474 if (returnValue != undefined && typeof returnValue.post === "object") {
6475 returnValue = this.unescapeFilePostParams(returnValue);
6476 }
6477
6478 return returnValue;
6479 };
6480
6481 /* *****************************
6482 -- Flash control methods --
6483 Your UI should use these
6484 to operate SWFUpload
6485 ***************************** */
6486
6487 // WARNING: this function does not work in Flash Player 10
6488 // Public: selectFile causes a File Selection Dialog window to appear. This
6489 // dialog only allows 1 file to be selected.
6490 SWFUpload.prototype.selectFile = function () {
6491 this.callFlash("SelectFile");
6492 };
6493
6494 // WARNING: this function does not work in Flash Player 10
6495 // Public: selectFiles causes a File Selection Dialog window to appear/ This
6496 // dialog allows the user to select any number of files
6497 // Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names.
6498 // If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around
6499 // for this bug.
6500 SWFUpload.prototype.selectFiles = function () {
6501 this.callFlash("SelectFiles");
6502 };
6503
6504
6505 // Public: startUpload starts uploading the first file in the queue unless
6506 // the optional parameter 'fileID' specifies the ID
6507 SWFUpload.prototype.startUpload = function (fileID) {
6508 this.callFlash("StartUpload", [fileID]);
6509 };
6510
6511 // Public: cancelUpload cancels any queued file. The fileID parameter may be the file ID or index.
6512 // If you do not specify a fileID the current uploading file or first file in the queue is cancelled.
6513 // If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter.
6514 SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) {
6515 if (triggerErrorEvent !== false) {
6516 triggerErrorEvent = true;
6517 }
6518 this.callFlash("CancelUpload", [fileID, triggerErrorEvent]);
6519 };
6520
6521 // Public: stopUpload stops the current upload and requeues the file at the beginning of the queue.
6522 // If nothing is currently uploading then nothing happens.
6523 SWFUpload.prototype.stopUpload = function () {
6524 this.callFlash("StopUpload");
6525 };
6526
6527 /* ************************
6528 * Settings methods
6529 * These methods change the SWFUpload settings.
6530 * SWFUpload settings should not be changed directly on the settings object
6531 * since many of the settings need to be passed to Flash in order to take
6532 * effect.
6533 * *********************** */
6534
6535 // Public: getStats gets the file statistics object.
6536 SWFUpload.prototype.getStats = function () {
6537 return this.callFlash("GetStats");
6538 };
6539
6540 // Public: setStats changes the SWFUpload statistics. You shouldn't need to
6541 // change the statistics but you can. Changing the statistics does not
6542 // affect SWFUpload accept for the successful_uploads count which is used
6543 // by the upload_limit setting to determine how many files the user may upload.
6544 SWFUpload.prototype.setStats = function (statsObject) {
6545 this.callFlash("SetStats", [statsObject]);
6546 };
6547
6548 // Public: getFile retrieves a File object by ID or Index. If the file is
6549 // not found then 'null' is returned.
6550 SWFUpload.prototype.getFile = function (fileID) {
6551 if (typeof(fileID) === "number") {
6552 return this.callFlash("GetFileByIndex", [fileID]);
6553 } else {
6554 return this.callFlash("GetFile", [fileID]);
6555 }
6556 };
6557
6558 // Public: addFileParam sets a name/value pair that will be posted with the
6559 // file specified by the Files ID. If the name already exists then the
6560 // exiting value will be overwritten.
6561 SWFUpload.prototype.addFileParam = function (fileID, name, value) {
6562 return this.callFlash("AddFileParam", [fileID, name, value]);
6563 };
6564
6565 // Public: removeFileParam removes a previously set (by addFileParam) name/value
6566 // pair from the specified file.
6567 SWFUpload.prototype.removeFileParam = function (fileID, name) {
6568 this.callFlash("RemoveFileParam", [fileID, name]);
6569 };
6570
6571 // Public: setUploadUrl changes the upload_url setting.
6572 SWFUpload.prototype.setUploadURL = function (url) {
6573 this.settings.upload_url = url.toString();
6574 this.callFlash("SetUploadURL", [url]);
6575 };
6576
6577 // Public: setPostParams changes the post_params setting
6578 SWFUpload.prototype.setPostParams = function (paramsObject) {
6579 this.settings.post_params = paramsObject;
6580 this.callFlash("SetPostParams", [paramsObject]);
6581 };
6582
6583 // Public: addPostParam adds post name/value pair. Each name can have only one value.
6584 SWFUpload.prototype.addPostParam = function (name, value) {
6585 this.settings.post_params[name] = value;
6586 this.callFlash("SetPostParams", [this.settings.post_params]);
6587 };
6588
6589 // Public: removePostParam deletes post name/value pair.
6590 SWFUpload.prototype.removePostParam = function (name) {
6591 delete this.settings.post_params[name];
6592 this.callFlash("SetPostParams", [this.settings.post_params]);
6593 };
6594
6595 // Public: setFileTypes changes the file_types setting and the file_types_description setting
6596 SWFUpload.prototype.setFileTypes = function (types, description) {
6597 this.settings.file_types = types;
6598 this.settings.file_types_description = description;
6599 this.callFlash("SetFileTypes", [types, description]);
6600 };
6601
6602 // Public: setFileSizeLimit changes the file_size_limit setting
6603 SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) {
6604 this.settings.file_size_limit = fileSizeLimit;
6605 this.callFlash("SetFileSizeLimit", [fileSizeLimit]);
6606 };
6607
6608 // Public: setFileUploadLimit changes the file_upload_limit setting
6609 SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) {
6610 this.settings.file_upload_limit = fileUploadLimit;
6611 this.callFlash("SetFileUploadLimit", [fileUploadLimit]);
6612 };
6613
6614 // Public: setFileQueueLimit changes the file_queue_limit setting
6615 SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) {
6616 this.settings.file_queue_limit = fileQueueLimit;
6617 this.callFlash("SetFileQueueLimit", [fileQueueLimit]);
6618 };
6619
6620 // Public: setFilePostName changes the file_post_name setting
6621 SWFUpload.prototype.setFilePostName = function (filePostName) {
6622 this.settings.file_post_name = filePostName;
6623 this.callFlash("SetFilePostName", [filePostName]);
6624 };
6625
6626 // Public: setUseQueryString changes the use_query_string setting
6627 SWFUpload.prototype.setUseQueryString = function (useQueryString) {
6628 this.settings.use_query_string = useQueryString;
6629 this.callFlash("SetUseQueryString", [useQueryString]);
6630 };
6631
6632 // Public: setRequeueOnError changes the requeue_on_error setting
6633 SWFUpload.prototype.setRequeueOnError = function (requeueOnError) {
6634 this.settings.requeue_on_error = requeueOnError;
6635 this.callFlash("SetRequeueOnError", [requeueOnError]);
6636 };
6637
6638 // Public: setHTTPSuccess changes the http_success setting
6639 SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) {
6640 if (typeof http_status_codes === "string") {
6641 http_status_codes = http_status_codes.replace(" ", "").split(",");
6642 }
6643
6644 this.settings.http_success = http_status_codes;
6645 this.callFlash("SetHTTPSuccess", [http_status_codes]);
6646 };
6647
6648 // Public: setHTTPSuccess changes the http_success setting
6649 SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) {
6650 this.settings.assume_success_timeout = timeout_seconds;
6651 this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]);
6652 };
6653
6654 // Public: setDebugEnabled changes the debug_enabled setting
6655 SWFUpload.prototype.setDebugEnabled = function (debugEnabled) {
6656 this.settings.debug_enabled = debugEnabled;
6657 this.callFlash("SetDebugEnabled", [debugEnabled]);
6658 };
6659
6660 // Public: setButtonImageURL loads a button image sprite
6661 SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) {
6662 if (buttonImageURL == undefined) {
6663 buttonImageURL = "";
6664 }
6665
6666 this.settings.button_image_url = buttonImageURL;
6667 this.callFlash("SetButtonImageURL", [buttonImageURL]);
6668 };
6669
6670 // Public: setButtonDimensions resizes the Flash Movie and button
6671 SWFUpload.prototype.setButtonDimensions = function (width, height) {
6672 this.settings.button_width = width;
6673 this.settings.button_height = height;
6674
6675 var movie = this.getMovieElement();
6676 if (movie != undefined) {
6677 movie.style.width = width + "px";
6678 movie.style.height = height + "px";
6679 }
6680
6681 this.callFlash("SetButtonDimensions", [width, height]);
6682 };
6683 // Public: setButtonText Changes the text overlaid on the button
6684 SWFUpload.prototype.setButtonText = function (html) {
6685 this.settings.button_text = html;
6686 this.callFlash("SetButtonText", [html]);
6687 };
6688 // Public: setButtonTextPadding changes the top and left padding of the text overlay
6689 SWFUpload.prototype.setButtonTextPadding = function (left, top) {
6690 this.settings.button_text_top_padding = top;
6691 this.settings.button_text_left_padding = left;
6692 this.callFlash("SetButtonTextPadding", [left, top]);
6693 };
6694
6695 // Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button
6696 SWFUpload.prototype.setButtonTextStyle = function (css) {
6697 this.settings.button_text_style = css;
6698 this.callFlash("SetButtonTextStyle", [css]);
6699 };
6700 // Public: setButtonDisabled disables/enables the button
6701 SWFUpload.prototype.setButtonDisabled = function (isDisabled) {
6702 this.settings.button_disabled = isDisabled;
6703 this.callFlash("SetButtonDisabled", [isDisabled]);
6704 };
6705 // Public: setButtonAction sets the action that occurs when the button is clicked
6706 SWFUpload.prototype.setButtonAction = function (buttonAction) {
6707 this.settings.button_action = buttonAction;
6708 this.callFlash("SetButtonAction", [buttonAction]);
6709 };
6710
6711 // Public: setButtonCursor changes the mouse cursor displayed when hovering over the button
6712 SWFUpload.prototype.setButtonCursor = function (cursor) {
6713 this.settings.button_cursor = cursor;
6714 this.callFlash("SetButtonCursor", [cursor]);
6715 };
6716
6717 /* *******************************
6718 Flash Event Interfaces
6719 These functions are used by Flash to trigger the various
6720 events.
6721
6722 All these functions a Private.
6723
6724 Because the ExternalInterface library is buggy the event calls
6725 are added to a queue and the queue then executed by a setTimeout.
6726 This ensures that events are executed in a determinate order and that
6727 the ExternalInterface bugs are avoided.
6728 ******************************* */
6729
6730 SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) {
6731 // Warning: Don't call this.debug inside here or you'll create an infinite loop
6732
6733 if (argumentArray == undefined) {
6734 argumentArray = [];
6735 } else if (!(argumentArray instanceof Array)) {
6736 argumentArray = [argumentArray];
6737 }
6738
6739 var self = this;
6740 if (typeof this.settings[handlerName] === "function") {
6741 // Queue the event
6742 this.eventQueue.push(function () {
6743 this.settings[handlerName].apply(this, argumentArray);
6744 });
6745
6746 // Execute the next queued event
6747 setTimeout(function () {
6748 self.executeNextEvent();
6749 }, 0);
6750
6751 } else if (this.settings[handlerName] !== null) {
6752 throw "Event handler " + handlerName + " is unknown or is not a function";
6753 }
6754 };
6755
6756 // Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout
6757 // we must queue them in order to garentee that they are executed in order.
6758 SWFUpload.prototype.executeNextEvent = function () {
6759 // Warning: Don't call this.debug inside here or you'll create an infinite loop
6760
6761 var f = this.eventQueue ? this.eventQueue.shift() : null;
6762 if (typeof(f) === "function") {
6763 f.apply(this);
6764 }
6765 };
6766
6767 // Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have
6768 // properties that contain characters that are not valid for JavaScript identifiers. To work around this
6769 // the Flash Component escapes the parameter names and we must unescape again before passing them along.
6770 SWFUpload.prototype.unescapeFilePostParams = function (file) {
6771 var reg = /[$]([0-9a-f]{4})/i;
6772 var unescapedPost = {};
6773 var uk;
6774
6775 if (file != undefined) {
6776 for (var k in file.post) {
6777 if (file.post.hasOwnProperty(k)) {
6778 uk = k;
6779 var match;
6780 while ((match = reg.exec(uk)) !== null) {
6781 uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16)));
6782 }
6783 unescapedPost[uk] = file.post[k];
6784 }
6785 }
6786
6787 file.post = unescapedPost;
6788 }
6789
6790 return file;
6791 };
6792
6793 // Private: Called by Flash to see if JS can call in to Flash (test if External Interface is working)
6794 SWFUpload.prototype.testExternalInterface = function () {
6795 try {
6796 return this.callFlash("TestExternalInterface");
6797 } catch (ex) {
6798 return false;
6799 }
6800 };
6801
6802 // Private: This event is called by Flash when it has finished loading. Don't modify this.
6803 // Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded.
6804 SWFUpload.prototype.flashReady = function () {
6805 // Check that the movie element is loaded correctly with its ExternalInterface methods defined
6806 var movieElement = this.getMovieElement();
6807
6808 if (!movieElement) {
6809 this.debug("Flash called back ready but the flash movie can't be found.");
6810 return;
6811 }
6812
6813 this.cleanUp(movieElement);
6814
6815 this.queueEvent("swfupload_loaded_handler");
6816 };
6817
6818 // Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE.
6819 // This function is called by Flash each time the ExternalInterface functions are created.
6820 SWFUpload.prototype.cleanUp = function (movieElement) {
6821 // Pro-actively unhook all the Flash functions
6822 try {
6823 if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
6824 this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
6825 for (var key in movieElement) {
6826 try {
6827 if (typeof(movieElement[key]) === "function") {
6828 movieElement[key] = null;
6829 }
6830 } catch (ex) {
6831 }
6832 }
6833 }
6834 } catch (ex1) {
6835
6836 }
6837
6838 // Fix Flashes own cleanup code so if the SWFMovie was removed from the page
6839 // it doesn't display errors.
6840 window["__flash__removeCallback"] = function (instance, name) {
6841 try {
6842 if (instance) {
6843 instance[name] = null;
6844 }
6845 } catch (flashEx) {
6846
6847 }
6848 };
6849
6850 };
6851
6852
6853 /* This is a chance to do something before the browse window opens */
6854 SWFUpload.prototype.fileDialogStart = function () {
6855 this.queueEvent("file_dialog_start_handler");
6856 };
6857
6858
6859 /* Called when a file is successfully added to the queue. */
6860 SWFUpload.prototype.fileQueued = function (file) {
6861 file = this.unescapeFilePostParams(file);
6862 this.queueEvent("file_queued_handler", file);
6863 };
6864
6865
6866 /* Handle errors that occur when an attempt to queue a file fails. */
6867 SWFUpload.prototype.fileQueueError = function (file, errorCode, message) {
6868 file = this.unescapeFilePostParams(file);
6869 this.queueEvent("file_queue_error_handler", [file, errorCode, message]);
6870 };
6871
6872 /* Called after the file dialog has closed and the selected files have been queued.
6873 You could call startUpload here if you want the queued files to begin uploading immediately. */
6874 SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) {
6875 this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]);
6876 };
6877
6878 SWFUpload.prototype.uploadStart = function (file) {
6879 file = this.unescapeFilePostParams(file);
6880 this.queueEvent("return_upload_start_handler", file);
6881 };
6882
6883 SWFUpload.prototype.returnUploadStart = function (file) {
6884 var returnValue;
6885 if (typeof this.settings.upload_start_handler === "function") {
6886 file = this.unescapeFilePostParams(file);
6887 returnValue = this.settings.upload_start_handler.call(this, file);
6888 } else if (this.settings.upload_start_handler != undefined) {
6889 throw "upload_start_handler must be a function";
6890 }
6891
6892 // Convert undefined to true so if nothing is returned from the upload_start_handler it is
6893 // interpretted as 'true'.
6894 if (returnValue === undefined) {
6895 returnValue = true;
6896 }
6897
6898 returnValue = !!returnValue;
6899
6900 this.callFlash("ReturnUploadStart", [returnValue]);
6901 };
6902
6903
6904
6905 SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) {
6906 file = this.unescapeFilePostParams(file);
6907 this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]);
6908 };
6909
6910 SWFUpload.prototype.uploadError = function (file, errorCode, message) {
6911 file = this.unescapeFilePostParams(file);
6912 this.queueEvent("upload_error_handler", [file, errorCode, message]);
6913 };
6914
6915 SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) {
6916 file = this.unescapeFilePostParams(file);
6917 this.queueEvent("upload_success_handler", [file, serverData, responseReceived]);
6918 };
6919
6920 SWFUpload.prototype.uploadComplete = function (file) {
6921 file = this.unescapeFilePostParams(file);
6922 this.queueEvent("upload_complete_handler", file);
6923 };
6924
6925 /* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the
6926 internal debug console. You can override this event and have messages written where you want. */
6927 SWFUpload.prototype.debug = function (message) {
6928 this.queueEvent("debug_handler", message);
6929 };
6930
6931
6932 /* **********************************
6933 Debug Console
6934 The debug console is a self contained, in page location
6935 for debug message to be sent. The Debug Console adds
6936 itself to the body if necessary.
6937
6938 The console is automatically scrolled as messages appear.
6939
6940 If you are using your own debug handler or when you deploy to production and
6941 have debug disabled you can remove these functions to reduce the file size
6942 and complexity.
6943 ********************************** */
6944
6945 // Private: debugMessage is the default debug_handler. If you want to print debug messages
6946 // call the debug() function. When overriding the function your own function should
6947 // check to see if the debug setting is true before outputting debug information.
6948 SWFUpload.prototype.debugMessage = function (message) {
6949 if (this.settings.debug) {
6950 var exceptionMessage, exceptionValues = [];
6951
6952 // Check for an exception object and print it nicely
6953 if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") {
6954 for (var key in message) {
6955 if (message.hasOwnProperty(key)) {
6956 exceptionValues.push(key + ": " + message[key]);
6957 }
6958 }
6959 exceptionMessage = exceptionValues.join("\n") || "";
6960 exceptionValues = exceptionMessage.split("\n");
6961 exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: ");
6962 SWFUpload.Console.writeLine(exceptionMessage);
6963 } else {
6964 SWFUpload.Console.writeLine(message);
6965 }
6966 }
6967 };
6968
6969 SWFUpload.Console = {};
6970 SWFUpload.Console.writeLine = function (message) {
6971 var console, documentForm;
6972
6973 try {
6974 console = document.getElementById("SWFUpload_Console");
6975
6976 if (!console) {
6977 documentForm = document.createElement("form");
6978 document.getElementsByTagName("body")[0].appendChild(documentForm);
6979
6980 console = document.createElement("textarea");
6981 console.id = "SWFUpload_Console";
6982 console.style.fontFamily = "monospace";
6983 console.setAttribute("wrap", "off");
6984 console.wrap = "off";
6985 console.style.overflow = "auto";
6986 console.style.width = "700px";
6987 console.style.height = "350px";
6988 console.style.margin = "5px";
6989 documentForm.appendChild(console);
6990 }
6991
6992 console.value += message + "\n";
6993
6994 console.scrollTop = console.scrollHeight - console.clientHeight;
6995 } catch (ex) {
6996 alert("Exception: " + ex.name + " Message: " + ex.message);
6997 }
6998 };
6999
7000 /*
7001 Cookie Plug-in
7002
7003 This plug in automatically gets all the cookies for this site and adds them to the post_params.
7004 Cookies are loaded only on initialization. The refreshCookies function can be called to update the post_params.
7005 The cookies will override any other post params with the same name.
7006 */
7007
7008 var SWFUpload;
7009 if (typeof(SWFUpload) === "function") {
7010 SWFUpload.prototype.initSettings = function (oldInitSettings) {
7011 return function () {
7012 if (typeof(oldInitSettings) === "function") {
7013 oldInitSettings.call(this);
7014 }
7015
7016 this.refreshCookies(false); // The false parameter must be sent since SWFUpload has not initialzed at this point
7017 };
7018 }(SWFUpload.prototype.initSettings);
7019
7020 // refreshes the post_params and updates SWFUpload. The sendToFlash parameters is optional and defaults to True
7021 SWFUpload.prototype.refreshCookies = function (sendToFlash) {
7022 if (sendToFlash === undefined) {
7023 sendToFlash = true;
7024 }
7025 sendToFlash = !!sendToFlash;
7026
7027 // Get the post_params object
7028 var postParams = this.settings.post_params;
7029
7030 // Get the cookies
7031 var i, cookieArray = document.cookie.split(';'), caLength = cookieArray.length, c, eqIndex, name, value;
7032 for (i = 0; i < caLength; i++) {
7033 c = cookieArray[i];
7034
7035 // Left Trim spaces
7036 while (c.charAt(0) === " ") {
7037 c = c.substring(1, c.length);
7038 }
7039 eqIndex = c.indexOf("=");
7040 if (eqIndex > 0) {
7041 name = c.substring(0, eqIndex);
7042 value = c.substring(eqIndex + 1);
7043 postParams[name] = value;
7044 }
7045 }
7046
7047 if (sendToFlash) {
7048 this.setPostParams(postParams);
7049 }
7050 };
7051
7052 }
7053
7054 /*
7055 Queue Plug-in
7056
7057 Features:
7058 *Adds a cancelQueue() method for cancelling the entire queue.
7059 *All queued files are uploaded when startUpload() is called.
7060 *If false is returned from uploadComplete then the queue upload is stopped.
7061 If false is not returned (strict comparison) then the queue upload is continued.
7062 *Adds a QueueComplete event that is fired when all the queued files have finished uploading.
7063 Set the event handler with the queue_complete_handler setting.
7064
7065 */
7066
7067 var SWFUpload;
7068 if (typeof(SWFUpload) === "function") {
7069 SWFUpload.queue = {};
7070
7071 SWFUpload.prototype.initSettings = (function (oldInitSettings) {
7072 return function () {
7073 if (typeof(oldInitSettings) === "function") {
7074 oldInitSettings.call(this);
7075 }
7076
7077 this.queueSettings = {};
7078
7079 this.queueSettings.queue_cancelled_flag = false;
7080 this.queueSettings.queue_upload_count = 0;
7081
7082 this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler;
7083 this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler;
7084 this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler;
7085 this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler;
7086
7087 this.settings.queue_complete_handler = this.settings.queue_complete_handler || null;
7088 };
7089 })(SWFUpload.prototype.initSettings);
7090
7091 SWFUpload.prototype.startUpload = function (fileID) {
7092 this.queueSettings.queue_cancelled_flag = false;
7093 this.callFlash("StartUpload", [fileID]);
7094 };
7095
7096 SWFUpload.prototype.cancelQueue = function () {
7097 this.queueSettings.queue_cancelled_flag = true;
7098 this.stopUpload();
7099
7100 var stats = this.getStats();
7101 while (stats.files_queued > 0) {
7102 this.cancelUpload();
7103 stats = this.getStats();
7104 }
7105 };
7106
7107 SWFUpload.queue.uploadStartHandler = function (file) {
7108 var returnValue;
7109 if (typeof(this.queueSettings.user_upload_start_handler) === "function") {
7110 returnValue = this.queueSettings.user_upload_start_handler.call(this, file);
7111 }
7112
7113 // To prevent upload a real "FALSE" value must be returned, otherwise default to a real "TRUE" value.
7114 returnValue = (returnValue === false) ? false : true;
7115
7116 this.queueSettings.queue_cancelled_flag = !returnValue;
7117
7118 return returnValue;
7119 };
7120
7121 SWFUpload.queue.uploadCompleteHandler = function (file) {
7122 var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler;
7123 var continueUpload;
7124
7125 if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {
7126 this.queueSettings.queue_upload_count++;
7127 }
7128
7129 if (typeof(user_upload_complete_handler) === "function") {
7130 continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true;
7131 } else if (file.filestatus === SWFUpload.FILE_STATUS.QUEUED) {
7132 // If the file was stopped and re-queued don't restart the upload
7133 continueUpload = false;
7134 } else {
7135 continueUpload = true;
7136 }
7137
7138 if (continueUpload) {
7139 var stats = this.getStats();
7140 if (stats.files_queued > 0 && this.queueSettings.queue_cancelled_flag === false) {
7141 this.startUpload();
7142 } else if (this.queueSettings.queue_cancelled_flag === false) {
7143 this.queueEvent("queue_complete_handler", [this.queueSettings.queue_upload_count]);
7144 this.queueSettings.queue_upload_count = 0;
7145 } else {
7146 this.queueSettings.queue_cancelled_flag = false;
7147 this.queueSettings.queue_upload_count = 0;
7148 }
7149 }
7150 };
7151 }
7152 /*
7153 Speed Plug-in
7154
7155 Features:
7156 *Adds several properties to the 'file' object indicated upload speed, time left, upload time, etc.
7157 - currentSpeed -- String indicating the upload speed, bytes per second
7158 - averageSpeed -- Overall average upload speed, bytes per second
7159 - movingAverageSpeed -- Speed over averaged over the last several measurements, bytes per second
7160 - timeRemaining -- Estimated remaining upload time in seconds
7161 - timeElapsed -- Number of seconds passed for this upload
7162 - percentUploaded -- Percentage of the file uploaded (0 to 100)
7163 - sizeUploaded -- Formatted size uploaded so far, bytes
7164
7165 *Adds setting 'moving_average_history_size' for defining the window size used to calculate the moving average speed.
7166
7167 *Adds several Formatting functions for formatting that values provided on the file object.
7168 - SWFUpload.speed.formatBPS(bps) -- outputs string formatted in the best units (Gbps, Mbps, Kbps, bps)
7169 - SWFUpload.speed.formatTime(seconds) -- outputs string formatted in the best units (x Hr y M z S)
7170 - SWFUpload.speed.formatSize(bytes) -- outputs string formatted in the best units (w GB x MB y KB z B )
7171 - SWFUpload.speed.formatPercent(percent) -- outputs string formatted with a percent sign (x.xx %)
7172 - SWFUpload.speed.formatUnits(baseNumber, divisionArray, unitLabelArray, fractionalBoolean)
7173 - Formats a number using the division array to determine how to apply the labels in the Label Array
7174 - factionalBoolean indicates whether the number should be returned as a single fractional number with a unit (speed)
7175 or as several numbers labeled with units (time)
7176 */
7177
7178 var SWFUpload;
7179 if (typeof(SWFUpload) === "function") {
7180 SWFUpload.speed = {};
7181
7182 SWFUpload.prototype.initSettings = (function (oldInitSettings) {
7183 return function () {
7184 if (typeof(oldInitSettings) === "function") {
7185 oldInitSettings.call(this);
7186 }
7187
7188 this.ensureDefault = function (settingName, defaultValue) {
7189 this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
7190 };
7191
7192 // List used to keep the speed stats for the files we are tracking
7193 this.fileSpeedStats = {};
7194 this.speedSettings = {};
7195
7196 this.ensureDefault("moving_average_history_size", "10");
7197
7198 this.speedSettings.user_file_queued_handler = this.settings.file_queued_handler;
7199 this.speedSettings.user_file_queue_error_handler = this.settings.file_queue_error_handler;
7200 this.speedSettings.user_upload_start_handler = this.settings.upload_start_handler;
7201 this.speedSettings.user_upload_error_handler = this.settings.upload_error_handler;
7202 this.speedSettings.user_upload_progress_handler = this.settings.upload_progress_handler;
7203 this.speedSettings.user_upload_success_handler = this.settings.upload_success_handler;
7204 this.speedSettings.user_upload_complete_handler = this.settings.upload_complete_handler;
7205
7206 this.settings.file_queued_handler = SWFUpload.speed.fileQueuedHandler;
7207 this.settings.file_queue_error_handler = SWFUpload.speed.fileQueueErrorHandler;
7208 this.settings.upload_start_handler = SWFUpload.speed.uploadStartHandler;
7209 this.settings.upload_error_handler = SWFUpload.speed.uploadErrorHandler;
7210 this.settings.upload_progress_handler = SWFUpload.speed.uploadProgressHandler;
7211 this.settings.upload_success_handler = SWFUpload.speed.uploadSuccessHandler;
7212 this.settings.upload_complete_handler = SWFUpload.speed.uploadCompleteHandler;
7213
7214 delete this.ensureDefault;
7215 };
7216 })(SWFUpload.prototype.initSettings);
7217
7218
7219 SWFUpload.speed.fileQueuedHandler = function (file) {
7220 if (typeof this.speedSettings.user_file_queued_handler === "function") {
7221 file = SWFUpload.speed.extendFile(file);
7222
7223 return this.speedSettings.user_file_queued_handler.call(this, file);
7224 }
7225 };
7226
7227 SWFUpload.speed.fileQueueErrorHandler = function (file, errorCode, message) {
7228 if (typeof this.speedSettings.user_file_queue_error_handler === "function") {
7229 file = SWFUpload.speed.extendFile(file);
7230
7231 return this.speedSettings.user_file_queue_error_handler.call(this, file, errorCode, message);
7232 }
7233 };
7234
7235 SWFUpload.speed.uploadStartHandler = function (file) {
7236 if (typeof this.speedSettings.user_upload_start_handler === "function") {
7237 file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
7238 return this.speedSettings.user_upload_start_handler.call(this, file);
7239 }
7240 };
7241
7242 SWFUpload.speed.uploadErrorHandler = function (file, errorCode, message) {
7243 file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
7244 SWFUpload.speed.removeTracking(file, this.fileSpeedStats);
7245
7246 if (typeof this.speedSettings.user_upload_error_handler === "function") {
7247 return this.speedSettings.user_upload_error_handler.call(this, file, errorCode, message);
7248 }
7249 };
7250 SWFUpload.speed.uploadProgressHandler = function (file, bytesComplete, bytesTotal) {
7251 this.updateTracking(file, bytesComplete);
7252 file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
7253
7254 if (typeof this.speedSettings.user_upload_progress_handler === "function") {
7255 return this.speedSettings.user_upload_progress_handler.call(this, file, bytesComplete, bytesTotal);
7256 }
7257 };
7258
7259 SWFUpload.speed.uploadSuccessHandler = function (file, serverData) {
7260 if (typeof this.speedSettings.user_upload_success_handler === "function") {
7261 file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
7262 return this.speedSettings.user_upload_success_handler.call(this, file, serverData);
7263 }
7264 };
7265 SWFUpload.speed.uploadCompleteHandler = function (file) {
7266 file = SWFUpload.speed.extendFile(file, this.fileSpeedStats);
7267 SWFUpload.speed.removeTracking(file, this.fileSpeedStats);
7268
7269 if (typeof this.speedSettings.user_upload_complete_handler === "function") {
7270 return this.speedSettings.user_upload_complete_handler.call(this, file);
7271 }
7272 };
7273
7274 // Private: extends the file object with the speed plugin values
7275 SWFUpload.speed.extendFile = function (file, trackingList) {
7276 var tracking;
7277
7278 if (trackingList) {
7279 tracking = trackingList[file.id];
7280 }
7281
7282 if (tracking) {
7283 file.currentSpeed = tracking.currentSpeed;
7284 file.averageSpeed = tracking.averageSpeed;
7285 file.movingAverageSpeed = tracking.movingAverageSpeed;
7286 file.timeRemaining = tracking.timeRemaining;
7287 file.timeElapsed = tracking.timeElapsed;
7288 file.percentUploaded = tracking.percentUploaded;
7289 file.sizeUploaded = tracking.bytesUploaded;
7290
7291 } else {
7292 file.currentSpeed = 0;
7293 file.averageSpeed = 0;
7294 file.movingAverageSpeed = 0;
7295 file.timeRemaining = 0;
7296 file.timeElapsed = 0;
7297 file.percentUploaded = 0;
7298 file.sizeUploaded = 0;
7299 }
7300
7301 return file;
7302 };
7303
7304 // Private: Updates the speed tracking object, or creates it if necessary
7305 SWFUpload.prototype.updateTracking = function (file, bytesUploaded) {
7306 var tracking = this.fileSpeedStats[file.id];
7307 if (!tracking) {
7308 this.fileSpeedStats[file.id] = tracking = {};
7309 }
7310
7311 // Sanity check inputs
7312 bytesUploaded = bytesUploaded || tracking.bytesUploaded || 0;
7313 if (bytesUploaded < 0) {
7314 bytesUploaded = 0;
7315 }
7316 if (bytesUploaded > file.size) {
7317 bytesUploaded = file.size;
7318 }
7319
7320 var tickTime = (new Date()).getTime();
7321 if (!tracking.startTime) {
7322 tracking.startTime = (new Date()).getTime();
7323 tracking.lastTime = tracking.startTime;
7324 tracking.currentSpeed = 0;
7325 tracking.averageSpeed = 0;
7326 tracking.movingAverageSpeed = 0;
7327 tracking.movingAverageHistory = [];
7328 tracking.timeRemaining = 0;
7329 tracking.timeElapsed = 0;
7330 tracking.percentUploaded = bytesUploaded / file.size;
7331 tracking.bytesUploaded = bytesUploaded;
7332 } else if (tracking.startTime > tickTime) {
7333 this.debug("When backwards in time");
7334 } else {
7335 // Get time and deltas
7336 var now = (new Date()).getTime();
7337 var lastTime = tracking.lastTime;
7338 var deltaTime = now - lastTime;
7339 var deltaBytes = bytesUploaded - tracking.bytesUploaded;
7340
7341 if (deltaBytes === 0 || deltaTime === 0) {
7342 return tracking;
7343 }
7344
7345 // Update tracking object
7346 tracking.lastTime = now;
7347 tracking.bytesUploaded = bytesUploaded;
7348
7349 // Calculate speeds
7350 tracking.currentSpeed = (deltaBytes * 8 ) / (deltaTime / 1000);
7351 tracking.averageSpeed = (tracking.bytesUploaded * 8) / ((now - tracking.startTime) / 1000);
7352
7353 // Calculate moving average
7354 tracking.movingAverageHistory.push(tracking.currentSpeed);
7355 if (tracking.movingAverageHistory.length > this.settings.moving_average_history_size) {
7356 tracking.movingAverageHistory.shift();
7357 }
7358
7359 tracking.movingAverageSpeed = SWFUpload.speed.calculateMovingAverage(tracking.movingAverageHistory);
7360
7361 // Update times
7362 tracking.timeRemaining = (file.size - tracking.bytesUploaded) * 8 / tracking.movingAverageSpeed;
7363 tracking.timeElapsed = (now - tracking.startTime) / 1000;
7364
7365 // Update percent
7366 tracking.percentUploaded = (tracking.bytesUploaded / file.size * 100);
7367 }
7368
7369 return tracking;
7370 };
7371 SWFUpload.speed.removeTracking = function (file, trackingList) {
7372 try {
7373 trackingList[file.id] = null;
7374 delete trackingList[file.id];
7375 } catch (ex) {
7376 }
7377 };
7378
7379 SWFUpload.speed.formatUnits = function (baseNumber, unitDivisors, unitLabels, singleFractional) {
7380 var i, unit, unitDivisor, unitLabel;
7381
7382 if (baseNumber === 0) {
7383 return "0 " + unitLabels[unitLabels.length - 1];
7384 }
7385
7386 if (singleFractional) {
7387 unit = baseNumber;
7388 unitLabel = unitLabels.length >= unitDivisors.length ? unitLabels[unitDivisors.length - 1] : "";
7389 for (i = 0; i < unitDivisors.length; i++) {
7390 if (baseNumber >= unitDivisors[i]) {
7391 unit = (baseNumber / unitDivisors[i]).toFixed(2);
7392 unitLabel = unitLabels.length >= i ? " " + unitLabels[i] : "";
7393 break;
7394 }
7395 }
7396
7397 return unit + unitLabel;
7398 } else {
7399 var formattedStrings = [];
7400 var remainder = baseNumber;
7401
7402 for (i = 0; i < unitDivisors.length; i++) {
7403 unitDivisor = unitDivisors[i];
7404 unitLabel = unitLabels.length > i ? " " + unitLabels[i] : "";
7405
7406 unit = remainder / unitDivisor;
7407 if (i < unitDivisors.length -1) {
7408 unit = Math.floor(unit);
7409 } else {
7410 unit = unit.toFixed(2);
7411 }
7412 if (unit > 0) {
7413 remainder = remainder % unitDivisor;
7414
7415 formattedStrings.push(unit + unitLabel);
7416 }
7417 }
7418
7419 return formattedStrings.join(" ");
7420 }
7421 };
7422
7423 SWFUpload.speed.formatBPS = function (baseNumber) {
7424 var bpsUnits = [1073741824, 1048576, 1024, 1], bpsUnitLabels = ["Gbps", "Mbps", "Kbps", "bps"];
7425 return SWFUpload.speed.formatUnits(baseNumber, bpsUnits, bpsUnitLabels, true);
7426
7427 };
7428 SWFUpload.speed.formatTime = function (baseNumber) {
7429 var timeUnits = [86400, 3600, 60, 1], timeUnitLabels = ["d", "h", "m", "s"];
7430 return SWFUpload.speed.formatUnits(baseNumber, timeUnits, timeUnitLabels, false);
7431
7432 };
7433 SWFUpload.speed.formatBytes = function (baseNumber) {
7434 var sizeUnits = [1073741824, 1048576, 1024, 1], sizeUnitLabels = ["GB", "MB", "KB", "bytes"];
7435 return SWFUpload.speed.formatUnits(baseNumber, sizeUnits, sizeUnitLabels, true);
7436
7437 };
7438 SWFUpload.speed.formatPercent = function (baseNumber) {
7439 return baseNumber.toFixed(2) + " %";
7440 };
7441
7442 SWFUpload.speed.calculateMovingAverage = function (history) {
7443 var vals = [], size, sum = 0.0, mean = 0.0, varianceTemp = 0.0, variance = 0.0, standardDev = 0.0;
7444 var i;
7445 var mSum = 0, mCount = 0;
7446
7447 size = history.length;
7448
7449 // Check for sufficient data
7450 if (size >= 8) {
7451 // Clone the array and Calculate sum of the values
7452 for (i = 0; i < size; i++) {
7453 vals[i] = history[i];
7454 sum += vals[i];
7455 }
7456
7457 mean = sum / size;
7458
7459 // Calculate variance for the set
7460 for (i = 0; i < size; i++) {
7461 varianceTemp += Math.pow((vals[i] - mean), 2);
7462 }
7463
7464 variance = varianceTemp / size;
7465 standardDev = Math.sqrt(variance);
7466
7467 //Standardize the Data
7468 for (i = 0; i < size; i++) {
7469 vals[i] = (vals[i] - mean) / standardDev;
7470 }
7471
7472 // Calculate the average excluding outliers
7473 var deviationRange = 2.0;
7474 for (i = 0; i < size; i++) {
7475
7476 if (vals[i] <= deviationRange && vals[i] >= -deviationRange) {
7477 mCount++;
7478 mSum += history[i];
7479 }
7480 }
7481
7482 } else {
7483 // Calculate the average (not enough data points to remove outliers)
7484 mCount = size;
7485 for (i = 0; i < size; i++) {
7486 mSum += history[i];
7487 }
7488 }
7489
7490 return mSum / mCount;
7491 };
7492
7493 }
7494 /*
7495 A simple class for displaying file information and progress
7496 Note: This is a demonstration only and not part of SWFUpload.
7497 Note: Some have had problems adapting this class in IE7. It may not be suitable for your application.
7498 */
7499
7500 // Constructor
7501 // file is a SWFUpload file object
7502 // targetID is the HTML element id attribute that the FileProgress HTML structure will be added to.
7503 // Instantiating a new FileProgress object with an existing file will reuse/update the existing DOM elements
7504 function FileProgress(file, targetID) {
7505 this.fileProgressID = file.id;
7506
7507 this.opacity = 100;
7508 this.height = 0;
7509
7510
7511 this.fileProgressWrapper = document.getElementById(this.fileProgressID);
7512 if (!this.fileProgressWrapper) {
7513 this.fileProgressWrapper = document.createElement("div");
7514 this.fileProgressWrapper.className = "progressWrapper";
7515 this.fileProgressWrapper.id = this.fileProgressID;
7516
7517 this.fileProgressElement = document.createElement("div");
7518 this.fileProgressElement.className = "progressContainer";
7519
7520 var progressCancel = document.createElement("a");
7521 progressCancel.className = "progressCancel";
7522 progressCancel.href = "#";
7523 progressCancel.style.visibility = "hidden";
7524 progressCancel.appendChild(document.createTextNode(" "));
7525
7526 var progressText = document.createElement("div");
7527 progressText.className = "progressName";
7528 progressText.appendChild(document.createTextNode(file.name));
7529
7530 var progressBar = document.createElement("div");
7531 progressBar.className = "progressBarInProgress";
7532
7533 var progressStatus = document.createElement("div");
7534 progressStatus.className = "progressBarStatus";
7535 progressStatus.innerHTML = "&nbsp;";
7536
7537 this.fileProgressElement.appendChild(progressCancel);
7538 this.fileProgressElement.appendChild(progressText);
7539 this.fileProgressElement.appendChild(progressStatus);
7540 this.fileProgressElement.appendChild(progressBar);
7541
7542 this.fileProgressWrapper.appendChild(this.fileProgressElement);
7543
7544 document.getElementById(targetID).appendChild(this.fileProgressWrapper);
7545 } else {
7546 this.fileProgressElement = this.fileProgressWrapper.firstChild;
7547 this.reset();
7548 }
7549
7550 this.height = this.fileProgressWrapper.offsetHeight;
7551 this.setTimer(null);
7552
7553
7554 }
7555
7556 FileProgress.prototype.setTimer = function (timer) {
7557 this.fileProgressElement["FP_TIMER"] = timer;
7558 };
7559 FileProgress.prototype.getTimer = function (timer) {
7560 return this.fileProgressElement["FP_TIMER"] || null;
7561 };
7562
7563 FileProgress.prototype.reset = function () {
7564 this.fileProgressElement.className = "progressContainer";
7565
7566 this.fileProgressElement.childNodes[2].innerHTML = "&nbsp;";
7567 this.fileProgressElement.childNodes[2].className = "progressBarStatus";
7568
7569 this.fileProgressElement.childNodes[3].className = "progressBarInProgress";
7570 this.fileProgressElement.childNodes[3].style.width = "0%";
7571
7572 this.appear();
7573 };
7574
7575 FileProgress.prototype.setProgress = function (percentage) {
7576 this.fileProgressElement.className = "progressContainer green";
7577 this.fileProgressElement.childNodes[3].className = "progressBarInProgress";
7578 this.fileProgressElement.childNodes[3].style.width = percentage + "%";
7579
7580 this.appear();
7581 };
7582 FileProgress.prototype.setComplete = function () {
7583 this.fileProgressElement.className = "progressContainer blue";
7584 this.fileProgressElement.childNodes[3].className = "progressBarComplete";
7585 this.fileProgressElement.childNodes[3].style.width = "";
7586
7587 var oSelf = this;
7588 this.setTimer(setTimeout(function () {
7589 oSelf.disappear();
7590 }, 10000));
7591 };
7592 FileProgress.prototype.setError = function () {
7593 this.fileProgressElement.className = "progressContainer red";
7594 this.fileProgressElement.childNodes[3].className = "progressBarError";
7595 this.fileProgressElement.childNodes[3].style.width = "";
7596
7597 var oSelf = this;
7598 this.setTimer(setTimeout(function () {
7599 oSelf.disappear();
7600 }, 5000));
7601 };
7602 FileProgress.prototype.setCancelled = function () {
7603 this.fileProgressElement.className = "progressContainer";
7604 this.fileProgressElement.childNodes[3].className = "progressBarError";
7605 this.fileProgressElement.childNodes[3].style.width = "";
7606
7607 var oSelf = this;
7608 this.setTimer(setTimeout(function () {
7609 oSelf.disappear();
7610 }, 2000));
7611 };
7612 FileProgress.prototype.setStatus = function (status) {
7613 this.fileProgressElement.childNodes[2].innerHTML = status;
7614 };
7615
7616 // Show/Hide the cancel button
7617 FileProgress.prototype.toggleCancel = function (show, swfUploadInstance) {
7618 this.fileProgressElement.childNodes[0].style.visibility = show ? "visible" : "hidden";
7619 if (swfUploadInstance) {
7620 var fileID = this.fileProgressID;
7621 this.fileProgressElement.childNodes[0].onclick = function () {
7622 swfUploadInstance.cancelUpload(fileID);
7623 return false;
7624 };
7625 }
7626 };
7627
7628 FileProgress.prototype.appear = function () {
7629 if (this.getTimer() !== null) {
7630 clearTimeout(this.getTimer());
7631 this.setTimer(null);
7632 }
7633
7634 if (this.fileProgressWrapper.filters) {
7635 try {
7636 this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = 100;
7637 } catch (e) {
7638 // If it is not set initially, the browser will throw an error. This will set it if it is not set yet.
7639 this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=100)";
7640 }
7641 } else {
7642 this.fileProgressWrapper.style.opacity = 1;
7643 }
7644
7645 this.fileProgressWrapper.style.height = "";
7646
7647 this.height = this.fileProgressWrapper.offsetHeight;
7648 this.opacity = 100;
7649 this.fileProgressWrapper.style.display = "";
7650
7651 };
7652
7653 // Fades out and clips away the FileProgress box.
7654 FileProgress.prototype.disappear = function () {
7655
7656 var reduceOpacityBy = 15;
7657 var reduceHeightBy = 4;
7658 var rate = 30; // 15 fps
7659
7660 if (this.opacity > 0) {
7661 this.opacity -= reduceOpacityBy;
7662 if (this.opacity < 0) {
7663 this.opacity = 0;
7664 }
7665
7666 if (this.fileProgressWrapper.filters) {
7667 try {
7668 this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = this.opacity;
7669 } catch (e) {
7670 // If it is not set initially, the browser will throw an error. This will set it if it is not set yet.
7671 this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + this.opacity + ")";
7672 }
7673 } else {
7674 this.fileProgressWrapper.style.opacity = this.opacity / 100;
7675 }
7676 }
7677
7678 if (this.height > 0) {
7679 this.height -= reduceHeightBy;
7680 if (this.height < 0) {
7681 this.height = 0;
7682 }
7683
7684 this.fileProgressWrapper.style.height = this.height + "px";
7685 }
7686
7687 if (this.height > 0 || this.opacity > 0) {
7688 var oSelf = this;
7689 this.setTimer(setTimeout(function () {
7690 oSelf.disappear();
7691 }, rate));
7692 } else {
7693 this.fileProgressWrapper.style.display = "none";
7694 this.setTimer(null);
7695 }
7696 };
7697 /* Demo Note: This demo uses a FileProgress class that handles the UI for displaying the file name and percent complete.
7698 The FileProgress class is not part of SWFUpload.
7699 */
7700
7701
7702 /* **********************
7703 Event Handlers
7704 These are my custom event handlers to make my
7705 web application behave the way I went when SWFUpload
7706 completes different tasks. These aren't part of the SWFUpload
7707 package. They are part of my application. Without these none
7708 of the actions SWFUpload makes will show up in my application.
7709 ********************** */
7710 function fileQueued(file) {
7711 try {
7712 var progress = new FileProgress(file, this.customSettings.progressTarget);
7713 progress.setStatus( ultimix.get_string( "pending" ) );
7714 progress.toggleCancel(true, this);
7715
7716 } catch (ex) {
7717 this.debug(ex);
7718 }
7719
7720 }
7721
7722 function fileQueueError(file, errorCode, message) {
7723 try {
7724 if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
7725 alert("You have attempted to queue too many files.\n" + (message === 0 ? "You have reached the upload limit." : "You may select " + (message > 1 ? "up to " + message + " files." : "one file.")));
7726 return;
7727 }
7728
7729 var progress = new FileProgress(file, this.customSettings.progressTarget);
7730 progress.setError();
7731 progress.toggleCancel(false);
7732
7733 switch (errorCode) {
7734 case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
7735 progress.setStatus( ultimix.get_string( "file_is_too_big" ));
7736 this.debug("Error Code: File too big, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
7737 break;
7738 case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
7739 progress.setStatus( ultimix.get_string( "cannot_upload_zero_bytes" ) );
7740 this.debug("Error Code: Zero byte file, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
7741 break;
7742 case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
7743 progress.setStatus( ultimix.get_string( "invalid_file_type" ) );
7744 this.debug("Error Code: Invalid File Type, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
7745 break;
7746 default:
7747 if (file !== null) {
7748 progress.setStatus( ultimix.get_string( "unhandled_error" ) );
7749 }
7750 this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
7751 break;
7752 }
7753 } catch (ex) {
7754 this.debug(ex);
7755 }
7756 }
7757
7758 function fileDialogComplete(numFilesSelected, numFilesQueued) {
7759 try {
7760 if (numFilesSelected > 0) {
7761 document.getElementById(this.customSettings.cancelButtonId).disabled = false;
7762 }
7763
7764 /* I want auto start the upload and I can do that here */
7765 this.startUpload();
7766 } catch (ex) {
7767 this.debug(ex);
7768 }
7769 }
7770
7771 function uploadStart(file) {
7772 try {
7773 /* I don't want to do any file validation or anything, I'll just update the UI and
7774 return true to indicate that the upload should start.
7775 It's important to update the UI here because in Linux no uploadProgress events are called. The best
7776 we can do is say we are uploading.
7777 */
7778 var progress = new FileProgress(file, this.customSettings.progressTarget);
7779 progress.setStatus( ultimix.get_string( 'uploading' ) );
7780 progress.toggleCancel(true, this);
7781 }
7782 catch (ex) {}
7783
7784 return true;
7785 }
7786
7787 function uploadProgress(file, bytesLoaded, bytesTotal) {
7788 try {
7789 var percent = Math.ceil((bytesLoaded / bytesTotal) * 100);
7790
7791 var progress = new FileProgress(file, this.customSettings.progressTarget);
7792 progress.setProgress(percent);
7793 progress.setStatus( ultimix.get_string( 'uploading' ) );
7794 } catch (ex) {
7795 this.debug(ex);
7796 }
7797 }
7798
7799 function uploadSuccess(file, serverData) {
7800 try {
7801 var progress = new FileProgress(file, this.customSettings.progressTarget);
7802 progress.setComplete();
7803 progress.setStatus( ultimix.get_string( 'complete' ) );
7804 progress.toggleCancel(false);
7805
7806 } catch (ex) {
7807 this.debug(ex);
7808 }
7809 }
7810
7811 function uploadError(file, errorCode, message) {
7812 try {
7813 var progress = new FileProgress(file, this.customSettings.progressTarget);
7814 progress.setError();
7815 progress.toggleCancel(false);
7816
7817 switch (errorCode) {
7818 case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
7819 progress.setStatus( ultimix.get_string( "upload_error" ) + message );
7820 this.debug("Error Code: HTTP Error, File name: " + file.name + ", Message: " + message);
7821 break;
7822 case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
7823 progress.setStatus( ultimix.get_string( "upload_failed" ) );
7824 this.debug("Error Code: Upload Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
7825 break;
7826 case SWFUpload.UPLOAD_ERROR.IO_ERROR:
7827 progress.setStatus( ultimix.get_string( "server_io_error" ) ) ;
7828 this.debug("Error Code: IO Error, File name: " + file.name + ", Message: " + message);
7829 break;
7830 case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
7831 progress.setStatus( ultimix.get_string( "security_error" ) );
7832 this.debug("Error Code: Security Error, File name: " + file.name + ", Message: " + message);
7833 break;
7834 case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
7835 progress.setStatus( ultimix.get_string( "upload_limit" ) );
7836 this.debug("Error Code: Upload Limit Exceeded, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
7837 break;
7838 case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
7839 progress.setStatus( ultimix.get_string( "failed_validation" ) );
7840 this.debug("Error Code: File Validation Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
7841 break;
7842 case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
7843 /* If there aren't any files left (they were all cancelled) disable the cancel button */
7844 if (this.getStats().files_queued === 0) {
7845 document.getElementById(this.customSettings.cancelButtonId).disabled = true;
7846 }
7847 progress.setStatus( ultimix.get_string( "cancelled" ) );
7848 progress.setCancelled();
7849 break;
7850 case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
7851 progress.setStatus( ultimix.get_string( "stopped" ) );
7852 break;
7853 default:
7854 progress.setStatus( ultimix.get_string( "unhandled_error" ) + ": " + errorCode);
7855 this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
7856 break;
7857 }
7858 } catch (ex) {
7859 this.debug(ex);
7860 }
7861 }
7862
7863 function uploadComplete(file) {
7864 if (this.getStats().files_queued === 0) {
7865 document.getElementById(this.customSettings.cancelButtonId).disabled = true;
7866 }
7867 }
7868
7869 /* This event comes from the Queue Plugin */
7870 function queueComplete(numFilesUploaded) {
7871 var status = document.getElementById("divStatus");
7872 status.innerHTML = numFilesUploaded + " file" + (numFilesUploaded === 1 ? "" : "s") + " uploaded.";
7873 }
7874
7880 if( !ultimix )
7881 {
7882 ultimix = {};
7883 }
7884
7890 if( !ultimix.file_input )
7891 {
7892 ultimix.file_input = {};
7893 }
7894
7904 ultimix.file_input.SetSingleUploadedFileInfo = function( ServerDataObject , ControlSettings )
7905 {
7906 jQuery( '#' + ControlSettings.statusAcceptor ).html(
7907 ServerDataObject.original_file_name
7908 );
7909
7910 jQuery( '#' + ControlSettings.dataAcceptor ).html(
7911 "<input type=\"hidden\" name=\"" + ControlSettings.name + "\" value=\"" + ServerDataObject.id + "\">" +
7912 "<input type=\"hidden\" name=\"visible_" + ControlSettings.name + "\" value=\"" +
7913 ServerDataObject.original_file_name+ "\">"
7914 );
7915 }
7916
7928 ultimix_file_input_view_AfterImageUploadProcessor = function( File , ServerData , ReceivedResponse )
7929 {
7930 try
7931 {
7932 var Progress = new FileProgress( File , this.customSettings.progressTarget );
7933 Progress.setComplete();
7934 Progress.setStatus( ultimix.get_string( 'complete' ) );
7935 Progress.toggleCancel( false );
7936
7937 var ServerDataObject = {};
7938 eval( "ServerDataObject=" + ServerData );
7939
7940 ultimix.file_input.SetSingleUploadedFileInfo( ServerDataObject , this.customSettings );
7941 }
7942 catch( ex )
7943 {
7944 this.debug( ex );
7945 }
7946 }
7947 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'pending' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'pending' ] = {};
7948 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'pending' ][ 'default' ] = 'Отправка...';
7949 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'file_is_too_big' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'file_is_too_big' ] = {};
7950 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'file_is_too_big' ][ 'default' ] = 'Файл слишком большой.';
7951 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cannot_upload_zero_bytes' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cannot_upload_zero_bytes' ] = {};
7952 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cannot_upload_zero_bytes' ][ 'default' ] = 'Невозможно отправить файл нулевого размера.';
7953 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'invalid_file_type' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'invalid_file_type' ] = {};
7954 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'invalid_file_type' ][ 'default' ] = 'Некорректный тип файла.';
7955 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'unhandled_error' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'unhandled_error' ] = {};
7956 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'unhandled_error' ][ 'default' ] = 'Неизвестная ошибка';
7957 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'upload_error' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'upload_error' ] = {};
7958 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'upload_error' ][ 'default' ] = 'Ошибка загрузки: ';
7959 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'upload_failed' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'upload_failed' ] = {};
7960 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'upload_failed' ][ 'default' ] = 'Загрузка сорвана';
7961 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'server_io_error' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'server_io_error' ] = {};
7962 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'server_io_error' ][ 'default' ] = 'Ошибка сервера';
7963 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'security_error' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'security_error' ] = {};
7964 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'security_error' ][ 'default' ] = 'Ошибка безопасности';
7965 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'upload_limit' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'upload_limit' ] = {};
7966 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'upload_limit' ][ 'default' ] = 'Предел загрузки исчерпан';
7967 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'failed_validation' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'failed_validation' ] = {};
7968 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'failed_validation' ][ 'default' ] = 'Проверка не пройдена. Загрузка пропущена.';
7969 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cancelled' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cancelled' ] = {};
7970 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cancelled' ][ 'default' ] = 'Отменена';
7971 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'stopped' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'stopped' ] = {};
7972 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'stopped' ][ 'default' ] = 'Остановлена';
7973 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'uploading' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'uploading' ] = {};
7974 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'uploading' ][ 'default' ] = 'Загрузка...';
7975 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'complete' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'complete' ] = {};
7976 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'complete' ][ 'default' ] = 'Завершено';
7977
7978 /*
7979 * jsTree 1.0-rc3
7980 * http://jstree.com/
7981 *
7982 * Copyright (c) 2010 Ivan Bozhanov (vakata.com)
7983 *
7984 * Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License
7985 * http://www.opensource.org/licenses/mit-license.php
7986 * http://www.gnu.org/licenses/gpl.html
7987 *
7988 * $Date: 2011-02-09 01:17:14 +0200 (ср, 09 февр 2011) $
7989 * $Revision: 236 $
7990 */
7991
7992 /*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
7993 /*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/
7994
7995 "use strict";
7996
7997 // top wrapper to prevent multiple inclusion (is this OK?)
7998 (function () { if(jQuery && jQuery.jstree) { return; }
7999 var is_ie6 = false, is_ie7 = false, is_ff2 = false;
8000
8001 /*
8002 * jsTree core
8003 */
8004 (function ($) {
8005 // Common functions not related to jsTree
8006 // decided to move them to a `vakata` "namespace"
8007 $.vakata = {};
8008 // CSS related functions
8009 $.vakata.css = {
8010 get_css : function(rule_name, delete_flag, sheet) {
8011 rule_name = rule_name.toLowerCase();
8012 var css_rules = sheet.cssRules || sheet.rules,
8013 j = 0;
8014 do {
8015 if(css_rules.length && j > css_rules.length + 5) { return false; }
8016 if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) {
8017 if(delete_flag === true) {
8018 if(sheet.removeRule) { sheet.removeRule(j); }
8019 if(sheet.deleteRule) { sheet.deleteRule(j); }
8020 return true;
8021 }
8022 else { return css_rules[j]; }
8023 }
8024 }
8025 while (css_rules[++j]);
8026 return false;
8027 },
8028 add_css : function(rule_name, sheet) {
8029 if($.jstree.css.get_css(rule_name, false, sheet)) { return false; }
8030 if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); }
8031 return $.vakata.css.get_css(rule_name);
8032 },
8033 remove_css : function(rule_name, sheet) {
8034 return $.vakata.css.get_css(rule_name, true, sheet);
8035 },
8036 add_sheet : function(opts) {
8037 var tmp = false, is_new = true;
8038 if(opts.str) {
8039 if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; }
8040 if(tmp) { is_new = false; }
8041 else {
8042 tmp = document.createElement("style");
8043 tmp.setAttribute('type',"text/css");
8044 if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); }
8045 }
8046 if(tmp.styleSheet) {
8047 if(is_new) {
8048 document.getElementsByTagName("head")[0].appendChild(tmp);
8049 tmp.styleSheet.cssText = opts.str;
8050 }
8051 else {
8052 tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str;
8053 }
8054 }
8055 else {
8056 tmp.appendChild(document.createTextNode(opts.str));
8057 document.getElementsByTagName("head")[0].appendChild(tmp);
8058 }
8059 return tmp.sheet || tmp.styleSheet;
8060 }
8061 if(opts.url) {
8062 if(document.createStyleSheet) {
8063 try { tmp = document.createStyleSheet(opts.url); } catch (e) { }
8064 }
8065 else {
8066 tmp = document.createElement('link');
8067 tmp.rel = 'stylesheet';
8068 tmp.type = 'text/css';
8069 tmp.media = "all";
8070 tmp.href = opts.url;
8071 document.getElementsByTagName("head")[0].appendChild(tmp);
8072 return tmp.styleSheet;
8073 }
8074 }
8075 }
8076 };
8077
8078 // private variables
8079 var instances = [], // instance array (used by $.jstree.reference/create/focused)
8080 focused_instance = -1, // the index in the instance array of the currently focused instance
8081 plugins = {}, // list of included plugins
8082 prepared_move = {}; // for the move_node function
8083
8084 // jQuery plugin wrapper (thanks to jquery UI widget function)
8085 $.fn.jstree = function (settings) {
8086 var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node")
8087 args = Array.prototype.slice.call(arguments, 1),
8088 returnValue = this;
8089
8090 // if a method call execute the method on all selected instances
8091 if(isMethodCall) {
8092 if(settings.substring(0, 1) == '_') { return returnValue; }
8093 this.each(function() {
8094 var instance = instances[$.data(this, "jstree_instance_id")],
8095 methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
8096 if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
8097 });
8098 }
8099 else {
8100 this.each(function() {
8101 // extend settings and allow for multiple hashes and $.data
8102 var instance_id = $.data(this, "jstree_instance_id"),
8103 a = [],
8104 b = settings ? $.extend({}, true, settings) : {},
8105 c = $(this),
8106 s = false,
8107 t = [];
8108 a = a.concat(args);
8109 if(c.data("jstree")) { a.push(c.data("jstree")); }
8110 b = a.length ? $.extend.apply(null, [true, b].concat(a)) : b;
8111
8112 // if an instance already exists, destroy it first
8113 if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); }
8114 // push a new empty object to the instances array
8115 instance_id = parseInt(instances.push({}),10) - 1;
8116 // store the jstree instance id to the container element
8117 $.data(this, "jstree_instance_id", instance_id);
8118 // clean up all plugins
8119 b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
8120 b.plugins.unshift("core");
8121 // only unique plugins
8122 b.plugins = b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
8123
8124 // extend defaults with passed data
8125 s = $.extend(true, {}, $.jstree.defaults, b);
8126 s.plugins = b.plugins;
8127 $.each(plugins, function (i, val) {
8128 if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; }
8129 else { t.push(i); }
8130 });
8131 s.plugins = t;
8132
8133 // push the new object to the instances array (at the same time set the default classes to the container) and init
8134 instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s);
8135 // init all activated plugins for this instance
8136 $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
8137 $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
8138 // initialize the instance
8139 setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0);
8140 });
8141 }
8142 // return the jquery selection (or if it was a method call that returned a value - the returned value)
8143 return returnValue;
8144 };
8145 // object to store exposed functions and objects
8146 $.jstree = {
8147 defaults : {
8148 plugins : []
8149 },
8150 _focused : function () { return instances[focused_instance] || null; },
8151 _reference : function (needle) {
8152 // get by instance id
8153 if(instances[needle]) { return instances[needle]; }
8154 // get by DOM (if still no luck - return null
8155 var o = $(needle);
8156 if(!o.length && typeof needle === "string") { o = $("#" + needle); }
8157 if(!o.length) { return null; }
8158 return instances[o.closest(".jstree").data("jstree_instance_id")] || null;
8159 },
8160 _instance : function (index, container, settings) {
8161 // for plugins to store data in
8162 this.data = { core : {} };
8163 this.get_settings = function () { return $.extend(true, {}, settings); };
8164 this._get_settings = function () { return settings; };
8165 this.get_index = function () { return index; };
8166 this.get_container = function () { return container; };
8167 this.get_container_ul = function () { return container.children("ul:eq(0)"); };
8168 this._set_settings = function (s) {
8169 settings = $.extend(true, {}, settings, s);
8170 };
8171 },
8172 _fn : { },
8173 plugin : function (pname, pdata) {
8174 pdata = $.extend({}, {
8175 __init : $.noop,
8176 __destroy : $.noop,
8177 _fn : {},
8178 defaults : false
8179 }, pdata);
8180 plugins[pname] = pdata;
8181
8182 $.jstree.defaults[pname] = pdata.defaults;
8183 $.each(pdata._fn, function (i, val) {
8184 val.plugin = pname;
8185 val.old = $.jstree._fn[i];
8186 $.jstree._fn[i] = function () {
8187 var rslt,
8188 func = val,
8189 args = Array.prototype.slice.call(arguments),
8190 evnt = new $.Event("before.jstree"),
8191 rlbk = false;
8192
8193 if(this.data.core.locked === true && i !== "unlock" && i !== "is_locked") { return; }
8194
8195 // Check if function belongs to the included plugins of this instance
8196 do {
8197 if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; }
8198 func = func.old;
8199 } while(func);
8200 if(!func) { return; }
8201
8202 // context and function to trigger events, then finally call the function
8203 if(i.indexOf("_") === 0) {
8204 rslt = func.apply(this, args);
8205 }
8206 else {
8207 rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args, "plugin" : func.plugin });
8208 if(rslt === false) { return; }
8209 if(typeof rslt !== "undefined") { args = rslt; }
8210
8211 rslt = func.apply(
8212 $.extend({}, this, {
8213 __callback : function (data) {
8214 this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });
8215 },
8216 __rollback : function () {
8217 rlbk = this.get_rollback();
8218 return rlbk;
8219 },
8220 __call_old : function (replace_arguments) {
8221 return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) );
8222 }
8223 }), args);
8224 }
8225
8226 // return the result
8227 return rslt;
8228 };
8229 $.jstree._fn[i].old = val.old;
8230 $.jstree._fn[i].plugin = pname;
8231 });
8232 },
8233 rollback : function (rb) {
8234 if(rb) {
8235 if(!$.isArray(rb)) { rb = [ rb ]; }
8236 $.each(rb, function (i, val) {
8237 instances[val.i].set_rollback(val.h, val.d);
8238 });
8239 }
8240 }
8241 };
8242 // set the prototype for all instances
8243 $.jstree._fn = $.jstree._instance.prototype = {};
8244
8245 // load the css when DOM is ready
8246 $(function() {
8247 // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
8248 var u = navigator.userAgent.toLowerCase(),
8249 v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
8250 css_string = '' +
8251 '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' +
8252 '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' +
8253 '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
8254 '.jstree > ul > li { margin-left:0px; } ' +
8255 '.jstree-rtl > ul > li { margin-right:0px; } ' +
8256 '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' +
8257 '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +
8258 '.jstree a:focus { outline: none; } ' +
8259 '.jstree a > ins { height:16px; width:16px; } ' +
8260 '.jstree a > .jstree-icon { margin-right:3px; } ' +
8261 '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' +
8262 'li.jstree-open > ul { display:block; } ' +
8263 'li.jstree-closed > ul { display:none; } ';
8264 // Correct IE 6 (does not support the > CSS selector)
8265 if(/msie/.test(u) && parseInt(v, 10) == 6) {
8266 is_ie6 = true;
8267
8268 // fix image flicker and lack of caching
8269 try {
8270 document.execCommand("BackgroundImageCache", false, true);
8271 } catch (err) { }
8272
8273 css_string += '' +
8274 '.jstree li { height:18px; margin-left:0; margin-right:0; } ' +
8275 '.jstree li li { margin-left:18px; } ' +
8276 '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' +
8277 'li.jstree-open ul { display:block; } ' +
8278 'li.jstree-closed ul { display:none !important; } ' +
8279 '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' +
8280 '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' +
8281 '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } ';
8282 }
8283 // Correct IE 7 (shifts anchor nodes onhover)
8284 if(/msie/.test(u) && parseInt(v, 10) == 7) {
8285 is_ie7 = true;
8286 css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';
8287 }
8288 // correct ff2 lack of display:inline-block
8289 if(!/compatible/.test(u) && /mozilla/.test(u) && parseFloat(v, 10) < 1.9) {
8290 is_ff2 = true;
8291 css_string += '' +
8292 '.jstree ins { display:-moz-inline-box; } ' +
8293 '.jstree li { line-height:12px; } ' + // WHY??
8294 '.jstree a { display:-moz-inline-box; } ' +
8295 '.jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } ';
8296 /* this shouldn't be here as it is theme specific */
8297 }
8298 // the default stylesheet
8299 $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
8300 });
8301
8302 // core functions (open, close, create, update, delete)
8303 $.jstree.plugin("core", {
8304 __init : function () {
8305 this.data.core.locked = false;
8306 this.data.core.to_open = this.get_settings().core.initially_open;
8307 this.data.core.to_load = this.get_settings().core.initially_load;
8308 },
8309 defaults : {
8310 html_titles : false,
8311 animation : 500,
8312 initially_open : [],
8313 initially_load : [],
8314 open_parents : true,
8315 notify_plugins : true,
8316 rtl : false,
8317 load_open : false,
8318 strings : {
8319 loading : "Loading ...",
8320 new_node : "New node",
8321 multiple_selection : "Multiple selection"
8322 }
8323 },
8324 _fn : {
8325 init : function () {
8326 this.set_focus();
8327 if(this._get_settings().core.rtl) {
8328 this.get_container().addClass("jstree-rtl").css("direction", "rtl");
8329 }
8330 this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>" + this._get_string("loading") + "</a></li></ul>");
8331 this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18;
8332
8333 this.get_container()
8334 .delegate("li > ins", "click.jstree", $.proxy(function (event) {
8335 var trgt = $(event.target);
8336 // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
8337 this.toggle_node(trgt);
8338 }, this))
8339 .bind("mousedown.jstree", $.proxy(function () {
8340 this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
8341 }, this))
8342 .bind("dblclick.jstree", function (event) {
8343 var sel;
8344 if(document.selection && document.selection.empty) { document.selection.empty(); }
8345 else {
8346 if(window.getSelection) {
8347 sel = window.getSelection();
8348 try {
8349 sel.removeAllRanges();
8350 sel.collapse();
8351 } catch (err) { }
8352 }
8353 }
8354 });
8355 if(this._get_settings().core.notify_plugins) {
8356 this.get_container()
8357 .bind("load_node.jstree", $.proxy(function (e, data) {
8358 var o = this._get_node(data.rslt.obj),
8359 t = this;
8360 if(o === -1) { o = this.get_container_ul(); }
8361 if(!o.length) { return; }
8362 o.find("li").each(function () {
8363 var th = $(this);
8364 if(th.data("jstree")) {
8365 $.each(th.data("jstree"), function (plugin, values) {
8366 if(t.data[plugin] && $.isFunction(t["_" + plugin + "_notify"])) {
8367 t["_" + plugin + "_notify"].call(t, th, values);
8368 }
8369 });
8370 }
8371 });
8372 }, this));
8373 }
8374 if(this._get_settings().core.load_open) {
8375 this.get_container()
8376 .bind("load_node.jstree", $.proxy(function (e, data) {
8377 var o = this._get_node(data.rslt.obj),
8378 t = this;
8379 if(o === -1) { o = this.get_container_ul(); }
8380 if(!o.length) { return; }
8381 o.find("li.jstree-open:not(:has(ul))").each(function () {
8382 t.load_node(this, $.noop, $.noop);
8383 });
8384 }, this));
8385 }
8386 this.__callback();
8387 this.load_node(-1, function () { this.loaded(); this.reload_nodes(); });
8388 },
8389 destroy : function () {
8390 var i,
8391 n = this.get_index(),
8392 s = this._get_settings(),
8393 _this = this;
8394
8395 $.each(s.plugins, function (i, val) {
8396 try { plugins[val].__destroy.apply(_this); } catch(err) { }
8397 });
8398 this.__callback();
8399 // set focus to another instance if this one is focused
8400 if(this.is_focused()) {
8401 for(i in instances) {
8402 if(instances.hasOwnProperty(i) && i != n) {
8403 instances[i].set_focus();
8404 break;
8405 }
8406 }
8407 }
8408 // if no other instance found
8409 if(n === focused_instance) { focused_instance = -1; }
8410 // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events
8411 this.get_container()
8412 .unbind(".jstree")
8413 .undelegate(".jstree")
8414 .removeData("jstree_instance_id")
8415 .find("[class^='jstree']")
8416 .andSelf()
8417 .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
8418 $(document)
8419 .unbind(".jstree-" + n)
8420 .undelegate(".jstree-" + n);
8421 // remove the actual data
8422 instances[n] = null;
8423 delete instances[n];
8424 },
8425
8426 _core_notify : function (n, data) {
8427 if(data.opened) {
8428 this.open_node(n, false, true);
8429 }
8430 },
8431
8432 lock : function () {
8433 this.data.core.locked = true;
8434 this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");
8435 this.__callback({});
8436 },
8437 unlock : function () {
8438 this.data.core.locked = false;
8439 this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");
8440 this.__callback({});
8441 },
8442 is_locked : function () { return this.data.core.locked; },
8443 save_opened : function () {
8444 var _this = this;
8445 this.data.core.to_open = [];
8446 this.get_container_ul().find("li.jstree-open").each(function () {
8447 if(this.id) { _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); }
8448 });
8449 this.__callback(_this.data.core.to_open);
8450 },
8451 save_loaded : function () { },
8452 reload_nodes : function (is_callback) {
8453 var _this = this,
8454 done = true,
8455 current = [],
8456 remaining = [];
8457 if(!is_callback) {
8458 this.data.core.reopen = false;
8459 this.data.core.refreshing = true;
8460 this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
8461 this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
8462 if(this.data.core.to_open.length) {
8463 this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open);
8464 }
8465 }
8466 if(this.data.core.to_load.length) {
8467 $.each(this.data.core.to_load, function (i, val) {
8468 if(val == "#") { return true; }
8469 if($(val).length) { current.push(val); }
8470 else { remaining.push(val); }
8471 });
8472 if(current.length) {
8473 this.data.core.to_load = remaining;
8474 $.each(current, function (i, val) {
8475 if(!_this._is_loaded(val)) {
8476 _this.load_node(val, function () { _this.reload_nodes(true); }, function () { _this.reload_nodes(true); });
8477 done = false;
8478 }
8479 });
8480 }
8481 }
8482 if(this.data.core.to_open.length) {
8483 $.each(this.data.core.to_open, function (i, val) {
8484 _this.open_node(val, false, true);
8485 });
8486 }
8487 if(done) {
8488 // TODO: find a more elegant approach to syncronizing returning requests
8489 if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); }
8490 this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50);
8491 this.data.core.refreshing = false;
8492 this.reopen();
8493 }
8494 },
8495 reopen : function () {
8496 var _this = this;
8497 if(this.data.core.to_open.length) {
8498 $.each(this.data.core.to_open, function (i, val) {
8499 _this.open_node(val, false, true);
8500 });
8501 }
8502 this.__callback({});
8503 },
8504 refresh : function (obj) {
8505 var _this = this;
8506 this.save_opened();
8507 if(!obj) { obj = -1; }
8508 obj = this._get_node(obj);
8509 if(!obj) { obj = -1; }
8510 if(obj !== -1) { obj.children("UL").remove(); }
8511 else { this.get_container_ul().empty(); }
8512 this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); });
8513 },
8514 // Dummy function to fire after the first load (so that there is a jstree.loaded event)
8515 loaded : function () {
8516 this.__callback();
8517 },
8518 // deal with focus
8519 set_focus : function () {
8520 if(this.is_focused()) { return; }
8521 var f = $.jstree._focused();
8522 if(f) { f.unset_focus(); }
8523
8524 this.get_container().addClass("jstree-focused");
8525 focused_instance = this.get_index();
8526 this.__callback();
8527 },
8528 is_focused : function () {
8529 return focused_instance == this.get_index();
8530 },
8531 unset_focus : function () {
8532 if(this.is_focused()) {
8533 this.get_container().removeClass("jstree-focused");
8534 focused_instance = -1;
8535 }
8536 this.__callback();
8537 },
8538
8539 // traverse
8540 _get_node : function (obj) {
8541 var $obj = $(obj, this.get_container());
8542 if($obj.is(".jstree") || obj == -1) { return -1; }
8543 $obj = $obj.closest("li", this.get_container());
8544 return $obj.length ? $obj : false;
8545 },
8546 _get_next : function (obj, strict) {
8547 obj = this._get_node(obj);
8548 if(obj === -1) { return this.get_container().find("> ul > li:first-child"); }
8549 if(!obj.length) { return false; }
8550 if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; }
8551
8552 if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); }
8553 else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); }
8554 else { return obj.parentsUntil(".jstree","li").next("li").eq(0); }
8555 },
8556 _get_prev : function (obj, strict) {
8557 obj = this._get_node(obj);
8558 if(obj === -1) { return this.get_container().find("> ul > li:last-child"); }
8559 if(!obj.length) { return false; }
8560 if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; }
8561
8562 if(obj.prev("li").length) {
8563 obj = obj.prev("li").eq(0);
8564 while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); }
8565 return obj;
8566 }
8567 else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; }
8568 },
8569 _get_parent : function (obj) {
8570 obj = this._get_node(obj);
8571 if(obj == -1 || !obj.length) { return false; }
8572 var o = obj.parentsUntil(".jstree", "li:eq(0)");
8573 return o.length ? o : -1;
8574 },
8575 _get_children : function (obj) {
8576 obj = this._get_node(obj);
8577 if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); }
8578 if(!obj.length) { return false; }
8579 return obj.children("ul:eq(0)").children("li");
8580 },
8581 get_path : function (obj, id_mode) {
8582 var p = [],
8583 _this = this;
8584 obj = this._get_node(obj);
8585 if(obj === -1 || !obj || !obj.length) { return false; }
8586 obj.parentsUntil(".jstree", "li").each(function () {
8587 p.push( id_mode ? this.id : _this.get_text(this) );
8588 });
8589 p.reverse();
8590 p.push( id_mode ? obj.attr("id") : this.get_text(obj) );
8591 return p;
8592 },
8593
8594 // string functions
8595 _get_string : function (key) {
8596 return this._get_settings().core.strings[key] || key;
8597 },
8598
8599 is_open : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); },
8600 is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); },
8601 is_leaf : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); },
8602 correct_state : function (obj) {
8603 obj = this._get_node(obj);
8604 if(!obj || obj === -1) { return false; }
8605 obj.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();
8606 this.__callback({ "obj" : obj });
8607 },
8608 // open/close
8609 open_node : function (obj, callback, skip_animation) {
8610 obj = this._get_node(obj);
8611 if(!obj.length) { return false; }
8612 if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; }
8613 var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
8614 t = this;
8615 if(!this._is_loaded(obj)) {
8616 obj.children("a").addClass("jstree-loading");
8617 this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback);
8618 }
8619 else {
8620 if(this._get_settings().core.open_parents) {
8621 obj.parentsUntil(".jstree",".jstree-closed").each(function () {
8622 t.open_node(this, false, true);
8623 });
8624 }
8625 if(s) { obj.children("ul").css("display","none"); }
8626 obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");
8627 if(s) { obj.children("ul").stop(true, true).slideDown(s, function () { this.style.display = ""; t.after_open(obj); }); }
8628 else { t.after_open(obj); }
8629 this.__callback({ "obj" : obj });
8630 if(callback) { callback.call(); }
8631 }
8632 },
8633 after_open : function (obj) { this.__callback({ "obj" : obj }); },
8634 close_node : function (obj, skip_animation) {
8635 obj = this._get_node(obj);
8636 var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
8637 t = this;
8638 if(!obj.length || !obj.hasClass("jstree-open")) { return false; }
8639 if(s) { obj.children("ul").attr("style","display:block !important"); }
8640 obj.removeClass("jstree-open").addClass("jstree-closed");
8641 if(s) { obj.children("ul").stop(true, true).slideUp(s, function () { this.style.display = ""; t.after_close(obj); }); }
8642 else { t.after_close(obj); }
8643 this.__callback({ "obj" : obj });
8644 },
8645 after_close : function (obj) { this.__callback({ "obj" : obj }); },
8646 toggle_node : function (obj) {
8647 obj = this._get_node(obj);
8648 if(obj.hasClass("jstree-closed")) { return this.open_node(obj); }
8649 if(obj.hasClass("jstree-open")) { return this.close_node(obj); }
8650 },
8651 open_all : function (obj, do_animation, original_obj) {
8652 obj = obj ? this._get_node(obj) : -1;
8653 if(!obj || obj === -1) { obj = this.get_container_ul(); }
8654 if(original_obj) {
8655 obj = obj.find("li.jstree-closed");
8656 }
8657 else {
8658 original_obj = obj;
8659 if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }
8660 else { obj = obj.find("li.jstree-closed"); }
8661 }
8662 var _this = this;
8663 obj.each(function () {
8664 var __this = this;
8665 if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, do_animation, original_obj); }, !do_animation); }
8666 else { _this.open_node(this, false, !do_animation); }
8667 });
8668 // so that callback is fired AFTER all nodes are open
8669 if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); }
8670 },
8671 close_all : function (obj, do_animation) {
8672 var _this = this;
8673 obj = obj ? this._get_node(obj) : this.get_container();
8674 if(!obj || obj === -1) { obj = this.get_container_ul(); }
8675 obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); });
8676 this.__callback({ "obj" : obj });
8677 },
8678 clean_node : function (obj) {
8679 obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
8680 obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
8681 obj.removeClass("jstree-last")
8682 .filter("li:last-child").addClass("jstree-last").end()
8683 .filter(":has(li)")
8684 .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");
8685 obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();
8686 this.__callback({ "obj" : obj });
8687 },
8688 // rollback
8689 get_rollback : function () {
8690 this.__callback();
8691 return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data };
8692 },
8693 set_rollback : function (html, data) {
8694 this.get_container().empty().append(html);
8695 this.data = data;
8696 this.__callback();
8697 },
8698 // Dummy functions to be overwritten by any datastore plugin included
8699 load_node : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); },
8700 _is_loaded : function (obj) { return true; },
8701
8702 // Basic operations: create
8703 create_node : function (obj, position, js, callback, is_loaded) {
8704 obj = this._get_node(obj);
8705 position = typeof position === "undefined" ? "last" : position;
8706 var d = $("<li />"),
8707 s = this._get_settings().core,
8708 tmp;
8709
8710 if(obj !== -1 && !obj.length) { return false; }
8711 if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; }
8712
8713 this.__rollback();
8714
8715 if(typeof js === "string") { js = { "data" : js }; }
8716 if(!js) { js = {}; }
8717 if(js.attr) { d.attr(js.attr); }
8718 if(js.metadata) { d.data(js.metadata); }
8719 if(js.state) { d.addClass("jstree-" + js.state); }
8720 if(!js.data) { js.data = this._get_string("new_node"); }
8721 if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
8722 $.each(js.data, function (i, m) {
8723 tmp = $("<a />");
8724 if($.isFunction(m)) { m = m.call(this, js); }
8725 if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); }
8726 else {
8727 if(!m.attr) { m.attr = {}; }
8728 if(!m.attr.href) { m.attr.href = '#'; }
8729 tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title);
8730 if(m.language) { tmp.addClass(m.language); }
8731 }
8732 tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
8733 if(!m.icon && js.icon) { m.icon = js.icon; }
8734 if(m.icon) {
8735 if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
8736 else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
8737 }
8738 d.append(tmp);
8739 });
8740 d.prepend("<ins class='jstree-icon'>&#160;</ins>");
8741 if(obj === -1) {
8742 obj = this.get_container();
8743 if(position === "before") { position = "first"; }
8744 if(position === "after") { position = "last"; }
8745 }
8746 switch(position) {
8747 case "before": obj.before(d); tmp = this._get_parent(obj); break;
8748 case "after" : obj.after(d); tmp = this._get_parent(obj); break;
8749 case "inside":
8750 case "first" :
8751 if(!obj.children("ul").length) { obj.append("<ul />"); }
8752 obj.children("ul").prepend(d);
8753 tmp = obj;
8754 break;
8755 case "last":
8756 if(!obj.children("ul").length) { obj.append("<ul />"); }
8757 obj.children("ul").append(d);
8758 tmp = obj;
8759 break;
8760 default:
8761 if(!obj.children("ul").length) { obj.append("<ul />"); }
8762 if(!position) { position = 0; }
8763 tmp = obj.children("ul").children("li").eq(position);
8764 if(tmp.length) { tmp.before(d); }
8765 else { obj.children("ul").append(d); }
8766 tmp = obj;
8767 break;
8768 }
8769 if(tmp === -1 || tmp.get(0) === this.get_container().get(0)) { tmp = -1; }
8770 this.clean_node(tmp);
8771 this.__callback({ "obj" : d, "parent" : tmp });
8772 if(callback) { callback.call(this, d); }
8773 return d;
8774 },
8775 // Basic operations: rename (deal with text)
8776 get_text : function (obj) {
8777 obj = this._get_node(obj);
8778 if(!obj.length) { return false; }
8779 var s = this._get_settings().core.html_titles;
8780 obj = obj.children("a:eq(0)");
8781 if(s) {
8782 obj = obj.clone();
8783 obj.children("INS").remove();
8784 return obj.html();
8785 }
8786 else {
8787 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
8788 return obj.nodeValue;
8789 }
8790 },
8791 set_text : function (obj, val) {
8792 obj = this._get_node(obj);
8793 if(!obj.length) { return false; }
8794 obj = obj.children("a:eq(0)");
8795 if(this._get_settings().core.html_titles) {
8796 var tmp = obj.children("INS").clone();
8797 obj.html(val).prepend(tmp);
8798 this.__callback({ "obj" : obj, "name" : val });
8799 return true;
8800 }
8801 else {
8802 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
8803 this.__callback({ "obj" : obj, "name" : val });
8804 return (obj.nodeValue = val);
8805 }
8806 },
8807 rename_node : function (obj, val) {
8808 obj = this._get_node(obj);
8809 this.__rollback();
8810 if(obj && obj.length && this.set_text.apply(this, Array.prototype.slice.call(arguments))) { this.__callback({ "obj" : obj, "name" : val }); }
8811 },
8812 // Basic operations: deleting nodes
8813 delete_node : function (obj) {
8814 obj = this._get_node(obj);
8815 if(!obj.length) { return false; }
8816 this.__rollback();
8817 var p = this._get_parent(obj), prev = $([]), t = this;
8818 obj.each(function () {
8819 prev = prev.add(t._get_prev(this));
8820 });
8821 obj = obj.detach();
8822 if(p !== -1 && p.find("> ul > li").length === 0) {
8823 p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");
8824 }
8825 this.clean_node(p);
8826 this.__callback({ "obj" : obj, "prev" : prev, "parent" : p });
8827 return obj;
8828 },
8829 prepare_move : function (o, r, pos, cb, is_cb) {
8830 var p = {};
8831
8832 p.ot = $.jstree._reference(o) || this;
8833 p.o = p.ot._get_node(o);
8834 p.r = r === - 1 ? -1 : this._get_node(r);
8835 p.p = (typeof pos === "undefined" || pos === false) ? "last" : pos; // TODO: move to a setting
8836 if(!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0] && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) {
8837 this.__callback(prepared_move);
8838 if(cb) { cb.call(this, prepared_move); }
8839 return;
8840 }
8841 p.ot = $.jstree._reference(p.o) || this;
8842 p.rt = $.jstree._reference(p.r) || this; // r === -1 ? p.ot : $.jstree._reference(p.r) || this
8843 if(p.r === -1 || !p.r) {
8844 p.cr = -1;
8845 switch(p.p) {
8846 case "first":
8847 case "before":
8848 case "inside":
8849 p.cp = 0;
8850 break;
8851 case "after":
8852 case "last":
8853 p.cp = p.rt.get_container().find(" > ul > li").length;
8854 break;
8855 default:
8856 p.cp = p.p;
8857 break;
8858 }
8859 }
8860 else {
8861 if(!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) {
8862 return this.load_node(p.r, function () { this.prepare_move(o, r, pos, cb, true); });
8863 }
8864 switch(p.p) {
8865 case "before":
8866 p.cp = p.r.index();
8867 p.cr = p.rt._get_parent(p.r);
8868 break;
8869 case "after":
8870 p.cp = p.r.index() + 1;
8871 p.cr = p.rt._get_parent(p.r);
8872 break;
8873 case "inside":
8874 case "first":
8875 p.cp = 0;
8876 p.cr = p.r;
8877 break;
8878 case "last":
8879 p.cp = p.r.find(" > ul > li").length;
8880 p.cr = p.r;
8881 break;
8882 default:
8883 p.cp = p.p;
8884 p.cr = p.r;
8885 break;
8886 }
8887 }
8888 p.np = p.cr == -1 ? p.rt.get_container() : p.cr;
8889 p.op = p.ot._get_parent(p.o);
8890 p.cop = p.o.index();
8891 if(p.op === -1) { p.op = p.ot ? p.ot.get_container() : this.get_container(); }
8892 if(!/^(before|after)$/.test(p.p) && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp++; }
8893 //if(p.p === "before" && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp--; }
8894 p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")");
8895 prepared_move = p;
8896 this.__callback(prepared_move);
8897 if(cb) { cb.call(this, prepared_move); }
8898 },
8899 check_move : function () {
8900 var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
8901 if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
8902 if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
8903 obj.o.each(function () {
8904 if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; }
8905 });
8906 return ret;
8907 },
8908 move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
8909 if(!is_prepared) {
8910 return this.prepare_move(obj, ref, position, function (p) {
8911 this.move_node(p, false, false, is_copy, true, skip_check);
8912 });
8913 }
8914 if(is_copy) {
8915 prepared_move.cy = true;
8916 }
8917 if(!skip_check && !this.check_move()) { return false; }
8918
8919 this.__rollback();
8920 var o = false;
8921 if(is_copy) {
8922 o = obj.o.clone(true);
8923 o.find("*[id]").andSelf().each(function () {
8924 if(this.id) { this.id = "copy_" + this.id; }
8925 });
8926 }
8927 else { o = obj.o; }
8928
8929 if(obj.or.length) { obj.or.before(o); }
8930 else {
8931 if(!obj.np.children("ul").length) { $("<ul />").appendTo(obj.np); }
8932 obj.np.children("ul:eq(0)").append(o);
8933 }
8934
8935 try {
8936 obj.ot.clean_node(obj.op);
8937 obj.rt.clean_node(obj.np);
8938 if(!obj.op.find("> ul > li").length) {
8939 obj.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove();
8940 }
8941 } catch (e) { }
8942
8943 if(is_copy) {
8944 prepared_move.cy = true;
8945 prepared_move.oc = o;
8946 }
8947 this.__callback(prepared_move);
8948 return prepared_move;
8949 },
8950 _get_move : function () { return prepared_move; }
8951 }
8952 });
8953 })(jQuery);
8954 //*/
8955
8956 /*
8957 * jsTree ui plugin
8958 * This plugins handles selecting/deselecting/hovering/dehovering nodes
8959 */
8960 (function ($) {
8961 var scrollbar_width, e1, e2;
8962 $(function() {
8963 if (/msie/.test(navigator.userAgent.toLowerCase())) {
8964 e1 = $('<textarea cols="10" rows="2"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
8965 e2 = $('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
8966 scrollbar_width = e1.width() - e2.width();
8967 e1.add(e2).remove();
8968 }
8969 else {
8970 e1 = $('<div />').css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: 0 })
8971 .prependTo('body').append('<div />').find('div').css({ width: '100%', height: 200 });
8972 scrollbar_width = 100 - e1.width();
8973 e1.parent().remove();
8974 }
8975 });
8976 $.jstree.plugin("ui", {
8977 __init : function () {
8978 this.data.ui.selected = $();
8979 this.data.ui.last_selected = false;
8980 this.data.ui.hovered = null;
8981 this.data.ui.to_select = this.get_settings().ui.initially_select;
8982
8983 this.get_container()
8984 .delegate("a", "click.jstree", $.proxy(function (event) {
8985 event.preventDefault();
8986 event.currentTarget.blur();
8987 if(!$(event.currentTarget).hasClass("jstree-loading")) {
8988 this.select_node(event.currentTarget, true, event);
8989 }
8990 }, this))
8991 .delegate("a", "mouseenter.jstree", $.proxy(function (event) {
8992 if(!$(event.currentTarget).hasClass("jstree-loading")) {
8993 this.hover_node(event.target);
8994 }
8995 }, this))
8996 .delegate("a", "mouseleave.jstree", $.proxy(function (event) {
8997 if(!$(event.currentTarget).hasClass("jstree-loading")) {
8998 this.dehover_node(event.target);
8999 }
9000 }, this))
9001 .bind("reopen.jstree", $.proxy(function () {
9002 this.reselect();
9003 }, this))
9004 .bind("get_rollback.jstree", $.proxy(function () {
9005 this.dehover_node();
9006 this.save_selected();
9007 }, this))
9008 .bind("set_rollback.jstree", $.proxy(function () {
9009 this.reselect();
9010 }, this))
9011 .bind("close_node.jstree", $.proxy(function (event, data) {
9012 var s = this._get_settings().ui,
9013 obj = this._get_node(data.rslt.obj),
9014 clk = (obj && obj.length) ? obj.children("ul").find("a.jstree-clicked") : $(),
9015 _this = this;
9016 if(s.selected_parent_close === false || !clk.length) { return; }
9017 clk.each(function () {
9018 _this.deselect_node(this);
9019 if(s.selected_parent_close === "select_parent") { _this.select_node(obj); }
9020 });
9021 }, this))
9022 .bind("delete_node.jstree", $.proxy(function (event, data) {
9023 var s = this._get_settings().ui.select_prev_on_delete,
9024 obj = this._get_node(data.rslt.obj),
9025 clk = (obj && obj.length) ? obj.find("a.jstree-clicked") : [],
9026 _this = this;
9027 clk.each(function () { _this.deselect_node(this); });
9028 if(s && clk.length) {
9029 data.rslt.prev.each(function () {
9030 if(this.parentNode) { _this.select_node(this); return false; /* if return false is removed all prev nodes will be selected */}
9031 });
9032 }
9033 }, this))
9034 .bind("move_node.jstree", $.proxy(function (event, data) {
9035 if(data.rslt.cy) {
9036 data.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked");
9037 }
9038 }, this));
9039 },
9040 defaults : {
9041 select_limit : -1, // 0, 1, 2 ... or -1 for unlimited
9042 select_multiple_modifier : "ctrl", // on, or ctrl, shift, alt
9043 select_range_modifier : "shift",
9044 selected_parent_close : "select_parent", // false, "deselect", "select_parent"
9045 selected_parent_open : true,
9046 select_prev_on_delete : true,
9047 disable_selecting_children : false,
9048 initially_select : []
9049 },
9050 _fn : {
9051 _get_node : function (obj, allow_multiple) {
9052 if(typeof obj === "undefined" || obj === null) { return allow_multiple ? this.data.ui.selected : this.data.ui.last_selected; }
9053 var $obj = $(obj, this.get_container());
9054 if($obj.is(".jstree") || obj == -1) { return -1; }
9055 $obj = $obj.closest("li", this.get_container());
9056 return $obj.length ? $obj : false;
9057 },
9058 _ui_notify : function (n, data) {
9059 if(data.selected) {
9060 this.select_node(n, false);
9061 }
9062 },
9063 save_selected : function () {
9064 var _this = this;
9065 this.data.ui.to_select = [];
9066 this.data.ui.selected.each(function () { if(this.id) { _this.data.ui.to_select.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); } });
9067 this.__callback(this.data.ui.to_select);
9068 },
9069 reselect : function () {
9070 var _this = this,
9071 s = this.data.ui.to_select;
9072 s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
9073 // this.deselect_all(); WHY deselect, breaks plugin state notifier?
9074 $.each(s, function (i, val) { if(val && val !== "#") { _this.select_node(val); } });
9075 this.data.ui.selected = this.data.ui.selected.filter(function () { return this.parentNode; });
9076 this.__callback();
9077 },
9078 refresh : function (obj) {
9079 this.save_selected();
9080 return this.__call_old();
9081 },
9082 hover_node : function (obj) {
9083 obj = this._get_node(obj);
9084 if(!obj.length) { return false; }
9085 //if(this.data.ui.hovered && obj.get(0) === this.data.ui.hovered.get(0)) { return; }
9086 if(!obj.hasClass("jstree-hovered")) { this.dehover_node(); }
9087 this.data.ui.hovered = obj.children("a").addClass("jstree-hovered").parent();
9088 this._fix_scroll(obj);
9089 this.__callback({ "obj" : obj });
9090 },
9091 dehover_node : function () {
9092 var obj = this.data.ui.hovered, p;
9093 if(!obj || !obj.length) { return false; }
9094 p = obj.children("a").removeClass("jstree-hovered").parent();
9095 if(this.data.ui.hovered[0] === p[0]) { this.data.ui.hovered = null; }
9096 this.__callback({ "obj" : obj });
9097 },
9098 select_node : function (obj, check, e) {
9099 obj = this._get_node(obj);
9100 if(obj == -1 || !obj || !obj.length) { return false; }
9101 var s = this._get_settings().ui,
9102 is_multiple = (s.select_multiple_modifier == "on" || (s.select_multiple_modifier !== false && e && e[s.select_multiple_modifier + "Key"])),
9103 is_range = (s.select_range_modifier !== false && e && e[s.select_range_modifier + "Key"] && this.data.ui.last_selected && this.data.ui.last_selected[0] !== obj[0] && this.data.ui.last_selected.parent()[0] === obj.parent()[0]),
9104 is_selected = this.is_selected(obj),
9105 proceed = true,
9106 t = this;
9107 if(check) {
9108 if(s.disable_selecting_children && is_multiple &&
9109 (
9110 (obj.parentsUntil(".jstree","li").children("a.jstree-clicked").length) ||
9111 (obj.children("ul").find("a.jstree-clicked:eq(0)").length)
9112 )
9113 ) {
9114 return false;
9115 }
9116 proceed = false;
9117 switch(!0) {
9118 case (is_range):
9119 this.data.ui.last_selected.addClass("jstree-last-selected");
9120 obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").andSelf();
9121 if(s.select_limit == -1 || obj.length < s.select_limit) {
9122 this.data.ui.last_selected.removeClass("jstree-last-selected");
9123 this.data.ui.selected.each(function () {
9124 if(this !== t.data.ui.last_selected[0]) { t.deselect_node(this); }
9125 });
9126 is_selected = false;
9127 proceed = true;
9128 }
9129 else {
9130 proceed = false;
9131 }
9132 break;
9133 case (is_selected && !is_multiple):
9134 this.deselect_all();
9135 is_selected = false;
9136 proceed = true;
9137 break;
9138 case (!is_selected && !is_multiple):
9139 if(s.select_limit == -1 || s.select_limit > 0) {
9140 this.deselect_all();
9141 proceed = true;
9142 }
9143 break;
9144 case (is_selected && is_multiple):
9145 this.deselect_node(obj);
9146 break;
9147 case (!is_selected && is_multiple):
9148 if(s.select_limit == -1 || this.data.ui.selected.length + 1 <= s.select_limit) {
9149 proceed = true;
9150 }
9151 break;
9152 }
9153 }
9154 if(proceed && !is_selected) {
9155 if(!is_range) { this.data.ui.last_selected = obj; }
9156 obj.children("a").addClass("jstree-clicked");
9157 if(s.selected_parent_open) {
9158 obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
9159 }
9160 this.data.ui.selected = this.data.ui.selected.add(obj);
9161 this._fix_scroll(obj.eq(0));
9162 this.__callback({ "obj" : obj, "e" : e });
9163 }
9164 },
9165 _fix_scroll : function (obj) {
9166 var c = this.get_container()[0], t;
9167 if(c.scrollHeight > c.offsetHeight) {
9168 obj = this._get_node(obj);
9169 if(!obj || obj === -1 || !obj.length || !obj.is(":visible")) { return; }
9170 t = obj.offset().top - this.get_container().offset().top;
9171 if(t < 0) {
9172 c.scrollTop = c.scrollTop + t - 1;
9173 }
9174 if(t + this.data.core.li_height + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0) > c.offsetHeight) {
9175 c.scrollTop = c.scrollTop + (t - c.offsetHeight + this.data.core.li_height + 1 + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0));
9176 }
9177 }
9178 },
9179 deselect_node : function (obj) {
9180 obj = this._get_node(obj);
9181 if(!obj.length) { return false; }
9182 if(this.is_selected(obj)) {
9183 obj.children("a").removeClass("jstree-clicked");
9184 this.data.ui.selected = this.data.ui.selected.not(obj);
9185 if(this.data.ui.last_selected.get(0) === obj.get(0)) { this.data.ui.last_selected = this.data.ui.selected.eq(0); }
9186 this.__callback({ "obj" : obj });
9187 }
9188 },
9189 toggle_select : function (obj) {
9190 obj = this._get_node(obj);
9191 if(!obj.length) { return false; }
9192 if(this.is_selected(obj)) { this.deselect_node(obj); }
9193 else { this.select_node(obj); }
9194 },
9195 is_selected : function (obj) { return this.data.ui.selected.index(this._get_node(obj)) >= 0; },
9196 get_selected : function (context) {
9197 return context ? $(context).find("a.jstree-clicked").parent() : this.data.ui.selected;
9198 },
9199 deselect_all : function (context) {
9200 var ret = context ? $(context).find("a.jstree-clicked").parent() : this.get_container().find("a.jstree-clicked").parent();
9201 ret.children("a.jstree-clicked").removeClass("jstree-clicked");
9202 this.data.ui.selected = $([]);
9203 this.data.ui.last_selected = false;
9204 this.__callback({ "obj" : ret });
9205 }
9206 }
9207 });
9208 // include the selection plugin by default
9209 $.jstree.defaults.plugins.push("ui");
9210 })(jQuery);
9211 //*/
9212
9213 /*
9214 * jsTree CRRM plugin
9215 * Handles creating/renaming/removing/moving nodes by user interaction.
9216 */
9217 (function ($) {
9218 $.jstree.plugin("crrm", {
9219 __init : function () {
9220 this.get_container()
9221 .bind("move_node.jstree", $.proxy(function (e, data) {
9222 if(this._get_settings().crrm.move.open_onmove) {
9223 var t = this;
9224 data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {
9225 t.open_node(this, false, true);
9226 });
9227 }
9228 }, this));
9229 },
9230 defaults : {
9231 input_width_limit : 200,
9232 move : {
9233 always_copy : false, // false, true or "multitree"
9234 open_onmove : true,
9235 default_position : "last",
9236 check_move : function (m) { return true; }
9237 }
9238 },
9239 _fn : {
9240 _show_input : function (obj, callback) {
9241 obj = this._get_node(obj);
9242 var rtl = this._get_settings().core.rtl,
9243 w = this._get_settings().crrm.input_width_limit,
9244 w1 = obj.children("ins").width(),
9245 w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length,
9246 t = this.get_text(obj),
9247 h1 = $("<div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),
9248 h2 = obj.css("position","relative").append(
9249 $("<input />", {
9250 "value" : t,
9251 "class" : "jstree-rename-input",
9252 // "size" : t.length,
9253 "css" : {
9254 "padding" : "0",
9255 "border" : "1px solid silver",
9256 "position" : "absolute",
9257 "left" : (rtl ? "auto" : (w1 + w2 + 4) + "px"),
9258 "right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
9259 "top" : "0px",
9260 "height" : (this.data.core.li_height - 2) + "px",
9261 "lineHeight" : (this.data.core.li_height - 2) + "px",
9262 "width" : "150px" // will be set a bit further down
9263 },
9264 "blur" : $.proxy(function () {
9265 var i = obj.children(".jstree-rename-input"),
9266 v = i.val();
9267 if(v === "") { v = t; }
9268 h1.remove();
9269 i.remove(); // rollback purposes
9270 this.set_text(obj,t); // rollback purposes
9271 this.rename_node(obj, v);
9272 callback.call(this, obj, v, t);
9273 obj.css("position","");
9274 }, this),
9275 "keyup" : function (event) {
9276 var key = event.keyCode || event.which;
9277 if(key == 27) { this.value = t; this.blur(); return; }
9278 else if(key == 13) { this.blur(); return; }
9279 else {
9280 h2.width(Math.min(h1.text("pW" + this.value).width(),w));
9281 }
9282 },
9283 "keypress" : function(event) {
9284 var key = event.keyCode || event.which;
9285 if(key == 13) { return false; }
9286 }
9287 })
9288 ).children(".jstree-rename-input");
9289 this.set_text(obj, "");
9290 h1.css({
9291 fontFamily : h2.css('fontFamily') || '',
9292 fontSize : h2.css('fontSize') || '',
9293 fontWeight : h2.css('fontWeight') || '',
9294 fontStyle : h2.css('fontStyle') || '',
9295 fontStretch : h2.css('fontStretch') || '',
9296 fontVariant : h2.css('fontVariant') || '',
9297 letterSpacing : h2.css('letterSpacing') || '',
9298 wordSpacing : h2.css('wordSpacing') || ''
9299 });
9300 h2.width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();
9301 },
9302 rename : function (obj) {
9303 obj = this._get_node(obj);
9304 this.__rollback();
9305 var f = this.__callback;
9306 this._show_input(obj, function (obj, new_name, old_name) {
9307 f.call(this, { "obj" : obj, "new_name" : new_name, "old_name" : old_name });
9308 });
9309 },
9310 create : function (obj, position, js, callback, skip_rename) {
9311 var t, _this = this;
9312 obj = this._get_node(obj);
9313 if(!obj) { obj = -1; }
9314 this.__rollback();
9315 t = this.create_node(obj, position, js, function (t) {
9316 var p = this._get_parent(t),
9317 pos = $(t).index();
9318 if(callback) { callback.call(this, t); }
9319 if(p.length && p.hasClass("jstree-closed")) { this.open_node(p, false, true); }
9320 if(!skip_rename) {
9321 this._show_input(t, function (obj, new_name, old_name) {
9322 _this.__callback({ "obj" : obj, "name" : new_name, "parent" : p, "position" : pos });
9323 });
9324 }
9325 else { _this.__callback({ "obj" : t, "name" : this.get_text(t), "parent" : p, "position" : pos }); }
9326 });
9327 return t;
9328 },
9329 remove : function (obj) {
9330 obj = this._get_node(obj, true);
9331 var p = this._get_parent(obj), prev = this._get_prev(obj);
9332 this.__rollback();
9333 obj = this.delete_node(obj);
9334 if(obj !== false) { this.__callback({ "obj" : obj, "prev" : prev, "parent" : p }); }
9335 },
9336 check_move : function () {
9337 if(!this.__call_old()) { return false; }
9338 var s = this._get_settings().crrm.move;
9339 if(!s.check_move.call(this, this._get_move())) { return false; }
9340 return true;
9341 },
9342 move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
9343 var s = this._get_settings().crrm.move;
9344 if(!is_prepared) {
9345 if(typeof position === "undefined") { position = s.default_position; }
9346 if(position === "inside" && !s.default_position.match(/^(before|after)$/)) { position = s.default_position; }
9347 return this.__call_old(true, obj, ref, position, is_copy, false, skip_check);
9348 }
9349 // if the move is already prepared
9350 if(s.always_copy === true || (s.always_copy === "multitree" && obj.rt.get_index() !== obj.ot.get_index() )) {
9351 is_copy = true;
9352 }
9353 this.__call_old(true, obj, ref, position, is_copy, true, skip_check);
9354 },
9355
9356 cut : function (obj) {
9357 obj = this._get_node(obj, true);
9358 if(!obj || !obj.length) { return false; }
9359 this.data.crrm.cp_nodes = false;
9360 this.data.crrm.ct_nodes = obj;
9361 this.__callback({ "obj" : obj });
9362 },
9363 copy : function (obj) {
9364 obj = this._get_node(obj, true);
9365 if(!obj || !obj.length) { return false; }
9366 this.data.crrm.ct_nodes = false;
9367 this.data.crrm.cp_nodes = obj;
9368 this.__callback({ "obj" : obj });
9369 },
9370 paste : function (obj) {
9371 obj = this._get_node(obj);
9372 if(!obj || !obj.length) { return false; }
9373 var nodes = this.data.crrm.ct_nodes ? this.data.crrm.ct_nodes : this.data.crrm.cp_nodes;
9374 if(!this.data.crrm.ct_nodes && !this.data.crrm.cp_nodes) { return false; }
9375 if(this.data.crrm.ct_nodes) { this.move_node(this.data.crrm.ct_nodes, obj); this.data.crrm.ct_nodes = false; }
9376 if(this.data.crrm.cp_nodes) { this.move_node(this.data.crrm.cp_nodes, obj, false, true); }
9377 this.__callback({ "obj" : obj, "nodes" : nodes });
9378 }
9379 }
9380 });
9381 // include the crr plugin by default
9382 // $.jstree.defaults.plugins.push("crrm");
9383 })(jQuery);
9384 //*/
9385
9386 /*
9387 * jsTree themes plugin
9388 * Handles loading and setting themes, as well as detecting path to themes, etc.
9389 */
9390 (function ($) {
9391 var themes_loaded = [];
9392 // this variable stores the path to the themes folder - if left as false - it will be autodetected
9393 $.jstree._themes = false;
9394 $.jstree.plugin("themes", {
9395 __init : function () {
9396 this.get_container()
9397 .bind("init.jstree", $.proxy(function () {
9398 var s = this._get_settings().themes;
9399 this.data.themes.dots = s.dots;
9400 this.data.themes.icons = s.icons;
9401 this.set_theme(s.theme, s.url);
9402 }, this))
9403 .bind("loaded.jstree", $.proxy(function () {
9404 // bound here too, as simple HTML tree's won't honor dots & icons otherwise
9405 if(!this.data.themes.dots) { this.hide_dots(); }
9406 else { this.show_dots(); }
9407 if(!this.data.themes.icons) { this.hide_icons(); }
9408 else { this.show_icons(); }
9409 }, this));
9410 },
9411 defaults : {
9412 theme : "default",
9413 url : false,
9414 dots : true,
9415 icons : true
9416 },
9417 _fn : {
9418 set_theme : function (theme_name, theme_url) {
9419 if(!theme_name) { return false; }
9420 if(!theme_url) { theme_url = $.jstree._themes + theme_name + '/style.css'; }
9421 if($.inArray(theme_url, themes_loaded) == -1) {
9422 $.vakata.css.add_sheet({ "url" : theme_url });
9423 themes_loaded.push(theme_url);
9424 }
9425 if(this.data.themes.theme != theme_name) {
9426 this.get_container().removeClass('jstree-' + this.data.themes.theme);
9427 this.data.themes.theme = theme_name;
9428 }
9429 this.get_container().addClass('jstree-' + theme_name);
9430 if(!this.data.themes.dots) { this.hide_dots(); }
9431 else { this.show_dots(); }
9432 if(!this.data.themes.icons) { this.hide_icons(); }
9433 else { this.show_icons(); }
9434 this.__callback();
9435 },
9436 get_theme : function () { return this.data.themes.theme; },
9437
9438 show_dots : function () { this.data.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); },
9439 hide_dots : function () { this.data.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); },
9440 toggle_dots : function () { if(this.data.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },
9441
9442 show_icons : function () { this.data.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); },
9443 hide_icons : function () { this.data.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); },
9444 toggle_icons: function () { if(this.data.themes.icons) { this.hide_icons(); } else { this.show_icons(); } }
9445 }
9446 });
9447 // autodetect themes path
9448 $(function () {
9449 if($.jstree._themes === false) {
9450 $("script").each(function () {
9451 if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) {
9452 $.jstree._themes = this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/';
9453 return false;
9454 }
9455 });
9456 }
9457 if($.jstree._themes === false) { $.jstree._themes = "themes/"; }
9458 });
9459 // include the themes plugin by default
9460 $.jstree.defaults.plugins.push("themes");
9461 })(jQuery);
9462 //*/
9463
9464 /*
9465 * jsTree hotkeys plugin
9466 * Enables keyboard navigation for all tree instances
9467 * Depends on the jstree ui & jquery hotkeys plugins
9468 */
9469 (function ($) {
9470 var bound = [];
9471 function exec(i, event) {
9472 var f = $.jstree._focused(), tmp;
9473 if(f && f.data && f.data.hotkeys && f.data.hotkeys.enabled) {
9474 tmp = f._get_settings().hotkeys[i];
9475 if(tmp) { return tmp.call(f, event); }
9476 }
9477 }
9478 $.jstree.plugin("hotkeys", {
9479 __init : function () {
9480 if(typeof $.hotkeys === "undefined") { throw "jsTree hotkeys: jQuery hotkeys plugin not included."; }
9481 if(!this.data.ui) { throw "jsTree hotkeys: jsTree UI plugin not included."; }
9482 $.each(this._get_settings().hotkeys, function (i, v) {
9483 if(v !== false && $.inArray(i, bound) == -1) {
9484 $(document).bind("keydown", i, function (event) { return exec(i, event); });
9485 bound.push(i);
9486 }
9487 });
9488 this.get_container()
9489 .bind("lock.jstree", $.proxy(function () {
9490 if(this.data.hotkeys.enabled) { this.data.hotkeys.enabled = false; this.data.hotkeys.revert = true; }
9491 }, this))
9492 .bind("unlock.jstree", $.proxy(function () {
9493 if(this.data.hotkeys.revert) { this.data.hotkeys.enabled = true; }
9494 }, this));
9495 this.enable_hotkeys();
9496 },
9497 defaults : {
9498 "up" : function () {
9499 var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
9500 this.hover_node(this._get_prev(o));
9501 return false;
9502 },
9503 "ctrl+up" : function () {
9504 var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
9505 this.hover_node(this._get_prev(o));
9506 return false;
9507 },
9508 "shift+up" : function () {
9509 var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
9510 this.hover_node(this._get_prev(o));
9511 return false;
9512 },
9513 "down" : function () {
9514 var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
9515 this.hover_node(this._get_next(o));
9516 return false;
9517 },
9518 "ctrl+down" : function () {
9519 var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
9520 this.hover_node(this._get_next(o));
9521 return false;
9522 },
9523 "shift+down" : function () {
9524 var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
9525 this.hover_node(this._get_next(o));
9526 return false;
9527 },
9528 "left" : function () {
9529 var o = this.data.ui.hovered || this.data.ui.last_selected;
9530 if(o) {
9531 if(o.hasClass("jstree-open")) { this.close_node(o); }
9532 else { this.hover_node(this._get_prev(o)); }
9533 }
9534 return false;
9535 },
9536 "ctrl+left" : function () {
9537 var o = this.data.ui.hovered || this.data.ui.last_selected;
9538 if(o) {
9539 if(o.hasClass("jstree-open")) { this.close_node(o); }
9540 else { this.hover_node(this._get_prev(o)); }
9541 }
9542 return false;
9543 },
9544 "shift+left" : function () {
9545 var o = this.data.ui.hovered || this.data.ui.last_selected;
9546 if(o) {
9547 if(o.hasClass("jstree-open")) { this.close_node(o); }
9548 else { this.hover_node(this._get_prev(o)); }
9549 }
9550 return false;
9551 },
9552 "right" : function () {
9553 var o = this.data.ui.hovered || this.data.ui.last_selected;
9554 if(o && o.length) {
9555 if(o.hasClass("jstree-closed")) { this.open_node(o); }
9556 else { this.hover_node(this._get_next(o)); }
9557 }
9558 return false;
9559 },
9560 "ctrl+right" : function () {
9561 var o = this.data.ui.hovered || this.data.ui.last_selected;
9562 if(o && o.length) {
9563 if(o.hasClass("jstree-closed")) { this.open_node(o); }
9564 else { this.hover_node(this._get_next(o)); }
9565 }
9566 return false;
9567 },
9568 "shift+right" : function () {
9569 var o = this.data.ui.hovered || this.data.ui.last_selected;
9570 if(o && o.length) {
9571 if(o.hasClass("jstree-closed")) { this.open_node(o); }
9572 else { this.hover_node(this._get_next(o)); }
9573 }
9574 return false;
9575 },
9576 "space" : function () {
9577 if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").click(); }
9578 return false;
9579 },
9580 "ctrl+space" : function (event) {
9581 event.type = "click";
9582 if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
9583 return false;
9584 },
9585 "shift+space" : function (event) {
9586 event.type = "click";
9587 if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
9588 return false;
9589 },
9590 "f2" : function () { this.rename(this.data.ui.hovered || this.data.ui.last_selected); },
9591 "del" : function () { this.remove(this.data.ui.hovered || this._get_node(null)); }
9592 },
9593 _fn : {
9594 enable_hotkeys : function () {
9595 this.data.hotkeys.enabled = true;
9596 },
9597 disable_hotkeys : function () {
9598 this.data.hotkeys.enabled = false;
9599 }
9600 }
9601 });
9602 })(jQuery);
9603 //*/
9604
9605 /*
9606 * jsTree JSON plugin
9607 * The JSON data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
9608 */
9609 (function ($) {
9610 $.jstree.plugin("json_data", {
9611 __init : function() {
9612 var s = this._get_settings().json_data;
9613 if(s.progressive_unload) {
9614 this.get_container().bind("after_close.jstree", function (e, data) {
9615 data.rslt.obj.children("ul").remove();
9616 });
9617 }
9618 },
9619 defaults : {
9620 // `data` can be a function:
9621 // * accepts two arguments - node being loaded and a callback to pass the result to
9622 // * will be executed in the current tree's scope & ajax won't be supported
9623 data : false,
9624 ajax : false,
9625 correct_state : true,
9626 progressive_render : false,
9627 progressive_unload : false
9628 },
9629 _fn : {
9630 load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_json(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
9631 _is_loaded : function (obj) {
9632 var s = this._get_settings().json_data;
9633 obj = this._get_node(obj);
9634 return obj == -1 || !obj || (!s.ajax && !s.progressive_render && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").length > 0;
9635 },
9636 refresh : function (obj) {
9637 obj = this._get_node(obj);
9638 var s = this._get_settings().json_data;
9639 if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
9640 obj.removeData("jstree_children");
9641 }
9642 return this.__call_old();
9643 },
9644 load_node_json : function (obj, s_call, e_call) {
9645 var s = this.get_settings().json_data, d,
9646 error_func = function () {},
9647 success_func = function () {};
9648 obj = this._get_node(obj);
9649
9650 if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree_children")) {
9651 d = this._parse_json(obj.data("jstree_children"), obj);
9652 if(d) {
9653 obj.append(d);
9654 if(!s.progressive_unload) { obj.removeData("jstree_children"); }
9655 }
9656 this.clean_node(obj);
9657 if(s_call) { s_call.call(this); }
9658 return;
9659 }
9660
9661 if(obj && obj !== -1) {
9662 if(obj.data("jstree_is_loading")) { return; }
9663 else { obj.data("jstree_is_loading",true); }
9664 }
9665 switch(!0) {
9666 case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
9667 // function option added here for easier model integration (also supporting async - see callback)
9668 case ($.isFunction(s.data)):
9669 s.data.call(this, obj, $.proxy(function (d) {
9670 d = this._parse_json(d, obj);
9671 if(!d) {
9672 if(obj === -1 || !obj) {
9673 if(s.correct_state) { this.get_container().children("ul").empty(); }
9674 }
9675 else {
9676 obj.children("a.jstree-loading").removeClass("jstree-loading");
9677 obj.removeData("jstree_is_loading");
9678 if(s.correct_state) { this.correct_state(obj); }
9679 }
9680 if(e_call) { e_call.call(this); }
9681 }
9682 else {
9683 if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
9684 else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
9685 this.clean_node(obj);
9686 if(s_call) { s_call.call(this); }
9687 }
9688 }, this));
9689 break;
9690 case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
9691 if(!obj || obj == -1) {
9692 d = this._parse_json(s.data, obj);
9693 if(d) {
9694 this.get_container().children("ul").empty().append(d.children());
9695 this.clean_node();
9696 }
9697 else {
9698 if(s.correct_state) { this.get_container().children("ul").empty(); }
9699 }
9700 }
9701 if(s_call) { s_call.call(this); }
9702 break;
9703 case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
9704 error_func = function (x, t, e) {
9705 var ef = this.get_settings().json_data.ajax.error;
9706 if(ef) { ef.call(this, x, t, e); }
9707 if(obj != -1 && obj.length) {
9708 obj.children("a.jstree-loading").removeClass("jstree-loading");
9709 obj.removeData("jstree_is_loading");
9710 if(t === "success" && s.correct_state) { this.correct_state(obj); }
9711 }
9712 else {
9713 if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
9714 }
9715 if(e_call) { e_call.call(this); }
9716 };
9717 success_func = function (d, t, x) {
9718 var sf = this.get_settings().json_data.ajax.success;
9719 if(sf) { d = sf.call(this,d,t,x) || d; }
9720 if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "") || (!$.isArray(d) && !$.isPlainObject(d))) {
9721 return error_func.call(this, x, t, "");
9722 }
9723 d = this._parse_json(d, obj);
9724 if(d) {
9725 if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
9726 else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
9727 this.clean_node(obj);
9728 if(s_call) { s_call.call(this); }
9729 }
9730 else {
9731 if(obj === -1 || !obj) {
9732 if(s.correct_state) {
9733 this.get_container().children("ul").empty();
9734 if(s_call) { s_call.call(this); }
9735 }
9736 }
9737 else {
9738 obj.children("a.jstree-loading").removeClass("jstree-loading");
9739 obj.removeData("jstree_is_loading");
9740 if(s.correct_state) {
9741 this.correct_state(obj);
9742 if(s_call) { s_call.call(this); }
9743 }
9744 }
9745 }
9746 };
9747 s.ajax.context = this;
9748 s.ajax.error = error_func;
9749 s.ajax.success = success_func;
9750 if(!s.ajax.dataType) { s.ajax.dataType = "json"; }
9751 if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
9752 if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
9753 $.ajax(s.ajax);
9754 break;
9755 }
9756 },
9757 _parse_json : function (js, obj, is_callback) {
9758 var d = false,
9759 p = this._get_settings(),
9760 s = p.json_data,
9761 t = p.core.html_titles,
9762 tmp, i, j, ul1, ul2;
9763
9764 if(!js) { return d; }
9765 if(s.progressive_unload && obj && obj !== -1) {
9766 obj.data("jstree_children", d);
9767 }
9768 if($.isArray(js)) {
9769 d = $();
9770 if(!js.length) { return false; }
9771 for(i = 0, j = js.length; i < j; i++) {
9772 tmp = this._parse_json(js[i], obj, true);
9773 if(tmp.length) { d = d.add(tmp); }
9774 }
9775 }
9776 else {
9777 if(typeof js == "string") { js = { data : js }; }
9778 if(!js.data && js.data !== "") { return d; }
9779 d = $("<li />");
9780 if(js.attr) { d.attr(js.attr); }
9781 if(js.metadata) { d.data(js.metadata); }
9782 if(js.state) { d.addClass("jstree-" + js.state); }
9783 if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
9784 $.each(js.data, function (i, m) {
9785 tmp = $("<a />");
9786 if($.isFunction(m)) { m = m.call(this, js); }
9787 if(typeof m == "string") { tmp.attr('href','#')[ t ? "html" : "text" ](m); }
9788 else {
9789 if(!m.attr) { m.attr = {}; }
9790 if(!m.attr.href) { m.attr.href = '#'; }
9791 tmp.attr(m.attr)[ t ? "html" : "text" ](m.title);
9792 if(m.language) { tmp.addClass(m.language); }
9793 }
9794 tmp.prepend("<ins class='jstree-icon'>&#160;</ins>");
9795 if(!m.icon && js.icon) { m.icon = js.icon; }
9796 if(m.icon) {
9797 if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
9798 else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
9799 }
9800 d.append(tmp);
9801 });
9802 d.prepend("<ins class='jstree-icon'>&#160;</ins>");
9803 if(js.children) {
9804 if(s.progressive_render && js.state !== "open") {
9805 d.addClass("jstree-closed").data("jstree_children", js.children);
9806 }
9807 else {
9808 if(s.progressive_unload) { d.data("jstree_children", js.children); }
9809 if($.isArray(js.children) && js.children.length) {
9810 tmp = this._parse_json(js.children, obj, true);
9811 if(tmp.length) {
9812 ul2 = $("<ul />");
9813 ul2.append(tmp);
9814 d.append(ul2);
9815 }
9816 }
9817 }
9818 }
9819 }
9820 if(!is_callback) {
9821 ul1 = $("<ul />");
9822 ul1.append(d);
9823 d = ul1;
9824 }
9825 return d;
9826 },
9827 get_json : function (obj, li_attr, a_attr, is_callback) {
9828 var result = [],
9829 s = this._get_settings(),
9830 _this = this,
9831 tmp1, tmp2, li, a, t, lang;
9832 obj = this._get_node(obj);
9833 if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
9834 li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
9835 if(!is_callback && this.data.types) { li_attr.push(s.types.type_attr); }
9836 a_attr = $.isArray(a_attr) ? a_attr : [ ];
9837
9838 obj.each(function () {
9839 li = $(this);
9840 tmp1 = { data : [] };
9841 if(li_attr.length) { tmp1.attr = { }; }
9842 $.each(li_attr, function (i, v) {
9843 tmp2 = li.attr(v);
9844 if(tmp2 && tmp2.length && tmp2.replace(/jstree[^ ]*/ig,'').length) {
9845 tmp1.attr[v] = (" " + tmp2).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
9846 }
9847 });
9848 if(li.hasClass("jstree-open")) { tmp1.state = "open"; }
9849 if(li.hasClass("jstree-closed")) { tmp1.state = "closed"; }
9850 if(li.data()) { tmp1.metadata = li.data(); }
9851 a = li.children("a");
9852 a.each(function () {
9853 t = $(this);
9854 if(
9855 a_attr.length ||
9856 $.inArray("languages", s.plugins) !== -1 ||
9857 t.children("ins").get(0).style.backgroundImage.length ||
9858 (t.children("ins").get(0).className && t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').length)
9859 ) {
9860 lang = false;
9861 if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
9862 $.each(s.languages, function (l, lv) {
9863 if(t.hasClass(lv)) {
9864 lang = lv;
9865 return false;
9866 }
9867 });
9868 }
9869 tmp2 = { attr : { }, title : _this.get_text(t, lang) };
9870 $.each(a_attr, function (k, z) {
9871 tmp2.attr[z] = (" " + (t.attr(z) || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
9872 });
9873 if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
9874 $.each(s.languages, function (k, z) {
9875 if(t.hasClass(z)) { tmp2.language = z; return true; }
9876 });
9877 }
9878 if(t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
9879 tmp2.icon = t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
9880 }
9881 if(t.children("ins").get(0).style.backgroundImage.length) {
9882 tmp2.icon = t.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","");
9883 }
9884 }
9885 else {
9886 tmp2 = _this.get_text(t);
9887 }
9888 if(a.length > 1) { tmp1.data.push(tmp2); }
9889 else { tmp1.data = tmp2; }
9890 });
9891 li = li.find("> ul > li");
9892 if(li.length) { tmp1.children = _this.get_json(li, li_attr, a_attr, true); }
9893 result.push(tmp1);
9894 });
9895 return result;
9896 }
9897 }
9898 });
9899 })(jQuery);
9900 //*/
9901
9902 /*
9903 * jsTree languages plugin
9904 * Adds support for multiple language versions in one tree
9905 * This basically allows for many titles coexisting in one node, but only one of them being visible at any given time
9906 * This is useful for maintaining the same structure in many languages (hence the name of the plugin)
9907 */
9908 (function ($) {
9909 $.jstree.plugin("languages", {
9910 __init : function () { this._load_css(); },
9911 defaults : [],
9912 _fn : {
9913 set_lang : function (i) {
9914 var langs = this._get_settings().languages,
9915 st = false,
9916 selector = ".jstree-" + this.get_index() + ' a';
9917 if(!$.isArray(langs) || langs.length === 0) { return false; }
9918 if($.inArray(i,langs) == -1) {
9919 if(!!langs[i]) { i = langs[i]; }
9920 else { return false; }
9921 }
9922 if(i == this.data.languages.current_language) { return true; }
9923 st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, this.data.languages.language_css);
9924 if(st !== false) { st.style.display = "none"; }
9925 st = $.vakata.css.get_css(selector + "." + i, false, this.data.languages.language_css);
9926 if(st !== false) { st.style.display = ""; }
9927 this.data.languages.current_language = i;
9928 this.__callback(i);
9929 return true;
9930 },
9931 get_lang : function () {
9932 return this.data.languages.current_language;
9933 },
9934 _get_string : function (key, lang) {
9935 var langs = this._get_settings().languages,
9936 s = this._get_settings().core.strings;
9937 if($.isArray(langs) && langs.length) {
9938 lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
9939 }
9940 if(s[lang] && s[lang][key]) { return s[lang][key]; }
9941 if(s[key]) { return s[key]; }
9942 return key;
9943 },
9944 get_text : function (obj, lang) {
9945 obj = this._get_node(obj) || this.data.ui.last_selected;
9946 if(!obj.size()) { return false; }
9947 var langs = this._get_settings().languages,
9948 s = this._get_settings().core.html_titles;
9949 if($.isArray(langs) && langs.length) {
9950 lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
9951 obj = obj.children("a." + lang);
9952 }
9953 else { obj = obj.children("a:eq(0)"); }
9954 if(s) {
9955 obj = obj.clone();
9956 obj.children("INS").remove();
9957 return obj.html();
9958 }
9959 else {
9960 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
9961 return obj.nodeValue;
9962 }
9963 },
9964 set_text : function (obj, val, lang) {
9965 obj = this._get_node(obj) || this.data.ui.last_selected;
9966 if(!obj.size()) { return false; }
9967 var langs = this._get_settings().languages,
9968 s = this._get_settings().core.html_titles,
9969 tmp;
9970 if($.isArray(langs) && langs.length) {
9971 lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
9972 obj = obj.children("a." + lang);
9973 }
9974 else { obj = obj.children("a:eq(0)"); }
9975 if(s) {
9976 tmp = obj.children("INS").clone();
9977 obj.html(val).prepend(tmp);
9978 this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
9979 return true;
9980 }
9981 else {
9982 obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
9983 this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
9984 return (obj.nodeValue = val);
9985 }
9986 },
9987 _load_css : function () {
9988 var langs = this._get_settings().languages,
9989 str = "/* languages css */",
9990 selector = ".jstree-" + this.get_index() + ' a',
9991 ln;
9992 if($.isArray(langs) && langs.length) {
9993 this.data.languages.current_language = langs[0];
9994 for(ln = 0; ln < langs.length; ln++) {
9995 str += selector + "." + langs[ln] + " {";
9996 if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
9997 str += " } ";
9998 }
9999 this.data.languages.language_css = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
10000 }
10001 },
10002 create_node : function (obj, position, js, callback) {
10003 var t = this.__call_old(true, obj, position, js, function (t) {
10004 var langs = this._get_settings().languages,
10005 a = t.children("a"),
10006 ln;
10007 if($.isArray(langs) && langs.length) {
10008 for(ln = 0; ln < langs.length; ln++) {
10009 if(!a.is("." + langs[ln])) {
10010 t.append(a.eq(0).clone().removeClass(langs.join(" ")).addClass(langs[ln]));
10011 }
10012 }
10013 a.not("." + langs.join(", .")).remove();
10014 }
10015 if(callback) { callback.call(this, t); }
10016 });
10017 return t;
10018 }
10019 }
10020 });
10021 })(jQuery);
10022 //*/
10023
10024 /*
10025 * jsTree cookies plugin
10026 * Stores the currently opened/selected nodes in a cookie and then restores them
10027 * Depends on the jquery.cookie plugin
10028 */
10029 (function ($) {
10030 $.jstree.plugin("cookies", {
10031 __init : function () {
10032 if(typeof $.cookie === "undefined") { throw "jsTree cookie: jQuery cookie plugin not included."; }
10033
10034 var s = this._get_settings().cookies,
10035 tmp;
10036 if(!!s.save_loaded) {
10037 tmp = $.cookie(s.save_loaded);
10038 if(tmp && tmp.length) { this.data.core.to_load = tmp.split(","); }
10039 }
10040 if(!!s.save_opened) {
10041 tmp = $.cookie(s.save_opened);
10042 if(tmp && tmp.length) { this.data.core.to_open = tmp.split(","); }
10043 }
10044 if(!!s.save_selected) {
10045 tmp = $.cookie(s.save_selected);
10046 if(tmp && tmp.length && this.data.ui) { this.data.ui.to_select = tmp.split(","); }
10047 }
10048 this.get_container()
10049 .one( ( this.data.ui ? "reselect" : "reopen" ) + ".jstree", $.proxy(function () {
10050 this.get_container()
10051 .bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree", $.proxy(function (e) {
10052 if(this._get_settings().cookies.auto_save) { this.save_cookie((e.handleObj.namespace + e.handleObj.type).replace("jstree","")); }
10053 }, this));
10054 }, this));
10055 },
10056 defaults : {
10057 save_loaded : "jstree_load",
10058 save_opened : "jstree_open",
10059 save_selected : "jstree_select",
10060 auto_save : true,
10061 cookie_options : {}
10062 },
10063 _fn : {
10064 save_cookie : function (c) {
10065 if(this.data.core.refreshing) { return; }
10066 var s = this._get_settings().cookies;
10067 if(!c) { // if called manually and not by event
10068 if(s.save_loaded) {
10069 this.save_loaded();
10070 $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
10071 }
10072 if(s.save_opened) {
10073 this.save_opened();
10074 $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
10075 }
10076 if(s.save_selected && this.data.ui) {
10077 this.save_selected();
10078 $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
10079 }
10080 return;
10081 }
10082 switch(c) {
10083 case "open_node":
10084 case "close_node":
10085 if(!!s.save_opened) {
10086 this.save_opened();
10087 $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
10088 }
10089 if(!!s.save_loaded) {
10090 this.save_loaded();
10091 $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
10092 }
10093 break;
10094 case "select_node":
10095 case "deselect_node":
10096 if(!!s.save_selected && this.data.ui) {
10097 this.save_selected();
10098 $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
10099 }
10100 break;
10101 }
10102 }
10103 }
10104 });
10105 // include cookies by default
10106 // $.jstree.defaults.plugins.push("cookies");
10107 })(jQuery);
10108 //*/
10109
10110 /*
10111 * jsTree sort plugin
10112 * Sorts items alphabetically (or using any other function)
10113 */
10114 (function ($) {
10115 $.jstree.plugin("sort", {
10116 __init : function () {
10117 this.get_container()
10118 .bind("load_node.jstree", $.proxy(function (e, data) {
10119 var obj = this._get_node(data.rslt.obj);
10120 obj = obj === -1 ? this.get_container().children("ul") : obj.children("ul");
10121 this.sort(obj);
10122 }, this))
10123 .bind("rename_node.jstree create_node.jstree create.jstree", $.proxy(function (e, data) {
10124 this.sort(data.rslt.obj.parent());
10125 }, this))
10126 .bind("move_node.jstree", $.proxy(function (e, data) {
10127 var m = data.rslt.np == -1 ? this.get_container() : data.rslt.np;
10128 this.sort(m.children("ul"));
10129 }, this));
10130 },
10131 defaults : function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; },
10132 _fn : {
10133 sort : function (obj) {
10134 var s = this._get_settings().sort,
10135 t = this;
10136 obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));
10137 obj.find("> li > ul").each(function() { t.sort($(this)); });
10138 this.clean_node(obj);
10139 }
10140 }
10141 });
10142 })(jQuery);
10143 //*/
10144
10145 /*
10146 * jsTree DND plugin
10147 * Drag and drop plugin for moving/copying nodes
10148 */
10149 (function ($) {
10150 var o = false,
10151 r = false,
10152 m = false,
10153 ml = false,
10154 sli = false,
10155 sti = false,
10156 dir1 = false,
10157 dir2 = false,
10158 last_pos = false;
10159 $.vakata.dnd = {
10160 is_down : false,
10161 is_drag : false,
10162 helper : false,
10163 scroll_spd : 10,
10164 init_x : 0,
10165 init_y : 0,
10166 threshold : 5,
10167 helper_left : 5,
10168 helper_top : 10,
10169 user_data : {},
10170
10171 drag_start : function (e, data, html) {
10172 if($.vakata.dnd.is_drag) { $.vakata.drag_stop({}); }
10173 try {
10174 e.currentTarget.unselectable = "on";
10175 e.currentTarget.onselectstart = function() { return false; };
10176 if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }
10177 } catch(err) { }
10178 $.vakata.dnd.init_x = e.pageX;
10179 $.vakata.dnd.init_y = e.pageY;
10180 $.vakata.dnd.user_data = data;
10181 $.vakata.dnd.is_down = true;
10182 $.vakata.dnd.helper = $("<div id='vakata-dragged' />").html(html); //.fadeTo(10,0.25);
10183 $(document).bind("mousemove", $.vakata.dnd.drag);
10184 $(document).bind("mouseup", $.vakata.dnd.drag_stop);
10185 return false;
10186 },
10187 drag : function (e) {
10188 if(!$.vakata.dnd.is_down) { return; }
10189 if(!$.vakata.dnd.is_drag) {
10190 if(Math.abs(e.pageX - $.vakata.dnd.init_x) > 5 || Math.abs(e.pageY - $.vakata.dnd.init_y) > 5) {
10191 $.vakata.dnd.helper.appendTo("body");
10192 $.vakata.dnd.is_drag = true;
10193 $(document).triggerHandler("drag_start.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
10194 }
10195 else { return; }
10196 }
10197
10198 // maybe use a scrolling parent element instead of document?
10199 if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a
10200 var d = $(document), t = d.scrollTop(), l = d.scrollLeft();
10201 if(e.pageY - t < 20) {
10202 if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
10203 if(!sti) { dir1 = "up"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() - $.vakata.dnd.scroll_spd); }, 150); }
10204 }
10205 else {
10206 if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
10207 }
10208 if($(window).height() - (e.pageY - t) < 20) {
10209 if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
10210 if(!sti) { dir1 = "down"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() + $.vakata.dnd.scroll_spd); }, 150); }
10211 }
10212 else {
10213 if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
10214 }
10215
10216 if(e.pageX - l < 20) {
10217 if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
10218 if(!sli) { dir2 = "left"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() - $.vakata.dnd.scroll_spd); }, 150); }
10219 }
10220 else {
10221 if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
10222 }
10223 if($(window).width() - (e.pageX - l) < 20) {
10224 if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
10225 if(!sli) { dir2 = "right"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() + $.vakata.dnd.scroll_spd); }, 150); }
10226 }
10227 else {
10228 if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
10229 }
10230 }
10231
10232 $.vakata.dnd.helper.css({ left : (e.pageX + $.vakata.dnd.helper_left) + "px", top : (e.pageY + $.vakata.dnd.helper_top) + "px" });
10233 $(document).triggerHandler("drag.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
10234 },
10235 drag_stop : function (e) {
10236 if(sli) { clearInterval(sli); }
10237 if(sti) { clearInterval(sti); }
10238 $(document).unbind("mousemove", $.vakata.dnd.drag);
10239 $(document).unbind("mouseup", $.vakata.dnd.drag_stop);
10240 $(document).triggerHandler("drag_stop.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
10241 $.vakata.dnd.helper.remove();
10242 $.vakata.dnd.init_x = 0;
10243 $.vakata.dnd.init_y = 0;
10244 $.vakata.dnd.user_data = {};
10245 $.vakata.dnd.is_down = false;
10246 $.vakata.dnd.is_drag = false;
10247 }
10248 };
10249 $(function() {
10250 var css_string = '#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ';
10251 $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
10252 });
10253
10254 $.jstree.plugin("dnd", {
10255 __init : function () {
10256 this.data.dnd = {
10257 active : false,
10258 after : false,
10259 inside : false,
10260 before : false,
10261 off : false,
10262 prepared : false,
10263 w : 0,
10264 to1 : false,
10265 to2 : false,
10266 cof : false,
10267 cw : false,
10268 ch : false,
10269 i1 : false,
10270 i2 : false,
10271 mto : false
10272 };
10273 this.get_container()
10274 .bind("mouseenter.jstree", $.proxy(function (e) {
10275 if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
10276 if(this.data.themes) {
10277 m.attr("class", "jstree-" + this.data.themes.theme);
10278 if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
10279 $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
10280 }
10281 //if($(e.currentTarget).find("> ul > li").length === 0) {
10282 if(e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
10283 var tr = $.jstree._reference(e.target), dc;
10284 if(tr.data.dnd.foreign) {
10285 dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
10286 if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
10287 $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
10288 }
10289 }
10290 else {
10291 tr.prepare_move(o, tr.get_container(), "last");
10292 if(tr.check_move()) {
10293 $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
10294 }
10295 }
10296 }
10297 }
10298 }, this))
10299 .bind("mouseup.jstree", $.proxy(function (e) {
10300 //if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && $(e.currentTarget).find("> ul > li").length === 0) {
10301 if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
10302 var tr = $.jstree._reference(e.currentTarget), dc;
10303 if(tr.data.dnd.foreign) {
10304 dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
10305 if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
10306 tr._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
10307 }
10308 }
10309 else {
10310 tr.move_node(o, tr.get_container(), "last", e[tr._get_settings().dnd.copy_modifier + "Key"]);
10311 }
10312 }
10313 }, this))
10314 .bind("mouseleave.jstree", $.proxy(function (e) {
10315 if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
10316 return false;
10317 }
10318 if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
10319 if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
10320 if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
10321 if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
10322 if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
10323 if($.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
10324 $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
10325 }
10326 }
10327 }, this))
10328 .bind("mousemove.jstree", $.proxy(function (e) {
10329 if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
10330 var cnt = this.get_container()[0];
10331
10332 // Horizontal scroll
10333 if(e.pageX + 24 > this.data.dnd.cof.left + this.data.dnd.cw) {
10334 if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
10335 this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft += $.vakata.dnd.scroll_spd; }, cnt), 100);
10336 }
10337 else if(e.pageX - 24 < this.data.dnd.cof.left) {
10338 if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
10339 this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft -= $.vakata.dnd.scroll_spd; }, cnt), 100);
10340 }
10341 else {
10342 if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
10343 }
10344
10345 // Vertical scroll
10346 if(e.pageY + 24 > this.data.dnd.cof.top + this.data.dnd.ch) {
10347 if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
10348 this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop += $.vakata.dnd.scroll_spd; }, cnt), 100);
10349 }
10350 else if(e.pageY - 24 < this.data.dnd.cof.top) {
10351 if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
10352 this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop -= $.vakata.dnd.scroll_spd; }, cnt), 100);
10353 }
10354 else {
10355 if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
10356 }
10357
10358 }
10359 }, this))
10360 .bind("scroll.jstree", $.proxy(function (e) {
10361 if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && m && ml) {
10362 m.hide();
10363 ml.hide();
10364 }
10365 }, this))
10366 .delegate("a", "mousedown.jstree", $.proxy(function (e) {
10367 if(e.which === 1) {
10368 this.start_drag(e.currentTarget, e);
10369 return false;
10370 }
10371 }, this))
10372 .delegate("a", "mouseenter.jstree", $.proxy(function (e) {
10373 if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
10374 this.dnd_enter(e.currentTarget);
10375 }
10376 }, this))
10377 .delegate("a", "mousemove.jstree", $.proxy(function (e) {
10378 if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
10379 if(!r || !r.length || r.children("a")[0] !== e.currentTarget) {
10380 this.dnd_enter(e.currentTarget);
10381 }
10382 if(typeof this.data.dnd.off.top === "undefined") { this.data.dnd.off = $(e.target).offset(); }
10383 this.data.dnd.w = (e.pageY - (this.data.dnd.off.top || 0)) % this.data.core.li_height;
10384 if(this.data.dnd.w < 0) { this.data.dnd.w += this.data.core.li_height; }
10385 this.dnd_show();
10386 }
10387 }, this))
10388 .delegate("a", "mouseleave.jstree", $.proxy(function (e) {
10389 if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
10390 if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
10391 return false;
10392 }
10393 if(m) { m.hide(); }
10394 if(ml) { ml.hide(); }
10395 /*
10396 var ec = $(e.currentTarget).closest("li"),
10397 er = $(e.relatedTarget).closest("li");
10398 if(er[0] !== ec.prev()[0] && er[0] !== ec.next()[0]) {
10399 if(m) { m.hide(); }
10400 if(ml) { ml.hide(); }
10401 }
10402 */
10403 this.data.dnd.mto = setTimeout(
10404 (function (t) { return function () { t.dnd_leave(e); }; })(this),
10405 0);
10406 }
10407 }, this))
10408 .delegate("a", "mouseup.jstree", $.proxy(function (e) {
10409 if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
10410 this.dnd_finish(e);
10411 }
10412 }, this));
10413
10414 $(document)
10415 .bind("drag_stop.vakata", $.proxy(function () {
10416 if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
10417 if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
10418 if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
10419 if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
10420 this.data.dnd.after = false;
10421 this.data.dnd.before = false;
10422 this.data.dnd.inside = false;
10423 this.data.dnd.off = false;
10424 this.data.dnd.prepared = false;
10425 this.data.dnd.w = false;
10426 this.data.dnd.to1 = false;
10427 this.data.dnd.to2 = false;
10428 this.data.dnd.i1 = false;
10429 this.data.dnd.i2 = false;
10430 this.data.dnd.active = false;
10431 this.data.dnd.foreign = false;
10432 if(m) { m.css({ "top" : "-2000px" }); }
10433 if(ml) { ml.css({ "top" : "-2000px" }); }
10434 }, this))
10435 .bind("drag_start.vakata", $.proxy(function (e, data) {
10436 if(data.data.jstree) {
10437 var et = $(data.event.target);
10438 if(et.closest(".jstree").hasClass("jstree-" + this.get_index())) {
10439 this.dnd_enter(et);
10440 }
10441 }
10442 }, this));
10443 /*
10444 .bind("keydown.jstree-" + this.get_index() + " keyup.jstree-" + this.get_index(), $.proxy(function(e) {
10445 if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && !this.data.dnd.foreign) {
10446 var h = $.vakata.dnd.helper.children("ins");
10447 if(e[this._get_settings().dnd.copy_modifier + "Key"] && h.hasClass("jstree-ok")) {
10448 h.parent().html(h.parent().html().replace(/ \(Copy\)$/, "") + " (Copy)");
10449 }
10450 else {
10451 h.parent().html(h.parent().html().replace(/ \(Copy\)$/, ""));
10452 }
10453 }
10454 }, this)); */
10455
10456
10457
10458 var s = this._get_settings().dnd;
10459 if(s.drag_target) {
10460 $(document)
10461 .delegate(s.drag_target, "mousedown.jstree-" + this.get_index(), $.proxy(function (e) {
10462 o = e.target;
10463 $.vakata.dnd.drag_start(e, { jstree : true, obj : e.target }, "<ins class='jstree-icon'></ins>" + $(e.target).text() );
10464 if(this.data.themes) {
10465 if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
10466 if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
10467 $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
10468 }
10469 $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
10470 var cnt = this.get_container();
10471 this.data.dnd.cof = cnt.offset();
10472 this.data.dnd.cw = parseInt(cnt.width(),10);
10473 this.data.dnd.ch = parseInt(cnt.height(),10);
10474 this.data.dnd.foreign = true;
10475 e.preventDefault();
10476 }, this));
10477 }
10478 if(s.drop_target) {
10479 $(document)
10480 .delegate(s.drop_target, "mouseenter.jstree-" + this.get_index(), $.proxy(function (e) {
10481 if(this.data.dnd.active && this._get_settings().dnd.drop_check.call(this, { "o" : o, "r" : $(e.target), "e" : e })) {
10482 $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
10483 }
10484 }, this))
10485 .delegate(s.drop_target, "mouseleave.jstree-" + this.get_index(), $.proxy(function (e) {
10486 if(this.data.dnd.active) {
10487 $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
10488 }
10489 }, this))
10490 .delegate(s.drop_target, "mouseup.jstree-" + this.get_index(), $.proxy(function (e) {
10491 if(this.data.dnd.active && $.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
10492 this._get_settings().dnd.drop_finish.call(this, { "o" : o, "r" : $(e.target), "e" : e });
10493 }
10494 }, this));
10495 }
10496 },
10497 defaults : {
10498 copy_modifier : "ctrl",
10499 check_timeout : 100,
10500 open_timeout : 500,
10501 drop_target : ".jstree-drop",
10502 drop_check : function (data) { return true; },
10503 drop_finish : $.noop,
10504 drag_target : ".jstree-draggable",
10505 drag_finish : $.noop,
10506 drag_check : function (data) { return { after : false, before : false, inside : true }; }
10507 },
10508 _fn : {
10509 dnd_prepare : function () {
10510 if(!r || !r.length) { return; }
10511 this.data.dnd.off = r.offset();
10512 if(this._get_settings().core.rtl) {
10513 this.data.dnd.off.right = this.data.dnd.off.left + r.width();
10514 }
10515 if(this.data.dnd.foreign) {
10516 var a = this._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : r });
10517 this.data.dnd.after = a.after;
10518 this.data.dnd.before = a.before;
10519 this.data.dnd.inside = a.inside;
10520 this.data.dnd.prepared = true;
10521 return this.dnd_show();
10522 }
10523 this.prepare_move(o, r, "before");
10524 this.data.dnd.before = this.check_move();
10525 this.prepare_move(o, r, "after");
10526 this.data.dnd.after = this.check_move();
10527 if(this._is_loaded(r)) {
10528 this.prepare_move(o, r, "inside");
10529 this.data.dnd.inside = this.check_move();
10530 }
10531 else {
10532 this.data.dnd.inside = false;
10533 }
10534 this.data.dnd.prepared = true;
10535 return this.dnd_show();
10536 },
10537 dnd_show : function () {
10538 if(!this.data.dnd.prepared) { return; }
10539 var o = ["before","inside","after"],
10540 r = false,
10541 rtl = this._get_settings().core.rtl,
10542 pos;
10543 if(this.data.dnd.w < this.data.core.li_height/3) { o = ["before","inside","after"]; }
10544 else if(this.data.dnd.w <= this.data.core.li_height*2/3) {
10545 o = this.data.dnd.w < this.data.core.li_height/2 ? ["inside","before","after"] : ["inside","after","before"];
10546 }
10547 else { o = ["after","inside","before"]; }
10548 $.each(o, $.proxy(function (i, val) {
10549 if(this.data.dnd[val]) {
10550 $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
10551 r = val;
10552 return false;
10553 }
10554 }, this));
10555 if(r === false) { $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"); }
10556
10557 pos = rtl ? (this.data.dnd.off.right - 18) : (this.data.dnd.off.left + 10);
10558 switch(r) {
10559 case "before":
10560 m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();
10561 if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top - 1) + "px" }).show(); }
10562 break;
10563 case "after":
10564 m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 6) + "px" }).show();
10565 if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 1) + "px" }).show(); }
10566 break;
10567 case "inside":
10568 m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();
10569 if(ml) { ml.hide(); }
10570 break;
10571 default:
10572 m.hide();
10573 if(ml) { ml.hide(); }
10574 break;
10575 }
10576 last_pos = r;
10577 return r;
10578 },
10579 dnd_open : function () {
10580 this.data.dnd.to2 = false;
10581 this.open_node(r, $.proxy(this.dnd_prepare,this), true);
10582 },
10583 dnd_finish : function (e) {
10584 if(this.data.dnd.foreign) {
10585 if(this.data.dnd.after || this.data.dnd.before || this.data.dnd.inside) {
10586 this._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : r, "p" : last_pos });
10587 }
10588 }
10589 else {
10590 this.dnd_prepare();
10591 this.move_node(o, r, last_pos, e[this._get_settings().dnd.copy_modifier + "Key"]);
10592 }
10593 o = false;
10594 r = false;
10595 m.hide();
10596 if(ml) { ml.hide(); }
10597 },
10598 dnd_enter : function (obj) {
10599 if(this.data.dnd.mto) {
10600 clearTimeout(this.data.dnd.mto);
10601 this.data.dnd.mto = false;
10602 }
10603 var s = this._get_settings().dnd;
10604 this.data.dnd.prepared = false;
10605 r = this._get_node(obj);
10606 if(s.check_timeout) {
10607 // do the calculations after a minimal timeout (users tend to drag quickly to the desired location)
10608 if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
10609 this.data.dnd.to1 = setTimeout($.proxy(this.dnd_prepare, this), s.check_timeout);
10610 }
10611 else {
10612 this.dnd_prepare();
10613 }
10614 if(s.open_timeout) {
10615 if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
10616 if(r && r.length && r.hasClass("jstree-closed")) {
10617 // if the node is closed - open it, then recalculate
10618 this.data.dnd.to2 = setTimeout($.proxy(this.dnd_open, this), s.open_timeout);
10619 }
10620 }
10621 else {
10622 if(r && r.length && r.hasClass("jstree-closed")) {
10623 this.dnd_open();
10624 }
10625 }
10626 },
10627 dnd_leave : function (e) {
10628 this.data.dnd.after = false;
10629 this.data.dnd.before = false;
10630 this.data.dnd.inside = false;
10631 $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
10632 m.hide();
10633 if(ml) { ml.hide(); }
10634 if(r && r[0] === e.target.parentNode) {
10635 if(this.data.dnd.to1) {
10636 clearTimeout(this.data.dnd.to1);
10637 this.data.dnd.to1 = false;
10638 }
10639 if(this.data.dnd.to2) {
10640 clearTimeout(this.data.dnd.to2);
10641 this.data.dnd.to2 = false;
10642 }
10643 }
10644 },
10645 start_drag : function (obj, e) {
10646 o = this._get_node(obj);
10647 if(this.data.ui && this.is_selected(o)) { o = this._get_node(null, true); }
10648 var dt = o.length > 1 ? this._get_string("multiple_selection") : this.get_text(o),
10649 cnt = this.get_container();
10650 if(!this._get_settings().core.html_titles) { dt = dt.replace(/</ig,"&lt;").replace(/>/ig,"&gt;"); }
10651 $.vakata.dnd.drag_start(e, { jstree : true, obj : o }, "<ins class='jstree-icon'></ins>" + dt );
10652 if(this.data.themes) {
10653 if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
10654 if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
10655 $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
10656 }
10657 this.data.dnd.cof = cnt.offset();
10658 this.data.dnd.cw = parseInt(cnt.width(),10);
10659 this.data.dnd.ch = parseInt(cnt.height(),10);
10660 this.data.dnd.active = true;
10661 }
10662 }
10663 });
10664 $(function() {
10665 var css_string = '' +
10666 '#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; ' +
10667 ' -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; ' +
10668 '} ' +
10669 '#vakata-dragged .jstree-ok { background:green; } ' +
10670 '#vakata-dragged .jstree-invalid { background:red; } ' +
10671 '#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
10672 '#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; ' +
10673 ' cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
10674 ' -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; ' +
10675 '}' +
10676 '';
10677 $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
10678 m = $("<div />").attr({ id : "jstree-marker" }).hide().html("&raquo;")
10679 .bind("mouseleave mouseenter", function (e) {
10680 m.hide();
10681 ml.hide();
10682 e.preventDefault();
10683 e.stopImmediatePropagation();
10684 return false;
10685 })
10686 .appendTo("body");
10687 ml = $("<div />").attr({ id : "jstree-marker-line" }).hide()
10688 .bind("mouseup", function (e) {
10689 if(r && r.length) {
10690 r.children("a").trigger(e);
10691 e.preventDefault();
10692 e.stopImmediatePropagation();
10693 return false;
10694 }
10695 })
10696 .bind("mouseleave", function (e) {
10697 var rt = $(e.relatedTarget);
10698 if(rt.is(".jstree") || rt.closest(".jstree").length === 0) {
10699 if(r && r.length) {
10700 r.children("a").trigger(e);
10701 m.hide();
10702 ml.hide();
10703 e.preventDefault();
10704 e.stopImmediatePropagation();
10705 return false;
10706 }
10707 }
10708 })
10709 .appendTo("body");
10710 $(document).bind("drag_start.vakata", function (e, data) {
10711 if(data.data.jstree) { m.show(); if(ml) { ml.show(); } }
10712 });
10713 $(document).bind("drag_stop.vakata", function (e, data) {
10714 if(data.data.jstree) { m.hide(); if(ml) { ml.hide(); } }
10715 });
10716 });
10717 })(jQuery);
10718 //*/
10719
10720 /*
10721 * jsTree checkbox plugin
10722 * Inserts checkboxes in front of every node
10723 * Depends on the ui plugin
10724 * DOES NOT WORK NICELY WITH MULTITREE DRAG'N'DROP
10725 */
10726 (function ($) {
10727 $.jstree.plugin("checkbox", {
10728 __init : function () {
10729 this.data.checkbox.noui = this._get_settings().checkbox.override_ui;
10730 if(this.data.ui && this.data.checkbox.noui) {
10731 this.select_node = this.deselect_node = this.deselect_all = $.noop;
10732 this.get_selected = this.get_checked;
10733 }
10734
10735 this.get_container()
10736 .bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree", $.proxy(function (e, data) {
10737 this._prepare_checkboxes(data.rslt.obj);
10738 }, this))
10739 .bind("loaded.jstree", $.proxy(function (e) {
10740 this._prepare_checkboxes();
10741 }, this))
10742 .delegate( (this.data.ui && this.data.checkbox.noui ? "a" : "ins.jstree-checkbox") , "click.jstree", $.proxy(function (e) {
10743 e.preventDefault();
10744 if(this._get_node(e.target).hasClass("jstree-checked")) { this.uncheck_node(e.target); }
10745 else { this.check_node(e.target); }
10746 if(this.data.ui && this.data.checkbox.noui) {
10747 this.save_selected();
10748 if(this.data.cookies) { this.save_cookie("select_node"); }
10749 }
10750 else {
10751 e.stopImmediatePropagation();
10752 return false;
10753 }
10754 }, this));
10755 },
10756 defaults : {
10757 override_ui : false,
10758 two_state : false,
10759 real_checkboxes : false,
10760 checked_parent_open : true,
10761 real_checkboxes_names : function (n) { return [ ("check_" + (n[0].id || Math.ceil(Math.random() * 10000))) , 1]; }
10762 },
10763 __destroy : function () {
10764 this.get_container()
10765 .find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end()
10766 .find("ins.jstree-checkbox").remove();
10767 },
10768 _fn : {
10769 _checkbox_notify : function (n, data) {
10770 if(data.checked) {
10771 this.check_node(n, false);
10772 }
10773 },
10774 _prepare_checkboxes : function (obj) {
10775 obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
10776 if(obj === false) { return; } // added for removing root nodes
10777 var c, _this = this, t, ts = this._get_settings().checkbox.two_state, rc = this._get_settings().checkbox.real_checkboxes, rcn = this._get_settings().checkbox.real_checkboxes_names;
10778 obj.each(function () {
10779 t = $(this);
10780 c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
10781 t.find("li").andSelf().each(function () {
10782 var $t = $(this), nm;
10783 $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
10784 if(rc) {
10785 if(!$t.children(":checkbox").length) {
10786 nm = rcn.call(_this, $t);
10787 $t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='" + nm[0] + "' name='" + nm[0] + "' value='" + nm[1] + "' />");
10788 }
10789 else {
10790 $t.children(":checkbox").addClass("jstree-real-checkbox");
10791 }
10792 }
10793 if(!ts) {
10794 if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
10795 $t.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked", true);
10796 }
10797 }
10798 else {
10799 if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
10800 $t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
10801 }
10802 }
10803 });
10804 });
10805 if(!ts) {
10806 obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
10807 }
10808 },
10809 change_state : function (obj, state) {
10810 obj = this._get_node(obj);
10811 var coll = false, rc = this._get_settings().checkbox.real_checkboxes;
10812 if(!obj || obj === -1) { return false; }
10813 state = (state === false || state === true) ? state : obj.hasClass("jstree-checked");
10814 if(this._get_settings().checkbox.two_state) {
10815 if(state) {
10816 obj.removeClass("jstree-checked").addClass("jstree-unchecked");
10817 if(rc) { obj.children(":checkbox").prop("checked", false); }
10818 }
10819 else {
10820 obj.removeClass("jstree-unchecked").addClass("jstree-checked");
10821 if(rc) { obj.children(":checkbox").prop("checked", true); }
10822 }
10823 }
10824 else {
10825 if(state) {
10826 coll = obj.find("li").andSelf();
10827 if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
10828 coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
10829 if(rc) { coll.children(":checkbox").prop("checked", false); }
10830 }
10831 else {
10832 coll = obj.find("li").andSelf();
10833 if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
10834 coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
10835 if(rc) { coll.children(":checkbox").prop("checked", true); }
10836 if(this.data.ui) { this.data.ui.last_selected = obj; }
10837 this.data.checkbox.last_selected = obj;
10838 }
10839 obj.parentsUntil(".jstree", "li").each(function () {
10840 var $this = $(this);
10841 if(state) {
10842 if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
10843 $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
10844 if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
10845 return false;
10846 }
10847 else {
10848 $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
10849 if(rc) { $this.children(":checkbox").prop("checked", false); }
10850 }
10851 }
10852 else {
10853 if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
10854 $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
10855 if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
10856 return false;
10857 }
10858 else {
10859 $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
10860 if(rc) { $this.children(":checkbox").prop("checked", true); }
10861 }
10862 }
10863 });
10864 }
10865 if(this.data.ui && this.data.checkbox.noui) { this.data.ui.selected = this.get_checked(); }
10866 this.__callback(obj);
10867 return true;
10868 },
10869 check_node : function (obj) {
10870 if(this.change_state(obj, false)) {
10871 obj = this._get_node(obj);
10872 if(this._get_settings().checkbox.checked_parent_open) {
10873 var t = this;
10874 obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
10875 }
10876 this.__callback({ "obj" : obj });
10877 }
10878 },
10879 uncheck_node : function (obj) {
10880 if(this.change_state(obj, true)) { this.__callback({ "obj" : this._get_node(obj) }); }
10881 },
10882 check_all : function () {
10883 var _this = this,
10884 coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
10885 coll.each(function () {
10886 _this.change_state(this, false);
10887 });
10888 this.__callback();
10889 },
10890 uncheck_all : function () {
10891 var _this = this,
10892 coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
10893 coll.each(function () {
10894 _this.change_state(this, true);
10895 });
10896 this.__callback();
10897 },
10898
10899 is_checked : function(obj) {
10900 obj = this._get_node(obj);
10901 return obj.length ? obj.is(".jstree-checked") : false;
10902 },
10903 get_checked : function (obj, get_all) {
10904 obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
10905 return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-checked") : obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");
10906 },
10907 get_unchecked : function (obj, get_all) {
10908 obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
10909 return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-unchecked") : obj.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked");
10910 },
10911
10912 show_checkboxes : function () { this.get_container().children("ul").removeClass("jstree-no-checkboxes"); },
10913 hide_checkboxes : function () { this.get_container().children("ul").addClass("jstree-no-checkboxes"); },
10914
10915 _repair_state : function (obj) {
10916 obj = this._get_node(obj);
10917 if(!obj.length) { return; }
10918 if(this._get_settings().checkbox.two_state) {
10919 obj.find('li').andSelf().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
10920 return;
10921 }
10922 var rc = this._get_settings().checkbox.real_checkboxes,
10923 a = obj.find("> ul > .jstree-checked").length,
10924 b = obj.find("> ul > .jstree-undetermined").length,
10925 c = obj.find("> ul > li").length;
10926 if(c === 0) { if(obj.hasClass("jstree-undetermined")) { this.change_state(obj, false); } }
10927 else if(a === 0 && b === 0) { this.change_state(obj, true); }
10928 else if(a === c) { this.change_state(obj, false); }
10929 else {
10930 obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
10931 if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
10932 }
10933 },
10934 reselect : function () {
10935 if(this.data.ui && this.data.checkbox.noui) {
10936 var _this = this,
10937 s = this.data.ui.to_select;
10938 s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
10939 this.deselect_all();
10940 $.each(s, function (i, val) { _this.check_node(val); });
10941 this.__callback();
10942 }
10943 else {
10944 this.__call_old();
10945 }
10946 },
10947 save_loaded : function () {
10948 var _this = this;
10949 this.data.core.to_load = [];
10950 this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function () {
10951 if(this.id) { _this.data.core.to_load.push("#" + this.id); }
10952 });
10953 }
10954 }
10955 });
10956 $(function() {
10957 var css_string = '.jstree .jstree-real-checkbox { display:none; } ';
10958 $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
10959 });
10960 })(jQuery);
10961 //*/
10962
10963 /*
10964 * jsTree XML plugin
10965 * The XML data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
10966 */
10967 (function ($) {
10968 $.vakata.xslt = function (xml, xsl, callback) {
10969 var rs = "", xm, xs, processor, support;
10970 // TODO: IE9 no XSLTProcessor, no document.recalc
10971 if(document.recalc) {
10972 xm = document.createElement('xml');
10973 xs = document.createElement('xml');
10974 xm.innerHTML = xml;
10975 xs.innerHTML = xsl;
10976 $("body").append(xm).append(xs);
10977 setTimeout( (function (xm, xs, callback) {
10978 return function () {
10979 callback.call(null, xm.transformNode(xs.XMLDocument));
10980 setTimeout( (function (xm, xs) { return function () { $(xm).remove(); $(xs).remove(); }; })(xm, xs), 200);
10981 };
10982 })(xm, xs, callback), 100);
10983 return true;
10984 }
10985 if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor === "undefined") {
10986 xml = new DOMParser().parseFromString(xml, "text/xml");
10987 xsl = new DOMParser().parseFromString(xsl, "text/xml");
10988 // alert(xml.transformNode());
10989 // callback.call(null, new XMLSerializer().serializeToString(rs));
10990
10991 }
10992 if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor !== "undefined") {
10993 processor = new XSLTProcessor();
10994 support = $.isFunction(processor.transformDocument) ? (typeof window.XMLSerializer !== "undefined") : true;
10995 if(!support) { return false; }
10996 xml = new DOMParser().parseFromString(xml, "text/xml");
10997 xsl = new DOMParser().parseFromString(xsl, "text/xml");
10998 if($.isFunction(processor.transformDocument)) {
10999 rs = document.implementation.createDocument("", "", null);
11000 processor.transformDocument(xml, xsl, rs, null);
11001 callback.call(null, new XMLSerializer().serializeToString(rs));
11002 return true;
11003 }
11004 else {
11005 processor.importStylesheet(xsl);
11006 rs = processor.transformToFragment(xml, document);
11007 callback.call(null, $("<div />").append(rs).html());
11008 return true;
11009 }
11010 }
11011 return false;
11012 };
11013 var xsl = {
11014 'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
11015 '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
11016 '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' +
11017 '<xsl:template match="/">' +
11018 ' <xsl:call-template name="nodes">' +
11019 ' <xsl:with-param name="node" select="/root" />' +
11020 ' </xsl:call-template>' +
11021 '</xsl:template>' +
11022 '<xsl:template name="nodes">' +
11023 ' <xsl:param name="node" />' +
11024 ' <ul>' +
11025 ' <xsl:for-each select="$node/item">' +
11026 ' <xsl:variable name="children" select="count(./item) &gt; 0" />' +
11027 ' <li>' +
11028 ' <xsl:attribute name="class">' +
11029 ' <xsl:if test="position() = last()">jstree-last </xsl:if>' +
11030 ' <xsl:choose>' +
11031 ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
11032 ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
11033 ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
11034 ' </xsl:choose>' +
11035 ' <xsl:value-of select="@class" />' +
11036 ' </xsl:attribute>' +
11037 ' <xsl:for-each select="@*">' +
11038 ' <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">' +
11039 ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
11040 ' </xsl:if>' +
11041 ' </xsl:for-each>' +
11042 ' <ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' +
11043 ' <xsl:for-each select="content/name">' +
11044 ' <a>' +
11045 ' <xsl:attribute name="href">' +
11046 ' <xsl:choose>' +
11047 ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
11048 ' <xsl:otherwise>#</xsl:otherwise>' +
11049 ' </xsl:choose>' +
11050 ' </xsl:attribute>' +
11051 ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
11052 ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
11053 ' <xsl:for-each select="@*">' +
11054 ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
11055 ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
11056 ' </xsl:if>' +
11057 ' </xsl:for-each>' +
11058 ' <ins>' +
11059 ' <xsl:attribute name="class">jstree-icon ' +
11060 ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
11061 ' </xsl:attribute>' +
11062 ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
11063 ' <xsl:text>&#xa0;</xsl:text>' +
11064 ' </ins>' +
11065 ' <xsl:copy-of select="./child::node()" />' +
11066 ' </a>' +
11067 ' </xsl:for-each>' +
11068 ' <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>' +
11069 ' </li>' +
11070 ' </xsl:for-each>' +
11071 ' </ul>' +
11072 '</xsl:template>' +
11073 '</xsl:stylesheet>',
11074
11075 'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
11076 '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
11077 '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' +
11078 '<xsl:template match="/">' +
11079 ' <ul>' +
11080 ' <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">' + /* the last `or` may be removed */
11081 ' <xsl:call-template name="nodes">' +
11082 ' <xsl:with-param name="node" select="." />' +
11083 ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
11084 ' </xsl:call-template>' +
11085 ' </xsl:for-each>' +
11086 ' </ul>' +
11087 '</xsl:template>' +
11088 '<xsl:template name="nodes">' +
11089 ' <xsl:param name="node" />' +
11090 ' <xsl:param name="is_last" />' +
11091 ' <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" />' +
11092 ' <li>' +
11093 ' <xsl:attribute name="class">' +
11094 ' <xsl:if test="$is_last = true()">jstree-last </xsl:if>' +
11095 ' <xsl:choose>' +
11096 ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
11097 ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
11098 ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
11099 ' </xsl:choose>' +
11100 ' <xsl:value-of select="@class" />' +
11101 ' </xsl:attribute>' +
11102 ' <xsl:for-each select="@*">' +
11103 ' <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">' +
11104 ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
11105 ' </xsl:if>' +
11106 ' </xsl:for-each>' +
11107 ' <ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins>' +
11108 ' <xsl:for-each select="content/name">' +
11109 ' <a>' +
11110 ' <xsl:attribute name="href">' +
11111 ' <xsl:choose>' +
11112 ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
11113 ' <xsl:otherwise>#</xsl:otherwise>' +
11114 ' </xsl:choose>' +
11115 ' </xsl:attribute>' +
11116 ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
11117 ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
11118 ' <xsl:for-each select="@*">' +
11119 ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
11120 ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
11121 ' </xsl:if>' +
11122 ' </xsl:for-each>' +
11123 ' <ins>' +
11124 ' <xsl:attribute name="class">jstree-icon ' +
11125 ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
11126 ' </xsl:attribute>' +
11127 ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
11128 ' <xsl:text>&#xa0;</xsl:text>' +
11129 ' </ins>' +
11130 ' <xsl:copy-of select="./child::node()" />' +
11131 ' </a>' +
11132 ' </xsl:for-each>' +
11133 ' <xsl:if test="$children">' +
11134 ' <ul>' +
11135 ' <xsl:for-each select="//item[@parent_id=$node/attribute::id]">' +
11136 ' <xsl:call-template name="nodes">' +
11137 ' <xsl:with-param name="node" select="." />' +
11138 ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
11139 ' </xsl:call-template>' +
11140 ' </xsl:for-each>' +
11141 ' </ul>' +
11142 ' </xsl:if>' +
11143 ' </li>' +
11144 '</xsl:template>' +
11145 '</xsl:stylesheet>'
11146 },
11147 escape_xml = function(string) {
11148 return string
11149 .toString()
11150 .replace(/&/g, '&amp;')
11151 .replace(/</g, '&lt;')
11152 .replace(/>/g, '&gt;')
11153 .replace(/"/g, '&quot;')
11154 .replace(/'/g, '&apos;');
11155 };
11156 $.jstree.plugin("xml_data", {
11157 defaults : {
11158 data : false,
11159 ajax : false,
11160 xsl : "flat",
11161 clean_node : false,
11162 correct_state : true,
11163 get_skip_empty : false,
11164 get_include_preamble : true
11165 },
11166 _fn : {
11167 load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_xml(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
11168 _is_loaded : function (obj) {
11169 var s = this._get_settings().xml_data;
11170 obj = this._get_node(obj);
11171 return obj == -1 || !obj || (!s.ajax && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
11172 },
11173 load_node_xml : function (obj, s_call, e_call) {
11174 var s = this.get_settings().xml_data,
11175 error_func = function () {},
11176 success_func = function () {};
11177
11178 obj = this._get_node(obj);
11179 if(obj && obj !== -1) {
11180 if(obj.data("jstree_is_loading")) { return; }
11181 else { obj.data("jstree_is_loading",true); }
11182 }
11183 switch(!0) {
11184 case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
11185 case ($.isFunction(s.data)):
11186 s.data.call(this, obj, $.proxy(function (d) {
11187 this.parse_xml(d, $.proxy(function (d) {
11188 if(d) {
11189 d = d.replace(/ ?xmlns="[^"]*"/ig, "");
11190 if(d.length > 10) {
11191 d = $(d);
11192 if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
11193 else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
11194 if(s.clean_node) { this.clean_node(obj); }
11195 if(s_call) { s_call.call(this); }
11196 }
11197 else {
11198 if(obj && obj !== -1) {
11199 obj.children("a.jstree-loading").removeClass("jstree-loading");
11200 obj.removeData("jstree_is_loading");
11201 if(s.correct_state) {
11202 this.correct_state(obj);
11203 if(s_call) { s_call.call(this); }
11204 }
11205 }
11206 else {
11207 if(s.correct_state) {
11208 this.get_container().children("ul").empty();
11209 if(s_call) { s_call.call(this); }
11210 }
11211 }
11212 }
11213 }
11214 }, this));
11215 }, this));
11216 break;
11217 case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
11218 if(!obj || obj == -1) {
11219 this.parse_xml(s.data, $.proxy(function (d) {
11220 if(d) {
11221 d = d.replace(/ ?xmlns="[^"]*"/ig, "");
11222 if(d.length > 10) {
11223 d = $(d);
11224 this.get_container().children("ul").empty().append(d.children());
11225 if(s.clean_node) { this.clean_node(obj); }
11226 if(s_call) { s_call.call(this); }
11227 }
11228 }
11229 else {
11230 if(s.correct_state) {
11231 this.get_container().children("ul").empty();
11232 if(s_call) { s_call.call(this); }
11233 }
11234 }
11235 }, this));
11236 }
11237 break;
11238 case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
11239 error_func = function (x, t, e) {
11240 var ef = this.get_settings().xml_data.ajax.error;
11241 if(ef) { ef.call(this, x, t, e); }
11242 if(obj !== -1 && obj.length) {
11243 obj.children("a.jstree-loading").removeClass("jstree-loading");
11244 obj.removeData("jstree_is_loading");
11245 if(t === "success" && s.correct_state) { this.correct_state(obj); }
11246 }
11247 else {
11248 if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
11249 }
11250 if(e_call) { e_call.call(this); }
11251 };
11252 success_func = function (d, t, x) {
11253 d = x.responseText;
11254 var sf = this.get_settings().xml_data.ajax.success;
11255 if(sf) { d = sf.call(this,d,t,x) || d; }
11256 if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
11257 return error_func.call(this, x, t, "");
11258 }
11259 this.parse_xml(d, $.proxy(function (d) {
11260 if(d) {
11261 d = d.replace(/ ?xmlns="[^"]*"/ig, "");
11262 if(d.length > 10) {
11263 d = $(d);
11264 if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
11265 else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
11266 if(s.clean_node) { this.clean_node(obj); }
11267 if(s_call) { s_call.call(this); }
11268 }
11269 else {
11270 if(obj && obj !== -1) {
11271 obj.children("a.jstree-loading").removeClass("jstree-loading");
11272 obj.removeData("jstree_is_loading");
11273 if(s.correct_state) {
11274 this.correct_state(obj);
11275 if(s_call) { s_call.call(this); }
11276 }
11277 }
11278 else {
11279 if(s.correct_state) {
11280 this.get_container().children("ul").empty();
11281 if(s_call) { s_call.call(this); }
11282 }
11283 }
11284 }
11285 }
11286 }, this));
11287 };
11288 s.ajax.context = this;
11289 s.ajax.error = error_func;
11290 s.ajax.success = success_func;
11291 if(!s.ajax.dataType) { s.ajax.dataType = "xml"; }
11292 if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
11293 if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
11294 $.ajax(s.ajax);
11295 break;
11296 }
11297 },
11298 parse_xml : function (xml, callback) {
11299 var s = this._get_settings().xml_data;
11300 $.vakata.xslt(xml, xsl[s.xsl], callback);
11301 },
11302 get_xml : function (tp, obj, li_attr, a_attr, is_callback) {
11303 var result = "",
11304 s = this._get_settings(),
11305 _this = this,
11306 tmp1, tmp2, li, a, lang;
11307 if(!tp) { tp = "flat"; }
11308 if(!is_callback) { is_callback = 0; }
11309 obj = this._get_node(obj);
11310 if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
11311 li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
11312 if(!is_callback && this.data.types && $.inArray(s.types.type_attr, li_attr) === -1) { li_attr.push(s.types.type_attr); }
11313
11314 a_attr = $.isArray(a_attr) ? a_attr : [ ];
11315
11316 if(!is_callback) {
11317 if(s.xml_data.get_include_preamble) {
11318 result += '<' + '?xml version="1.0" encoding="UTF-8"?' + '>';
11319 }
11320 result += "<root>";
11321 }
11322 obj.each(function () {
11323 result += "<item";
11324 li = $(this);
11325 $.each(li_attr, function (i, v) {
11326 var t = li.attr(v);
11327 if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
11328 result += " " + v + "=\"" + escape_xml((" " + (t || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
11329 }
11330 });
11331 if(li.hasClass("jstree-open")) { result += " state=\"open\""; }
11332 if(li.hasClass("jstree-closed")) { result += " state=\"closed\""; }
11333 if(tp === "flat") { result += " parent_id=\"" + escape_xml(is_callback) + "\""; }
11334 result += ">";
11335 result += "<content>";
11336 a = li.children("a");
11337 a.each(function () {
11338 tmp1 = $(this);
11339 lang = false;
11340 result += "<name";
11341 if($.inArray("languages", s.plugins) !== -1) {
11342 $.each(s.languages, function (k, z) {
11343 if(tmp1.hasClass(z)) { result += " lang=\"" + escape_xml(z) + "\""; lang = z; return false; }
11344 });
11345 }
11346 if(a_attr.length) {
11347 $.each(a_attr, function (k, z) {
11348 var t = tmp1.attr(z);
11349 if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
11350 result += " " + z + "=\"" + escape_xml((" " + t || "").replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
11351 }
11352 });
11353 }
11354 if(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
11355 result += ' icon="' + escape_xml(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + '"';
11356 }
11357 if(tmp1.children("ins").get(0).style.backgroundImage.length) {
11358 result += ' icon="' + escape_xml(tmp1.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,"")) + '"';
11359 }
11360 result += ">";
11361 result += "<![CDATA[" + _this.get_text(tmp1, lang) + "]]>";
11362 result += "</name>";
11363 });
11364 result += "</content>";
11365 tmp2 = li[0].id || true;
11366 li = li.find("> ul > li");
11367 if(li.length) { tmp2 = _this.get_xml(tp, li, li_attr, a_attr, tmp2); }
11368 else { tmp2 = ""; }
11369 if(tp == "nest") { result += tmp2; }
11370 result += "</item>";
11371 if(tp == "flat") { result += tmp2; }
11372 });
11373 if(!is_callback) { result += "</root>"; }
11374 return result;
11375 }
11376 }
11377 });
11378 })(jQuery);
11379 //*/
11380
11381 /*
11382 * jsTree search plugin
11383 * Enables both sync and async search on the tree
11384 * DOES NOT WORK WITH JSON PROGRESSIVE RENDER
11385 */
11386 (function ($) {
11387 $.expr[':'].jstree_contains = function(a,i,m){
11388 return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
11389 };
11390 $.expr[':'].jstree_title_contains = function(a,i,m) {
11391 return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
11392 };
11393 $.jstree.plugin("search", {
11394 __init : function () {
11395 this.data.search.str = "";
11396 this.data.search.result = $();
11397 if(this._get_settings().search.show_only_matches) {
11398 this.get_container()
11399 .bind("search.jstree", function (e, data) {
11400 $(this).children("ul").find("li").hide().removeClass("jstree-last");
11401 data.rslt.nodes.parentsUntil(".jstree").andSelf().show()
11402 .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
11403 })
11404 .bind("clear_search.jstree", function () {
11405 $(this).children("ul").find("li").css("display","").end().end().jstree("clean_node", -1);
11406 });
11407 }
11408 },
11409 defaults : {
11410 ajax : false,
11411 search_method : "jstree_contains", // for case insensitive - jstree_contains
11412 show_only_matches : false
11413 },
11414 _fn : {
11415 search : function (str, skip_async) {
11416 if($.trim(str) === "") { this.clear_search(); return; }
11417 var s = this.get_settings().search,
11418 t = this,
11419 error_func = function () { },
11420 success_func = function () { };
11421 this.data.search.str = str;
11422
11423 if(!skip_async && s.ajax !== false && this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length > 0) {
11424 this.search.supress_callback = true;
11425 error_func = function () { };
11426 success_func = function (d, t, x) {
11427 var sf = this.get_settings().search.ajax.success;
11428 if(sf) { d = sf.call(this,d,t,x) || d; }
11429 this.data.search.to_open = d;
11430 this._search_open();
11431 };
11432 s.ajax.context = this;
11433 s.ajax.error = error_func;
11434 s.ajax.success = success_func;
11435 if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, str); }
11436 if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, str); }
11437 if(!s.ajax.data) { s.ajax.data = { "search_string" : str }; }
11438 if(!s.ajax.dataType || /^json/.exec(s.ajax.dataType)) { s.ajax.dataType = "json"; }
11439 $.ajax(s.ajax);
11440 return;
11441 }
11442 if(this.data.search.result.length) { this.clear_search(); }
11443 this.data.search.result = this.get_container().find("a" + (this.data.languages ? "." + this.get_lang() : "" ) + ":" + (s.search_method) + "(" + this.data.search.str + ")");
11444 this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function () {
11445 t.open_node(this, false, true);
11446 });
11447 this.__callback({ nodes : this.data.search.result, str : str });
11448 },
11449 clear_search : function (str) {
11450 this.data.search.result.removeClass("jstree-search");
11451 this.__callback(this.data.search.result);
11452 this.data.search.result = $();
11453 },
11454 _search_open : function (is_callback) {
11455 var _this = this,
11456 done = true,
11457 current = [],
11458 remaining = [];
11459 if(this.data.search.to_open.length) {
11460 $.each(this.data.search.to_open, function (i, val) {
11461 if(val == "#") { return true; }
11462 if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }
11463 else { remaining.push(val); }
11464 });
11465 if(current.length) {
11466 this.data.search.to_open = remaining;
11467 $.each(current, function (i, val) {
11468 _this.open_node(val, function () { _this._search_open(true); });
11469 });
11470 done = false;
11471 }
11472 }
11473 if(done) { this.search(this.data.search.str, true); }
11474 }
11475 }
11476 });
11477 })(jQuery);
11478 //*/
11479
11480 /*
11481 * jsTree contextmenu plugin
11482 */
11483 (function ($) {
11484 $.vakata.context = {
11485 hide_on_mouseleave : false,
11486
11487 cnt : $("<div id='vakata-contextmenu' />"),
11488 vis : false,
11489 tgt : false,
11490 par : false,
11491 func : false,
11492 data : false,
11493 rtl : false,
11494 show : function (s, t, x, y, d, p, rtl) {
11495 $.vakata.context.rtl = !!rtl;
11496 var html = $.vakata.context.parse(s), h, w;
11497 if(!html) { return; }
11498 $.vakata.context.vis = true;
11499 $.vakata.context.tgt = t;
11500 $.vakata.context.par = p || t || null;
11501 $.vakata.context.data = d || null;
11502 $.vakata.context.cnt
11503 .html(html)
11504 .css({ "visibility" : "hidden", "display" : "block", "left" : 0, "top" : 0 });
11505
11506 if($.vakata.context.hide_on_mouseleave) {
11507 $.vakata.context.cnt
11508 .one("mouseleave", function(e) { $.vakata.context.hide(); });
11509 }
11510
11511 h = $.vakata.context.cnt.height();
11512 w = $.vakata.context.cnt.width();
11513 if(x + w > $(document).width()) {
11514 x = $(document).width() - (w + 5);
11515 $.vakata.context.cnt.find("li > ul").addClass("right");
11516 }
11517 if(y + h > $(document).height()) {
11518 y = y - (h + t[0].offsetHeight);
11519 $.vakata.context.cnt.find("li > ul").addClass("bottom");
11520 }
11521
11522 $.vakata.context.cnt
11523 .css({ "left" : x, "top" : y })
11524 .find("li:has(ul)")
11525 .bind("mouseenter", function (e) {
11526 var w = $(document).width(),
11527 h = $(document).height(),
11528 ul = $(this).children("ul").show();
11529 if(w !== $(document).width()) { ul.toggleClass("right"); }
11530 if(h !== $(document).height()) { ul.toggleClass("bottom"); }
11531 })
11532 .bind("mouseleave", function (e) {
11533 $(this).children("ul").hide();
11534 })
11535 .end()
11536 .css({ "visibility" : "visible" })
11537 .show();
11538 $(document).triggerHandler("context_show.vakata");
11539 },
11540 hide : function () {
11541 $.vakata.context.vis = false;
11542 $.vakata.context.cnt.attr("class","").css({ "visibility" : "hidden" });
11543 $(document).triggerHandler("context_hide.vakata");
11544 },
11545 parse : function (s, is_callback) {
11546 if(!s) { return false; }
11547 var str = "",
11548 tmp = false,
11549 was_sep = true;
11550 if(!is_callback) { $.vakata.context.func = {}; }
11551 str += "<ul>";
11552 $.each(s, function (i, val) {
11553 if(!val) { return true; }
11554 $.vakata.context.func[i] = val.action;
11555 if(!was_sep && val.separator_before) {
11556 str += "<li class='vakata-separator vakata-separator-before'></li>";
11557 }
11558 was_sep = false;
11559 str += "<li class='" + (val._class || "") + (val._disabled ? " jstree-contextmenu-disabled " : "") + "'><ins ";
11560 if(val.icon && val.icon.indexOf("/") === -1) { str += " class='" + val.icon + "' "; }
11561 if(val.icon && val.icon.indexOf("/") !== -1) { str += " style='background:url(" + val.icon + ") center center no-repeat;' "; }
11562 str += ">&#160;</ins><a href='#' rel='" + i + "'>";
11563 if(val.submenu) {
11564 str += "<span style='float:" + ($.vakata.context.rtl ? "left" : "right") + ";'>&raquo;</span>";
11565 }
11566 str += val.label + "</a>";
11567 if(val.submenu) {
11568 tmp = $.vakata.context.parse(val.submenu, true);
11569 if(tmp) { str += tmp; }
11570 }
11571 str += "</li>";
11572 if(val.separator_after) {
11573 str += "<li class='vakata-separator vakata-separator-after'></li>";
11574 was_sep = true;
11575 }
11576 });
11577 str = str.replace(/<li class\='vakata-separator vakata-separator-after'><\/li>$/,"");
11578 str += "</ul>";
11579 $(document).triggerHandler("context_parse.vakata");
11580 return str.length > 10 ? str : false;
11581 },
11582 exec : function (i) {
11583 if($.isFunction($.vakata.context.func[i])) {
11584 // if is string - eval and call it!
11585 $.vakata.context.func[i].call($.vakata.context.data, $.vakata.context.par);
11586 return true;
11587 }
11588 else { return false; }
11589 }
11590 };
11591 $(function () {
11592 var css_string = '' +
11593 '#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } ' +
11594 '#vakata-contextmenu ul { min-width:180px; *width:180px; } ' +
11595 '#vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } ' +
11596 '#vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } ' +
11597 '#vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } ' +
11598 '#vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } ' +
11599 '#vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } ' +
11600 '#vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } ' +
11601 '#vakata-contextmenu .right { right:100%; left:auto; } ' +
11602 '#vakata-contextmenu .bottom { bottom:-1px; top:auto; } ' +
11603 '#vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ';
11604 $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
11605 $.vakata.context.cnt
11606 .delegate("a","click", function (e) { e.preventDefault(); })
11607 .delegate("a","mouseup", function (e) {
11608 if(!$(this).parent().hasClass("jstree-contextmenu-disabled") && $.vakata.context.exec($(this).attr("rel"))) {
11609 $.vakata.context.hide();
11610 }
11611 else { $(this).blur(); }
11612 })
11613 .delegate("a","mouseover", function () {
11614 $.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover");
11615 })
11616 .appendTo("body");
11617 $(document).bind("mousedown", function (e) { if($.vakata.context.vis && !$.contains($.vakata.context.cnt[0], e.target)) { $.vakata.context.hide(); } });
11618 if(typeof $.hotkeys !== "undefined") {
11619 $(document)
11620 .bind("keydown", "up", function (e) {
11621 if($.vakata.context.vis) {
11622 var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();
11623 if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last(); }
11624 o.addClass("vakata-hover");
11625 e.stopImmediatePropagation();
11626 e.preventDefault();
11627 }
11628 })
11629 .bind("keydown", "down", function (e) {
11630 if($.vakata.context.vis) {
11631 var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();
11632 if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first(); }
11633 o.addClass("vakata-hover");
11634 e.stopImmediatePropagation();
11635 e.preventDefault();
11636 }
11637 })
11638 .bind("keydown", "right", function (e) {
11639 if($.vakata.context.vis) {
11640 $.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");
11641 e.stopImmediatePropagation();
11642 e.preventDefault();
11643 }
11644 })
11645 .bind("keydown", "left", function (e) {
11646 if($.vakata.context.vis) {
11647 $.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");
11648 e.stopImmediatePropagation();
11649 e.preventDefault();
11650 }
11651 })
11652 .bind("keydown", "esc", function (e) {
11653 $.vakata.context.hide();
11654 e.preventDefault();
11655 })
11656 .bind("keydown", "space", function (e) {
11657 $.vakata.context.cnt.find(".vakata-hover").last().children("a").click();
11658 e.preventDefault();
11659 });
11660 }
11661 });
11662
11663 $.jstree.plugin("contextmenu", {
11664 __init : function () {
11665 this.get_container()
11666 .delegate("a", "contextmenu.jstree", $.proxy(function (e) {
11667 e.preventDefault();
11668 if(!$(e.currentTarget).hasClass("jstree-loading")) {
11669 this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
11670 }
11671 }, this))
11672 .delegate("a", "click.jstree", $.proxy(function (e) {
11673 if(this.data.contextmenu) {
11674 $.vakata.context.hide();
11675 }
11676 }, this))
11677 .bind("destroy.jstree", $.proxy(function () {
11678 // TODO: move this to descruct method
11679 if(this.data.contextmenu) {
11680 $.vakata.context.hide();
11681 }
11682 }, this));
11683 $(document).bind("context_hide.vakata", $.proxy(function () { this.data.contextmenu = false; }, this));
11684 },
11685 defaults : {
11686 select_node : false, // requires UI plugin
11687 show_at_node : true,
11688 items : { // Could be a function that should return an object like this one
11689 "create" : {
11690 "separator_before" : false,
11691 "separator_after" : true,
11692 "label" : "Create",
11693 "action" : function (obj) { this.create(obj); }
11694 },
11695 "rename" : {
11696 "separator_before" : false,
11697 "separator_after" : false,
11698 "label" : "Rename",
11699 "action" : function (obj) { this.rename(obj); }
11700 },
11701 "remove" : {
11702 "separator_before" : false,
11703 "icon" : false,
11704 "separator_after" : false,
11705 "label" : "Delete",
11706 "action" : function (obj) { if(this.is_selected(obj)) { this.remove(); } else { this.remove(obj); } }
11707 },
11708 "ccp" : {
11709 "separator_before" : true,
11710 "icon" : false,
11711 "separator_after" : false,
11712 "label" : "Edit",
11713 "action" : false,
11714 "submenu" : {
11715 "cut" : {
11716 "separator_before" : false,
11717 "separator_after" : false,
11718 "label" : "Cut",
11719 "action" : function (obj) { this.cut(obj); }
11720 },
11721 "copy" : {
11722 "separator_before" : false,
11723 "icon" : false,
11724 "separator_after" : false,
11725 "label" : "Copy",
11726 "action" : function (obj) { this.copy(obj); }
11727 },
11728 "paste" : {
11729 "separator_before" : false,
11730 "icon" : false,
11731 "separator_after" : false,
11732 "label" : "Paste",
11733 "action" : function (obj) { this.paste(obj); }
11734 }
11735 }
11736 }
11737 }
11738 },
11739 _fn : {
11740 show_contextmenu : function (obj, x, y) {
11741 obj = this._get_node(obj);
11742 var s = this.get_settings().contextmenu,
11743 a = obj.children("a:visible:eq(0)"),
11744 o = false,
11745 i = false;
11746 if(s.select_node && this.data.ui && !this.is_selected(obj)) {
11747 this.deselect_all();
11748 this.select_node(obj, true);
11749 }
11750 if(s.show_at_node || typeof x === "undefined" || typeof y === "undefined") {
11751 o = a.offset();
11752 x = o.left;
11753 y = o.top + this.data.core.li_height;
11754 }
11755 i = obj.data("jstree") && obj.data("jstree").contextmenu ? obj.data("jstree").contextmenu : s.items;
11756 if($.isFunction(i)) { i = i.call(this, obj); }
11757 this.data.contextmenu = true;
11758 $.vakata.context.show(i, a, x, y, this, obj, this._get_settings().core.rtl);
11759 if(this.data.themes) { $.vakata.context.cnt.attr("class", "jstree-" + this.data.themes.theme + "-context"); }
11760 }
11761 }
11762 });
11763 })(jQuery);
11764 //*/
11765
11766 /*
11767 * jsTree types plugin
11768 * Adds support types of nodes
11769 * You can set an attribute on each li node, that represents its type.
11770 * According to the type setting the node may get custom icon/validation rules
11771 */
11772 (function ($) {
11773 $.jstree.plugin("types", {
11774 __init : function () {
11775 var s = this._get_settings().types;
11776 this.data.types.attach_to = [];
11777 this.get_container()
11778 .bind("init.jstree", $.proxy(function () {
11779 var types = s.types,
11780 attr = s.type_attr,
11781 icons_css = "",
11782 _this = this;
11783
11784 $.each(types, function (i, tp) {
11785 $.each(tp, function (k, v) {
11786 if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)) { _this.data.types.attach_to.push(k); }
11787 });
11788 if(!tp.icon) { return true; }
11789 if( tp.icon.image || tp.icon.position) {
11790 if(i == "default") { icons_css += '.jstree-' + _this.get_index() + ' a > .jstree-icon { '; }
11791 else { icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '="' + i + '"] > a > .jstree-icon { '; }
11792 if(tp.icon.image) { icons_css += ' background-image:url(' + tp.icon.image + '); '; }
11793 if(tp.icon.position){ icons_css += ' background-position:' + tp.icon.position + '; '; }
11794 else { icons_css += ' background-position:0 0; '; }
11795 icons_css += '} ';
11796 }
11797 });
11798 if(icons_css !== "") { $.vakata.css.add_sheet({ 'str' : icons_css, title : "jstree-types" }); }
11799 }, this))
11800 .bind("before.jstree", $.proxy(function (e, data) {
11801 var s, t,
11802 o = this._get_settings().types.use_data ? this._get_node(data.args[0]) : false,
11803 d = o && o !== -1 && o.length ? o.data("jstree") : false;
11804 if(d && d.types && d.types[data.func] === false) { e.stopImmediatePropagation(); return false; }
11805 if($.inArray(data.func, this.data.types.attach_to) !== -1) {
11806 if(!data.args[0] || (!data.args[0].tagName && !data.args[0].jquery)) { return; }
11807 s = this._get_settings().types.types;
11808 t = this._get_type(data.args[0]);
11809 if(
11810 (
11811 (s[t] && typeof s[t][data.func] !== "undefined") ||
11812 (s["default"] && typeof s["default"][data.func] !== "undefined")
11813 ) && this._check(data.func, data.args[0]) === false
11814 ) {
11815 e.stopImmediatePropagation();
11816 return false;
11817 }
11818 }
11819 }, this));
11820 if(is_ie6) {
11821 this.get_container()
11822 .bind("load_node.jstree set_type.jstree", $.proxy(function (e, data) {
11823 var r = data && data.rslt && data.rslt.obj && data.rslt.obj !== -1 ? this._get_node(data.rslt.obj).parent() : this.get_container_ul(),
11824 c = false,
11825 s = this._get_settings().types;
11826 $.each(s.types, function (i, tp) {
11827 if(tp.icon && (tp.icon.image || tp.icon.position)) {
11828 c = i === "default" ? r.find("li > a > .jstree-icon") : r.find("li[" + s.type_attr + "='" + i + "'] > a > .jstree-icon");
11829 if(tp.icon.image) { c.css("backgroundImage","url(" + tp.icon.image + ")"); }
11830 c.css("backgroundPosition", tp.icon.position || "0 0");
11831 }
11832 });
11833 }, this));
11834 }
11835 },
11836 defaults : {
11837 // defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking)
11838 max_children : -1,
11839 // defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking)
11840 max_depth : -1,
11841 // defines valid node types for the root nodes
11842 valid_children : "all",
11843
11844 // whether to use $.data
11845 use_data : false,
11846 // where is the type stores (the rel attribute of the LI element)
11847 type_attr : "rel",
11848 // a list of types
11849 types : {
11850 // the default type
11851 "default" : {
11852 "max_children" : -1,
11853 "max_depth" : -1,
11854 "valid_children": "all"
11855
11856 // Bound functions - you can bind any other function here (using boolean or function)
11857 //"select_node" : true
11858 }
11859 }
11860 },
11861 _fn : {
11862 _types_notify : function (n, data) {
11863 if(data.type && this._get_settings().types.use_data) {
11864 this.set_type(data.type, n);
11865 }
11866 },
11867 _get_type : function (obj) {
11868 obj = this._get_node(obj);
11869 return (!obj || !obj.length) ? false : obj.attr(this._get_settings().types.type_attr) || "default";
11870 },
11871 set_type : function (str, obj) {
11872 obj = this._get_node(obj);
11873 var ret = (!obj.length || !str) ? false : obj.attr(this._get_settings().types.type_attr, str);
11874 if(ret) { this.__callback({ obj : obj, type : str}); }
11875 return ret;
11876 },
11877 _check : function (rule, obj, opts) {
11878 obj = this._get_node(obj);
11879 var v = false, t = this._get_type(obj), d = 0, _this = this, s = this._get_settings().types, data = false;
11880 if(obj === -1) {
11881 if(!!s[rule]) { v = s[rule]; }
11882 else { return; }
11883 }
11884 else {
11885 if(t === false) { return; }
11886 data = s.use_data ? obj.data("jstree") : false;
11887 if(data && data.types && typeof data.types[rule] !== "undefined") { v = data.types[rule]; }
11888 else if(!!s.types[t] && typeof s.types[t][rule] !== "undefined") { v = s.types[t][rule]; }
11889 else if(!!s.types["default"] && typeof s.types["default"][rule] !== "undefined") { v = s.types["default"][rule]; }
11890 }
11891 if($.isFunction(v)) { v = v.call(this, obj); }
11892 if(rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth !== -2 && v !== 0) {
11893 // also include the node itself - otherwise if root node it is not checked
11894 obj.children("a:eq(0)").parentsUntil(".jstree","li").each(function (i) {
11895 // check if current depth already exceeds global tree depth
11896 if(s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) { v = 0; return false; }
11897 d = (i === 0) ? v : _this._check(rule, this, false);
11898 // check if current node max depth is already matched or exceeded
11899 if(d !== -1 && d - (i + 1) <= 0) { v = 0; return false; }
11900 // otherwise - set the max depth to the current value minus current depth
11901 if(d >= 0 && (d - (i + 1) < v || v < 0) ) { v = d - (i + 1); }
11902 // if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited
11903 if(s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0) ) { v = s.max_depth - (i + 1); }
11904 });
11905 }
11906 return v;
11907 },
11908 check_move : function () {
11909 if(!this.__call_old()) { return false; }
11910 var m = this._get_move(),
11911 s = m.rt._get_settings().types,
11912 mc = m.rt._check("max_children", m.cr),
11913 md = m.rt._check("max_depth", m.cr),
11914 vc = m.rt._check("valid_children", m.cr),
11915 ch = 0, d = 1, t;
11916
11917 if(vc === "none") { return false; }
11918 if($.isArray(vc) && m.ot && m.ot._get_type) {
11919 m.o.each(function () {
11920 if($.inArray(m.ot._get_type(this), vc) === -1) { d = false; return false; }
11921 });
11922 if(d === false) { return false; }
11923 }
11924 if(s.max_children !== -2 && mc !== -1) {
11925 ch = m.cr === -1 ? this.get_container().find("> ul > li").not(m.o).length : m.cr.find("> ul > li").not(m.o).length;
11926 if(ch + m.o.length > mc) { return false; }
11927 }
11928 if(s.max_depth !== -2 && md !== -1) {
11929 d = 0;
11930 if(md === 0) { return false; }
11931 if(typeof m.o.d === "undefined") {
11932 // TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node)
11933 t = m.o;
11934 while(t.length > 0) {
11935 t = t.find("> ul > li");
11936 d ++;
11937 }
11938 m.o.d = d;
11939 }
11940 if(md - m.o.d < 0) { return false; }
11941 }
11942 return true;
11943 },
11944 create_node : function (obj, position, js, callback, is_loaded, skip_check) {
11945 if(!skip_check && (is_loaded || this._is_loaded(obj))) {
11946 var p = (typeof position == "string" && position.match(/^before|after$/i) && obj !== -1) ? this._get_parent(obj) : this._get_node(obj),
11947 s = this._get_settings().types,
11948 mc = this._check("max_children", p),
11949 md = this._check("max_depth", p),
11950 vc = this._check("valid_children", p),
11951 ch;
11952 if(typeof js === "string") { js = { data : js }; }
11953 if(!js) { js = {}; }
11954 if(vc === "none") { return false; }
11955 if($.isArray(vc)) {
11956 if(!js.attr || !js.attr[s.type_attr]) {
11957 if(!js.attr) { js.attr = {}; }
11958 js.attr[s.type_attr] = vc[0];
11959 }
11960 else {
11961 if($.inArray(js.attr[s.type_attr], vc) === -1) { return false; }
11962 }
11963 }
11964 if(s.max_children !== -2 && mc !== -1) {
11965 ch = p === -1 ? this.get_container().find("> ul > li").length : p.find("> ul > li").length;
11966 if(ch + 1 > mc) { return false; }
11967 }
11968 if(s.max_depth !== -2 && md !== -1 && (md - 1) < 0) { return false; }
11969 }
11970 return this.__call_old(true, obj, position, js, callback, is_loaded, skip_check);
11971 }
11972 }
11973 });
11974 })(jQuery);
11975 //*/
11976
11977 /*
11978 * jsTree HTML plugin
11979 * The HTML data store. Datastores are build by replacing the `load_node` and `_is_loaded` functions.
11980 */
11981 (function ($) {
11982 $.jstree.plugin("html_data", {
11983 __init : function () {
11984 // this used to use html() and clean the whitespace, but this way any attached data was lost
11985 this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
11986 // remove white space from LI node - otherwise nodes appear a bit to the right
11987 this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();
11988 },
11989 defaults : {
11990 data : false,
11991 ajax : false,
11992 correct_state : true
11993 },
11994 _fn : {
11995 load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
11996 _is_loaded : function (obj) {
11997 obj = this._get_node(obj);
11998 return obj == -1 || !obj || (!this._get_settings().html_data.ajax && !$.isFunction(this._get_settings().html_data.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
11999 },
12000 load_node_html : function (obj, s_call, e_call) {
12001 var d,
12002 s = this.get_settings().html_data,
12003 error_func = function () {},
12004 success_func = function () {};
12005 obj = this._get_node(obj);
12006 if(obj && obj !== -1) {
12007 if(obj.data("jstree_is_loading")) { return; }
12008 else { obj.data("jstree_is_loading",true); }
12009 }
12010 switch(!0) {
12011 case ($.isFunction(s.data)):
12012 s.data.call(this, obj, $.proxy(function (d) {
12013 if(d && d !== "" && d.toString && d.toString().replace(/^[\s\n]+$/,"") !== "") {
12014 d = $(d);
12015 if(!d.is("ul")) { d = $("<ul />").append(d); }
12016 if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
12017 else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
12018 this.clean_node(obj);
12019 if(s_call) { s_call.call(this); }
12020 }
12021 else {
12022 if(obj && obj !== -1) {
12023 obj.children("a.jstree-loading").removeClass("jstree-loading");
12024 obj.removeData("jstree_is_loading");
12025 if(s.correct_state) {
12026 this.correct_state(obj);
12027 if(s_call) { s_call.call(this); }
12028 }
12029 }
12030 else {
12031 if(s.correct_state) {
12032 this.get_container().children("ul").empty();
12033 if(s_call) { s_call.call(this); }
12034 }
12035 }
12036 }
12037 }, this));
12038 break;
12039 case (!s.data && !s.ajax):
12040 if(!obj || obj == -1) {
12041 this.get_container()
12042 .children("ul").empty()
12043 .append(this.data.html_data.original_container_html)
12044 .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
12045 .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
12046 this.clean_node();
12047 }
12048 if(s_call) { s_call.call(this); }
12049 break;
12050 case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
12051 if(!obj || obj == -1) {
12052 d = $(s.data);
12053 if(!d.is("ul")) { d = $("<ul />").append(d); }
12054 this.get_container()
12055 .children("ul").empty().append(d.children())
12056 .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end()
12057 .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
12058 this.clean_node();
12059 }
12060 if(s_call) { s_call.call(this); }
12061 break;
12062 case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
12063 obj = this._get_node(obj);
12064 error_func = function (x, t, e) {
12065 var ef = this.get_settings().html_data.ajax.error;
12066 if(ef) { ef.call(this, x, t, e); }
12067 if(obj != -1 && obj.length) {
12068 obj.children("a.jstree-loading").removeClass("jstree-loading");
12069 obj.removeData("jstree_is_loading");
12070 if(t === "success" && s.correct_state) { this.correct_state(obj); }
12071 }
12072 else {
12073 if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
12074 }
12075 if(e_call) { e_call.call(this); }
12076 };
12077 success_func = function (d, t, x) {
12078 var sf = this.get_settings().html_data.ajax.success;
12079 if(sf) { d = sf.call(this,d,t,x) || d; }
12080 if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
12081 return error_func.call(this, x, t, "");
12082 }
12083 if(d) {
12084 d = $(d);
12085 if(!d.is("ul")) { d = $("<ul />").append(d); }
12086 if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
12087 else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
12088 this.clean_node(obj);
12089 if(s_call) { s_call.call(this); }
12090 }
12091 else {
12092 if(obj && obj !== -1) {
12093 obj.children("a.jstree-loading").removeClass("jstree-loading");
12094 obj.removeData("jstree_is_loading");
12095 if(s.correct_state) {
12096 this.correct_state(obj);
12097 if(s_call) { s_call.call(this); }
12098 }
12099 }
12100 else {
12101 if(s.correct_state) {
12102 this.get_container().children("ul").empty();
12103 if(s_call) { s_call.call(this); }
12104 }
12105 }
12106 }
12107 };
12108 s.ajax.context = this;
12109 s.ajax.error = error_func;
12110 s.ajax.success = success_func;
12111 if(!s.ajax.dataType) { s.ajax.dataType = "html"; }
12112 if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
12113 if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
12114 $.ajax(s.ajax);
12115 break;
12116 }
12117 }
12118 }
12119 });
12120 // include the HTML data plugin by default
12121 $.jstree.defaults.plugins.push("html_data");
12122 })(jQuery);
12123 //*/
12124
12125 /*
12126 * jsTree themeroller plugin
12127 * Adds support for jQuery UI themes. Include this at the end of your plugins list, also make sure "themes" is not included.
12128 */
12129 (function ($) {
12130 $.jstree.plugin("themeroller", {
12131 __init : function () {
12132 var s = this._get_settings().themeroller;
12133 this.get_container()
12134 .addClass("ui-widget-content")
12135 .addClass("jstree-themeroller")
12136 .delegate("a","mouseenter.jstree", function (e) {
12137 if(!$(e.currentTarget).hasClass("jstree-loading")) {
12138 $(this).addClass(s.item_h);
12139 }
12140 })
12141 .delegate("a","mouseleave.jstree", function () {
12142 $(this).removeClass(s.item_h);
12143 })
12144 .bind("init.jstree", $.proxy(function (e, data) {
12145 data.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");
12146 this._themeroller(data.inst.get_container().find("> ul > li"));
12147 }, this))
12148 .bind("open_node.jstree create_node.jstree", $.proxy(function (e, data) {
12149 this._themeroller(data.rslt.obj);
12150 }, this))
12151 .bind("loaded.jstree refresh.jstree", $.proxy(function (e) {
12152 this._themeroller();
12153 }, this))
12154 .bind("close_node.jstree", $.proxy(function (e, data) {
12155 this._themeroller(data.rslt.obj);
12156 }, this))
12157 .bind("delete_node.jstree", $.proxy(function (e, data) {
12158 this._themeroller(data.rslt.parent);
12159 }, this))
12160 .bind("correct_state.jstree", $.proxy(function (e, data) {
12161 data.rslt.obj
12162 .children("ins.jstree-icon").removeClass(s.opened + " " + s.closed + " ui-icon").end()
12163 .find("> a > ins.ui-icon")
12164 .filter(function() {
12165 return this.className.toString()
12166 .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
12167 .indexOf("ui-icon-") === -1;
12168 }).removeClass(s.item_open + " " + s.item_clsd).addClass(s.item_leaf || "jstree-no-icon");
12169 }, this))
12170 .bind("select_node.jstree", $.proxy(function (e, data) {
12171 data.rslt.obj.children("a").addClass(s.item_a);
12172 }, this))
12173 .bind("deselect_node.jstree deselect_all.jstree", $.proxy(function (e, data) {
12174 this.get_container()
12175 .find("a." + s.item_a).removeClass(s.item_a).end()
12176 .find("a.jstree-clicked").addClass(s.item_a);
12177 }, this))
12178 .bind("dehover_node.jstree", $.proxy(function (e, data) {
12179 data.rslt.obj.children("a").removeClass(s.item_h);
12180 }, this))
12181 .bind("hover_node.jstree", $.proxy(function (e, data) {
12182 this.get_container()
12183 .find("a." + s.item_h).not(data.rslt.obj).removeClass(s.item_h);
12184 data.rslt.obj.children("a").addClass(s.item_h);
12185 }, this))
12186 .bind("move_node.jstree", $.proxy(function (e, data) {
12187 this._themeroller(data.rslt.o);
12188 this._themeroller(data.rslt.op);
12189 }, this));
12190 },
12191 __destroy : function () {
12192 var s = this._get_settings().themeroller,
12193 c = [ "ui-icon" ];
12194 $.each(s, function (i, v) {
12195 v = v.split(" ");
12196 if(v.length) { c = c.concat(v); }
12197 });
12198 this.get_container()
12199 .removeClass("ui-widget-content")
12200 .find("." + c.join(", .")).removeClass(c.join(" "));
12201 },
12202 _fn : {
12203 _themeroller : function (obj) {
12204 var s = this._get_settings().themeroller;
12205 obj = !obj || obj == -1 ? this.get_container_ul() : this._get_node(obj).parent();
12206 obj
12207 .find("li.jstree-closed")
12208 .children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
12209 .children("a").addClass(s.item)
12210 .children("ins.jstree-icon").addClass("ui-icon")
12211 .filter(function() {
12212 return this.className.toString()
12213 .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
12214 .indexOf("ui-icon-") === -1;
12215 }).removeClass(s.item_leaf + " " + s.item_open).addClass(s.item_clsd || "jstree-no-icon")
12216 .end()
12217 .end()
12218 .end()
12219 .end()
12220 .find("li.jstree-open")
12221 .children("ins.jstree-icon").removeClass(s.closed).addClass("ui-icon " + s.opened).end()
12222 .children("a").addClass(s.item)
12223 .children("ins.jstree-icon").addClass("ui-icon")
12224 .filter(function() {
12225 return this.className.toString()
12226 .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
12227 .indexOf("ui-icon-") === -1;
12228 }).removeClass(s.item_leaf + " " + s.item_clsd).addClass(s.item_open || "jstree-no-icon")
12229 .end()
12230 .end()
12231 .end()
12232 .end()
12233 .find("li.jstree-leaf")
12234 .children("ins.jstree-icon").removeClass(s.closed + " ui-icon " + s.opened).end()
12235 .children("a").addClass(s.item)
12236 .children("ins.jstree-icon").addClass("ui-icon")
12237 .filter(function() {
12238 return this.className.toString()
12239 .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
12240 .indexOf("ui-icon-") === -1;
12241 }).removeClass(s.item_clsd + " " + s.item_open).addClass(s.item_leaf || "jstree-no-icon");
12242 }
12243 },
12244 defaults : {
12245 "opened" : "ui-icon-triangle-1-se",
12246 "closed" : "ui-icon-triangle-1-e",
12247 "item" : "ui-state-default",
12248 "item_h" : "ui-state-hover",
12249 "item_a" : "ui-state-active",
12250 "item_open" : "ui-icon-folder-open",
12251 "item_clsd" : "ui-icon-folder-collapsed",
12252 "item_leaf" : "ui-icon-document"
12253 }
12254 });
12255 $(function() {
12256 var css_string = '' +
12257 '.jstree-themeroller .ui-icon { overflow:visible; } ' +
12258 '.jstree-themeroller a { padding:0 2px; } ' +
12259 '.jstree-themeroller .jstree-no-icon { display:none; }';
12260 $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
12261 });
12262 })(jQuery);
12263 //*/
12264
12265 /*
12266 * jsTree unique plugin
12267 * Forces different names amongst siblings (still a bit experimental)
12268 * NOTE: does not check language versions (it will not be possible to have nodes with the same title, even in different languages)
12269 */
12270 (function ($) {
12271 $.jstree.plugin("unique", {
12272 __init : function () {
12273 this.get_container()
12274 .bind("before.jstree", $.proxy(function (e, data) {
12275 var nms = [], res = true, p, t;
12276 if(data.func == "move_node") {
12277 // obj, ref, position, is_copy, is_prepared, skip_check
12278 if(data.args[4] === true) {
12279 if(data.args[0].o && data.args[0].o.length) {
12280 data.args[0].o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
12281 res = this._check_unique(nms, data.args[0].np.find("> ul > li").not(data.args[0].o), "move_node");
12282 }
12283 }
12284 }
12285 if(data.func == "create_node") {
12286 // obj, position, js, callback, is_loaded
12287 if(data.args[4] || this._is_loaded(data.args[0])) {
12288 p = this._get_node(data.args[0]);
12289 if(data.args[1] && (data.args[1] === "before" || data.args[1] === "after")) {
12290 p = this._get_parent(data.args[0]);
12291 if(!p || p === -1) { p = this.get_container(); }
12292 }
12293 if(typeof data.args[2] === "string") { nms.push(data.args[2]); }
12294 else if(!data.args[2] || !data.args[2].data) { nms.push(this._get_string("new_node")); }
12295 else { nms.push(data.args[2].data); }
12296 res = this._check_unique(nms, p.find("> ul > li"), "create_node");
12297 }
12298 }
12299 if(data.func == "rename_node") {
12300 // obj, val
12301 nms.push(data.args[1]);
12302 t = this._get_node(data.args[0]);
12303 p = this._get_parent(t);
12304 if(!p || p === -1) { p = this.get_container(); }
12305 res = this._check_unique(nms, p.find("> ul > li").not(t), "rename_node");
12306 }
12307 if(!res) {
12308 e.stopPropagation();
12309 return false;
12310 }
12311 }, this));
12312 },
12313 defaults : {
12314 error_callback : $.noop
12315 },
12316 _fn : {
12317 _check_unique : function (nms, p, func) {
12318 var cnms = [];
12319 p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
12320 if(!cnms.length || !nms.length) { return true; }
12321 cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
12322 if((cnms.length + nms.length) != cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length) {
12323 this._get_settings().unique.error_callback.call(null, nms, p, func);
12324 return false;
12325 }
12326 return true;
12327 },
12328 check_move : function () {
12329 if(!this.__call_old()) { return false; }
12330 var p = this._get_move(), nms = [];
12331 if(p.o && p.o.length) {
12332 p.o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
12333 return this._check_unique(nms, p.np.find("> ul > li").not(p.o), "check_move");
12334 }
12335 return true;
12336 }
12337 }
12338 });
12339 })(jQuery);
12340 //*/
12341
12342 /*
12343 * jsTree wholerow plugin
12344 * Makes select and hover work on the entire width of the node
12345 * MAY BE HEAVY IN LARGE DOM
12346 */
12347 (function ($) {
12348 $.jstree.plugin("wholerow", {
12349 __init : function () {
12350 if(!this.data.ui) { throw "jsTree wholerow: jsTree UI plugin not included."; }
12351 this.data.wholerow.html = false;
12352 this.data.wholerow.to = false;
12353 this.get_container()
12354 .bind("init.jstree", $.proxy(function (e, data) {
12355 this._get_settings().core.animation = 0;
12356 }, this))
12357 .bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree", $.proxy(function (e, data) {
12358 this._prepare_wholerow_span( data && data.rslt && data.rslt.obj ? data.rslt.obj : -1 );
12359 }, this))
12360 .bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree", $.proxy(function (e, data) {
12361 if(this.data.to) { clearTimeout(this.data.to); }
12362 this.data.to = setTimeout( (function (t, o) { return function() { t._prepare_wholerow_ul(o); }; })(this, data && data.rslt && data.rslt.obj ? data.rslt.obj : -1), 0);
12363 }, this))
12364 .bind("deselect_all.jstree", $.proxy(function (e, data) {
12365 this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked " + (this.data.themeroller ? this._get_settings().themeroller.item_a : "" ));
12366 }, this))
12367 .bind("select_node.jstree deselect_node.jstree ", $.proxy(function (e, data) {
12368 data.rslt.obj.each(function () {
12369 var ref = data.inst.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt((($(this).offset().top - data.inst.get_container().offset().top + data.inst.get_container()[0].scrollTop) / data.inst.data.core.li_height),10)) + ")");
12370 // ref.children("a")[e.type === "select_node" ? "addClass" : "removeClass"]("jstree-clicked");
12371 ref.children("a").attr("class",data.rslt.obj.children("a").attr("class"));
12372 });
12373 }, this))
12374 .bind("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) {
12375 this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered " + (this.data.themeroller ? this._get_settings().themeroller.item_h : "" ));
12376 if(e.type === "hover_node") {
12377 var ref = this.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt(((data.rslt.obj.offset().top - this.get_container().offset().top + this.get_container()[0].scrollTop) / this.data.core.li_height),10)) + ")");
12378 // ref.children("a").addClass("jstree-hovered");
12379 ref.children("a").attr("class",data.rslt.obj.children(".jstree-hovered").attr("class"));
12380 }
12381 }, this))
12382 .delegate(".jstree-wholerow-span, ins.jstree-icon, li", "click.jstree", function (e) {
12383 var n = $(e.currentTarget);
12384 if(e.target.tagName === "A" || (e.target.tagName === "INS" && n.closest("li").is(".jstree-open, .jstree-closed"))) { return; }
12385 n.closest("li").children("a:visible:eq(0)").click();
12386 e.stopImmediatePropagation();
12387 })
12388 .delegate("li", "mouseover.jstree", $.proxy(function (e) {
12389 e.stopImmediatePropagation();
12390 if($(e.currentTarget).children(".jstree-hovered, .jstree-clicked").length) { return false; }
12391 this.hover_node(e.currentTarget);
12392 return false;
12393 }, this))
12394 .delegate("li", "mouseleave.jstree", $.proxy(function (e) {
12395 if($(e.currentTarget).children("a").hasClass("jstree-hovered").length) { return; }
12396 this.dehover_node(e.currentTarget);
12397 }, this));
12398 if(is_ie7 || is_ie6) {
12399 $.vakata.css.add_sheet({ str : ".jstree-" + this.get_index() + " { position:relative; } ", title : "jstree" });
12400 }
12401 },
12402 defaults : {
12403 },
12404 __destroy : function () {
12405 this.get_container().children(".jstree-wholerow").remove();
12406 this.get_container().find(".jstree-wholerow-span").remove();
12407 },
12408 _fn : {
12409 _prepare_wholerow_span : function (obj) {
12410 obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
12411 if(obj === false) { return; } // added for removing root nodes
12412 obj.each(function () {
12413 $(this).find("li").andSelf().each(function () {
12414 var $t = $(this);
12415 if($t.children(".jstree-wholerow-span").length) { return true; }
12416 $t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'>&#160;</span>");
12417 });
12418 });
12419 },
12420 _prepare_wholerow_ul : function () {
12421 var o = this.get_container().children("ul").eq(0), h = o.html();
12422 o.addClass("jstree-wholerow-real");
12423 if(this.data.wholerow.last_html !== h) {
12424 this.data.wholerow.last_html = h;
12425 this.get_container().children(".jstree-wholerow").remove();
12426 this.get_container().append(
12427 o.clone().removeClass("jstree-wholerow-real")
12428 .wrapAll("<div class='jstree-wholerow' />").parent()
12429 .width(o.parent()[0].scrollWidth)
12430 .css("top", (o.height() + ( is_ie7 ? 5 : 0)) * -1 )
12431 .find("li[id]").each(function () { this.removeAttribute("id"); }).end()
12432 );
12433 }
12434 }
12435 }
12436 });
12437 $(function() {
12438 var css_string = '' +
12439 '.jstree .jstree-wholerow-real { position:relative; z-index:1; } ' +
12440 '.jstree .jstree-wholerow-real li { cursor:pointer; } ' +
12441 '.jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } ' +
12442 '.jstree .jstree-wholerow { position:relative; z-index:0; height:0; } ' +
12443 '.jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } ' +
12444 '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } ' +
12445 '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }' +
12446 '.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }' +
12447 '.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } ' +
12448 '.jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }';
12449 if(is_ff2) {
12450 css_string += '' +
12451 '.jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } ' +
12452 '.jstree .jstree-wholerow-real a { border-color:transparent !important; } ';
12453 }
12454 if(is_ie7 || is_ie6) {
12455 css_string += '' +
12456 '.jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } ' +
12457 '.jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } ';
12458 }
12459 $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
12460 });
12461 })(jQuery);
12462 //*/
12463
12464 /*
12465 * jsTree model plugin
12466 * This plugin gets jstree to use a class model to retrieve data, creating great dynamism
12467 */
12468 (function ($) {
12469 var nodeInterface = ["getChildren","getChildrenCount","getAttr","getName","getProps"],
12470 validateInterface = function(obj, inter) {
12471 var valid = true;
12472 obj = obj || {};
12473 inter = [].concat(inter);
12474 $.each(inter, function (i, v) {
12475 if(!$.isFunction(obj[v])) { valid = false; return false; }
12476 });
12477 return valid;
12478 };
12479 $.jstree.plugin("model", {
12480 __init : function () {
12481 if(!this.data.json_data) { throw "jsTree model: jsTree json_data plugin not included."; }
12482 this._get_settings().json_data.data = function (n, b) {
12483 var obj = (n == -1) ? this._get_settings().model.object : n.data("jstree_model");
12484 if(!validateInterface(obj, nodeInterface)) { return b.call(null, false); }
12485 if(this._get_settings().model.async) {
12486 obj.getChildren($.proxy(function (data) {
12487 this.model_done(data, b);
12488 }, this));
12489 }
12490 else {
12491 this.model_done(obj.getChildren(), b);
12492 }
12493 };
12494 },
12495 defaults : {
12496 object : false,
12497 id_prefix : false,
12498 async : false
12499 },
12500 _fn : {
12501 model_done : function (data, callback) {
12502 var ret = [],
12503 s = this._get_settings(),
12504 _this = this;
12505
12506 if(!$.isArray(data)) { data = [data]; }
12507 $.each(data, function (i, nd) {
12508 var r = nd.getProps() || {};
12509 r.attr = nd.getAttr() || {};
12510 if(nd.getChildrenCount()) { r.state = "closed"; }
12511 r.data = nd.getName();
12512 if(!$.isArray(r.data)) { r.data = [r.data]; }
12513 if(_this.data.types && $.isFunction(nd.getType)) {
12514 r.attr[s.types.type_attr] = nd.getType();
12515 }
12516 if(r.attr.id && s.model.id_prefix) { r.attr.id = s.model.id_prefix + r.attr.id; }
12517 if(!r.metadata) { r.metadata = { }; }
12518 r.metadata.jstree_model = nd;
12519 ret.push(r);
12520 });
12521 callback.call(null, ret);
12522 }
12523 }
12524 });
12525 })(jQuery);
12526 //*/
12527
12528 })();
12534 if( !ultimix )
12535 {
12536 ultimix = {};
12537 }
12538
12544 if( !ultimix.jstree )
12545 {
12546 ultimix.jstree = {};
12547 }
12548
12558 ultimix.jstree.CreateNodeEventHandler = function( e , Data )
12559 {
12560 var RootId = jQuery( Data.rslt.parent ).attr( 'id' ).replace( 'phtml_' , '' );
12561
12562 ultimix.ajax_gate.DirectController(
12563 {
12564 'package_name' : 'category::category_controller' ,
12565 'create_category' : 1 ,
12566 'category_action' : 'create_record' ,
12567 'root_id' : RootId ,
12568 'title' : Data.rslt.name ,
12569 'category_name' : 'category_name'
12570 } ,
12571 function( Result )
12572 {
12573 /* parsing result */
12574 eval( "Result = " + Result + ";" );
12575 jQuery( Data.rslt.obj ).attr( 'id' , 'phtml_' + Result.id );
12576 }
12577 );
12578 }
12579
12589 ultimix.jstree.RenameNodeEventHandler = function( e , Data )
12590 {
12591 var NodeId = jQuery( Data.rslt.obj ).attr( 'id' ).replace( 'phtml_' , '' );
12592
12593 ultimix.ajax_gate.DirectController(
12594 {
12595 'package_name' : 'category::category_controller' ,
12596 'update_category' : 1 ,
12597 'category_action' : 'update_category_title' ,
12598 'category_id' : NodeId ,
12599 'title' : Data.rslt.new_name
12600 }
12601 );
12602 }
12603
12613 ultimix.jstree.RemoveNodeEventHandler = function( e , Data )
12614 {
12615 for( var i = 0 ; i < Data.rslt.obj.length ; i++ )
12616 {
12617 var NodeId = jQuery( Data.rslt.obj[ i ] ).attr( 'id' ).replace( 'phtml_' , '' );
12618
12619 ultimix.ajax_gate.DirectController(
12620 {
12621 'package_name' : 'category::category_controller' ,
12622 'delete_category' : 1 ,
12623 'category_action' : 'delete_record' ,
12624 'category_record_id' : NodeId
12625 }
12626 );
12627 }
12628 }
12629
12635 ultimix.jstree.CreateItem = function()
12636 {
12637 var Tree = jQuery.jstree._focused();
12638 var Node = Tree.get_selected();
12639
12640 if( Node.length )
12641 {
12642 Tree.create( Node , 'last' , ultimix.get_string( 'tree_new_item' ) );
12643 }
12644 else
12645 {
12646 ultimix.std_dialogs.MessageBox(
12647 ultimix.get_string( 'select_tree_node_first' ) , ultimix.get_string( 'Error' ) ,
12648 ultimix.std_dialogs.MB_OK | ultimix.std_dialogs.MB_ICONERROR | ultimix.std_dialogs.MB_MODAL
12649 );
12650 }
12651 }
12652
12658 ultimix.jstree.RenameItem = function()
12659 {
12660 var Tree = jQuery.jstree._focused();
12661 var Node = Tree.get_selected();
12662
12663 if( Node.length )
12664 {
12665 Tree.rename();
12666 }
12667 else
12668 {
12669 ultimix.std_dialogs.MessageBox(
12670 ultimix.get_string( 'select_tree_node_first' ) , ultimix.get_string( 'Error' ) ,
12671 ultimix.std_dialogs.MB_OK | ultimix.std_dialogs.MB_ICONERROR | ultimix.std_dialogs.MB_MODAL
12672 );
12673 }
12674 }
12675
12683 ultimix.jstree.MoveUpForSelected = function( Tree )
12684 {
12685 /* move children elements upper */
12686 var SelectedNodes = Tree.get_selected();
12687
12688 for( var i = 0 ; i < SelectedNodes.length ; i++ )
12689 {
12690 var Children = Tree._get_children( SelectedNodes[ i ] );
12691
12692 if( Children.length )
12693 {
12694 Tree.move_node( Children , SelectedNodes[ i ] , 'after' );
12695 }
12696 }
12697 }
12698
12706 ultimix.jstree.ShowRemoveItemDialog = function( ConfirmString )
12707 {
12708 if( ConfirmString == '' )
12709 {
12710 ConfirmString = 'shure_to_delete_tree_item';
12711 }
12712
12713 ultimix.std_dialogs.MessageBox(
12714 ultimix.get_string( ConfirmString ) ,
12715 ultimix.get_string( 'Question' ) ,
12716 ultimix.std_dialogs.MB_YESNO | ultimix.std_dialogs.MB_ICONQUESTION | ultimix.std_dialogs.MB_MODAL ,
12717 function( Result )
12718 {
12719 if( Result == ultimix.std_dialogs.MB_YES )
12720 {
12721 var Tree = jQuery.jstree._focused();
12722
12723 ultimix.jstree.MoveUpForSelected( Tree );
12724
12725 Tree.remove();
12726 }
12727 }
12728 );
12729 }
12730
12738 ultimix.jstree.RemoveItem = function( ConfirmString )
12739 {
12740 var Tree = jQuery.jstree._focused();
12741 var Node = Tree.get_selected();
12742 var ErrMsg = '';
12743 if( jQuery( Node ).attr( 'rel' ) == 'root' )
12744 {
12745 ErrMsg = ultimix.get_string( 'cant_delete_root_node' );
12746 }
12747 if( Node.length == 0 )
12748 {
12749 ErrMsg = ultimix.get_string( 'select_tree_node_first' );
12750 }
12751 if( ErrMsg != '' )
12752 {
12753 ultimix.std_dialogs.MessageBox(
12754 ErrMsg , ultimix.get_string( 'Error' ) ,
12755 ultimix.std_dialogs.MB_OK | ultimix.std_dialogs.MB_ICONERROR | ultimix.std_dialogs.MB_MODAL
12756 );
12757 return;
12758 }
12759
12760 ultimix.jstree.ShowRemoveItemDialog( ConfirmString );
12761 }
12762
12763 jQuery(
12764 function()
12765 {
12766 jQuery( ".tree_control" ).jstree(
12767 {
12768 "plugins" : [ "themes" , "html_data" , "types" , "ui" , "crrm" , "cookies" , "types" ] ,
12769 "themes" : {
12770 "theme" : "classic" ,
12771 "url" : './packages/jstree/res/themes/classic/style.css'
12772 } ,
12773 "types" :
12774 {
12775 "default" :
12776 {
12777 draggable : false ,
12778 }
12779 } ,
12780 "lang" : {
12781 new_node : "New item"
12782 } ,
12783 "core" : {
12784 "initially_open" : [ "thtml_1" ] ,
12785 "strings" : { new_node : "New item" }
12786 } ,
12787 "types" :
12788 {
12789 "valid_children" : [ "not_selectable" ],
12790 "types" :
12791 {
12792 "not_selectable" :
12793 {
12794 "valid_children" : [ "default" ] ,
12795 "hover_node" : false ,
12796 "select_node" : function(){ return( false ); }
12797 } ,
12798 "default" :
12799 {
12800 "valid_children" : [ "default" ]
12801 }
12802 }
12803 }
12804 }
12805 );
12806
12807 jQuery( '.tree_control' ).bind( "create.jstree" , ultimix.jstree.CreateNodeEventHandler );
12808 jQuery( '.tree_control' ).bind( "rename.jstree" , ultimix.jstree.RenameNodeEventHandler );
12809 jQuery( '.tree_control' ).bind( "remove.jstree" , ultimix.jstree.RemoveNodeEventHandler );
12810 }
12811 );
12817 if( !ultimix )
12818 {
12819 ultimix = {};
12820 }
12821
12827 if( !ultimix.jstree )
12828 {
12829 ultimix.jstree = {};
12830 }
12831
12843 ultimix.jstree.ExtractJSTreeNode = function( AcceptorSelector , StatusSelector )
12844 {
12845 var Tree = jQuery.jstree._focused();
12846 var Node = Tree.get_selected();
12847
12848 if( Node.length )
12849 {
12850 var id = jQuery( Node ).attr( 'id' );
12851 id = id.replace( 'phtml_' , '' );
12852
12853 jQuery( AcceptorSelector ).attr( 'value' , id );
12854 jQuery( StatusSelector ).attr( 'value' , Tree.get_text( Node ) );
12855
12856 return( true );
12857 }
12858 else
12859 {
12860 ultimix.std_dialogs.MessageBox(
12861 ultimix.get_string( 'nothing_was_selected' ) , ultimix.get_string( 'Error' ) ,
12862 ultimix.std_dialogs.MB_OK | ultimix.std_dialogs.MB_ICONERROR
12863 );
12864 }
12865 return( false );
12866 }
12867
12868 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'shure_to_delete_tree_item' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'shure_to_delete_tree_item' ] = {};
12869 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'shure_to_delete_tree_item' ][ 'default' ] = 'Вы уверены что хотите удалить выбранный элемент?';
12870 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'nothing_was_selected' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'nothing_was_selected' ] = {};
12871 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'nothing_was_selected' ][ 'default' ] = 'Не выбрано ни одного элемента.';
12872 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'select_tree_node_first' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'select_tree_node_first' ] = {};
12873 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'select_tree_node_first' ][ 'default' ] = 'Сначала выберите какой-нибудь элемент';
12874 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cant_delete_this_item' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cant_delete_this_item' ] = {};
12875 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cant_delete_this_item' ][ 'default' ] = 'Этот элемент нельзя удалить';
12876 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cant_edit_this_item' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cant_edit_this_item' ] = {};
12877 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cant_edit_this_item' ][ 'default' ] = 'Этот элемент нельзя изменить';
12878 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'tree_new_item' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'tree_new_item' ] = {};
12879 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'tree_new_item' ][ 'default' ] = 'Новый элемент';
12880 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cant_delete_root_node' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cant_delete_root_node' ] = {};
12881 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'cant_delete_root_node' ][ 'default' ] = 'Невозможно удалить корневой элемент';
12882
12883 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'root_category' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'root_category' ] = {};
12884 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'root_category' ][ 'default' ] = 'Корневая[nbsp]категория';
12885 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_title' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_title' ] = {};
12886 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_title' ][ 'default' ] = 'Название[nbsp]категории';
12887 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_root_title' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_root_title' ] = {};
12888 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_root_title' ][ 'default' ] = 'Название[nbsp]корневой[nbsp]категории';
12889 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_mask' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_mask' ] = {};
12890 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_mask' ][ 'default' ] = 'Маска';
12891 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_actions' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_actions' ] = {};
12892 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_actions' ][ 'default' ] = 'Действия';
12893 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_delete' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_delete' ] = {};
12894 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_delete' ][ 'default' ] = 'удалить';
12895 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_edit' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_edit' ] = {};
12896 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_edit' ][ 'default' ] = 'редактировать';
12897 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_save' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_save' ] = {};
12898 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_save' ][ 'default' ] = 'сохранить';
12899 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_create' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_create' ] = {};
12900 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_create' ][ 'default' ] = 'создать';
12901 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'shure_to_delete_category' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'shure_to_delete_category' ] = {};
12902 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'shure_to_delete_category' ][ 'default' ] = 'Вы[nbsp]уверены,[nbsp]что[nbsp]хотите[nbsp]удалить[nbsp]категорию?';
12903 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_direct_title' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_direct_title' ] = {};
12904 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_direct_title' ][ 'default' ] = 'Сквозная[nbsp]категория';
12905 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category' ] = {};
12906 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category' ][ 'default' ] = 'Категория';
12907 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'catalogue_is_empty' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'catalogue_is_empty' ] = {};
12908 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'catalogue_is_empty' ][ 'default' ] = 'Каталог пуст';
12909 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'catalogue' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'catalogue' ] = {};
12910 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'catalogue' ][ 'default' ] = 'Каталог';
12911 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_label' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_label' ] = {};
12912 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_label' ][ 'default' ] = 'Категории';
12913 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_manager' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_manager' ] = {};
12914 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_manager' ][ 'default' ] = 'Управление категориями';
12915 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'mask_must_be_filled' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'mask_must_be_filled' ] = {};
12916 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'mask_must_be_filled' ][ 'default' ] = 'Поле "{lang:category_mask}" должно быть заполнено';
12917 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'title_must_be_filled' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'title_must_be_filled' ] = {};
12918 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'title_must_be_filled' ][ 'default' ] = 'Поле "{lang:category_title}" должно быть заполнено';
12919 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_delete_was_completed' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_delete_was_completed' ] = {};
12920 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_delete_was_completed' ][ 'default' ] = 'Удаление выбранных записей было завершено';
12921 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_create_was_completed' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_create_was_completed' ] = {};
12922 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_create_was_completed' ][ 'default' ] = 'Запись была создана';
12923 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_update_was_completed' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_update_was_completed' ] = {};
12924 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_update_was_completed' ][ 'default' ] = 'Редактирование было успешно завершено';
12925 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_selection' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_selection' ] = {};
12926 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_selection' ][ 'default' ] = 'Выбор категории';
12927 if( !ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_name' ] ) ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_name' ] = {};
12928 ultimix.lang.Strings[ ultimix.lang.Locale ][ 'category_name' ][ 'default' ] = 'Локатор';
12929
12935 if( !ultimix )
12936 {
12937 ultimix = {};
12938 }
12939
12961 ultimix.DeleteRecord = function( Selector , Url , Prefix , NotSelectedErrorMessage , ConfirmStrign , Waiting , PackageName , PackageVersion )
12962 {
12963 var CheckBoxSelector = '._' + Prefix + '_item_checkbox';
12964 var DialogBoxSelector;
12965
12966 if( ultimix.grids.RecordSelectedEx( CheckBoxSelector ) == false )
12967 {
12968 ultimix.std_dialogs.MessageBox( NotSelectedErrorMessage , ultimix.get_string( 'Error' ) , ultimix.std_dialogs.MB_OK | ultimix.std_dialogs.MB_ICONERROR | ultimix.std_dialogs.MB_MODAL );
12969 return;
12970 }
12971
12972 if( Waiting )
12973 {
12974 DialogBoxSelector = ultimix.std_dialogs.MessageBox( ultimix.get_string( 'wait_please' ) , ultimix.get_string( 'Info' ) , ultimix.std_dialogs.MB_ICONLOADING | ultimix.std_dialogs.MB_MODAL );
12975 }
12976
12977 var Data;
12978
12979 Data = ultimix.forms.ExtractFormData( jQuery( CheckBoxSelector ).filter( 'input:checked' ) );
12980 Data[ Prefix + '_context_action' ] = 'delete_record';
12981 Data[ Prefix + '_record_id' ] = -1;
12982 Data[ 'package_name' ] = PackageName;
12983 Data[ 'package_version' ] = PackageVersion;
12984 Data[ 'delete_' + Prefix ] = 1;
12985 Data[ 'ajaxed' ] = 1;
12986
12987 ultimix.DirectController(
12988 Data ,
12989 function()
12990 {
12991 jQuery( DialogBoxSelector ).dialog( 'close' );
12992 ultimix.ReloadGrid( Selector , true , Url );
12993 } ,
12994 { 'async' : true }
12995 );
12996 }
12997