lipsiadmin 2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (467) hide show
  1. data/CHANGELOG +90 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README +60 -0
  4. data/Rakefile +90 -0
  5. data/init.rb +1 -0
  6. data/lib/access_control/authentication.rb +105 -0
  7. data/lib/access_control/base.rb +227 -0
  8. data/lib/controller/ext.rb +168 -0
  9. data/lib/controller/lipsiadmin_controller.rb +18 -0
  10. data/lib/controller/pdf_builder.rb +67 -0
  11. data/lib/controller/rescue.rb +72 -0
  12. data/lib/controller/responds_to_parent.rb +56 -0
  13. data/lib/data_base/attachment.rb +351 -0
  14. data/lib/data_base/attachment/attach.rb +515 -0
  15. data/lib/data_base/attachment/geometry.rb +117 -0
  16. data/lib/data_base/attachment/iostream.rb +62 -0
  17. data/lib/data_base/attachment/processor.rb +49 -0
  18. data/lib/data_base/attachment/storage.rb +223 -0
  19. data/lib/data_base/attachment/thumbnail.rb +72 -0
  20. data/lib/data_base/attachment/upfile.rb +45 -0
  21. data/lib/data_base/attachment_table.rb +142 -0
  22. data/lib/data_base/translate_attributes.rb +30 -0
  23. data/lib/data_base/utility_scopes.rb +40 -0
  24. data/lib/data_base/without_table.rb +62 -0
  25. data/lib/generator.rb +114 -0
  26. data/lib/lipsiadmin.rb +77 -0
  27. data/lib/lipsiadmin_tasks.rb +3 -0
  28. data/lib/locale/en.yml +16 -0
  29. data/lib/locale/it.yml +16 -0
  30. data/lib/mailer/exception/exception.html.erb +11 -0
  31. data/lib/mailer/exception_notifier.rb +46 -0
  32. data/lib/mailer/pdf_builder.rb +66 -0
  33. data/lib/utils/html_entities.rb +63 -0
  34. data/lib/utils/literal.rb +20 -0
  35. data/lib/version.rb +9 -0
  36. data/lib/view/helpers/active_record_helper.rb +11 -0
  37. data/lib/view/helpers/backend_helper.rb +132 -0
  38. data/lib/view/helpers/ext/column_model.rb +73 -0
  39. data/lib/view/helpers/ext/component.rb +163 -0
  40. data/lib/view/helpers/ext/configuration.rb +36 -0
  41. data/lib/view/helpers/ext/grid.rb +281 -0
  42. data/lib/view/helpers/ext/store.rb +103 -0
  43. data/lib/view/helpers/ext/templates/grid_functions.js.erb +51 -0
  44. data/lib/view/helpers/ext/tool_bar.rb +40 -0
  45. data/lib/view/helpers/ext_helper.rb +150 -0
  46. data/lib/view/helpers/view_helper.rb +222 -0
  47. data/lipsiadmin_generators/attachment/REMEMBER +21 -0
  48. data/lipsiadmin_generators/attachment/attachment_generator.rb +27 -0
  49. data/lipsiadmin_generators/attachment/templates/migration.rb +14 -0
  50. data/lipsiadmin_generators/attachment/templates/model.rb +4 -0
  51. data/lipsiadmin_generators/backend/REMEMBER +18 -0
  52. data/lipsiadmin_generators/backend/backend_generator.rb +58 -0
  53. data/lipsiadmin_generators/backend/templates/config/config.yml +14 -0
  54. data/lipsiadmin_generators/backend/templates/config/initializers/config.rb +7 -0
  55. data/lipsiadmin_generators/backend/templates/config/initializers/emails.rb +2 -0
  56. data/lipsiadmin_generators/backend/templates/config/initializers/exception_notifier.rb +7 -0
  57. data/lipsiadmin_generators/backend/templates/config/locales/backend/en.yml +204 -0
  58. data/lipsiadmin_generators/backend/templates/config/locales/backend/it.yml +203 -0
  59. data/lipsiadmin_generators/backend/templates/config/locales/frontend/en.yml +5 -0
  60. data/lipsiadmin_generators/backend/templates/config/locales/frontend/it.yml +5 -0
  61. data/lipsiadmin_generators/backend/templates/config/locales/models/en.yml +31 -0
  62. data/lipsiadmin_generators/backend/templates/config/locales/models/it.yml +23 -0
  63. data/lipsiadmin_generators/backend/templates/config/locales/rails/en.yml +148 -0
  64. data/lipsiadmin_generators/backend/templates/config/locales/rails/it.yml +109 -0
  65. data/lipsiadmin_generators/backend/templates/controllers/backend/accounts_controller.rb +53 -0
  66. data/lipsiadmin_generators/backend/templates/controllers/backend/base_controller.rb +8 -0
  67. data/lipsiadmin_generators/backend/templates/controllers/backend/sessions_controller.rb +21 -0
  68. data/lipsiadmin_generators/backend/templates/controllers/backend_controller.rb +2 -0
  69. data/lipsiadmin_generators/backend/templates/controllers/frontend_controller.rb +4 -0
  70. data/lipsiadmin_generators/backend/templates/controllers/javascripts_controller.rb +17 -0
  71. data/lipsiadmin_generators/backend/templates/exceptions/template.html.haml +5 -0
  72. data/lipsiadmin_generators/backend/templates/helpers/backend_helper.rb +2 -0
  73. data/lipsiadmin_generators/backend/templates/helpers/frontend_helper.rb +2 -0
  74. data/lipsiadmin_generators/backend/templates/images/backend/back.gif +0 -0
  75. data/lipsiadmin_generators/backend/templates/images/backend/background.png +0 -0
  76. data/lipsiadmin_generators/backend/templates/images/backend/bg-content.png +0 -0
  77. data/lipsiadmin_generators/backend/templates/images/backend/bg-hd-slate.png +0 -0
  78. data/lipsiadmin_generators/backend/templates/images/backend/bg-hd.png +0 -0
  79. data/lipsiadmin_generators/backend/templates/images/backend/bg-intro.png +0 -0
  80. data/lipsiadmin_generators/backend/templates/images/backend/bg-login.png +0 -0
  81. data/lipsiadmin_generators/backend/templates/images/backend/bg-menu-slate.png +0 -0
  82. data/lipsiadmin_generators/backend/templates/images/backend/bg-menu.png +0 -0
  83. data/lipsiadmin_generators/backend/templates/images/backend/bg.png +0 -0
  84. data/lipsiadmin_generators/backend/templates/images/backend/btn-login.png +0 -0
  85. data/lipsiadmin_generators/backend/templates/images/backend/delete.gif +0 -0
  86. data/lipsiadmin_generators/backend/templates/images/backend/download.gif +0 -0
  87. data/lipsiadmin_generators/backend/templates/images/backend/duplicate.gif +0 -0
  88. data/lipsiadmin_generators/backend/templates/images/backend/edit.gif +0 -0
  89. data/lipsiadmin_generators/backend/templates/images/backend/hd-bg-slate.gif +0 -0
  90. data/lipsiadmin_generators/backend/templates/images/backend/hd-bg.gif +0 -0
  91. data/lipsiadmin_generators/backend/templates/images/backend/it.gif +0 -0
  92. data/lipsiadmin_generators/backend/templates/images/backend/loader.gif +0 -0
  93. data/lipsiadmin_generators/backend/templates/images/backend/logo-loader.png +0 -0
  94. data/lipsiadmin_generators/backend/templates/images/backend/logo-small.png +0 -0
  95. data/lipsiadmin_generators/backend/templates/images/backend/new.gif +0 -0
  96. data/lipsiadmin_generators/backend/templates/images/backend/no-image.png +0 -0
  97. data/lipsiadmin_generators/backend/templates/images/backend/preview.gif +0 -0
  98. data/lipsiadmin_generators/backend/templates/images/backend/print.gif +0 -0
  99. data/lipsiadmin_generators/backend/templates/images/backend/save.gif +0 -0
  100. data/lipsiadmin_generators/backend/templates/images/backend/support.gif +0 -0
  101. data/lipsiadmin_generators/backend/templates/images/backend/us.gif +0 -0
  102. data/lipsiadmin_generators/backend/templates/images/ext/default/box/corners-blue.gif +0 -0
  103. data/lipsiadmin_generators/backend/templates/images/ext/default/box/corners.gif +0 -0
  104. data/lipsiadmin_generators/backend/templates/images/ext/default/box/l-blue.gif +0 -0
  105. data/lipsiadmin_generators/backend/templates/images/ext/default/box/l.gif +0 -0
  106. data/lipsiadmin_generators/backend/templates/images/ext/default/box/r-blue.gif +0 -0
  107. data/lipsiadmin_generators/backend/templates/images/ext/default/box/r.gif +0 -0
  108. data/lipsiadmin_generators/backend/templates/images/ext/default/box/tb-blue.gif +0 -0
  109. data/lipsiadmin_generators/backend/templates/images/ext/default/box/tb-slate.gif +0 -0
  110. data/lipsiadmin_generators/backend/templates/images/ext/default/box/tb.gif +0 -0
  111. data/lipsiadmin_generators/backend/templates/images/ext/default/button/btn-arrow.gif +0 -0
  112. data/lipsiadmin_generators/backend/templates/images/ext/default/button/btn-sprite.gif +0 -0
  113. data/lipsiadmin_generators/backend/templates/images/ext/default/dd/drop-add.gif +0 -0
  114. data/lipsiadmin_generators/backend/templates/images/ext/default/dd/drop-no.gif +0 -0
  115. data/lipsiadmin_generators/backend/templates/images/ext/default/dd/drop-yes.gif +0 -0
  116. data/lipsiadmin_generators/backend/templates/images/ext/default/editor/tb-sprite.gif +0 -0
  117. data/lipsiadmin_generators/backend/templates/images/ext/default/form/clear-trigger.gif +0 -0
  118. data/lipsiadmin_generators/backend/templates/images/ext/default/form/clear-trigger.psd +0 -0
  119. data/lipsiadmin_generators/backend/templates/images/ext/default/form/date-trigger.gif +0 -0
  120. data/lipsiadmin_generators/backend/templates/images/ext/default/form/date-trigger.psd +0 -0
  121. data/lipsiadmin_generators/backend/templates/images/ext/default/form/error-tip-corners.gif +0 -0
  122. data/lipsiadmin_generators/backend/templates/images/ext/default/form/exclamation.gif +0 -0
  123. data/lipsiadmin_generators/backend/templates/images/ext/default/form/search-trigger.gif +0 -0
  124. data/lipsiadmin_generators/backend/templates/images/ext/default/form/search-trigger.psd +0 -0
  125. data/lipsiadmin_generators/backend/templates/images/ext/default/form/text-bg.gif +0 -0
  126. data/lipsiadmin_generators/backend/templates/images/ext/default/form/trigger-tpl.gif +0 -0
  127. data/lipsiadmin_generators/backend/templates/images/ext/default/form/trigger.gif +0 -0
  128. data/lipsiadmin_generators/backend/templates/images/ext/default/form/trigger.psd +0 -0
  129. data/lipsiadmin_generators/backend/templates/images/ext/default/gradient-bg.gif +0 -0
  130. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/Thumbs.db +0 -0
  131. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/arrow-left-white.gif +0 -0
  132. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/arrow-right-white.gif +0 -0
  133. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/col-move-bottom.gif +0 -0
  134. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/col-move-top.gif +0 -0
  135. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/columns.gif +0 -0
  136. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/dirty.gif +0 -0
  137. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/done.gif +0 -0
  138. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/drop-no.gif +0 -0
  139. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/drop-yes.gif +0 -0
  140. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/footer-bg.gif +0 -0
  141. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-blue-hd.gif +0 -0
  142. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-blue-split.gif +0 -0
  143. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-hrow.gif +0 -0
  144. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-loading.gif +0 -0
  145. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-split.gif +0 -0
  146. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-vista-hd.gif +0 -0
  147. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-hd-btn.gif +0 -0
  148. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-hrow-over.gif +0 -0
  149. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-hrow.gif +0 -0
  150. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-special-col-bg.gif +0 -0
  151. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-special-col-sel-bg.gif +0 -0
  152. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/group-by.gif +0 -0
  153. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/group-expand-sprite.gif +0 -0
  154. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hd-pop.gif +0 -0
  155. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-asc.gif +0 -0
  156. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-desc.gif +0 -0
  157. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-lock.gif +0 -0
  158. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-lock.png +0 -0
  159. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-unlock.gif +0 -0
  160. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-unlock.png +0 -0
  161. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/invalid_line.gif +0 -0
  162. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/loading.gif +0 -0
  163. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/mso-hd.gif +0 -0
  164. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/nowait.gif +0 -0
  165. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-first-disabled.gif +0 -0
  166. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-first.gif +0 -0
  167. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-last-disabled.gif +0 -0
  168. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-last.gif +0 -0
  169. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-next-disabled.gif +0 -0
  170. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-next.gif +0 -0
  171. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-prev-disabled.gif +0 -0
  172. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-prev.gif +0 -0
  173. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/pick-button.gif +0 -0
  174. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/refresh.gif +0 -0
  175. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/row-check-sprite.gif +0 -0
  176. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/row-expand-sprite.gif +0 -0
  177. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/row-over.gif +0 -0
  178. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/row-sel.gif +0 -0
  179. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/sort_asc.gif +0 -0
  180. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/sort_desc.gif +0 -0
  181. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/wait.gif +0 -0
  182. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/collapse.gif +0 -0
  183. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/expand.gif +0 -0
  184. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/gradient-bg.gif +0 -0
  185. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/mini-bottom.gif +0 -0
  186. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/mini-left.gif +0 -0
  187. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/mini-right.gif +0 -0
  188. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/mini-top.gif +0 -0
  189. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/ns-collapse.gif +0 -0
  190. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/ns-expand.gif +0 -0
  191. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/panel-close.gif +0 -0
  192. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/panel-title-bg.gif +0 -0
  193. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/panel-title-light-bg.gif +0 -0
  194. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/stick.gif +0 -0
  195. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/stuck.gif +0 -0
  196. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/tab-close-on.gif +0 -0
  197. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/tab-close.gif +0 -0
  198. data/lipsiadmin_generators/backend/templates/images/ext/default/menu/checked.gif +0 -0
  199. data/lipsiadmin_generators/backend/templates/images/ext/default/menu/group-checked.gif +0 -0
  200. data/lipsiadmin_generators/backend/templates/images/ext/default/menu/item-over.gif +0 -0
  201. data/lipsiadmin_generators/backend/templates/images/ext/default/menu/menu-parent.gif +0 -0
  202. data/lipsiadmin_generators/backend/templates/images/ext/default/menu/menu.gif +0 -0
  203. data/lipsiadmin_generators/backend/templates/images/ext/default/menu/unchecked.gif +0 -0
  204. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/corners-sprite.gif +0 -0
  205. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/left-right.gif +0 -0
  206. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/light-hd.gif +0 -0
  207. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/tool-sprite-tpl.gif +0 -0
  208. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/tool-sprites.gif +0 -0
  209. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/tools-sprites-trans.gif +0 -0
  210. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/top-bottom.gif +0 -0
  211. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/top-bottom.png +0 -0
  212. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/white-corners-sprite.gif +0 -0
  213. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/white-left-right.gif +0 -0
  214. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/white-top-bottom.gif +0 -0
  215. data/lipsiadmin_generators/backend/templates/images/ext/default/progress/progress-bg.gif +0 -0
  216. data/lipsiadmin_generators/backend/templates/images/ext/default/qtip/bg.gif +0 -0
  217. data/lipsiadmin_generators/backend/templates/images/ext/default/qtip/close.gif +0 -0
  218. data/lipsiadmin_generators/backend/templates/images/ext/default/qtip/tip-sprite.gif +0 -0
  219. data/lipsiadmin_generators/backend/templates/images/ext/default/s.gif +0 -0
  220. data/lipsiadmin_generators/backend/templates/images/ext/default/shadow-c.png +0 -0
  221. data/lipsiadmin_generators/backend/templates/images/ext/default/shadow-lr.png +0 -0
  222. data/lipsiadmin_generators/backend/templates/images/ext/default/shadow.png +0 -0
  223. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/blue-loading.gif +0 -0
  224. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/calendar.gif +0 -0
  225. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/glass-bg.gif +0 -0
  226. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/hd-sprite.gif +0 -0
  227. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/large-loading.gif +0 -0
  228. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/left-btn.gif +0 -0
  229. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/loading-balls.gif +0 -0
  230. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/right-btn.gif +0 -0
  231. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/warning.gif +0 -0
  232. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/e-handle-dark.gif +0 -0
  233. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/e-handle.gif +0 -0
  234. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/ne-handle-dark.gif +0 -0
  235. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/ne-handle.gif +0 -0
  236. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/nw-handle-dark.gif +0 -0
  237. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/nw-handle.gif +0 -0
  238. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/s-handle-dark.gif +0 -0
  239. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/s-handle.gif +0 -0
  240. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/se-handle-dark.gif +0 -0
  241. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/se-handle.gif +0 -0
  242. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/square.gif +0 -0
  243. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/sw-handle-dark.gif +0 -0
  244. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/sw-handle.gif +0 -0
  245. data/lipsiadmin_generators/backend/templates/images/ext/default/slider/slider-bg.png +0 -0
  246. data/lipsiadmin_generators/backend/templates/images/ext/default/slider/slider-thumb.png +0 -0
  247. data/lipsiadmin_generators/backend/templates/images/ext/default/slider/slider-v-bg.png +0 -0
  248. data/lipsiadmin_generators/backend/templates/images/ext/default/slider/slider-v-thumb.png +0 -0
  249. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/scroll-left.gif +0 -0
  250. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/scroll-right.gif +0 -0
  251. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/scroller-bg.gif +0 -0
  252. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-btm-inactive-left-bg.gif +0 -0
  253. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-btm-inactive-right-bg.gif +0 -0
  254. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-btm-left-bg.gif +0 -0
  255. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-btm-right-bg.gif +0 -0
  256. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-close.gif +0 -0
  257. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-strip-bg.gif +0 -0
  258. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-strip-bg.png +0 -0
  259. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-strip-btm-bg.gif +0 -0
  260. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tabs-sprite.gif +0 -0
  261. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/bg.gif +0 -0
  262. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/btn-arrow-light.gif +0 -0
  263. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/btn-arrow.gif +0 -0
  264. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/btn-over-bg.gif +0 -0
  265. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/gray-bg.gif +0 -0
  266. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/tb-bg.gif +0 -0
  267. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/tb-btn-sprite.gif +0 -0
  268. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/arrows.gif +0 -0
  269. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-add.gif +0 -0
  270. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-between.gif +0 -0
  271. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-no.gif +0 -0
  272. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-over.gif +0 -0
  273. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-under.gif +0 -0
  274. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-yes.gif +0 -0
  275. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end-minus-nl.gif +0 -0
  276. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end-minus.gif +0 -0
  277. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end-plus-nl.gif +0 -0
  278. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end-plus.gif +0 -0
  279. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end.gif +0 -0
  280. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-line.gif +0 -0
  281. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-minus-nl.gif +0 -0
  282. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-minus.gif +0 -0
  283. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-plus-nl.gif +0 -0
  284. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-plus.gif +0 -0
  285. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow.gif +0 -0
  286. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/folder-open.gif +0 -0
  287. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/folder.gif +0 -0
  288. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/leaf.gif +0 -0
  289. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/loading.gif +0 -0
  290. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/s.gif +0 -0
  291. data/lipsiadmin_generators/backend/templates/images/ext/default/window/icon-error.gif +0 -0
  292. data/lipsiadmin_generators/backend/templates/images/ext/default/window/icon-info.gif +0 -0
  293. data/lipsiadmin_generators/backend/templates/images/ext/default/window/icon-question.gif +0 -0
  294. data/lipsiadmin_generators/backend/templates/images/ext/default/window/icon-warning.gif +0 -0
  295. data/lipsiadmin_generators/backend/templates/images/ext/default/window/left-corners.png +0 -0
  296. data/lipsiadmin_generators/backend/templates/images/ext/default/window/left-corners.psd +0 -0
  297. data/lipsiadmin_generators/backend/templates/images/ext/default/window/left-right.png +0 -0
  298. data/lipsiadmin_generators/backend/templates/images/ext/default/window/left-right.psd +0 -0
  299. data/lipsiadmin_generators/backend/templates/images/ext/default/window/right-corners.png +0 -0
  300. data/lipsiadmin_generators/backend/templates/images/ext/default/window/right-corners.psd +0 -0
  301. data/lipsiadmin_generators/backend/templates/images/ext/default/window/top-bottom.png +0 -0
  302. data/lipsiadmin_generators/backend/templates/images/ext/default/window/top-bottom.psd +0 -0
  303. data/lipsiadmin_generators/backend/templates/images/ext/slate/button/btn-arrow.gif +0 -0
  304. data/lipsiadmin_generators/backend/templates/images/ext/slate/button/btn-sprite.gif +0 -0
  305. data/lipsiadmin_generators/backend/templates/images/ext/slate/editor/tb-sprite.gif +0 -0
  306. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/checkbox.gif +0 -0
  307. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/clear-trigger.gif +0 -0
  308. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/date-trigger.gif +0 -0
  309. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/radio.gif +0 -0
  310. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/search-trigger.gif +0 -0
  311. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/trigger-tpl.gif +0 -0
  312. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/trigger.gif +0 -0
  313. data/lipsiadmin_generators/backend/templates/images/ext/slate/gradient-bg.gif +0 -0
  314. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/arrow-left-white.gif +0 -0
  315. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/arrow-right-white.gif +0 -0
  316. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/col-move-bottom.gif +0 -0
  317. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/col-move-top.gif +0 -0
  318. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/footer-bg.gif +0 -0
  319. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-blue-hd.gif +0 -0
  320. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-blue-split.gif +0 -0
  321. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-hrow.gif +0 -0
  322. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-split.gif +0 -0
  323. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-vista-hd.gif +0 -0
  324. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-hd-btn.gif +0 -0
  325. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-hrow-over.gif +0 -0
  326. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-hrow.gif +0 -0
  327. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-special-col-bg.gif +0 -0
  328. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-special-col-sel-bg.gif +0 -0
  329. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/group-expand-sprite.gif +0 -0
  330. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/mso-hd.gif +0 -0
  331. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-first-disabled.gif +0 -0
  332. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-first.gif +0 -0
  333. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-last-disabled.gif +0 -0
  334. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-last.gif +0 -0
  335. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-next-disabled.gif +0 -0
  336. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-next.gif +0 -0
  337. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-prev-disabled.gif +0 -0
  338. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-prev.gif +0 -0
  339. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/refresh.gif +0 -0
  340. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/row-over.gif +0 -0
  341. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/row-sel.gif +0 -0
  342. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/sort_asc.gif +0 -0
  343. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/sort_desc.gif +0 -0
  344. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/checked.gif +0 -0
  345. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/group-checked.gif +0 -0
  346. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/item-over - Copy.gif +0 -0
  347. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/item-over.gif +0 -0
  348. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/menu-parent.gif +0 -0
  349. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/menu.gif +0 -0
  350. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/unchecked.gif +0 -0
  351. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/corners-sprite.gif +0 -0
  352. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/left-right.gif +0 -0
  353. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/light-hd.gif +0 -0
  354. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/tool-sprite-tpl.gif +0 -0
  355. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/tool-sprites.gif +0 -0
  356. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/tools-sprites-trans.gif +0 -0
  357. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/top-bottom.gif +0 -0
  358. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/top-bottom.png +0 -0
  359. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/white-corners-sprite.gif +0 -0
  360. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/white-left-right.gif +0 -0
  361. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/white-top-bottom.gif +0 -0
  362. data/lipsiadmin_generators/backend/templates/images/ext/slate/progress/progress-bg.gif +0 -0
  363. data/lipsiadmin_generators/backend/templates/images/ext/slate/qtip/bg.gif +0 -0
  364. data/lipsiadmin_generators/backend/templates/images/ext/slate/qtip/close.gif +0 -0
  365. data/lipsiadmin_generators/backend/templates/images/ext/slate/qtip/tip-sprite.gif +0 -0
  366. data/lipsiadmin_generators/backend/templates/images/ext/slate/s.gif +0 -0
  367. data/lipsiadmin_generators/backend/templates/images/ext/slate/shared/glass-bg.gif +0 -0
  368. data/lipsiadmin_generators/backend/templates/images/ext/slate/shared/hd-sprite.gif +0 -0
  369. data/lipsiadmin_generators/backend/templates/images/ext/slate/shared/left-btn.gif +0 -0
  370. data/lipsiadmin_generators/backend/templates/images/ext/slate/shared/right-btn.gif +0 -0
  371. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/e-handle-dark.gif +0 -0
  372. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/e-handle.gif +0 -0
  373. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/ne-handle-dark.gif +0 -0
  374. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/ne-handle.gif +0 -0
  375. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/nw-handle-dark.gif +0 -0
  376. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/nw-handle.gif +0 -0
  377. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/s-handle-dark.gif +0 -0
  378. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/s-handle.gif +0 -0
  379. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/se-handle-dark.gif +0 -0
  380. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/se-handle.gif +0 -0
  381. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/square.gif +0 -0
  382. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/sw-handle-dark.gif +0 -0
  383. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/sw-handle.gif +0 -0
  384. data/lipsiadmin_generators/backend/templates/images/ext/slate/slider/slider-bg.png +0 -0
  385. data/lipsiadmin_generators/backend/templates/images/ext/slate/slider/slider-thumb.png +0 -0
  386. data/lipsiadmin_generators/backend/templates/images/ext/slate/slider/slider-v-bg.png +0 -0
  387. data/lipsiadmin_generators/backend/templates/images/ext/slate/slider/slider-v-thumb.png +0 -0
  388. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/scroll-left.gif +0 -0
  389. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/scroll-right.gif +0 -0
  390. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/scroller-bg.gif +0 -0
  391. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-btm-inactive-left-bg.gif +0 -0
  392. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-btm-inactive-right-bg.gif +0 -0
  393. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-btm-left-bg.gif +0 -0
  394. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-btm-right-bg.gif +0 -0
  395. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-close.gif +0 -0
  396. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-strip-bg.gif +0 -0
  397. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-strip-bg.png +0 -0
  398. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-strip-btm-bg.gif +0 -0
  399. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tabs-sprite.gif +0 -0
  400. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/bg-menu.png +0 -0
  401. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/bg.gif +0 -0
  402. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/btn-arrow-light.gif +0 -0
  403. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/btn-arrow.gif +0 -0
  404. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/btn-over-bg.gif +0 -0
  405. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/gray-bg.gif +0 -0
  406. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/tb-bg.gif +0 -0
  407. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/tb-btn-sprite.gif +0 -0
  408. data/lipsiadmin_generators/backend/templates/images/ext/slate/tree/arrows.gif +0 -0
  409. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/icon-error.gif +0 -0
  410. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/icon-info.gif +0 -0
  411. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/icon-question.gif +0 -0
  412. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/icon-warning.gif +0 -0
  413. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/left-corners.png +0 -0
  414. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/left-right.png +0 -0
  415. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/right-corners.png +0 -0
  416. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/top-bottom.png +0 -0
  417. data/lipsiadmin_generators/backend/templates/javascripts/controls.js +3 -0
  418. data/lipsiadmin_generators/backend/templates/javascripts/dragdrop.js +3 -0
  419. data/lipsiadmin_generators/backend/templates/javascripts/effects.js +4 -0
  420. data/lipsiadmin_generators/backend/templates/javascripts/ext.js +76 -0
  421. data/lipsiadmin_generators/backend/templates/javascripts/prototype.js +12 -0
  422. data/lipsiadmin_generators/backend/templates/layouts/backend.html.haml +12 -0
  423. data/lipsiadmin_generators/backend/templates/layouts/frontend.html.haml +7 -0
  424. data/lipsiadmin_generators/backend/templates/migrations/create_accounts.rb +20 -0
  425. data/lipsiadmin_generators/backend/templates/models/account.rb +116 -0
  426. data/lipsiadmin_generators/backend/templates/models/account_access.rb +17 -0
  427. data/lipsiadmin_generators/backend/templates/models/notifier.rb +15 -0
  428. data/lipsiadmin_generators/backend/templates/stylesheets/backend-slate.css +105 -0
  429. data/lipsiadmin_generators/backend/templates/stylesheets/backend.css +74 -0
  430. data/lipsiadmin_generators/backend/templates/stylesheets/ext-slate.css +241 -0
  431. data/lipsiadmin_generators/backend/templates/stylesheets/ext.css +904 -0
  432. data/lipsiadmin_generators/backend/templates/stylesheets/login.css +22 -0
  433. data/lipsiadmin_generators/backend/templates/stylesheets/print.css +11 -0
  434. data/lipsiadmin_generators/backend/templates/stylesheets/standard.css +62 -0
  435. data/lipsiadmin_generators/backend/templates/views/backend/accounts/_form.html.haml +21 -0
  436. data/lipsiadmin_generators/backend/templates/views/backend/accounts/edit.html.haml +3 -0
  437. data/lipsiadmin_generators/backend/templates/views/backend/accounts/index.rjs +16 -0
  438. data/lipsiadmin_generators/backend/templates/views/backend/accounts/new.html.haml +3 -0
  439. data/lipsiadmin_generators/backend/templates/views/backend/base/index.html.haml +17 -0
  440. data/lipsiadmin_generators/backend/templates/views/backend/base/welcome.html.haml +2 -0
  441. data/lipsiadmin_generators/backend/templates/views/backend/sessions/new.html.haml +12 -0
  442. data/lipsiadmin_generators/backend/templates/views/javascripts/backend.js.erb +346 -0
  443. data/lipsiadmin_generators/backend/templates/views/javascripts/locale.js.erb +135 -0
  444. data/lipsiadmin_generators/backend/templates/views/notifier/registration.html.erb +2 -0
  445. data/lipsiadmin_generators/backend/templates/views/notifier/support_request.html.erb +1 -0
  446. data/lipsiadmin_generators/backend_page/REMEMBER +7 -0
  447. data/lipsiadmin_generators/backend_page/backend_page_generator.rb +212 -0
  448. data/lipsiadmin_generators/backend_page/templates/controller.rb +61 -0
  449. data/lipsiadmin_generators/backend_page/templates/form.html.haml +5 -0
  450. data/lipsiadmin_generators/backend_page/templates/form_scaffolding.html.haml +1 -0
  451. data/lipsiadmin_generators/backend_page/templates/functional_test.rb +45 -0
  452. data/lipsiadmin_generators/backend_page/templates/helper.rb +2 -0
  453. data/lipsiadmin_generators/backend_page/templates/view_edit.html.haml +3 -0
  454. data/lipsiadmin_generators/backend_page/templates/view_index.rjs.erb +16 -0
  455. data/lipsiadmin_generators/backend_page/templates/view_new.html.haml +3 -0
  456. data/lipsiadmin_generators/pdf/pdf_generator.rb +50 -0
  457. data/lipsiadmin_generators/pdf/templates/layout.html.erb +18 -0
  458. data/lipsiadmin_generators/pdf/templates/stylesheets/print.css +11 -0
  459. data/lipsiadmin_generators/pdf/templates/view.html.haml +7 -0
  460. data/resources/Pd4Ruby.class +0 -0
  461. data/resources/Pd4Ruby.java +52 -0
  462. data/resources/javascripts/ux.js +1102 -0
  463. data/resources/pd4ml.jar +0 -0
  464. data/resources/rdoc/horo.rb +613 -0
  465. data/resources/ss_css2.jar +0 -0
  466. data/tasks/lipsiadmin_tasks.rake +14 -0
  467. metadata +604 -0
@@ -0,0 +1,3 @@
1
+ if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library")}var Autocompleter={};Autocompleter.Base=Class.create({baseInitialize:function(element,update,options){element=$(element);this.element=element;this.update=$(update);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;this.oldElementValue=this.element.value;if(this.setOptions){this.setOptions(options)}else{this.options=options||{}}this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=this.options.onShow||function(element,update){if(!update.style.position||update.style.position=="absolute"){update.style.position="absolute";Position.clone(element,update,{setHeight:false,offsetTop:element.offsetHeight})}Effect.Appear(update,{duration:0.15})};this.options.onHide=this.options.onHide||function(element,update){new Effect.Fade(update,{duration:0.15})};if(typeof(this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens)}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n")}this.observer=null;this.element.setAttribute("autocomplete","off");Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this))},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update)}if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,"position")=="absolute")){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.update.id+"_iefix")}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),50)}},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix)},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update)}if(this.iefix){Element.hide(this.iefix)}},startIndicator:function(){if(this.options.indicator){Element.show(this.options.indicator)}},stopIndicator:function(){if(this.options.indicator){Element.hide(this.options.indicator)}},onKeyPress:function(event){if(this.active){switch(event.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(event);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(event);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(event);return;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(event);return}}else{if(event.keyCode==Event.KEY_TAB||event.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&event.keyCode==0)){return}}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer)}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices()},onHover:function(event){var element=Event.findElement(event,"LI");if(this.index!=element.autocompleteIndex){this.index=element.autocompleteIndex;this.render()}Event.stop(event)},onClick:function(event){var element=Event.findElement(event,"LI");this.index=element.autocompleteIndex;this.selectEntry();this.hide()},onBlur:function(event){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false},render:function(){if(this.entryCount>0){for(var i=0;i<this.entryCount;i++){this.index==i?Element.addClassName(this.getEntry(i),"selected"):Element.removeClassName(this.getEntry(i),"selected")}if(this.hasFocus){this.show();this.active=true}}else{this.active=false;this.hide()}},markPrevious:function(){if(this.index>0){this.index--}else{this.index=this.entryCount-1}this.getEntry(this.index).scrollIntoView(true)},markNext:function(){if(this.index<this.entryCount-1){this.index++}else{this.index=0}this.getEntry(this.index).scrollIntoView(false)},getEntry:function(index){return this.update.firstChild.childNodes[index]},getCurrentEntry:function(){return this.getEntry(this.index)},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry())},updateElement:function(selectedElement){if(this.options.updateElement){this.options.updateElement(selectedElement);return}var value="";if(this.options.select){var nodes=$(selectedElement).select("."+this.options.select)||[];if(nodes.length>0){value=Element.collectTextNodes(nodes[0],this.options.select)}}else{value=Element.collectTextNodesIgnoreClass(selectedElement,"informal")}var bounds=this.getTokenBounds();if(bounds[0]!=-1){var newValue=this.element.value.substr(0,bounds[0]);var whitespace=this.element.value.substr(bounds[0]).match(/^\s+/);if(whitespace){newValue+=whitespace[0]}this.element.value=newValue+value+this.element.value.substr(bounds[1])}else{this.element.value=value}this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,selectedElement)}},updateChoices:function(choices){if(!this.changed&&this.hasFocus){this.update.innerHTML=choices;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var i=0;i<this.entryCount;i++){var entry=this.getEntry(i);entry.autocompleteIndex=i;this.addObservers(entry)}}else{this.entryCount=0}this.stopIndicator();this.index=0;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide()}else{this.render()}}},addObservers:function(element){Event.observe(element,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(element,"click",this.onClick.bindAsEventListener(this))},onObserverEvent:function(){this.changed=false;this.tokenBounds=null;if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices()}else{this.active=false;this.hide()}this.oldElementValue=this.element.value},getToken:function(){var bounds=this.getTokenBounds();return this.element.value.substring(bounds[0],bounds[1]).strip()},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds}var value=this.element.value;if(value.strip().empty()){return[-1,0]}var diff=arguments.callee.getFirstDifferencePos(value,this.oldElementValue);var offset=(diff==this.oldElementValue.length?1:0);var prevTokenPos=-1,nextTokenPos=value.length;var tp;for(var index=0,l=this.options.tokens.length;index<l;++index){tp=value.lastIndexOf(this.options.tokens[index],diff+offset-1);if(tp>prevTokenPos){prevTokenPos=tp}tp=value.indexOf(this.options.tokens[index],diff+offset);if(-1!=tp&&tp<nextTokenPos){nextTokenPos=tp}}return(this.tokenBounds=[prevTokenPos+1,nextTokenPos])}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(newS,oldS){var boundary=Math.min(newS.length,oldS.length);for(var index=0;index<boundary;++index){if(newS[index]!=oldS[index]){return index}}return boundary};Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(element,update,url,options){this.baseInitialize(element,update,options);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=url},getUpdatedChoices:function(){this.startIndicator();var entry=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,entry):entry;if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams}new Ajax.Request(this.url,this.options)
2
+ },onComplete:function(request){this.updateChoices(request.responseText)}});Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(element,update,array,options){this.baseInitialize(element,update,options);this.options.array=array},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this))},setOptions:function(options){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(instance){var ret=[];var partial=[];var entry=instance.getToken();var count=0;for(var i=0;i<instance.options.array.length&&ret.length<instance.options.choices;i++){var elem=instance.options.array[i];var foundPos=instance.options.ignoreCase?elem.toLowerCase().indexOf(entry.toLowerCase()):elem.indexOf(entry);while(foundPos!=-1){if(foundPos==0&&elem.length!=entry.length){ret.push("<li><strong>"+elem.substr(0,entry.length)+"</strong>"+elem.substr(entry.length)+"</li>");break}else{if(entry.length>=instance.options.partialChars&&instance.options.partialSearch&&foundPos!=-1){if(instance.options.fullSearch||/\s/.test(elem.substr(foundPos-1,1))){partial.push("<li>"+elem.substr(0,foundPos)+"<strong>"+elem.substr(foundPos,entry.length)+"</strong>"+elem.substr(foundPos+entry.length)+"</li>");break}}}foundPos=instance.options.ignoreCase?elem.toLowerCase().indexOf(entry.toLowerCase(),foundPos+1):elem.indexOf(entry,foundPos+1)}}if(partial.length){ret=ret.concat(partial.slice(0,instance.options.choices-ret.length))}return"<ul>"+ret.join("")+"</ul>"}},options||{})}});Field.scrollFreeActivate=function(field){setTimeout(function(){Field.activate(field)},1)};Ajax.InPlaceEditor=Class.create({initialize:function(element,url,options){this.url=url;this.element=element=$(element);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(options);Object.extend(this.options,options||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";if($(this.options.formId)){this.options.formId=""}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl)}if(!this.options.externalControl){this.options.externalControlOnly=false}this._originalBackground=this.element.getStyle("background-color")||"transparent";this.element.title=this.options.clickToEditText;this._boundCancelHandler=this.handleFormCancellation.bind(this);this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);this._boundFailureHandler=this.handleAJAXFailure.bind(this);this._boundSubmitHandler=this.handleFormSubmission.bind(this);this._boundWrapperHandler=this.wrapUp.bind(this);this.registerListeners()},checkForEscapeOrReturn:function(e){if(!this._editing||e.ctrlKey||e.altKey||e.shiftKey){return}if(Event.KEY_ESC==e.keyCode){this.handleFormCancellation(e)}else{if(Event.KEY_RETURN==e.keyCode){this.handleFormSubmission(e)}}},createControl:function(mode,handler,extraClasses){var control=this.options[mode+"Control"];var text=this.options[mode+"Text"];if("button"==control){var btn=document.createElement("input");btn.type="submit";btn.value=text;btn.className="editor_"+mode+"_button";if("cancel"==mode){btn.onclick=this._boundCancelHandler}this._form.appendChild(btn);this._controls[mode]=btn}else{if("link"==control){var link=document.createElement("a");link.href="#";link.appendChild(document.createTextNode(text));link.onclick="cancel"==mode?this._boundCancelHandler:this._boundSubmitHandler;link.className="editor_"+mode+"_link";if(extraClasses){link.className+=" "+extraClasses}this._form.appendChild(link);this._controls[mode]=link}}},createEditField:function(){var text=(this.options.loadTextURL?this.options.loadingText:this.getText());var fld;if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){fld=document.createElement("input");fld.type="text";var size=this.options.size||this.options.cols||0;if(0<size){fld.size=size}}else{fld=document.createElement("textarea");fld.rows=(1>=this.options.rows?this.options.autoRows:this.options.rows);fld.cols=this.options.cols||40}fld.name=this.options.paramName;fld.value=text;fld.className="editor_field";if(this.options.submitOnBlur){fld.onblur=this._boundSubmitHandler}this._controls.editor=fld;if(this.options.loadTextURL){this.loadExternalText()}this._form.appendChild(this._controls.editor)},createForm:function(){var ipe=this;function addText(mode,condition){var text=ipe.options["text"+mode+"Controls"];if(!text||condition===false){return}ipe._form.appendChild(document.createTextNode(text))}this._form=$(document.createElement("form"));this._form.id=this.options.formId;this._form.addClassName(this.options.formClassName);this._form.onsubmit=this._boundSubmitHandler;this.createEditField();if("textarea"==this._controls.editor.tagName.toLowerCase()){this._form.appendChild(document.createElement("br"))}if(this.options.onFormCustomization){this.options.onFormCustomization(this,this._form)}addText("Before",this.options.okControl||this.options.cancelControl);this.createControl("ok",this._boundSubmitHandler);addText("Between",this.options.okControl&&this.options.cancelControl);this.createControl("cancel",this._boundCancelHandler,"editor_cancel");addText("After",this.options.okControl||this.options.cancelControl)},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML}this.leaveEditMode();this.unregisterListeners()},enterEditMode:function(e){if(this._saving||this._editing){return}this._editing=true;this.triggerCallback("onEnterEditMode");if(this.options.externalControl){this.options.externalControl.hide()}this.element.hide();this.createForm();this.element.parentNode.insertBefore(this._form,this.element);if(!this.options.loadTextURL){this.postProcessEditField()}if(e){Event.stop(e)}},enterHover:function(e){if(this.options.hoverClassName){this.element.addClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onEnterHover")},getText:function(){return this.element.innerHTML.unescapeHTML()},handleAJAXFailure:function(transport){this.triggerCallback("onFailure",transport);if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;this._oldInnerHTML=null}},handleFormCancellation:function(e){this.wrapUp();if(e){Event.stop(e)}},handleFormSubmission:function(e){var form=this._form;var value=$F(this._controls.editor);this.prepareSubmission();var params=this.options.callback(form,value)||"";if(Object.isString(params)){params=params.toQueryParams()}params.editorId=this.element.id;if(this.options.htmlResponse){var options=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(options,{parameters:params,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Updater({success:this.element},this.url,options)}else{var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:params,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,options)}if(e){Event.stop(e)}},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this._originalBackground;this.element.show();if(this.options.externalControl){this.options.externalControl.show()}this._saving=false;this._editing=false;this._oldInnerHTML=null;this.triggerCallback("onLeaveEditMode")},leaveHover:function(e){if(this.options.hoverClassName){this.element.removeClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onLeaveHover")},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);this._controls.editor.disabled=true;var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){this._form.removeClassName(this.options.loadingClassName);var text=transport.responseText;if(this.options.stripLoadedTextTags){text=text.stripTags()
3
+ }this._controls.editor.value=text;this._controls.editor.disabled=false;this.postProcessEditField()}.bind(this),onFailure:this._boundFailureHandler});new Ajax.Request(this.options.loadTextURL,options)},postProcessEditField:function(){var fpc=this.options.fieldPostCreation;if(fpc){$(this._controls.editor)["focus"==fpc?"focus":"activate"]()}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(defs){Object.extend(this.options,defs)}.bind(this))},prepareSubmission:function(){this._saving=true;this.removeForm();this.leaveHover();this.showSaving()},registerListeners:function(){this._listeners={};var listener;$H(Ajax.InPlaceEditor.Listeners).each(function(pair){listener=this[pair.value].bind(this);this._listeners[pair.key]=listener;if(!this.options.externalControlOnly){this.element.observe(pair.key,listener)}if(this.options.externalControl){this.options.externalControl.observe(pair.key,listener)}}.bind(this))},removeForm:function(){if(!this._form){return}this._form.remove();this._form=null;this._controls={}},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;this.element.addClassName(this.options.savingClassName);this.element.style.backgroundColor=this._originalBackground;this.element.show()},triggerCallback:function(cbName,arg){if("function"==typeof this.options[cbName]){this.options[cbName](this,arg)}},unregisterListeners:function(){$H(this._listeners).each(function(pair){if(!this.options.externalControlOnly){this.element.stopObserving(pair.key,pair.value)}if(this.options.externalControl){this.options.externalControl.stopObserving(pair.key,pair.value)}}.bind(this))},wrapUp:function(transport){this.leaveEditMode();this._boundComplete(transport,this.element)}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,element,url,options){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(element,url,options)},createEditField:function(){var list=document.createElement("select");list.name=this.options.paramName;list.size=1;this._controls.editor=list;this._collection=this.options.collection||[];if(this.options.loadCollectionURL){this.loadCollection()}else{this.checkForExternalText()}this._form.appendChild(this._controls.editor)},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);this.showLoadingText(this.options.loadingCollectionText);var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip();if(!/^\[.*\]$/.test(js)){throw ("Server returned an invalid collection representation.")}this._collection=eval(js);this.checkForExternalText()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadCollectionURL,options)},showLoadingText:function(text){this._controls.editor.disabled=true;var tempOption=this._controls.editor.firstChild;if(!tempOption){tempOption=document.createElement("option");tempOption.value="";this._controls.editor.appendChild(tempOption);tempOption.selected=true}tempOption.update((text||"").stripScripts().stripTags())},checkForExternalText:function(){this._text=this.getText();if(this.options.loadTextURL){this.loadExternalText()}else{this.buildOptionList()}},loadExternalText:function(){this.showLoadingText(this.options.loadingText);var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){this._text=transport.responseText.strip();this.buildOptionList()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadTextURL,options)},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);this._collection=this._collection.map(function(entry){return 2===entry.length?entry:[entry,entry].flatten()});var marker=("value" in this.options)?this.options.value:this._text;var textFound=this._collection.any(function(entry){return entry[0]==marker}.bind(this));this._controls.editor.update("");var option;this._collection.each(function(entry,index){option=document.createElement("option");option.value=entry[0];option.selected=textFound?entry[0]==marker:0==index;option.appendChild(document.createTextNode(entry[1]));this._controls.editor.appendChild(option)}.bind(this));this._controls.editor.disabled=false;Field.scrollFreeActivate(this._controls.editor)}});Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(options){if(!options){return}function fallback(name,expr){if(name in options||expr===undefined){return}options[name]=expr}fallback("cancelControl",(options.cancelLink?"link":(options.cancelButton?"button":options.cancelLink==options.cancelButton==false?false:undefined)));fallback("okControl",(options.okLink?"link":(options.okButton?"button":options.okLink==options.okButton==false?false:undefined)));fallback("highlightColor",options.highlightcolor);fallback("highlightEndColor",options.highlightendcolor)};Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(form){return Form.serialize(form)},onComplete:function(transport,element){new Effect.Highlight(element,{startcolor:this.options.highlightColor,keepBackgroundImage:true})},onEnterEditMode:null,onEnterHover:function(ipe){ipe.element.style.backgroundColor=ipe.options.highlightColor;if(ipe._effect){ipe._effect.cancel()}},onFailure:function(transport,ipe){alert("Error communication with the server: "+transport.responseText.stripTags())},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(ipe){ipe._effect=new Effect.Highlight(ipe.element,{startcolor:ipe.options.highlightColor,endcolor:ipe.options.highlightEndColor,restorecolor:ipe._originalBackground,keepBackgroundImage:true})}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."};Form.Element.DelayedObserver=Class.create({initialize:function(element,delay,callback){this.delay=delay||0.5;this.element=$(element);this.callback=callback;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this))},delayedListener:function(event){if(this.lastValue==$F(this.element)){return}if(this.timer){clearTimeout(this.timer)}this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element)},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element))}});
@@ -0,0 +1,3 @@
1
+ if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library")}var Droppables={drops:[],remove:function(element){this.drops=this.drops.reject(function(d){return d.element==$(element)})},add:function(element){element=$(element);var options=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(options.containment){options._containers=[];var containment=options.containment;if(Object.isArray(containment)){containment.each(function(c){options._containers.push($(c))})}else{options._containers.push($(containment))}}if(options.accept){options.accept=[options.accept].flatten()}Element.makePositioned(element);options.element=element;this.drops.push(options)},findDeepestChild:function(drops){deepest=drops[0];for(i=1;i<drops.length;++i){if(Element.isParent(drops[i].element,deepest.element)){deepest=drops[i]}}return deepest},isContained:function(element,drop){var containmentNode;if(drop.tree){containmentNode=element.treeNode}else{containmentNode=element.parentNode}return drop._containers.detect(function(c){return containmentNode==c})},isAffected:function(point,element,drop){return((drop.element!=element)&&((!drop._containers)||this.isContained(element,drop))&&((!drop.accept)||(Element.classNames(element).detect(function(v){return drop.accept.include(v)})))&&Position.within(drop.element,point[0],point[1]))},deactivate:function(drop){if(drop.hoverclass){Element.removeClassName(drop.element,drop.hoverclass)}this.last_active=null},activate:function(drop){if(drop.hoverclass){Element.addClassName(drop.element,drop.hoverclass)}this.last_active=drop},show:function(point,element){if(!this.drops.length){return}var drop,affected=[];this.drops.each(function(drop){if(Droppables.isAffected(point,element,drop)){affected.push(drop)}});if(affected.length>0){drop=Droppables.findDeepestChild(affected)}if(this.last_active&&this.last_active!=drop){this.deactivate(this.last_active)}if(drop){Position.within(drop.element,point[0],point[1]);if(drop.onHover){drop.onHover(element,drop.element,Position.overlap(drop.overlap,drop.element))}if(drop!=this.last_active){Droppables.activate(drop)}}},fire:function(event,element){if(!this.last_active){return}Position.prepare();if(this.isAffected([Event.pointerX(event),Event.pointerY(event)],element,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(element,this.last_active.element,event);return true}}},reset:function(){if(this.last_active){this.deactivate(this.last_active)}}};var Draggables={drags:[],observers:[],register:function(draggable){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)}this.drags.push(draggable)},unregister:function(draggable){this.drags=this.drags.reject(function(d){return d==draggable});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(draggable){if(draggable.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=draggable}.bind(this),draggable.options.delay)}else{window.focus();this.activeDraggable=draggable}},deactivate:function(){this.activeDraggable=null},updateDrag:function(event){if(!this.activeDraggable){return}var pointer=[Event.pointerX(event),Event.pointerY(event)];if(this._lastPointer&&(this._lastPointer.inspect()==pointer.inspect())){return}this._lastPointer=pointer;this.activeDraggable.updateDrag(event,pointer)},endDrag:function(event){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}if(!this.activeDraggable){return}this._lastPointer=null;this.activeDraggable.endDrag(event);this.activeDraggable=null},keyPress:function(event){if(this.activeDraggable){this.activeDraggable.keyPress(event)}},addObserver:function(observer){this.observers.push(observer);this._cacheObserverCallbacks()},removeObserver:function(element){this.observers=this.observers.reject(function(o){return o.element==element});this._cacheObserverCallbacks()},notify:function(eventName,draggable,event){if(this[eventName+"Count"]>0){this.observers.each(function(o){if(o[eventName]){o[eventName](eventName,draggable,event)}})}if(draggable.options[eventName]){draggable.options[eventName](draggable,event)}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(eventName){Draggables[eventName+"Count"]=Draggables.observers.select(function(o){return o[eventName]}).length})}};var Draggable=Class.create({initialize:function(element){var defaults={handle:false,reverteffect:function(element,top_offset,left_offset){var dur=Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02;new Effect.Move(element,{x:-left_offset,y:-top_offset,duration:dur,queue:{scope:"_draggable",position:"end"}})},endeffect:function(element){var toOpacity=Object.isNumber(element._opacity)?element._opacity:1;new Effect.Opacity(element,{duration:0.2,from:0.7,to:toOpacity,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[element]=false}})},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||Object.isUndefined(arguments[1].endeffect)){Object.extend(defaults,{starteffect:function(element){element._opacity=Element.getOpacity(element);Draggable._dragging[element]=true;new Effect.Opacity(element,{duration:0.2,from:element._opacity,to:0.7})}})}var options=Object.extend(defaults,arguments[1]||{});this.element=$(element);if(options.handle&&Object.isString(options.handle)){this.handle=this.element.down("."+options.handle,0)}if(!this.handle){this.handle=$(options.handle)}if(!this.handle){this.handle=this.element}if(options.scroll&&!options.scroll.scrollTo&&!options.scroll.outerHTML){options.scroll=$(options.scroll);this._isScrollChild=Element.childOf(this.element,options.scroll)}Element.makePositioned(this.element);this.options=options;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")])},initDrag:function(event){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return}if(Event.isLeftClick(event)){var src=Event.element(event);if((tag_name=src.tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA")){return}var pointer=[Event.pointerX(event),Event.pointerY(event)];var pos=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(i){return(pointer[i]-pos[i])});Draggables.activate(this);Event.stop(event)}},startDrag:function(event){this.dragging=true;if(!this.delta){this.delta=this.currentDelta()}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);this.element.style.zIndex=this.options.zindex}if(this.options.ghosting){this._clone=this.element.cloneNode(true);this._originallyAbsolute=(this.element.getStyle("position")=="absolute");if(!this._originallyAbsolute){Position.absolutize(this.element)}this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll){if(this.options.scroll==window){var where=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=where.left;this.originalScrollTop=where.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop
2
+ }}Draggables.notify("onStart",this,event);if(this.options.starteffect){this.options.starteffect(this.element)}},updateDrag:function(event,pointer){if(!this.dragging){this.startDrag(event)}if(!this.options.quiet){Position.prepare();Droppables.show(pointer,this.element)}Draggables.notify("onDrag",this,event);this.draw(pointer);if(this.options.change){this.options.change(this)}if(this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height]}}else{p=Position.page(this.options.scroll);p[0]+=this.options.scroll.scrollLeft+Position.deltaX;p[1]+=this.options.scroll.scrollTop+Position.deltaY;p.push(p[0]+this.options.scroll.offsetWidth);p.push(p[1]+this.options.scroll.offsetHeight)}var speed=[0,0];if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity)}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity)}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity)}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity)}this.startScrolling(speed)}if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(event)},finishDrag:function(event,success){this.dragging=false;if(this.options.quiet){Position.prepare();var pointer=[Event.pointerX(event),Event.pointerY(event)];Droppables.show(pointer,this.element)}if(this.options.ghosting){if(!this._originallyAbsolute){Position.relativize(this.element)}delete this._originallyAbsolute;Element.remove(this._clone);this._clone=null}var dropped=false;if(success){dropped=Droppables.fire(event,this.element);if(!dropped){dropped=false}}if(dropped&&this.options.onDropped){this.options.onDropped(this.element)}Draggables.notify("onEnd",this,event);var revert=this.options.revert;if(revert&&Object.isFunction(revert)){revert=revert(this.element)}var d=this.currentDelta();if(revert&&this.options.reverteffect){if(dropped==0||revert!="failure"){this.options.reverteffect(this.element,d[1]-this.delta[1],d[0]-this.delta[0])}}else{this.delta=d}if(this.options.zindex){this.element.style.zIndex=this.originalZ}if(this.options.endeffect){this.options.endeffect(this.element)}Draggables.deactivate(this);Droppables.reset()},keyPress:function(event){if(event.keyCode!=Event.KEY_ESC){return}this.finishDrag(event,false);Event.stop(event)},endDrag:function(event){if(!this.dragging){return}this.stopScrolling();this.finishDrag(event,true);Event.stop(event)},draw:function(point){var pos=Position.cumulativeOffset(this.element);if(this.options.ghosting){var r=Position.realOffset(this.element);pos[0]+=r[0]-Position.deltaX;pos[1]+=r[1]-Position.deltaY}var d=this.currentDelta();pos[0]-=d[0];pos[1]-=d[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){pos[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;pos[1]-=this.options.scroll.scrollTop-this.originalScrollTop}var p=[0,1].map(function(i){return(point[i]-pos[i]-this.offset[i])}.bind(this));if(this.options.snap){if(Object.isFunction(this.options.snap)){p=this.options.snap(p[0],p[1],this)}else{if(Object.isArray(this.options.snap)){p=p.map(function(v,i){return(v/this.options.snap[i]).round()*this.options.snap[i]}.bind(this))}else{p=p.map(function(v){return(v/this.options.snap).round()*this.options.snap}.bind(this))}}}var style=this.element.style;if((!this.options.constraint)||(this.options.constraint=="horizontal")){style.left=p[0]+"px"}if((!this.options.constraint)||(this.options.constraint=="vertical")){style.top=p[1]+"px"}if(style.visibility=="hidden"){style.visibility=""}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(speed){if(!(speed[0]||speed[1])){return}this.scrollSpeed=[speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10)},scroll:function(){var current=new Date();var delta=current-this.lastScrolled;this.lastScrolled=current;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify("onDrag",this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;if(Draggables._lastScrollPointer[0]<0){Draggables._lastScrollPointer[0]=0}if(Draggables._lastScrollPointer[1]<0){Draggables._lastScrollPointer[1]=0}this.draw(Draggables._lastScrollPointer)}if(this.options.change){this.options.change(this)}},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}return{top:T,left:L,width:W,height:H}}});Draggable._dragging={};var SortableObserver=Class.create({initialize:function(element,observer){this.element=$(element);this.observer=observer;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element)){this.observer(this.element)}}});var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(element){while(element.tagName.toUpperCase()!="BODY"){if(element.id&&Sortable.sortables[element.id]){return element}element=element.parentNode}},options:function(element){element=Sortable._findRootElement($(element));if(!element){return}return Sortable.sortables[element.id]},destroy:function(element){element=$(element);var s=Sortable.sortables[element.id];if(s){Draggables.removeObserver(s.element);s.droppables.each(function(d){Droppables.remove(d)});s.draggables.invoke("destroy");delete Sortable.sortables[s.element.id]}},create:function(element){element=$(element);var options=Object.extend({element:element,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:element,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(element);var options_for_draggable={revert:true,quiet:options.quiet,scroll:options.scroll,scrollSpeed:options.scrollSpeed,scrollSensitivity:options.scrollSensitivity,delay:options.delay,ghosting:options.ghosting,constraint:options.constraint,handle:options.handle};if(options.starteffect){options_for_draggable.starteffect=options.starteffect}if(options.reverteffect){options_for_draggable.reverteffect=options.reverteffect}else{if(options.ghosting){options_for_draggable.reverteffect=function(element){element.style.top=0;element.style.left=0}}}if(options.endeffect){options_for_draggable.endeffect=options.endeffect}if(options.zindex){options_for_draggable.zindex=options.zindex}var options_for_droppable={overlap:options.overlap,containment:options.containment,tree:options.tree,hoverclass:options.hoverclass,onHover:Sortable.onHover};var options_for_tree={onHover:Sortable.onEmptyHover,overlap:options.overlap,containment:options.containment,hoverclass:options.hoverclass};
3
+ Element.cleanWhitespace(element);options.draggables=[];options.droppables=[];if(options.dropOnEmpty||options.tree){Droppables.add(element,options_for_tree);options.droppables.push(element)}(options.elements||this.findElements(element,options)||[]).each(function(e,i){var handle=options.handles?$(options.handles[i]):(options.handle?$(e).select("."+options.handle)[0]:e);options.draggables.push(new Draggable(e,Object.extend(options_for_draggable,{handle:handle})));Droppables.add(e,options_for_droppable);if(options.tree){e.treeNode=element}options.droppables.push(e)});if(options.tree){(Sortable.findTreeElements(element,options)||[]).each(function(e){Droppables.add(e,options_for_tree);e.treeNode=element;options.droppables.push(e)})}this.sortables[element.id]=options;Draggables.addObserver(new SortableObserver(element,options.onUpdate))},findElements:function(element,options){return Element.findChildren(element,options.only,options.tree?true:false,options.tag)},findTreeElements:function(element,options){return Element.findChildren(element,options.only,options.tree?true:false,options.treeTag)},onHover:function(element,dropon,overlap){if(Element.isParent(dropon,element)){return}if(overlap>0.33&&overlap<0.66&&Sortable.options(dropon).tree){return}else{if(overlap>0.5){Sortable.mark(dropon,"before");if(dropon.previousSibling!=element){var oldParentNode=element.parentNode;element.style.visibility="hidden";dropon.parentNode.insertBefore(element,dropon);if(dropon.parentNode!=oldParentNode){Sortable.options(oldParentNode).onChange(element)}Sortable.options(dropon.parentNode).onChange(element)}}else{Sortable.mark(dropon,"after");var nextElement=dropon.nextSibling||null;if(nextElement!=element){var oldParentNode=element.parentNode;element.style.visibility="hidden";dropon.parentNode.insertBefore(element,nextElement);if(dropon.parentNode!=oldParentNode){Sortable.options(oldParentNode).onChange(element)}Sortable.options(dropon.parentNode).onChange(element)}}}},onEmptyHover:function(element,dropon,overlap){var oldParentNode=element.parentNode;var droponOptions=Sortable.options(dropon);if(!Element.isParent(dropon,element)){var index;var children=Sortable.findElements(dropon,{tag:droponOptions.tag,only:droponOptions.only});var child=null;if(children){var offset=Element.offsetSize(dropon,droponOptions.overlap)*(1-overlap);for(index=0;index<children.length;index+=1){if(offset-Element.offsetSize(children[index],droponOptions.overlap)>=0){offset-=Element.offsetSize(children[index],droponOptions.overlap)}else{if(offset-(Element.offsetSize(children[index],droponOptions.overlap)/2)>=0){child=index+1<children.length?children[index+1]:null;break}else{child=children[index];break}}}}dropon.insertBefore(element,child);Sortable.options(oldParentNode).onChange(element);droponOptions.onChange(element)}},unmark:function(){if(Sortable._marker){Sortable._marker.hide()}},mark:function(dropon,position){var sortable=Sortable.options(dropon.parentNode);if(sortable&&!sortable.ghosting){return}if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)}var offsets=Position.cumulativeOffset(dropon);Sortable._marker.setStyle({left:offsets[0]+"px",top:offsets[1]+"px"});if(position=="after"){if(sortable.overlap=="horizontal"){Sortable._marker.setStyle({left:(offsets[0]+dropon.clientWidth)+"px"})}else{Sortable._marker.setStyle({top:(offsets[1]+dropon.clientHeight)+"px"})}}Sortable._marker.show()},_tree:function(element,options,parent){var children=Sortable.findElements(element,options)||[];for(var i=0;i<children.length;++i){var match=children[i].id.match(options.format);if(!match){continue}var child={id:encodeURIComponent(match?match[1]:null),element:element,parent:parent,children:[],position:parent.children.length,container:$(children[i]).down(options.treeTag)};if(child.container){this._tree(child.container,options,child)}parent.children.push(child)}return parent},tree:function(element){element=$(element);var sortableOptions=this.options(element);var options=Object.extend({tag:sortableOptions.tag,treeTag:sortableOptions.treeTag,only:sortableOptions.only,name:element.id,format:sortableOptions.format},arguments[1]||{});var root={id:null,parent:null,children:[],container:element,position:0};return Sortable._tree(element,options,root)},_constructIndex:function(node){var index="";do{if(node.id){index="["+node.position+"]"+index}}while((node=node.parent)!=null);return index},sequence:function(element){element=$(element);var options=Object.extend(this.options(element),arguments[1]||{});return $(this.findElements(element,options)||[]).map(function(item){return item.id.match(options.format)?item.id.match(options.format)[1]:""})},setSequence:function(element,new_sequence){element=$(element);var options=Object.extend(this.options(element),arguments[2]||{});var nodeMap={};this.findElements(element,options).each(function(n){if(n.id.match(options.format)){nodeMap[n.id.match(options.format)[1]]=[n,n.parentNode]}n.parentNode.removeChild(n)});new_sequence.each(function(ident){var n=nodeMap[ident];if(n){n[1].appendChild(n[0]);delete nodeMap[ident]}})},serialize:function(element){element=$(element);var options=Object.extend(Sortable.options(element),arguments[1]||{});var name=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:element.id);if(options.tree){return Sortable.tree(element,arguments[1]).children.map(function(item){return[name+Sortable._constructIndex(item)+"[id]="+encodeURIComponent(item.id)].concat(item.children.map(arguments.callee))}).flatten().join("&")}else{return Sortable.sequence(element,arguments[1]).map(function(item){return name+"[]="+encodeURIComponent(item)}).join("&")}}};Element.isParent=function(child,element){if(!child.parentNode||child==element){return false}if(child.parentNode==element){return true}return Element.isParent(child.parentNode,element)};Element.findChildren=function(element,only,recursive,tagName){if(!element.hasChildNodes()){return null}tagName=tagName.toUpperCase();if(only){only=[only].flatten()}var elements=[];$A(element.childNodes).each(function(e){if(e.tagName&&e.tagName.toUpperCase()==tagName&&(!only||(Element.classNames(e).detect(function(v){return only.include(v)})))){elements.push(e)}if(recursive){var grandchildren=Element.findChildren(e,only,recursive,tagName);if(grandchildren){elements.push(grandchildren)}}});return(elements.length>0?elements.flatten():[])};Element.offsetSize=function(element,type){return element["offset"+((type=="vertical"||type=="height")?"Height":"Width")]};
@@ -0,0 +1,4 @@
1
+ String.prototype.parseColor=function(){var color="#";if(this.slice(0,4)=="rgb("){var cols=this.slice(4,this.length-1).split(",");var i=0;do{color+=parseInt(cols[i]).toColorPart()}while(++i<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var i=1;i<4;i++){color+=(this.charAt(i)+this.charAt(i)).toLowerCase()}}if(this.length==7){color=this.toLowerCase()}}}return(color.length==7?color:(arguments[0]||this))};Element.collectTextNodes=function(element){return $A($(element).childNodes).collect(function(node){return(node.nodeType==3?node.nodeValue:(node.hasChildNodes()?Element.collectTextNodes(node):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(element,className){return $A($(element).childNodes).collect(function(node){return(node.nodeType==3?node.nodeValue:((node.hasChildNodes()&&!Element.hasClassName(node,className))?Element.collectTextNodesIgnoreClass(node,className):""))}).flatten().join("")};Element.setContentZoom=function(element,percent){element=$(element);element.setStyle({fontSize:(percent/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return element};Element.getInlineOpacity=function(element){return $(element).style.opacity||""};Element.forceRerendering=function(element){try{element=$(element);var n=document.createTextNode(" ");element.appendChild(n);element.removeChild(n)}catch(e){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(pos){return(-Math.cos(pos*Math.PI)/2)+0.5},reverse:function(pos){return 1-pos},flicker:function(pos){var pos=((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;return pos>1?1:pos},wobble:function(pos){return(-Math.cos(pos*Math.PI*(9*pos))/2)+0.5},pulse:function(pos,pulses){return(-Math.cos((pos*((pulses||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(pos){return 1-(Math.cos(pos*4.5*Math.PI)*Math.exp(-pos*6))},none:function(pos){return 0},full:function(pos){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(element){var tagifyStyle="position:relative";if(Prototype.Browser.IE){tagifyStyle+=";zoom:1"}element=$(element);$A(element.childNodes).each(function(child){if(child.nodeType==3){child.nodeValue.toArray().each(function(character){element.insertBefore(new Element("span",{style:tagifyStyle}).update(character==" "?String.fromCharCode(160):character),child)});Element.remove(child)}})},multiple:function(element,effect){var elements;if(((typeof element=="object")||Object.isFunction(element))&&(element.length)){elements=element}else{elements=$(element).childNodes}var options=Object.extend({speed:0.1,delay:0},arguments[2]||{});var masterDelay=options.delay;$A(elements).each(function(element,index){new effect(element,Object.extend(options,{delay:index*options.speed+masterDelay}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(element,effect){element=$(element);effect=(effect||"appear").toLowerCase();var options=Object.extend({queue:{position:"end",scope:(element.id||"global"),limit:1}},arguments[2]||{});Effect[element.visible()?Effect.PAIRS[effect][1]:Effect.PAIRS[effect][0]](element,options)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(iterator){this.effects._each(iterator)},add:function(effect){var timestamp=new Date().getTime();var position=Object.isString(effect.options.queue)?effect.options.queue:effect.options.queue.position;switch(position){case"front":this.effects.findAll(function(e){return e.state=="idle"}).each(function(e){e.startOn+=effect.finishOn;e.finishOn+=effect.finishOn});break;case"with-last":timestamp=this.effects.pluck("startOn").max()||timestamp;break;case"end":timestamp=this.effects.pluck("finishOn").max()||timestamp;break}effect.startOn+=timestamp;effect.finishOn+=timestamp;if(!effect.options.queue.limit||(this.effects.length<effect.options.queue.limit)){this.effects.push(effect)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(effect){this.effects=this.effects.reject(function(e){return e==effect});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var timePos=new Date().getTime();for(var i=0,len=this.effects.length;i<len;i++){this.effects[i]&&this.effects[i].loop(timePos)}}});Effect.Queues={instances:$H(),get:function(queueName){if(!Object.isString(queueName)){return queueName}return this.instances.get(queueName)||this.instances.set(queueName,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":""))}if(options&&options.transition===false){options.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;this.render=(function(){function dispatch(effect,eventName){if(effect.options[eventName+"Internal"]){effect.options[eventName+"Internal"](effect)}if(effect.options[eventName]){effect.options[eventName](effect)}}return function(pos){if(this.state==="idle"){this.state="running";dispatch(this,"beforeSetup");if(this.setup){this.setup()}dispatch(this,"afterSetup")}if(this.state==="running"){pos=(this.options.transition(pos)*this.fromToDelta)+this.options.from;this.position=pos;dispatch(this,"beforeUpdate");if(this.update){this.update(pos)}dispatch(this,"afterUpdate")}}})();this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(timePos){if(timePos>=this.startOn){if(timePos>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var pos=(timePos-this.startOn)/this.totalTime,frame=(pos*this.totalFrames).round();if(frame>this.currentFrame){this.render(pos);this.currentFrame=frame}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(eventName){if(this.options[eventName+"Internal"]){this.options[eventName+"Internal"](this)}if(this.options[eventName]){this.options[eventName](this)}},inspect:function(){var data=$H();for(property in this){if(!Object.isFunction(this[property])){data.set(property,this[property])}}return"#<Effect:"+data.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(effects){this.effects=effects||[];this.start(arguments[1])},update:function(position){this.effects.invoke("render",position)},finish:function(position){this.effects.each(function(effect){effect.render(1);effect.cancel();effect.event("beforeFinish");if(effect.finish){effect.finish(position)}effect.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(object,from,to){object=Object.isString(object)?$(object):object;var args=$A(arguments),method=args.last(),options=args.length==5?args[3]:null;this.method=Object.isFunction(method)?method.bind(object):Object.isFunction(object[method])?object[method].bind(object):function(value){object[method]=value};this.start(Object.extend({from:from,to:to},options||{}))},update:function(position){this.method(position)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))
2
+ },update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var options=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(options)},update:function(position){this.element.setOpacity(position)}});Effect.Move=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element){throw (Effect._elementDoesNotExistError)}var options=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(options)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(position){this.element.setStyle({left:(this.options.x*position+this.originalLeft).round()+"px",top:(this.options.y*position+this.originalTop).round()+"px"})}});Effect.MoveBy=function(element,toTop,toLeft){return new Effect.Move(element,Object.extend({x:toLeft,y:toTop},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(element,percent){this.element=$(element);if(!this.element){throw (Effect._elementDoesNotExistError)}var options=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:percent},arguments[2]||{});this.start(options)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(k){this.originalStyle[k]=this.element.style[k]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var fontSize=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(fontSizeType){if(fontSize.indexOf(fontSizeType)>0){this.fontSize=parseFloat(fontSize);this.fontSizeType=fontSizeType}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(position){var currentScale=(this.options.scaleFrom/100)+(this.factor*position);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*currentScale+this.fontSizeType})}this.setDimensions(this.dims[0]*currentScale,this.dims[1]*currentScale)},finish:function(position){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(height,width){var d={};if(this.options.scaleX){d.width=width.round()+"px"}if(this.options.scaleY){d.height=height.round()+"px"}if(this.options.scaleFromCenter){var topd=(height-this.dims[0])/2;var leftd=(width-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){d.top=this.originalTop-topd+"px"}if(this.options.scaleX){d.left=this.originalLeft-leftd+"px"}}else{if(this.options.scaleY){d.top=-topd+"px"}if(this.options.scaleX){d.left=-leftd+"px"}}}this.element.setStyle(d)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element){throw (Effect._elementDoesNotExistError)}var options=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(options)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(i){return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(i){return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i]}.bind(this))},update:function(position){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(m,v,i){return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(element){var options=arguments[1]||{},scrollOffsets=document.viewport.getScrollOffsets(),elementOffsets=$(element).cumulativeOffset();if(options.offset){elementOffsets[1]+=options.offset}return new Effect.Tween(null,scrollOffsets.top,elementOffsets[1],options,function(p){scrollTo(scrollOffsets.left,p.round())})};Effect.Fade=function(element){element=$(element);var oldOpacity=element.getInlineOpacity();var options=Object.extend({from:element.getOpacity()||1,to:0,afterFinishInternal:function(effect){if(effect.options.to!=0){return}effect.element.hide().setStyle({opacity:oldOpacity})}},arguments[1]||{});return new Effect.Opacity(element,options)};Effect.Appear=function(element){element=$(element);var options=Object.extend({from:(element.getStyle("display")=="none"?0:element.getOpacity()||0),to:1,afterFinishInternal:function(effect){effect.element.forceRerendering()},beforeSetup:function(effect){effect.element.setOpacity(effect.options.from).show()}},arguments[1]||{});return new Effect.Opacity(element,options)};Effect.Puff=function(element){element=$(element);var oldStyle={opacity:element.getInlineOpacity(),position:element.getStyle("position"),top:element.style.top,left:element.style.left,width:element.style.width,height:element.style.height};return new Effect.Parallel([new Effect.Scale(element,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(element,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(effect){Position.absolutize(effect.effects[0].element)},afterFinishInternal:function(effect){effect.effects[0].element.hide().setStyle(oldStyle)}},arguments[1]||{}))};Effect.BlindUp=function(element){element=$(element);element.makeClipping();return new Effect.Scale(element,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(effect){effect.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(element){element=$(element);var elementDimensions=element.getDimensions();return new Effect.Scale(element,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){effect.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(effect){effect.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(element){element=$(element);var oldOpacity=element.getInlineOpacity();return new Effect.Appear(element,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(effect){new Effect.Scale(effect.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(effect){effect.element.makePositioned().makeClipping()},afterFinishInternal:function(effect){effect.element.hide().undoClipping().undoPositioned().setStyle({opacity:oldOpacity})}})}},arguments[1]||{}))};Effect.DropOut=function(element){element=$(element);var oldStyle={top:element.getStyle("top"),left:element.getStyle("left"),opacity:element.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(element,{x:0,y:100,sync:true}),new Effect.Opacity(element,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(effect){effect.effects[0].element.makePositioned()
3
+ },afterFinishInternal:function(effect){effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle)}},arguments[1]||{}))};Effect.Shake=function(element){element=$(element);var options=Object.extend({distance:20,duration:0.5},arguments[1]||{});var distance=parseFloat(options.distance);var split=parseFloat(options.duration)/10;var oldStyle={top:element.getStyle("top"),left:element.getStyle("left")};return new Effect.Move(element,{x:distance,y:0,duration:split,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:-distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:-distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:distance*2,y:0,duration:split*2,afterFinishInternal:function(effect){new Effect.Move(effect.element,{x:-distance,y:0,duration:split,afterFinishInternal:function(effect){effect.element.undoPositioned().setStyle(oldStyle)}})}})}})}})}})}})};Effect.SlideDown=function(element){element=$(element).cleanWhitespace();var oldInnerBottom=element.down().getStyle("bottom");var elementDimensions=element.getDimensions();return new Effect.Scale(element,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){effect.element.makePositioned();effect.element.down().makePositioned();if(window.opera){effect.element.setStyle({top:""})}effect.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(effect){effect.element.down().setStyle({bottom:(effect.dims[0]-effect.element.clientHeight)+"px"})},afterFinishInternal:function(effect){effect.element.undoClipping().undoPositioned();effect.element.down().undoPositioned().setStyle({bottom:oldInnerBottom})}},arguments[1]||{}))};Effect.SlideUp=function(element){element=$(element).cleanWhitespace();var oldInnerBottom=element.down().getStyle("bottom");var elementDimensions=element.getDimensions();return new Effect.Scale(element,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){effect.element.makePositioned();effect.element.down().makePositioned();if(window.opera){effect.element.setStyle({top:""})}effect.element.makeClipping().show()},afterUpdateInternal:function(effect){effect.element.down().setStyle({bottom:(effect.dims[0]-effect.element.clientHeight)+"px"})},afterFinishInternal:function(effect){effect.element.hide().undoClipping().undoPositioned();effect.element.down().undoPositioned().setStyle({bottom:oldInnerBottom})}},arguments[1]||{}))};Effect.Squish=function(element){return new Effect.Scale(element,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(effect){effect.element.makeClipping()},afterFinishInternal:function(effect){effect.element.hide().undoClipping()}})};Effect.Grow=function(element){element=$(element);var options=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var oldStyle={top:element.style.top,left:element.style.left,height:element.style.height,width:element.style.width,opacity:element.getInlineOpacity()};var dims=element.getDimensions();var initialMoveX,initialMoveY;var moveX,moveY;switch(options.direction){case"top-left":initialMoveX=initialMoveY=moveX=moveY=0;break;case"top-right":initialMoveX=dims.width;initialMoveY=moveY=0;moveX=-dims.width;break;case"bottom-left":initialMoveX=moveX=0;initialMoveY=dims.height;moveY=-dims.height;break;case"bottom-right":initialMoveX=dims.width;initialMoveY=dims.height;moveX=-dims.width;moveY=-dims.height;break;case"center":initialMoveX=dims.width/2;initialMoveY=dims.height/2;moveX=-dims.width/2;moveY=-dims.height/2;break}return new Effect.Move(element,{x:initialMoveX,y:initialMoveY,duration:0.01,beforeSetup:function(effect){effect.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(effect){new Effect.Parallel([new Effect.Opacity(effect.element,{sync:true,to:1,from:0,transition:options.opacityTransition}),new Effect.Move(effect.element,{x:moveX,y:moveY,sync:true,transition:options.moveTransition}),new Effect.Scale(effect.element,100,{scaleMode:{originalHeight:dims.height,originalWidth:dims.width},sync:true,scaleFrom:window.opera?1:0,transition:options.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(effect){effect.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(effect){effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle)}},options))}})};Effect.Shrink=function(element){element=$(element);var options=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var oldStyle={top:element.style.top,left:element.style.left,height:element.style.height,width:element.style.width,opacity:element.getInlineOpacity()};var dims=element.getDimensions();var moveX,moveY;switch(options.direction){case"top-left":moveX=moveY=0;break;case"top-right":moveX=dims.width;moveY=0;break;case"bottom-left":moveX=0;moveY=dims.height;break;case"bottom-right":moveX=dims.width;moveY=dims.height;break;case"center":moveX=dims.width/2;moveY=dims.height/2;break}return new Effect.Parallel([new Effect.Opacity(element,{sync:true,to:0,from:1,transition:options.opacityTransition}),new Effect.Scale(element,window.opera?1:0,{sync:true,transition:options.scaleTransition,restoreAfterFinish:true}),new Effect.Move(element,{x:moveX,y:moveY,sync:true,transition:options.moveTransition})],Object.extend({beforeStartInternal:function(effect){effect.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(effect){effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle)}},options))};Effect.Pulsate=function(element){element=$(element);var options=arguments[1]||{},oldOpacity=element.getInlineOpacity(),transition=options.transition||Effect.Transitions.linear,reverser=function(pos){return 1-transition((-Math.cos((pos*(options.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(element,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(effect){effect.element.setStyle({opacity:oldOpacity})}},options),{transition:reverser}))};Effect.Fold=function(element){element=$(element);var oldStyle={top:element.style.top,left:element.style.left,width:element.style.width,height:element.style.height};element.makeClipping();return new Effect.Scale(element,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(effect){new Effect.Scale(element,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(effect){effect.element.hide().undoClipping().setStyle(oldStyle)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(element){this.element=$(element);if(!this.element){throw (Effect._elementDoesNotExistError)}var options=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(options.style)){this.style=$H(options.style)}else{if(options.style.include(":")){this.style=options.style.parseStyle()}else{this.element.addClassName(options.style);this.style=$H(this.element.getStyles());this.element.removeClassName(options.style);var css=this.element.getStyles();this.style=this.style.reject(function(style){return style.value==css[style.key]});options.afterFinishInternal=function(effect){effect.element.addClassName(effect.options.style);effect.transforms.each(function(transform){effect.element.style[transform.style]=""})}}}this.start(options)},setup:function(){function parseColor(color){if(!color||["rgba(0, 0, 0, 0)","transparent"].include(color)){color="#ffffff"
4
+ }color=color.parseColor();return $R(0,2).map(function(i){return parseInt(color.slice(i*2+1,i*2+3),16)})}this.transforms=this.style.map(function(pair){var property=pair[0],value=pair[1],unit=null;if(value.parseColor("#zzzzzz")!="#zzzzzz"){value=value.parseColor();unit="color"}else{if(property=="opacity"){value=parseFloat(value);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(value)){var components=value.match(/^([\+\-]?[0-9\.]+)(.*)$/);value=parseFloat(components[1]);unit=(components.length==3)?components[2]:null}}}var originalValue=this.element.getStyle(property);return{style:property.camelize(),originalValue:unit=="color"?parseColor(originalValue):parseFloat(originalValue||0),targetValue:unit=="color"?parseColor(value):value,unit:unit}}.bind(this)).reject(function(transform){return((transform.originalValue==transform.targetValue)||(transform.unit!="color"&&(isNaN(transform.originalValue)||isNaN(transform.targetValue))))})},update:function(position){var style={},transform,i=this.transforms.length;while(i--){style[(transform=this.transforms[i]).style]=transform.unit=="color"?"#"+(Math.round(transform.originalValue[0]+(transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart()+(Math.round(transform.originalValue[1]+(transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart()+(Math.round(transform.originalValue[2]+(transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart():(transform.originalValue+(transform.targetValue-transform.originalValue)*position).toFixed(3)+(transform.unit===null?"":transform.unit)}this.element.setStyle(style,true)}});Effect.Transform=Class.create({initialize:function(tracks){this.tracks=[];this.options=arguments[1]||{};this.addTracks(tracks)},addTracks:function(tracks){tracks.each(function(track){track=$H(track);var data=track.values().first();this.tracks.push($H({ids:track.keys().first(),effect:Effect.Morph,options:{style:data}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(track){var ids=track.get("ids"),effect=track.get("effect"),options=track.get("options");var elements=[$(ids)||$$(ids)].flatten();return elements.map(function(e){return new effect(e,Object.extend({sync:true},options))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var style,styleRules=$H();if(Prototype.Browser.WebKit){style=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';style=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(property){if(style[property]){styleRules.set(property,style[property])}});if(Prototype.Browser.IE&&this.include("opacity")){styleRules.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return styleRules};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(element){var css=document.defaultView.getComputedStyle($(element),null);return Element.CSS_PROPERTIES.inject({},function(styles,property){styles[property]=css[property];return styles})}}else{Element.getStyles=function(element){element=$(element);var css=element.currentStyle,styles;styles=Element.CSS_PROPERTIES.inject({},function(results,property){results[property]=css[property];return results});if(!styles.opacity){styles.opacity=element.getOpacity()}return styles}}Effect.Methods={morph:function(element,style){element=$(element);new Effect.Morph(element,Object.extend({style:style},arguments[2]||{}));return element},visualEffect:function(element,effect,options){element=$(element);var s=effect.dasherize().camelize(),klass=s.charAt(0).toUpperCase()+s.substring(1);new Effect[klass](element,options);return element},highlight:function(element,options){element=$(element);new Effect.Highlight(element,options);return element}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(effect){Effect.Methods[effect]=function(element,options){element=$(element);Effect[effect.charAt(0).toUpperCase()+effect.substring(1)](element,options);return element}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(f){Effect.Methods[f]=Element[f]});Element.addMethods(Effect.Methods);
@@ -0,0 +1,76 @@
1
+ Ext={version:"2.2.1"};window["undefined"]=window["undefined"];Ext.apply=function(o,c,_3){if(_3){Ext.apply(o,_3)}if(o&&c&&typeof c=="object"){for(var p in c){o[p]=c[p]}}return o};(function(){var _5=0;var ua=navigator.userAgent.toLowerCase();var _7=document.compatMode=="CSS1Compat",_8=ua.indexOf("opera")>-1,_9=ua.indexOf("chrome")>-1,_a=!_9&&(/webkit|khtml/).test(ua),_b=_a&&ua.indexOf("webkit/5")!=-1,_c=!_8&&ua.indexOf("msie")>-1,_d=!_8&&ua.indexOf("msie 7")>-1,_e=!_8&&ua.indexOf("msie 8")>-1,_f=!_a&&!_9&&ua.indexOf("gecko")>-1,_10=_f&&ua.indexOf("rv:1.9")>-1,_11=_c&&!_7,_12=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),_13=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),_14=(ua.indexOf("adobeair")!=-1),_15=(ua.indexOf("linux")!=-1),_16=window.location.href.toLowerCase().indexOf("https")===0;if(_c&&!_d){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}Ext.apply(Ext,{isStrict:_7,isSecure:_16,isReady:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http://extjs.com/s.gif",emptyFn:function(){},applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p]}}}return o},addBehaviors:function(o){if(!Ext.isReady){Ext.onReady(function(){Ext.addBehaviors(o)});return}var _1b={};for(var b in o){var _1d=b.split("@");if(_1d[1]){var s=_1d[0];if(!_1b[s]){_1b[s]=Ext.select(s)}_1b[s].on(_1d[1],o[b])}}_1b=null},id:function(el,_20){_20=_20||"ext-gen";el=Ext.getDom(el);var id=_20+(++_5);return el?(el.id?el.id:(el.id=id)):id},extend:function(){var io=function(o){for(var m in o){this[m]=o[m]}};var oc=Object.prototype.constructor;return function(sb,sp,_28){if(typeof sp=="object"){_28=sp;sp=sb;sb=_28.constructor!=oc?_28.constructor:function(){sp.apply(this,arguments)}}var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==oc){spp.constructor=sp}sb.override=function(o){Ext.override(sb,o)};sbp.override=io;Ext.override(sb,_28);sb.extend=function(o){Ext.extend(sb,o)};return sb}}(),override:function(_2e,_2f){if(_2f){var p=_2e.prototype;for(var _31 in _2f){p[_31]=_2f[_31]}if(Ext.isIE&&_2f.toString!=_2e.toString){p.toString=_2f.toString}}},namespace:function(){var a=arguments,o=null,i,j,d,rt;for(i=0;i<a.length;++i){d=a[i].split(".");rt=d[0];eval("if (typeof "+rt+' == "undefined"){'+rt+" = {};} o = "+rt+";");for(j=1;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]]}}},urlEncode:function(o){if(!o){return""}var buf=[];for(var key in o){var ov=o[key],k=encodeURIComponent(key);var _3d=typeof ov;if(_3d=="undefined"){buf.push(k,"=&")}else{if(_3d!="function"&&_3d!="object"){buf.push(k,"=",encodeURIComponent(ov),"&")}else{if(Ext.isDate(ov)){var s=Ext.encode(ov).replace(/"/g,"");buf.push(k,"=",s,"&")}else{if(Ext.isArray(ov)){if(ov.length){for(var i=0,len=ov.length;i<len;i++){buf.push(k,"=",encodeURIComponent(ov[i]===undefined?"":ov[i]),"&")}}else{buf.push(k,"=&")}}}}}}buf.pop();return buf.join("")},urlDecode:function(_41,_42){if(!_41||!_41.length){return{}}var obj={};var _44=_41.split("&");var _45,_46,_47;for(var i=0,len=_44.length;i<len;i++){_45=_44[i].split("=");_46=decodeURIComponent(_45[0]);_47=decodeURIComponent(_45[1]);if(_42!==true){if(typeof obj[_46]=="undefined"){obj[_46]=_47}else{if(typeof obj[_46]=="string"){obj[_46]=[obj[_46]];obj[_46].push(_47)}else{obj[_46].push(_47)}}}else{obj[_46]=_47}}return obj},each:function(_4a,fn,_4c){if(typeof _4a.length=="undefined"||typeof _4a=="string"){_4a=[_4a]}for(var i=0,len=_4a.length;i<len;i++){if(fn.call(_4c||_4a[i],_4a[i],i,_4a)===false){return i}}},combine:function(){var as=arguments,l=as.length,r=[];for(var i=0;i<l;i++){var a=as[i];if(Ext.isArray(a)){r=r.concat(a)}else{if(a.length!==undefined&&!a.substr){r=r.concat(Array.prototype.slice.call(a,0))}else{r.push(a)}}}return r},escapeRe:function(s){return s.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},callback:function(cb,_56,_57,_58){if(typeof cb=="function"){if(_58){cb.defer(_58,_56,_57||[])}else{cb.apply(_56,_57||[])}}},getDom:function(el){if(!el||!document){return null}return el.dom?el.dom:(typeof el=="string"?document.getElementById(el):el)},getDoc:function(){return Ext.get(document)},getBody:function(){return Ext.get(document.body||document.documentElement)},getCmp:function(id){return Ext.ComponentMgr.get(id)},num:function(v,_5c){if(typeof v!="number"||isNaN(v)){return _5c}return v},destroy:function(){for(var i=0,a=arguments,len=a.length;i<len;i++){var as=a[i];if(as){if(typeof as.destroy=="function"){as.destroy()}else{if(as.dom){as.removeAllListeners();as.remove()}}}}},removeNode:_c?function(){var d;return function(n){if(n&&n.tagName!="BODY"){d=d||document.createElement("div");d.appendChild(n);d.innerHTML=""}}}():function(n){if(n&&n.parentNode&&n.tagName!="BODY"){n.parentNode.removeChild(n)}},type:function(o){if(o===undefined||o===null){return false}if(o.htmlElement){return"element"}var t=typeof o;if(t=="object"&&o.nodeName){switch(o.nodeType){case 1:return"element";case 3:return(/\S/).test(o.nodeValue)?"textnode":"whitespace"}}if(t=="object"||t=="function"){switch(o.constructor){case Array:return"array";case RegExp:return"regexp";case Date:return"date"}if(typeof o.length=="number"&&typeof o.item=="function"){return"nodelist"}}return t},isEmpty:function(v,_67){return v===null||v===undefined||(!_67?v==="":false)},value:function(v,_69,_6a){return Ext.isEmpty(v,_6a)?_69:v},isArray:function(v){return v&&typeof v.length=="number"&&typeof v.splice=="function"},isDate:function(v){return v&&typeof v.getFullYear=="function"},isOpera:_8,isChrome:_9,isSafari:_a,isSafari3:_b,isSafari2:_a&&!_b,isIE:_c,isIE6:_c&&!_d&&!_e,isIE7:_d,isIE8:_e,isGecko:_f,isGecko2:_f&&!_10,isGecko3:_10,isBorderBox:_11,isLinux:_15,isWindows:_12,isMac:_13,isAir:_14,useShims:((_c&&!_d)||(_13&&_f&&!_10))});Ext.ns=Ext.namespace})();Ext.ns("Ext","Ext.util","Ext.grid","Ext.dd","Ext.tree","Ext.data","Ext.form","Ext.menu","Ext.state","Ext.lib","Ext.layout","Ext.app","Ext.ux");Ext.apply(Function.prototype,{createCallback:function(){var _6d=arguments;var _6e=this;return function(){return _6e.apply(window,_6d)}},createDelegate:function(obj,_70,_71){var _72=this;return function(){var _73=_70||arguments;if(_71===true){_73=Array.prototype.slice.call(arguments,0);_73=_73.concat(_70)}else{if(typeof _71=="number"){_73=Array.prototype.slice.call(arguments,0);var _74=[_71,0].concat(_70);Array.prototype.splice.apply(_73,_74)}}return _72.apply(obj||window,_73)}},defer:function(_75,obj,_77,_78){var fn=this.createDelegate(obj,_77,_78);if(_75){return setTimeout(fn,_75)}fn();return 0},createSequence:function(fcn,_7b){if(typeof fcn!="function"){return this}var _7c=this;return function(){var _7d=_7c.apply(this||window,arguments);fcn.apply(_7b||this||window,arguments);return _7d}},createInterceptor:function(fcn,_7f){if(typeof fcn!="function"){return this}var _80=this;return function(){fcn.target=this;fcn.method=_80;if(fcn.apply(_7f||this||window,arguments)===false){return}return _80.apply(this||window,arguments)}}});Ext.applyIf(String,{escape:function(_81){return _81.replace(/('|\\)/g,"\\$1")},leftPad:function(val,_83,ch){var _85=new String(val);if(!ch){ch=" "}while(_85.length<_83){_85=ch+_85}return _85.toString()},format:function(_86){var _87=Array.prototype.slice.call(arguments,1);return _86.replace(/\{(\d+)\}/g,function(m,i){return _87[i]})}});String.prototype.toggle=function(_8a,_8b){return this==_8a?_8b:_8a};String.prototype.trim=function(){var re=/^\s+|\s+$/g;return function(){return this.replace(re,"")}}();Ext.applyIf(Number.prototype,{constrain:function(min,max){return Math.min(Math.max(this,min),max)}});Ext.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,len=this.length;i<len;i++){if(this[i]==o){return i}}return -1},remove:function(o){var _93=this.indexOf(o);if(_93!=-1){this.splice(_93,1)}return this}});Date.prototype.getElapsed=function(_94){return Math.abs((_94||new Date()).getTime()-this.getTime())};(function(){var _1;Ext.lib.Dom={getViewWidth:function(_2){return _2?this.getDocumentWidth():this.getViewportWidth()
2
+ },getViewHeight:function(_3){return _3?this.getDocumentHeight():this.getViewportHeight()},getDocumentHeight:function(){var _4=(document.compatMode!="CSS1Compat")?document.body.scrollHeight:document.documentElement.scrollHeight;return Math.max(_4,this.getViewportHeight())},getDocumentWidth:function(){var _5=(document.compatMode!="CSS1Compat")?document.body.scrollWidth:document.documentElement.scrollWidth;return Math.max(_5,this.getViewportWidth())},getViewportHeight:function(){var _6=self.innerHeight;var _7=document.compatMode;if((_7||Ext.isIE)&&!Ext.isOpera){_6=(_7=="CSS1Compat")?document.documentElement.clientHeight:document.body.clientHeight}return _6},getViewportWidth:function(){var _8=self.innerWidth;var _9=document.compatMode;if(_9||Ext.isIE){_8=(_9=="CSS1Compat")?document.documentElement.clientWidth:document.body.clientWidth}return _8},isAncestor:function(p,c){p=Ext.getDom(p);c=Ext.getDom(c);if(!p||!c){return false}if(p.contains&&!Ext.isSafari){return p.contains(c)}else{if(p.compareDocumentPosition){return !!(p.compareDocumentPosition(c)&16)}else{var _c=c.parentNode;while(_c){if(_c==p){return true}else{if(!_c.tagName||_c.tagName.toUpperCase()=="HTML"){return false}}_c=_c.parentNode}return false}}},getRegion:function(el){return Ext.lib.Region.getRegion(el)},getY:function(el){return this.getXY(el)[1]},getX:function(el){return this.getXY(el)[0]},getXY:function(el){var p,pe,b,_14,bd=(document.body||document.documentElement);el=Ext.getDom(el);if(el==bd){return[0,0]}if(el.getBoundingClientRect){b=el.getBoundingClientRect();_14=fly(document).getScroll();return[b.left+_14.left,b.top+_14.top]}var x=0,y=0;p=el;var _18=fly(el).getStyle("position")=="absolute";while(p){x+=p.offsetLeft;y+=p.offsetTop;if(!_18&&fly(p).getStyle("position")=="absolute"){_18=true}if(Ext.isGecko){pe=fly(p);var bt=parseInt(pe.getStyle("borderTopWidth"),10)||0;var bl=parseInt(pe.getStyle("borderLeftWidth"),10)||0;x+=bl;y+=bt;if(p!=el&&pe.getStyle("overflow")!="visible"){x+=bl;y+=bt}}p=p.offsetParent}if(Ext.isSafari&&_18){x-=bd.offsetLeft;y-=bd.offsetTop}if(Ext.isGecko&&!_18){var dbd=fly(bd);x+=parseInt(dbd.getStyle("borderLeftWidth"),10)||0;y+=parseInt(dbd.getStyle("borderTopWidth"),10)||0}p=el.parentNode;while(p&&p!=bd){if(!Ext.isOpera||(p.tagName!="TR"&&fly(p).getStyle("display")!="inline")){x-=p.scrollLeft;y-=p.scrollTop}p=p.parentNode}return[x,y]},setXY:function(el,xy){el=Ext.fly(el,"_setXY");el.position();var pts=el.translatePoints(xy);if(xy[0]!==false){el.dom.style.left=pts.left+"px"}if(xy[1]!==false){el.dom.style.top=pts.top+"px"}},setX:function(el,x){this.setXY(el,[x,false])},setY:function(el,y){this.setXY(el,[false,y])}};Ext.lib.Event={getPageX:function(e){return Event.pointerX(e.browserEvent||e)},getPageY:function(e){return Event.pointerY(e.browserEvent||e)},getXY:function(e){e=e.browserEvent||e;return[Event.pointerX(e),Event.pointerY(e)]},getTarget:function(e){return Event.element(e.browserEvent||e)},resolveTextNode:function(_27){if(_27&&3==_27.nodeType){return _27.parentNode}else{return _27}},getRelatedTarget:function(ev){ev=ev.browserEvent||ev;var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement}else{if(ev.type=="mouseover"){t=ev.fromElement}}}return this.resolveTextNode(t)},on:function(el,_2b,fn){Event.observe(el,_2b,fn,false)},un:function(el,_2e,fn){Event.stopObserving(el,_2e,fn,false)},purgeElement:function(el){},preventDefault:function(e){e=e.browserEvent||e;if(e.preventDefault){e.preventDefault()}else{e.returnValue=false}},stopPropagation:function(e){e=e.browserEvent||e;if(e.stopPropagation){e.stopPropagation()}else{e.cancelBubble=true}},stopEvent:function(e){Event.stop(e.browserEvent||e)},onAvailable:function(id,fn,_36){var _37=new Date(),iid;var f=function(){if(_37.getElapsed()>10000){clearInterval(iid)}var el=document.getElementById(id);if(el){clearInterval(iid);fn.call(_36||window,el)}};iid=setInterval(f,50)}};Ext.lib.Ajax=function(){var _3b=function(cb){return cb.success?function(xhr){cb.success.call(cb.scope||window,{responseText:xhr.responseText,responseXML:xhr.responseXML,argument:cb.argument})}:Ext.emptyFn};var _3e=function(cb){return cb.failure?function(xhr){cb.failure.call(cb.scope||window,{responseText:xhr.responseText,responseXML:xhr.responseXML,argument:cb.argument})}:Ext.emptyFn};return{request:function(_41,uri,cb,_44,_45){var o={method:_41,parameters:_44||"",timeout:cb.timeout,onSuccess:_3b(cb),onFailure:_3e(cb)};if(_45){var hs=_45.headers;if(hs){o.requestHeaders=hs}if(_45.xmlData){_41=(_41?_41:(_45.method?_45.method:"POST"));if(!hs||!hs["Content-Type"]){o.contentType="text/xml"}o.postBody=_45.xmlData;delete o.parameters}if(_45.jsonData){_41=(_41?_41:(_45.method?_45.method:"POST"));if(!hs||!hs["Content-Type"]){o.contentType="application/json"}o.postBody=typeof _45.jsonData=="object"?Ext.encode(_45.jsonData):_45.jsonData;delete o.parameters}}new Ajax.Request(uri,o)},formRequest:function(_48,uri,cb,_4b,_4c,_4d){new Ajax.Request(uri,{method:Ext.getDom(_48).method||"POST",parameters:Form.serialize(_48)+(_4b?"&"+_4b:""),timeout:cb.timeout,onSuccess:_3b(cb),onFailure:_3e(cb)})},isCallInProgress:function(_4e){return false},abort:function(_4f){return false},serializeForm:function(_50){return Form.serialize(_50.dom||_50)}}}();Ext.lib.Anim=function(){var _51={easeOut:function(pos){return 1-Math.pow(1-pos,2)},easeIn:function(pos){return 1-Math.pow(1-pos,2)}};var _54=function(cb,_56){return{stop:function(_57){this.effect.cancel()},isAnimated:function(){return this.effect.state=="running"},proxyCallback:function(){Ext.callback(cb,_56)}}};return{scroll:function(el,_59,_5a,_5b,cb,_5d){var _5e=_54(cb,_5d);el=Ext.getDom(el);if(typeof _59.scroll.to[0]=="number"){el.scrollLeft=_59.scroll.to[0]}if(typeof _59.scroll.to[1]=="number"){el.scrollTop=_59.scroll.to[1]}_5e.proxyCallback();return _5e},motion:function(el,_60,_61,_62,cb,_64){return this.run(el,_60,_61,_62,cb,_64)},color:function(el,_66,_67,_68,cb,_6a){return this.run(el,_66,_67,_68,cb,_6a)},run:function(el,_6c,_6d,_6e,cb,_70,_71){var o={};for(var k in _6c){switch(k){case"points":var by,pts,e=Ext.fly(el,"_animrun");e.position();if(by=_6c.points.by){var xy=e.getXY();pts=e.translatePoints([xy[0]+by[0],xy[1]+by[1]])}else{pts=e.translatePoints(_6c.points.to)}o.left=pts.left+"px";o.top=pts.top+"px";break;case"width":o.width=_6c.width.to+"px";break;case"height":o.height=_6c.height.to+"px";break;case"opacity":o.opacity=String(_6c.opacity.to);break;default:o[k]=String(_6c[k].to);break}}var _78=_54(cb,_70);_78.effect=new Effect.Morph(Ext.id(el),{duration:_6d,afterFinish:_78.proxyCallback,transition:_51[_6e]||Effect.Transitions.linear,style:o});return _78}}}();function fly(el){if(!_1){_1=new Ext.Element.Flyweight()}_1.dom=el;return _1}Ext.lib.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l};Ext.lib.Region.prototype={contains:function(_7e){return(_7e.left>=this.left&&_7e.right<=this.right&&_7e.top>=this.top&&_7e.bottom<=this.bottom)},getArea:function(){return((this.bottom-this.top)*(this.right-this.left))},intersect:function(_7f){var t=Math.max(this.top,_7f.top);var r=Math.min(this.right,_7f.right);var b=Math.min(this.bottom,_7f.bottom);var l=Math.max(this.left,_7f.left);if(b>=t&&r>=l){return new Ext.lib.Region(t,r,b,l)}else{return null}},union:function(_84){var t=Math.min(this.top,_84.top);var r=Math.max(this.right,_84.right);var b=Math.max(this.bottom,_84.bottom);var l=Math.min(this.left,_84.left);return new Ext.lib.Region(t,r,b,l)},constrainTo:function(r){this.top=this.top.constrain(r.top,r.bottom);this.bottom=this.bottom.constrain(r.top,r.bottom);this.left=this.left.constrain(r.left,r.right);this.right=this.right.constrain(r.left,r.right);return this},adjust:function(t,l,b,r){this.top+=t;this.left+=l;this.right+=r;this.bottom+=b;return this}};Ext.lib.Region.getRegion=function(el){var p=Ext.lib.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new Ext.lib.Region(t,r,b,l)};Ext.lib.Point=function(x,y){if(Ext.isArray(x)){y=x[1];
3
+ x=x[0]}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y};Ext.lib.Point.prototype=new Ext.lib.Region();if(Ext.isIE){function fnCleanUp(){var p=Function.prototype;delete p.createSequence;delete p.defer;delete p.createDelegate;delete p.createCallback;delete p.createInterceptor;window.detachEvent("onunload",fnCleanUp)}window.attachEvent("onunload",fnCleanUp)}})();
4
+ Ext.DomHelper=function(){var _1=null;var _2=/^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;var _3=/^table|tbody|tr|td$/i;var _4=function(o){if(typeof o=="string"){return o}var b="";if(Ext.isArray(o)){for(var i=0,l=o.length;i<l;i++){b+=_4(o[i])}return b}if(!o.tag){o.tag="div"}b+="<"+o.tag;for(var _9 in o){if(_9=="tag"||_9=="children"||_9=="cn"||_9=="html"||typeof o[_9]=="function"){continue}if(_9=="style"){var s=o.style;if(typeof s=="function"){s=s.call()}if(typeof s=="string"){b+=' style="'+s+'"'}else{if(typeof s=="object"){b+=' style="';for(var _b in s){if(typeof s[_b]!="function"){b+=_b+":"+s[_b]+";"}}b+='"'}}}else{if(_9=="cls"){b+=' class="'+o.cls+'"'}else{if(_9=="htmlFor"){b+=' for="'+o.htmlFor+'"'}else{b+=" "+_9+'="'+o[_9]+'"'}}}}if(_2.test(o.tag)){b+="/>"}else{b+=">";var cn=o.children||o.cn;if(cn){b+=_4(cn)}else{if(o.html){b+=o.html}}b+="</"+o.tag+">"}return b};var _d=function(o,_f){var el;if(Ext.isArray(o)){el=document.createDocumentFragment();for(var i=0,l=o.length;i<l;i++){_d(o[i],el)}}else{if(typeof o=="string"){el=document.createTextNode(o)}else{el=document.createElement(o.tag||"div");var _13=!!el.setAttribute;for(var _14 in o){if(_14=="tag"||_14=="children"||_14=="cn"||_14=="html"||_14=="style"||typeof o[_14]=="function"){continue}if(_14=="cls"){el.className=o.cls}else{if(_13){el.setAttribute(_14,o[_14])}else{el[_14]=o[_14]}}}Ext.DomHelper.applyStyles(el,o.style);var cn=o.children||o.cn;if(cn){_d(cn,el)}else{if(o.html){el.innerHTML=o.html}}}}if(_f){_f.appendChild(el)}return el};var _16=function(_17,s,h,e){_1.innerHTML=[s,h,e].join("");var i=-1,el=_1;while(++i<_17){el=el.firstChild}return el};var ts="<table>",te="</table>",tbs=ts+"<tbody>",tbe="</tbody>"+te,trs=tbs+"<tr>",tre="</tr>"+tbe;var _23=function(tag,_25,el,_27){if(!_1){_1=document.createElement("div")}var _28;var _29=null;if(tag=="td"){if(_25=="afterbegin"||_25=="beforeend"){return}if(_25=="beforebegin"){_29=el;el=el.parentNode}else{_29=el.nextSibling;el=el.parentNode}_28=_16(4,trs,_27,tre)}else{if(tag=="tr"){if(_25=="beforebegin"){_29=el;el=el.parentNode;_28=_16(3,tbs,_27,tbe)}else{if(_25=="afterend"){_29=el.nextSibling;el=el.parentNode;_28=_16(3,tbs,_27,tbe)}else{if(_25=="afterbegin"){_29=el.firstChild}_28=_16(4,trs,_27,tre)}}}else{if(tag=="tbody"){if(_25=="beforebegin"){_29=el;el=el.parentNode;_28=_16(2,ts,_27,te)}else{if(_25=="afterend"){_29=el.nextSibling;el=el.parentNode;_28=_16(2,ts,_27,te)}else{if(_25=="afterbegin"){_29=el.firstChild}_28=_16(3,tbs,_27,tbe)}}}else{if(_25=="beforebegin"||_25=="afterend"){return}if(_25=="afterbegin"){_29=el.firstChild}_28=_16(2,ts,_27,te)}}}el.insertBefore(_28,_29);return _28};return{useDom:false,markup:function(o){return _4(o)},applyStyles:function(el,_2c){if(_2c){el=Ext.fly(el);if(typeof _2c=="string"){var re=/\s?([a-z\-]*)\:\s?([^;]*);?/gi;var _2e;while((_2e=re.exec(_2c))!=null){el.setStyle(_2e[1],_2e[2])}}else{if(typeof _2c=="object"){for(var _2f in _2c){el.setStyle(_2f,_2c[_2f])}}else{if(typeof _2c=="function"){Ext.DomHelper.applyStyles(el,_2c.call())}}}}},insertHtml:function(_30,el,_32){_30=_30.toLowerCase();if(el.insertAdjacentHTML){if(_3.test(el.tagName)){var rs;if(rs=_23(el.tagName.toLowerCase(),_30,el,_32)){return rs}}switch(_30){case"beforebegin":el.insertAdjacentHTML("BeforeBegin",_32);return el.previousSibling;case"afterbegin":el.insertAdjacentHTML("AfterBegin",_32);return el.firstChild;case"beforeend":el.insertAdjacentHTML("BeforeEnd",_32);return el.lastChild;case"afterend":el.insertAdjacentHTML("AfterEnd",_32);return el.nextSibling}throw'Illegal insertion point -> "'+_30+'"'}var _34=el.ownerDocument.createRange();var _35;switch(_30){case"beforebegin":_34.setStartBefore(el);_35=_34.createContextualFragment(_32);el.parentNode.insertBefore(_35,el);return el.previousSibling;case"afterbegin":if(el.firstChild){_34.setStartBefore(el.firstChild);_35=_34.createContextualFragment(_32);el.insertBefore(_35,el.firstChild);return el.firstChild}else{el.innerHTML=_32;return el.firstChild}case"beforeend":if(el.lastChild){_34.setStartAfter(el.lastChild);_35=_34.createContextualFragment(_32);el.appendChild(_35);return el.lastChild}else{el.innerHTML=_32;return el.lastChild}case"afterend":_34.setStartAfter(el);_35=_34.createContextualFragment(_32);el.parentNode.insertBefore(_35,el.nextSibling);return el.nextSibling}throw'Illegal insertion point -> "'+_30+'"'},insertBefore:function(el,o,_38){return this.doInsert(el,o,_38,"beforeBegin")},insertAfter:function(el,o,_3b){return this.doInsert(el,o,_3b,"afterEnd","nextSibling")},insertFirst:function(el,o,_3e){return this.doInsert(el,o,_3e,"afterBegin","firstChild")},doInsert:function(el,o,_41,pos,_43){el=Ext.getDom(el);var _44;if(this.useDom){_44=_d(o,null);(_43==="firstChild"?el:el.parentNode).insertBefore(_44,_43?el[_43]:el)}else{var _45=_4(o);_44=this.insertHtml(pos,el,_45)}return _41?Ext.get(_44,true):_44},append:function(el,o,_48){el=Ext.getDom(el);var _49;if(this.useDom){_49=_d(o,null);el.appendChild(_49)}else{var _4a=_4(o);_49=this.insertHtml("beforeEnd",el,_4a)}return _48?Ext.get(_49,true):_49},overwrite:function(el,o,_4d){el=Ext.getDom(el);el.innerHTML=_4(o);return _4d?Ext.get(el.firstChild,true):el.firstChild},createTemplate:function(o){var _4f=_4(o);return new Ext.Template(_4f)}}}();Ext.Template=function(_1){var a=arguments;if(Ext.isArray(_1)){_1=_1.join("")}else{if(a.length>1){var _3=[];for(var i=0,_5=a.length;i<_5;i++){if(typeof a[i]=="object"){Ext.apply(this,a[i])}else{_3[_3.length]=a[i]}}_1=_3.join("")}}this.html=_1;if(this.compiled){this.compile()}};Ext.Template.prototype={applyTemplate:function(_6){if(this.compiled){return this.compiled(_6)}var _7=this.disableFormats!==true;var fm=Ext.util.Format,_9=this;var fn=function(m,_c,_d,_e){if(_d&&_7){if(_d.substr(0,5)=="this."){return _9.call(_d.substr(5),_6[_c],_6)}else{if(_e){var re=/^\s*['"](.*)["']\s*$/;_e=_e.split(",");for(var i=0,len=_e.length;i<len;i++){_e[i]=_e[i].replace(re,"$1")}_e=[_6[_c]].concat(_e)}else{_e=[_6[_c]]}return fm[_d].apply(fm,_e)}}else{return _6[_c]!==undefined?_6[_c]:""}};return this.html.replace(this.re,fn)},set:function(_12,_13){this.html=_12;this.compiled=null;if(_13){this.compile()}return this},disableFormats:false,re:/\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,compile:function(){var fm=Ext.util.Format;var _15=this.disableFormats!==true;var sep=Ext.isGecko?"+":",";var fn=function(m,_19,_1a,_1b){if(_1a&&_15){_1b=_1b?","+_1b:"";if(_1a.substr(0,5)!="this."){_1a="fm."+_1a+"("}else{_1a='this.call("'+_1a.substr(5)+'", ';_1b=", values"}}else{_1b="";_1a="(values['"+_19+"'] == undefined ? '' : "}return"'"+sep+_1a+"values['"+_19+"']"+_1b+")"+sep+"'"};var _1c;if(Ext.isGecko){_1c="this.compiled = function(values){ return '"+this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn)+"';};"}else{_1c=["this.compiled = function(values){ return ['"];_1c.push(this.html.replace(/\\/g,"\\\\").replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn));_1c.push("'].join('');};");_1c=_1c.join("")}eval(_1c);return this},call:function(_1d,_1e,_1f){return this[_1d](_1e,_1f)},insertFirst:function(el,_21,_22){return this.doInsert("afterBegin",el,_21,_22)},insertBefore:function(el,_24,_25){return this.doInsert("beforeBegin",el,_24,_25)},insertAfter:function(el,_27,_28){return this.doInsert("afterEnd",el,_27,_28)},append:function(el,_2a,_2b){return this.doInsert("beforeEnd",el,_2a,_2b)},doInsert:function(_2c,el,_2e,_2f){el=Ext.getDom(el);var _30=Ext.DomHelper.insertHtml(_2c,el,this.applyTemplate(_2e));return _2f?Ext.get(_30,true):_30},overwrite:function(el,_32,_33){el=Ext.getDom(el);el.innerHTML=this.applyTemplate(_32);return _33?Ext.get(el.firstChild,true):el.firstChild}};Ext.Template.prototype.apply=Ext.Template.prototype.applyTemplate;Ext.DomHelper.Template=Ext.Template;Ext.Template.from=function(el,_35){el=Ext.getDom(el);return new Ext.Template(el.value||el.innerHTML,_35||"")};Ext.DomQuery=function(){var _1={},_2={},_3={};var _4=/\S/;var _5=/^\s+|\s+$/g;var _6=/\{(\d+)\}/g;
5
+ var _7=/^(\s?[\/>+~]\s?|\s|$)/;var _8=/^(#)?([\w-\*]+)/;var _9=/(\d*)n\+?(\d*)/,_a=/\D/;function child(p,_c){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==_c){return n}}n=n.nextSibling}return null}function next(n){while((n=n.nextSibling)&&n.nodeType!=1){}return n}function prev(n){while((n=n.previousSibling)&&n.nodeType!=1){}return n}function children(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!_4.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}return this}function byClassName(c,a,v){if(!v){return c}var r=[],ri=-1,cn;for(var i=0,ci;ci=c[i];i++){if((" "+ci.className+" ").indexOf(v)!=-1){r[++ri]=ci}}return r}function attrValue(n,_1e){if(!n.tagName&&typeof n.length!="undefined"){n=n[0]}if(!n){return null}if(_1e=="for"){return n.htmlFor}if(_1e=="class"||_1e=="className"){return n.className}return n.getAttribute(_1e)||n[_1e]}function getNodes(ns,_20,_21){var _22=[],ri=-1,cs;if(!ns){return _22}_21=_21||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns]}if(!_20){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(_21);for(var j=0,ci;ci=cs[j];j++){_22[++ri]=ci}}}else{if(_20=="/"||_20==">"){var _29=_21.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.children||ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==_29||cj.nodeName==_21||_21=="*"){_22[++ri]=cj}}}}else{if(_20=="+"){var _29=_21.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(n&&(n.nodeName==_29||n.nodeName==_21||_21=="*")){_22[++ri]=n}}}else{if(_20=="~"){for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&(n.nodeType!=1||(_21=="*"||n.tagName.toLowerCase()!=_21))){}if(n){_22[++ri]=n}}}}}}return _22}function concat(a,b){if(b.slice){return a.concat(b)}for(var i=0,l=b.length;i<l;i++){a[a.length]=b[i]}return a}function byTag(cs,_32){if(cs.tagName||cs==document){cs=[cs]}if(!_32){return cs}var r=[],ri=-1;_32=_32.toLowerCase();for(var i=0,ci;ci=cs[i];i++){if(ci.nodeType==1&&ci.tagName.toLowerCase()==_32){r[++ri]=ci}}return r}function byId(cs,_38,id){if(cs.tagName||cs==document){cs=[cs]}if(!id){return cs}var r=[],ri=-1;for(var i=0,ci;ci=cs[i];i++){if(ci&&ci.id==id){r[++ri]=ci;return r}}return r}function byAttribute(cs,_3f,_40,op,_42){var r=[],ri=-1,st=_42=="{";var f=Ext.DomQuery.operators[op];for(var i=0,ci;ci=cs[i];i++){var a;if(st){a=Ext.DomQuery.getStyle(ci,_3f)}else{if(_3f=="class"||_3f=="className"){a=ci.className}else{if(_3f=="for"){a=ci.htmlFor}else{if(_3f=="href"){a=ci.getAttribute("href",2)}else{a=ci.getAttribute(_3f)}}}}if((f&&f(a,_40))||(!f&&a)){r[++ri]=ci}}return r}function byPseudo(cs,_4b,_4c){return Ext.DomQuery.pseudos[_4b](cs,_4c)}var _4d=window.ActiveXObject?true:false;eval("var batch = 30803;");var key=30803;function nodupIEXml(cs){var d=++key;cs[0].setAttribute("_nodup",d);var r=[cs[0]];for(var i=1,len=cs.length;i<len;i++){var c=cs[i];if(!c.getAttribute("_nodup")!=d){c.setAttribute("_nodup",d);r[r.length]=c}}for(var i=0,len=cs.length;i<len;i++){cs[i].removeAttribute("_nodup")}return r}function nodup(cs){if(!cs){return[]}var len=cs.length,c,i,r=cs,cj,ri=-1;if(!len||typeof cs.nodeType!="undefined"||len==1){return cs}if(_4d&&typeof cs[0].selectSingleNode!="undefined"){return nodupIEXml(cs)}var d=++key;cs[0]._nodup=d;for(i=1;c=cs[i];i++){if(c._nodup!=d){c._nodup=d}else{r=[];for(var j=0;j<i;j++){r[++ri]=cs[j]}for(j=i+1;cj=cs[j];j++){if(cj._nodup!=d){cj._nodup=d;r[++ri]=cj}}return r}}return r}function quickDiffIEXml(c1,c2){var d=++key;for(var i=0,len=c1.length;i<len;i++){c1[i].setAttribute("_qdiff",d)}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i].getAttribute("_qdiff")!=d){r[r.length]=c2[i]}}for(var i=0,len=c1.length;i<len;i++){c1[i].removeAttribute("_qdiff")}return r}function quickDiff(c1,c2){var _66=c1.length;if(!_66){return c2}if(_4d&&c1[0].selectSingleNode){return quickDiffIEXml(c1,c2)}var d=++key;for(var i=0;i<_66;i++){c1[i]._qdiff=d}var r=[];for(var i=0,len=c2.length;i<len;i++){if(c2[i]._qdiff!=d){r[r.length]=c2[i]}}return r}function quickId(ns,_6c,_6d,id){if(ns==_6d){var d=_6d.ownerDocument||_6d;return d.getElementById(id)}ns=getNodes(ns,_6c,"*");return byId(ns,null,id)}return{getStyle:function(el,_71){return Ext.fly(el).getStyle(_71)},compile:function(_72,_73){_73=_73||"select";var fn=["var f = function(root){\n var mode; ++batch; var n = root || document;\n"];var q=_72,_76,lq;var tk=Ext.DomQuery.matchers;var _79=tk.length;var mm;var _7b=q.match(_7);if(_7b&&_7b[1]){fn[fn.length]='mode="'+_7b[1].replace(_5,"")+'";';q=q.replace(_7b[1],"")}while(_72.substr(0,1)=="/"){_72=_72.substr(1)}while(q&&lq!=q){lq=q;var tm=q.match(_8);if(_73=="select"){if(tm){if(tm[1]=="#"){fn[fn.length]='n = quickId(n, mode, root, "'+tm[2]+'");'}else{fn[fn.length]='n = getNodes(n, mode, "'+tm[2]+'");'}q=q.replace(tm[0],"")}else{if(q.substr(0,1)!="@"){fn[fn.length]='n = getNodes(n, mode, "*");'}}}else{if(tm){if(tm[1]=="#"){fn[fn.length]='n = byId(n, null, "'+tm[2]+'");'}else{fn[fn.length]='n = byTag(n, "'+tm[2]+'");'}q=q.replace(tm[0],"")}}while(!(mm=q.match(_7))){var _7d=false;for(var j=0;j<_79;j++){var t=tk[j];var m=q.match(t.re);if(m){fn[fn.length]=t.select.replace(_6,function(x,i){return m[i]});q=q.replace(m[0],"");_7d=true;break}}if(!_7d){throw'Error parsing selector, parsing failed at "'+q+'"'}}if(mm[1]){fn[fn.length]='mode="'+mm[1].replace(_5,"")+'";';q=q.replace(mm[1],"")}}fn[fn.length]="return nodup(n);\n}";eval(fn.join(""));return f},select:function(_83,_84,_85){if(!_84||_84==document){_84=document}if(typeof _84=="string"){_84=document.getElementById(_84)}var _86=_83.split(",");var _87=[];for(var i=0,len=_86.length;i<len;i++){var p=_86[i].replace(_5,"");if(!_1[p]){_1[p]=Ext.DomQuery.compile(p);if(!_1[p]){throw p+" is not a valid selector"}}var _8b=_1[p](_84);if(_8b&&_8b!=document){_87=_87.concat(_8b)}}if(_86.length>1){return nodup(_87)}return _87},selectNode:function(_8c,_8d){return Ext.DomQuery.select(_8c,_8d)[0]},selectValue:function(_8e,_8f,_90){_8e=_8e.replace(_5,"");if(!_3[_8e]){_3[_8e]=Ext.DomQuery.compile(_8e,"select")}var n=_3[_8e](_8f);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==="")?_90:v)},selectNumber:function(_93,_94,_95){var v=Ext.DomQuery.selectValue(_93,_94,_95||0);return parseFloat(v)},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el)}var _99=Ext.isArray(el);var _9a=Ext.DomQuery.filter(_99?el:[el],ss);return _99?(_9a.length==el.length):(_9a.length>0)},filter:function(els,ss,_9d){ss=ss.replace(_5,"");if(!_2[ss]){_2[ss]=Ext.DomQuery.compile(ss,"simple")}var _9e=_2[ss](els);return _9d?quickDiff(_9e,els):_9e},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, null, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, null, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v},"!=":function(a,v){return a!=v},"^=":function(a,v){return a&&a.substr(0,v.length)==v},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v},"*=":function(a,v){return a&&a.indexOf(v)!==-1},"%=":function(a,v){return(a%v)==0},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+"-")},"~=":function(a,v){return a&&(" "+a+" ").indexOf(" "+v+" ")!=-1}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1){}if(!n){r[++ri]=ci}}return r},"nth-child":function(c,a){var r=[],ri=-1;var m=_9.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!_a.test(a)&&"n+"+a||a);var f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j
6
+ }}pn._batch=batch}if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n}}else{if((n.nodeIndex+l)%f==0){r[++ri]=n}}}return r},"only-child":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci}}return r},empty:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,_d4=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){_d4=false;break}}if(_d4){r[++ri]=ci}}return r},contains:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||"").indexOf(v)!=-1){r[++ri]=ci}}return r},nodeValue:function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci}}return r},checked:function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci}}return r},not:function(c,ss){return Ext.DomQuery.filter(c,ss,true)},any:function(c,_e9){var ss=_e9.split("|");var r=[],ri=-1,s;for(var i=0,ci;ci=c[i];i++){for(var j=0;s=ss[j];j++){if(Ext.DomQuery.is(ci,s)){r[++ri]=ci;break}}}return r},odd:function(c){return this["nth-child"](c,"odd")},even:function(c){return this["nth-child"](c,"even")},nth:function(c,a){return c[a-1]||[]},first:function(c){return c[0]||[]},last:function(c){return c[c.length-1]||[]},has:function(c,ss){var s=Ext.DomQuery.select;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci}}return r},next:function(c,ss){var is=Ext.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r},prev:function(c,ss){var is=Ext.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci}}return r}}}}();Ext.query=Ext.DomQuery.select;Ext.util.Observable=function(){if(this.listeners){this.on(this.listeners);delete this.listeners}};Ext.util.Observable.prototype={fireEvent:function(){if(this.eventsSuspended!==true){var ce=this.events[arguments[0].toLowerCase()];if(typeof ce=="object"){return ce.fire.apply(ce,Array.prototype.slice.call(arguments,1))}}return true},filterOptRe:/^(?:scope|delay|buffer|single)$/,addListener:function(_2,fn,_4,o){if(typeof _2=="object"){o=_2;for(var e in o){if(this.filterOptRe.test(e)){continue}if(typeof o[e]=="function"){this.addListener(e,o[e],o.scope,o)}else{this.addListener(e,o[e].fn,o[e].scope,o[e])}}return}o=(!o||typeof o=="boolean")?{}:o;_2=_2.toLowerCase();var ce=this.events[_2]||true;if(typeof ce=="boolean"){ce=new Ext.util.Event(this,_2);this.events[_2]=ce}ce.addListener(fn,_4,o)},removeListener:function(_8,fn,_a){var ce=this.events[_8.toLowerCase()];if(typeof ce=="object"){ce.removeListener(fn,_a)}},purgeListeners:function(){for(var _c in this.events){if(typeof this.events[_c]=="object"){this.events[_c].clearListeners()}}},relayEvents:function(o,_e){var _f=function(_10){return function(){return this.fireEvent.apply(this,Ext.combine(_10,Array.prototype.slice.call(arguments,0)))}};for(var i=0,len=_e.length;i<len;i++){var _13=_e[i];if(!this.events[_13]){this.events[_13]=true}o.on(_13,_f(_13),this)}},addEvents:function(o){if(!this.events){this.events={}}if(typeof o=="string"){for(var i=0,a=arguments,v;v=a[i];i++){if(!this.events[a[i]]){this.events[a[i]]=true}}}else{Ext.applyIf(this.events,o)}},hasListener:function(_18){var e=this.events[_18];return typeof e=="object"&&e.listeners.length>0},suspendEvents:function(){this.eventsSuspended=true},resumeEvents:function(){this.eventsSuspended=false},getMethodEvent:function(_1a){if(!this.methodEvents){this.methodEvents={}}var e=this.methodEvents[_1a];if(!e){e={};this.methodEvents[_1a]=e;e.originalFn=this[_1a];e.methodName=_1a;e.before=[];e.after=[];var _1c,v,_1e;var obj=this;var _20=function(fn,_22,_23){if((v=fn.apply(_22||obj,_23))!==undefined){if(typeof v==="object"){if(v.returnValue!==undefined){_1c=v.returnValue}else{_1c=v}if(v.cancel===true){_1e=true}}else{if(v===false){_1e=true}else{_1c=v}}}};this[_1a]=function(){_1c=v=undefined;_1e=false;var _24=Array.prototype.slice.call(arguments,0);for(var i=0,len=e.before.length;i<len;i++){_20(e.before[i].fn,e.before[i].scope,_24);if(_1e){return _1c}}if((v=e.originalFn.apply(obj,_24))!==undefined){_1c=v}for(var i=0,len=e.after.length;i<len;i++){_20(e.after[i].fn,e.after[i].scope,_24);if(_1e){return _1c}}return _1c}}return e},beforeMethod:function(_27,fn,_29){var e=this.getMethodEvent(_27);e.before.push({fn:fn,scope:_29})},afterMethod:function(_2b,fn,_2d){var e=this.getMethodEvent(_2b);e.after.push({fn:fn,scope:_2d})},removeMethodListener:function(_2f,fn,_31){var e=this.getMethodEvent(_2f);for(var i=0,len=e.before.length;i<len;i++){if(e.before[i].fn==fn&&e.before[i].scope==_31){e.before.splice(i,1);return}}for(var i=0,len=e.after.length;i<len;i++){if(e.after[i].fn==fn&&e.after[i].scope==_31){e.after.splice(i,1);return}}}};Ext.util.Observable.prototype.on=Ext.util.Observable.prototype.addListener;Ext.util.Observable.prototype.un=Ext.util.Observable.prototype.removeListener;Ext.util.Observable.capture=function(o,fn,_37){o.fireEvent=o.fireEvent.createInterceptor(fn,_37)};Ext.util.Observable.releaseCapture=function(o){o.fireEvent=Ext.util.Observable.prototype.fireEvent};(function(){var _39=function(h,o,_3c){var _3d=new Ext.util.DelayedTask();return function(){_3d.delay(o.buffer,h,_3c,Array.prototype.slice.call(arguments,0))}};var _3e=function(h,e,fn,_42){return function(){e.removeListener(fn,_42);return h.apply(_42,arguments)}};var _43=function(h,o,_46){return function(){var _47=Array.prototype.slice.call(arguments,0);setTimeout(function(){h.apply(_46,_47)},o.delay||10)}};Ext.util.Event=function(obj,_49){this.name=_49;this.obj=obj;this.listeners=[]};Ext.util.Event.prototype={addListener:function(fn,_4b,_4c){_4b=_4b||this.obj;if(!this.isListening(fn,_4b)){var l=this.createListener(fn,_4b,_4c);if(!this.firing){this.listeners.push(l)}else{this.listeners=this.listeners.slice(0);this.listeners.push(l)}}},createListener:function(fn,_4f,o){o=o||{};_4f=_4f||this.obj;var l={fn:fn,scope:_4f,options:o};var h=fn;if(o.delay){h=_43(h,o,_4f)}if(o.single){h=_3e(h,this,fn,_4f)}if(o.buffer){h=_39(h,o,_4f)}l.fireFn=h;return l},findListener:function(fn,_54){_54=_54||this.obj;var ls=this.listeners;for(var i=0,len=ls.length;i<len;i++){var l=ls[i];if(l.fn==fn&&l.scope==_54){return i}}return -1},isListening:function(fn,_5a){return this.findListener(fn,_5a)!=-1},removeListener:function(fn,_5c){var _5d;if((_5d=this.findListener(fn,_5c))!=-1){if(!this.firing){this.listeners.splice(_5d,1)}else{this.listeners=this.listeners.slice(0);this.listeners.splice(_5d,1)}return true}return false},clearListeners:function(){this.listeners=[]},fire:function(){var ls=this.listeners,_5f,len=ls.length;if(len>0){this.firing=true;var _61=Array.prototype.slice.call(arguments,0);for(var i=0;i<len;i++){var l=ls[i];if(l.fireFn.apply(l.scope||this.obj||window,arguments)===false){this.firing=false;return false}}this.firing=false}return true}}})();Ext.EventManager=function(){var _1,_2,_3=false;var _4,_5,_6,_7;var E=Ext.lib.Event;var D=Ext.lib.Dom;var _a="Ext";var _b={};var _c=function(el,_e,fn,_10,_11){var id=Ext.id(el);if(!_b[id]){_b[id]={}}var es=_b[id];if(!es[_e]){es[_e]=[]}var ls=es[_e];ls.push({id:id,ename:_e,fn:fn,wrap:_10,scope:_11});E.on(el,_e,_10);if(_e=="mousewheel"&&el.addEventListener){el.addEventListener("DOMMouseScroll",_10,false);E.on(window,"unload",function(){el.removeEventListener("DOMMouseScroll",_10,false)})}if(_e=="mousedown"&&el==document){Ext.EventManager.stoppedMouseDownEvent.addListener(_10)}};var _15=function(el,_17,fn,_19){el=Ext.getDom(el);var id=Ext.id(el),es=_b[id],_1c;if(es){var ls=es[_17],l;if(ls){for(var i=0,len=ls.length;i<len;i++){l=ls[i];if(l.fn==fn&&(!_19||l.scope==_19)){_1c=l.wrap;E.un(el,_17,_1c);ls.splice(i,1);break}}}}if(_17=="mousewheel"&&el.addEventListener&&_1c){el.removeEventListener("DOMMouseScroll",_1c,false)}if(_17=="mousedown"&&el==document&&_1c){Ext.EventManager.stoppedMouseDownEvent.removeListener(_1c)}};var _21=function(el){el=Ext.getDom(el);var id=Ext.id(el),es=_b[id],ls;if(es){for(var _26 in es){if(es.hasOwnProperty(_26)){ls=es[_26];
7
+ for(var i=0,len=ls.length;i<len;i++){E.un(el,_26,ls[i].wrap);ls[i]=null}}es[_26]=null}delete _b[id]}};var _29=function(){if(!_3){_3=true;Ext.isReady=true;if(_2){clearInterval(_2)}if(Ext.isGecko||Ext.isOpera){document.removeEventListener("DOMContentLoaded",_29,false)}if(Ext.isIE){var _2a=document.getElementById("ie-deferred-loader");if(_2a){_2a.onreadystatechange=null;_2a.parentNode.removeChild(_2a)}}if(_1){_1.fire();_1.clearListeners()}}};var _2b=function(){_1=new Ext.util.Event();if(Ext.isGecko||Ext.isOpera){document.addEventListener("DOMContentLoaded",_29,false)}else{if(Ext.isIE){document.write('<script id="ie-deferred-loader" defer="defer" src="//:"><\/script>');var _2c=document.getElementById("ie-deferred-loader");_2c.onreadystatechange=function(){if(this.readyState=="complete"){_29()}}}else{if(Ext.isSafari){_2=setInterval(function(){var rs=document.readyState;if(rs=="complete"){_29()}},10)}}}E.on(window,"load",_29)};var _2e=function(h,o){var _31=new Ext.util.DelayedTask(h);return function(e){e=new Ext.EventObjectImpl(e);_31.delay(o.buffer,h,null,[e])}};var _33=function(h,el,_36,fn,_38){return function(e){Ext.EventManager.removeListener(el,_36,fn,_38);h(e)}};var _3a=function(h,o){return function(e){e=new Ext.EventObjectImpl(e);setTimeout(function(){h(e)},o.delay||10)}};var _3e=function(_3f,_40,opt,fn,_43){var o=(!opt||typeof opt=="boolean")?{}:opt;fn=fn||o.fn;_43=_43||o.scope;var el=Ext.getDom(_3f);if(!el){throw'Error listening for "'+_40+'". Element "'+_3f+"\" doesn't exist."}var h=function(e){if(!window[_a]){return}e=Ext.EventObject.setEvent(e);var t;if(o.delegate){t=e.getTarget(o.delegate,el);if(!t){return}}else{t=e.target}if(o.stopEvent===true){e.stopEvent()}if(o.preventDefault===true){e.preventDefault()}if(o.stopPropagation===true){e.stopPropagation()}if(o.normalized===false){e=e.browserEvent}fn.call(_43||el,e,t,o)};if(o.delay){h=_3a(h,o)}if(o.single){h=_33(h,el,_40,fn,_43)}if(o.buffer){h=_2e(h,o)}_c(el,_40,fn,h,_43);return h};var _49=/^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;var pub={addListener:function(_4b,_4c,fn,_4e,_4f){if(typeof _4c=="object"){var o=_4c;for(var e in o){if(_49.test(e)){continue}if(typeof o[e]=="function"){_3e(_4b,e,o,o[e],o.scope)}else{_3e(_4b,e,o[e])}}return}return _3e(_4b,_4c,_4f,fn,_4e)},removeListener:function(_52,_53,fn,_55){return _15(_52,_53,fn,_55)},removeAll:function(_56){return _21(_56)},onDocumentReady:function(fn,_58,_59){if(_3){_1.addListener(fn,_58,_59);_1.fire();_1.clearListeners();return}if(!_1){_2b()}_59=_59||{};if(!_59.delay){_59.delay=1}_1.addListener(fn,_58,_59)},doResizeEvent:function(){_4.fire(D.getViewWidth(),D.getViewHeight())},onWindowResize:function(fn,_5b,_5c){if(!_4){_4=new Ext.util.Event();_5=new Ext.util.DelayedTask(this.doResizeEvent);E.on(window,"resize",this.fireWindowResize,this)}_4.addListener(fn,_5b,_5c)},fireWindowResize:function(){if(_4){if((Ext.isIE||Ext.isAir)&&_5){_5.delay(50)}else{_4.fire(D.getViewWidth(),D.getViewHeight())}}},onTextResize:function(fn,_5e,_5f){if(!_6){_6=new Ext.util.Event();var _60=new Ext.Element(document.createElement("div"));_60.dom.className="x-text-resize";_60.dom.innerHTML="X";_60.appendTo(document.body);_7=_60.dom.offsetHeight;setInterval(function(){if(_60.dom.offsetHeight!=_7){_6.fire(_7,_7=_60.dom.offsetHeight)}},this.textResizeInterval)}_6.addListener(fn,_5e,_5f)},removeResizeListener:function(fn,_62){if(_4){_4.removeListener(fn,_62)}},fireResize:function(){if(_4){_4.fire(D.getViewWidth(),D.getViewHeight())}},ieDeferSrc:false,textResizeInterval:50};pub.on=pub.addListener;pub.un=pub.removeListener;pub.stoppedMouseDownEvent=new Ext.util.Event();return pub}();Ext.onReady=Ext.EventManager.onDocumentReady;(function(){var _63=function(){var bd=document.body||document.getElementsByTagName("body")[0];if(!bd){return false}var cls=[" ",Ext.isIE?"ext-ie "+(Ext.isIE6?"ext-ie6":(Ext.isIE7?"ext-ie7":"ext-ie8")):Ext.isGecko?"ext-gecko "+(Ext.isGecko2?"ext-gecko2":"ext-gecko3"):Ext.isOpera?"ext-opera":Ext.isSafari?"ext-safari":Ext.isChrome?"ext-chrome":""];if(Ext.isMac){cls.push("ext-mac")}if(Ext.isLinux){cls.push("ext-linux")}if(Ext.isBorderBox){cls.push("ext-border-box")}if(Ext.isStrict){var p=bd.parentNode;if(p){p.className+=" ext-strict"}}bd.className+=cls.join(" ");return true};if(!_63()){Ext.onReady(_63)}})();Ext.EventObject=function(){var E=Ext.lib.Event;var _68={3:13,63234:37,63235:39,63232:38,63233:40,63276:33,63277:34,63272:46,63273:36,63275:35};var _69=Ext.isIE?{1:0,4:1,2:2}:(Ext.isSafari?{1:0,2:1,3:2}:{0:0,1:1,2:2});Ext.EventObjectImpl=function(e){if(e){this.setEvent(e.browserEvent||e)}};Ext.EventObjectImpl.prototype={browserEvent:null,button:-1,shiftKey:false,ctrlKey:false,altKey:false,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,CONTROL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGEUP:33,PAGE_DOWN:34,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,setEvent:function(e){if(e==this||(e&&e.browserEvent)){return e}this.browserEvent=e;if(e){this.button=e.button?_69[e.button]:(e.which?e.which-1:-1);if(e.type=="click"&&this.button==-1){this.button=0}this.type=e.type;this.shiftKey=e.shiftKey;this.ctrlKey=e.ctrlKey||e.metaKey;this.altKey=e.altKey;this.keyCode=e.keyCode;this.charCode=e.charCode;this.target=E.getTarget(e);this.xy=E.getXY(e)}else{this.button=-1;this.shiftKey=false;this.ctrlKey=false;this.altKey=false;this.keyCode=0;this.charCode=0;this.target=null;this.xy=[0,0]}return this},stopEvent:function(){if(this.browserEvent){if(this.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(this)}E.stopEvent(this.browserEvent)}},preventDefault:function(){if(this.browserEvent){E.preventDefault(this.browserEvent)}},isNavKeyPress:function(){var k=this.keyCode;k=Ext.isSafari?(_68[k]||k):k;return(k>=33&&k<=40)||k==this.RETURN||k==this.TAB||k==this.ESC},isSpecialKey:function(){var k=this.keyCode;return(this.type=="keypress"&&this.ctrlKey)||k==9||k==13||k==40||k==27||(k==16)||(k==17)||(k>=18&&k<=20)||(k>=33&&k<=35)||(k>=36&&k<=39)||(k>=44&&k<=45)},stopPropagation:function(){if(this.browserEvent){if(this.browserEvent.type=="mousedown"){Ext.EventManager.stoppedMouseDownEvent.fire(this)}E.stopPropagation(this.browserEvent)}},getCharCode:function(){return this.charCode||this.keyCode},getKey:function(){var k=this.keyCode||this.charCode;return Ext.isSafari?(_68[k]||k):k},getPageX:function(){return this.xy[0]},getPageY:function(){return this.xy[1]},getTime:function(){if(this.browserEvent){return E.getTime(this.browserEvent)}return null},getXY:function(){return this.xy},getTarget:function(_6f,_70,_71){return _6f?Ext.fly(this.target).findParent(_6f,_70,_71):(_71?Ext.get(this.target):this.target)},getRelatedTarget:function(){if(this.browserEvent){return E.getRelatedTarget(this.browserEvent)}return null},getWheelDelta:function(){var e=this.browserEvent;var _73=0;if(e.wheelDelta){_73=e.wheelDelta/120}else{if(e.detail){_73=-e.detail/3}}return _73},hasModifier:function(){return((this.ctrlKey||this.altKey)||this.shiftKey)?true:false},within:function(el,_75,_76){var t=this[_75?"getRelatedTarget":"getTarget"]();return t&&((_76?(t===Ext.getDom(el)):false)||Ext.fly(el).contains(t))},getPoint:function(){return new Ext.lib.Point(this.xy[0],this.xy[1])}};return new Ext.EventObjectImpl()}();(function(){var D=Ext.lib.Dom;var E=Ext.lib.Event;var A=Ext.lib.Anim;var _4={};var _5=/(-[a-z])/gi;var _6=function(m,a){return a.charAt(1).toUpperCase()
8
+ };var _9=document.defaultView;Ext.Element=function(_a,_b){var _c=typeof _a=="string"?document.getElementById(_a):_a;if(!_c){return null}var id=_c.id;if(_b!==true&&id&&Ext.Element.cache[id]){return Ext.Element.cache[id]}this.dom=_c;this.id=id||Ext.id(_c)};var El=Ext.Element;El.prototype={originalDisplay:"",visibilityMode:1,defaultUnit:"px",setVisibilityMode:function(_f){this.visibilityMode=_f;return this},enableDisplayMode:function(_10){this.setVisibilityMode(El.DISPLAY);if(typeof _10!="undefined"){this.originalDisplay=_10}return this},findParent:function(_11,_12,_13){var p=this.dom,b=document.body,_16=0,dq=Ext.DomQuery,_18;_12=_12||50;if(typeof _12!="number"){_18=Ext.getDom(_12);_12=10}while(p&&p.nodeType==1&&_16<_12&&p!=b&&p!=_18){if(dq.is(p,_11)){return _13?Ext.get(p):p}_16++;p=p.parentNode}return null},findParentNode:function(_19,_1a,_1b){var p=Ext.fly(this.dom.parentNode,"_internal");return p?p.findParent(_19,_1a,_1b):null},up:function(_1d,_1e){return this.findParentNode(_1d,_1e,true)},is:function(_1f){return Ext.DomQuery.is(this.dom,_1f)},animate:function(_20,_21,_22,_23,_24){this.anim(_20,{duration:_21,callback:_22,easing:_23},_24);return this},anim:function(_25,opt,_27,_28,_29,cb){_27=_27||"run";opt=opt||{};var _2b=Ext.lib.Anim[_27](this.dom,_25,(opt.duration||_28)||0.35,(opt.easing||_29)||"easeOut",function(){Ext.callback(cb,this);Ext.callback(opt.callback,opt.scope||this,[this,opt])},this);opt.anim=_2b;return _2b},preanim:function(a,i){return !a[i]?false:(typeof a[i]=="object"?a[i]:{duration:a[i+1],callback:a[i+2],easing:a[i+3]})},clean:function(_2e){if(this.isCleaned&&_2e!==true){return this}var ns=/\S/;var d=this.dom,n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!ns.test(n.nodeValue)){d.removeChild(n)}else{n.nodeIndex=++ni}n=nx}this.isCleaned=true;return this},scrollIntoView:function(_34,_35){var c=Ext.getDom(_34)||Ext.getBody().dom;var el=this.dom;var o=this.getOffsetsTo(c),l=o[0]+c.scrollLeft,t=o[1]+c.scrollTop,b=t+el.offsetHeight,r=l+el.offsetWidth;var ch=c.clientHeight;var ct=parseInt(c.scrollTop,10);var cl=parseInt(c.scrollLeft,10);var cb=ct+ch;var cr=cl+c.clientWidth;if(el.offsetHeight>ch||t<ct){c.scrollTop=t}else{if(b>cb){c.scrollTop=b-ch}}c.scrollTop=c.scrollTop;if(_35!==false){if(el.offsetWidth>c.clientWidth||l<cl){c.scrollLeft=l}else{if(r>cr){c.scrollLeft=r-c.clientWidth}}c.scrollLeft=c.scrollLeft}return this},scrollChildIntoView:function(_42,_43){Ext.fly(_42,"_scrollChildIntoView").scrollIntoView(this,_43)},autoHeight:function(_44,_45,_46,_47){var _48=this.getHeight();this.clip();this.setHeight(1);setTimeout(function(){var _49=parseInt(this.dom.scrollHeight,10);if(!_44){this.setHeight(_49);this.unclip();if(typeof _46=="function"){_46()}}else{this.setHeight(_48);this.setHeight(_49,_44,_45,function(){this.unclip();if(typeof _46=="function"){_46()}}.createDelegate(this),_47)}}.createDelegate(this),0);return this},contains:function(el){if(!el){return false}return D.isAncestor(this.dom,el.dom?el.dom:el)},isVisible:function(_4b){var vis=!(this.getStyle("visibility")=="hidden"||this.getStyle("display")=="none");if(_4b!==true||!vis){return vis}var p=this.dom.parentNode;while(p&&p.tagName.toLowerCase()!="body"){if(!Ext.fly(p,"_isVisible").isVisible()){return false}p=p.parentNode}return true},select:function(_4e,_4f){return El.select(_4e,_4f,this.dom)},query:function(_50){return Ext.DomQuery.select(_50,this.dom)},child:function(_51,_52){var n=Ext.DomQuery.selectNode(_51,this.dom);return _52?n:Ext.get(n)},down:function(_54,_55){var n=Ext.DomQuery.selectNode(" > "+_54,this.dom);return _55?n:Ext.get(n)},initDD:function(_57,_58,_59){var dd=new Ext.dd.DD(Ext.id(this.dom),_57,_58);return Ext.apply(dd,_59)},initDDProxy:function(_5b,_5c,_5d){var dd=new Ext.dd.DDProxy(Ext.id(this.dom),_5b,_5c);return Ext.apply(dd,_5d)},initDDTarget:function(_5f,_60,_61){var dd=new Ext.dd.DDTarget(Ext.id(this.dom),_5f,_60);return Ext.apply(dd,_61)},setVisible:function(_63,_64){if(!_64||!A){if(this.visibilityMode==El.DISPLAY){this.setDisplayed(_63)}else{this.fixDisplay();this.dom.style.visibility=_63?"visible":"hidden"}}else{var dom=this.dom;var _66=this.visibilityMode;if(_63){this.setOpacity(0.01);this.setVisible(true)}this.anim({opacity:{to:(_63?1:0)}},this.preanim(arguments,1),null,0.35,"easeIn",function(){if(!_63){if(_66==El.DISPLAY){dom.style.display="none"}else{dom.style.visibility="hidden"}Ext.get(dom).setOpacity(1)}})}return this},isDisplayed:function(){return this.getStyle("display")!="none"},toggle:function(_67){this.setVisible(!this.isVisible(),this.preanim(arguments,0));return this},setDisplayed:function(_68){if(typeof _68=="boolean"){_68=_68?this.originalDisplay:"none"}this.setStyle("display",_68);return this},focus:function(){try{this.dom.focus()}catch(e){}return this},blur:function(){try{this.dom.blur()}catch(e){}return this},addClass:function(_69){if(Ext.isArray(_69)){for(var i=0,len=_69.length;i<len;i++){this.addClass(_69[i])}}else{if(_69&&!this.hasClass(_69)){this.dom.className=this.dom.className+" "+_69}}return this},radioClass:function(_6c){var _6d=this.dom.parentNode.childNodes;for(var i=0;i<_6d.length;i++){var s=_6d[i];if(s.nodeType==1){Ext.get(s).removeClass(_6c)}}this.addClass(_6c);return this},removeClass:function(_70){if(!_70||!this.dom.className){return this}if(Ext.isArray(_70)){for(var i=0,len=_70.length;i<len;i++){this.removeClass(_70[i])}}else{if(this.hasClass(_70)){var re=this.classReCache[_70];if(!re){re=new RegExp("(?:^|\\s+)"+_70+"(?:\\s+|$)","g");this.classReCache[_70]=re}this.dom.className=this.dom.className.replace(re," ")}}return this},classReCache:{},toggleClass:function(_74){if(this.hasClass(_74)){this.removeClass(_74)}else{this.addClass(_74)}return this},hasClass:function(_75){return _75&&(" "+this.dom.className+" ").indexOf(" "+_75+" ")!=-1},replaceClass:function(_76,_77){this.removeClass(_76);this.addClass(_77);return this},getStyles:function(){var a=arguments,len=a.length,r={};for(var i=0;i<len;i++){r[a[i]]=this.getStyle(a[i])}return r},getStyle:function(){return _9&&_9.getComputedStyle?function(_7c){var el=this.dom,v,cs,_80;if(_7c=="float"){_7c="cssFloat"}if(v=el.style[_7c]){return v}if(cs=_9.getComputedStyle(el,"")){if(!(_80=_4[_7c])){_80=_4[_7c]=_7c.replace(_5,_6)}return cs[_80]}return null}:function(_81){var el=this.dom,v,cs,_85;if(_81=="opacity"){if(typeof el.style.filter=="string"){var m=el.style.filter.match(/alpha\(opacity=(.*)\)/i);if(m){var fv=parseFloat(m[1]);if(!isNaN(fv)){return fv?fv/100:0}}}return 1}else{if(_81=="float"){_81="styleFloat"}}if(!(_85=_4[_81])){_85=_4[_81]=_81.replace(_5,_6)}if(v=el.style[_85]){return v}if(cs=el.currentStyle){return cs[_85]}return null}}(),setStyle:function(_88,_89){if(typeof _88=="string"){var _8a;if(!(_8a=_4[_88])){_8a=_4[_88]=_88.replace(_5,_6)}if(_8a=="opacity"){this.setOpacity(_89)}else{this.dom.style[_8a]=_89}}else{for(var _8b in _88){if(typeof _88[_8b]!="function"){this.setStyle(_8b,_88[_8b])}}}return this},applyStyles:function(_8c){Ext.DomHelper.applyStyles(this.dom,_8c);return this},getX:function(){return D.getX(this.dom)},getY:function(){return D.getY(this.dom)},getXY:function(){return D.getXY(this.dom)},getOffsetsTo:function(el){var o=this.getXY();var e=Ext.fly(el,"_internal").getXY();return[o[0]-e[0],o[1]-e[1]]},setX:function(x,_91){if(!_91||!A){D.setX(this.dom,x)}else{this.setXY([x,this.getY()],this.preanim(arguments,1))}return this},setY:function(y,_93){if(!_93||!A){D.setY(this.dom,y)}else{this.setXY([this.getX(),y],this.preanim(arguments,1))}return this},setLeft:function(_94){this.setStyle("left",this.addUnits(_94));return this},setTop:function(top){this.setStyle("top",this.addUnits(top));return this},setRight:function(_96){this.setStyle("right",this.addUnits(_96));return this},setBottom:function(_97){this.setStyle("bottom",this.addUnits(_97));return this},setXY:function(pos,_99){if(!_99||!A){D.setXY(this.dom,pos)}else{this.anim({points:{to:pos}},this.preanim(arguments,1),"motion")}return this},setLocation:function(x,y,_9c){this.setXY([x,y],this.preanim(arguments,2));
9
+ return this},moveTo:function(x,y,_9f){this.setXY([x,y],this.preanim(arguments,2));return this},getRegion:function(){return D.getRegion(this.dom)},getHeight:function(_a0){var h=this.dom.offsetHeight||0;h=_a0!==true?h:h-this.getBorderWidth("tb")-this.getPadding("tb");return h<0?0:h},getWidth:function(_a2){var w=this.dom.offsetWidth||0;w=_a2!==true?w:w-this.getBorderWidth("lr")-this.getPadding("lr");return w<0?0:w},getComputedHeight:function(){var h=Math.max(this.dom.offsetHeight,this.dom.clientHeight);if(!h){h=parseInt(this.getStyle("height"),10)||0;if(!this.isBorderBox()){h+=this.getFrameWidth("tb")}}return h},getComputedWidth:function(){var w=Math.max(this.dom.offsetWidth,this.dom.clientWidth);if(!w){w=parseInt(this.getStyle("width"),10)||0;if(!this.isBorderBox()){w+=this.getFrameWidth("lr")}}return w},getSize:function(_a6){return{width:this.getWidth(_a6),height:this.getHeight(_a6)}},getStyleSize:function(){var w,h,d=this.dom,s=d.style;if(s.width&&s.width!="auto"){w=parseInt(s.width,10);if(Ext.isBorderBox){w-=this.getFrameWidth("lr")}}if(s.height&&s.height!="auto"){h=parseInt(s.height,10);if(Ext.isBorderBox){h-=this.getFrameWidth("tb")}}return{width:w||this.getWidth(true),height:h||this.getHeight(true)}},getViewSize:function(){var d=this.dom,doc=document,aw=0,ah=0;if(d==doc||d==doc.body){return{width:D.getViewWidth(),height:D.getViewHeight()}}else{return{width:d.clientWidth,height:d.clientHeight}}},getValue:function(_af){return _af?parseInt(this.dom.value,10):this.dom.value},adjustWidth:function(_b0){if(typeof _b0=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){_b0-=(this.getBorderWidth("lr")+this.getPadding("lr"))}if(_b0<0){_b0=0}}return _b0},adjustHeight:function(_b1){if(typeof _b1=="number"){if(this.autoBoxAdjust&&!this.isBorderBox()){_b1-=(this.getBorderWidth("tb")+this.getPadding("tb"))}if(_b1<0){_b1=0}}return _b1},setWidth:function(_b2,_b3){_b2=this.adjustWidth(_b2);if(!_b3||!A){this.dom.style.width=this.addUnits(_b2)}else{this.anim({width:{to:_b2}},this.preanim(arguments,1))}return this},setHeight:function(_b4,_b5){_b4=this.adjustHeight(_b4);if(!_b5||!A){this.dom.style.height=this.addUnits(_b4)}else{this.anim({height:{to:_b4}},this.preanim(arguments,1))}return this},setSize:function(_b6,_b7,_b8){if(typeof _b6=="object"){_b7=_b6.height;_b6=_b6.width}_b6=this.adjustWidth(_b6);_b7=this.adjustHeight(_b7);if(!_b8||!A){this.dom.style.width=this.addUnits(_b6);this.dom.style.height=this.addUnits(_b7)}else{this.anim({width:{to:_b6},height:{to:_b7}},this.preanim(arguments,2))}return this},setBounds:function(x,y,_bb,_bc,_bd){if(!_bd||!A){this.setSize(_bb,_bc);this.setLocation(x,y)}else{_bb=this.adjustWidth(_bb);_bc=this.adjustHeight(_bc);this.anim({points:{to:[x,y]},width:{to:_bb},height:{to:_bc}},this.preanim(arguments,4),"motion")}return this},setRegion:function(_be,_bf){this.setBounds(_be.left,_be.top,_be.right-_be.left,_be.bottom-_be.top,this.preanim(arguments,1));return this},addListener:function(_c0,fn,_c2,_c3){Ext.EventManager.on(this.dom,_c0,fn,_c2||this,_c3)},removeListener:function(_c4,fn,_c6){Ext.EventManager.removeListener(this.dom,_c4,fn,_c6||this);return this},removeAllListeners:function(){Ext.EventManager.removeAll(this.dom);return this},relayEvent:function(_c7,_c8){this.on(_c7,function(e){_c8.fireEvent(_c7,e)})},setOpacity:function(_ca,_cb){if(!_cb||!A){var s=this.dom.style;if(Ext.isIE){s.zoom=1;s.filter=(s.filter||"").replace(/alpha\([^\)]*\)/gi,"")+(_ca==1?"":" alpha(opacity="+_ca*100+")")}else{s.opacity=_ca}}else{this.anim({opacity:{to:_ca}},this.preanim(arguments,1),null,0.35,"easeIn")}return this},getLeft:function(_cd){if(!_cd){return this.getX()}else{return parseInt(this.getStyle("left"),10)||0}},getRight:function(_ce){if(!_ce){return this.getX()+this.getWidth()}else{return(this.getLeft(true)+this.getWidth())||0}},getTop:function(_cf){if(!_cf){return this.getY()}else{return parseInt(this.getStyle("top"),10)||0}},getBottom:function(_d0){if(!_d0){return this.getY()+this.getHeight()}else{return(this.getTop(true)+this.getHeight())||0}},position:function(pos,_d2,x,y){if(!pos){if(this.getStyle("position")=="static"){this.setStyle("position","relative")}}else{this.setStyle("position",pos)}if(_d2){this.setStyle("z-index",_d2)}if(x!==undefined&&y!==undefined){this.setXY([x,y])}else{if(x!==undefined){this.setX(x)}else{if(y!==undefined){this.setY(y)}}}},clearPositioning:function(_d5){_d5=_d5||"";this.setStyle({left:_d5,right:_d5,top:_d5,bottom:_d5,"z-index":"",position:"static"});return this},getPositioning:function(){var l=this.getStyle("left");var t=this.getStyle("top");return{position:this.getStyle("position"),left:l,right:l?"":this.getStyle("right"),top:t,bottom:t?"":this.getStyle("bottom"),"z-index":this.getStyle("z-index")}},getBorderWidth:function(_d8){return this.addStyles(_d8,El.borders)},getPadding:function(_d9){return this.addStyles(_d9,El.paddings)},setPositioning:function(pc){this.applyStyles(pc);if(pc.right=="auto"){this.dom.style.right=""}if(pc.bottom=="auto"){this.dom.style.bottom=""}return this},fixDisplay:function(){if(this.getStyle("display")=="none"){this.setStyle("visibility","hidden");this.setStyle("display",this.originalDisplay);if(this.getStyle("display")=="none"){this.setStyle("display","block")}}},setOverflow:function(v){if(v=="auto"&&Ext.isMac&&Ext.isGecko2){this.dom.style.overflow="hidden";(function(){this.dom.style.overflow="auto"}).defer(1,this)}else{this.dom.style.overflow=v}},setLeftTop:function(_dc,top){this.dom.style.left=this.addUnits(_dc);this.dom.style.top=this.addUnits(top);return this},move:function(_de,_df,_e0){var xy=this.getXY();_de=_de.toLowerCase();switch(_de){case"l":case"left":this.moveTo(xy[0]-_df,xy[1],this.preanim(arguments,2));break;case"r":case"right":this.moveTo(xy[0]+_df,xy[1],this.preanim(arguments,2));break;case"t":case"top":case"up":this.moveTo(xy[0],xy[1]-_df,this.preanim(arguments,2));break;case"b":case"bottom":case"down":this.moveTo(xy[0],xy[1]+_df,this.preanim(arguments,2));break}return this},clip:function(){if(!this.isClipped){this.isClipped=true;this.originalClip={o:this.getStyle("overflow"),x:this.getStyle("overflow-x"),y:this.getStyle("overflow-y")};this.setStyle("overflow","hidden");this.setStyle("overflow-x","hidden");this.setStyle("overflow-y","hidden")}return this},unclip:function(){if(this.isClipped){this.isClipped=false;var o=this.originalClip;if(o.o){this.setStyle("overflow",o.o)}if(o.x){this.setStyle("overflow-x",o.x)}if(o.y){this.setStyle("overflow-y",o.y)}}return this},getAnchorXY:function(_e3,_e4,s){var w,h,vp=false;if(!s){var d=this.dom;if(d==document.body||d==document){vp=true;w=D.getViewWidth();h=D.getViewHeight()}else{w=this.getWidth();h=this.getHeight()}}else{w=s.width;h=s.height}var x=0,y=0,r=Math.round;switch((_e3||"tl").toLowerCase()){case"c":x=r(w*0.5);y=r(h*0.5);break;case"t":x=r(w*0.5);y=0;break;case"l":x=0;y=r(h*0.5);break;case"r":x=w;y=r(h*0.5);break;case"b":x=r(w*0.5);y=h;break;case"tl":x=0;y=0;break;case"bl":x=0;y=h;break;case"br":x=w;y=h;break;case"tr":x=w;y=0;break}if(_e4===true){return[x,y]}if(vp){var sc=this.getScroll();return[x+sc.left,y+sc.top]}var o=this.getXY();return[x+o[0],y+o[1]]},getAlignToXY:function(el,p,o){el=Ext.get(el);if(!el||!el.dom){throw"Element.alignToXY with an element that doesn't exist"}var d=this.dom;var c=false;var p1="",p2="";o=o||[0,0];if(!p){p="tl-bl"}else{if(p=="?"){p="tl-bl?"}else{if(p.indexOf("-")==-1){p="tl-"+p}}}p=p.toLowerCase();var m=p.match(/^([a-z]+)-([a-z]+)(\?)?$/);if(!m){throw"Element.alignTo with an invalid alignment "+p}p1=m[1];p2=m[2];c=!!m[3];var a1=this.getAnchorXY(p1,true);var a2=el.getAnchorXY(p2,false);var x=a2[0]-a1[0]+o[0];var y=a2[1]-a1[1]+o[1];if(c){var w=this.getWidth(),h=this.getHeight(),r=el.getRegion();var dw=D.getViewWidth()-5,dh=D.getViewHeight()-5;var p1y=p1.charAt(0),p1x=p1.charAt(p1.length-1);var p2y=p2.charAt(0),p2x=p2.charAt(p2.length-1);var _104=((p1y=="t"&&p2y=="b")||(p1y=="b"&&p2y=="t"));var _105=((p1x=="r"&&p2x=="l")||(p1x=="l"&&p2x=="r"));var doc=document;var _107=(doc.documentElement.scrollLeft||doc.body.scrollLeft||0)+5;
10
+ var _108=(doc.documentElement.scrollTop||doc.body.scrollTop||0)+5;if((x+w)>dw+_107){x=_105?r.left-w:dw+_107-w}if(x<_107){x=_105?r.right:_107}if((y+h)>dh+_108){y=_104?r.top-h:dh+_108-h}if(y<_108){y=_104?r.bottom:_108}}return[x,y]},getConstrainToXY:function(){var os={top:0,left:0,bottom:0,right:0};return function(el,_10b,_10c,_10d){el=Ext.get(el);_10c=_10c?Ext.applyIf(_10c,os):os;var vw,vh,vx=0,vy=0;if(el.dom==document.body||el.dom==document){vw=Ext.lib.Dom.getViewWidth();vh=Ext.lib.Dom.getViewHeight()}else{vw=el.dom.clientWidth;vh=el.dom.clientHeight;if(!_10b){var vxy=el.getXY();vx=vxy[0];vy=vxy[1]}}var s=el.getScroll();vx+=_10c.left+s.left;vy+=_10c.top+s.top;vw-=_10c.right;vh-=_10c.bottom;var vr=vx+vw;var vb=vy+vh;var xy=_10d||(!_10b?this.getXY():[this.getLeft(true),this.getTop(true)]);var x=xy[0],y=xy[1];var w=this.dom.offsetWidth,h=this.dom.offsetHeight;var _11b=false;if((x+w)>vr){x=vr-w;_11b=true}if((y+h)>vb){y=vb-h;_11b=true}if(x<vx){x=vx;_11b=true}if(y<vy){y=vy;_11b=true}return _11b?[x,y]:false}}(),adjustForConstraints:function(xy,_11d,_11e){return this.getConstrainToXY(_11d||document,false,_11e,xy)||xy},alignTo:function(_11f,_120,_121,_122){var xy=this.getAlignToXY(_11f,_120,_121);this.setXY(xy,this.preanim(arguments,3));return this},anchorTo:function(el,_125,_126,_127,_128,_129){var _12a=function(){this.alignTo(el,_125,_126,_127);Ext.callback(_129,this)};Ext.EventManager.onWindowResize(_12a,this);var tm=typeof _128;if(tm!="undefined"){Ext.EventManager.on(window,"scroll",_12a,this,{buffer:tm=="number"?_128:50})}_12a.call(this);return this},clearOpacity:function(){if(window.ActiveXObject){if(typeof this.dom.style.filter=="string"&&(/alpha/i).test(this.dom.style.filter)){this.dom.style.filter=""}}else{this.dom.style.opacity="";this.dom.style["-moz-opacity"]="";this.dom.style["-khtml-opacity"]=""}return this},hide:function(_12c){this.setVisible(false,this.preanim(arguments,0));return this},show:function(_12d){this.setVisible(true,this.preanim(arguments,0));return this},addUnits:function(size){return Ext.Element.addUnits(size,this.defaultUnit)},update:function(html,_130,_131){if(typeof html=="undefined"){html=""}if(_130!==true){this.dom.innerHTML=html;if(typeof _131=="function"){_131()}return this}var id=Ext.id();var dom=this.dom;html+='<span id="'+id+'"></span>';E.onAvailable(id,function(){var hd=document.getElementsByTagName("head")[0];var re=/(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;var _136=/\ssrc=([\'\"])(.*?)\1/i;var _137=/\stype=([\'\"])(.*?)\1/i;var _138;while(_138=re.exec(html)){var _139=_138[1];var _13a=_139?_139.match(_136):false;if(_13a&&_13a[2]){var s=document.createElement("script");s.src=_13a[2];var _13c=_139.match(_137);if(_13c&&_13c[2]){s.type=_13c[2]}hd.appendChild(s)}else{if(_138[2]&&_138[2].length>0){if(window.execScript){window.execScript(_138[2])}else{window.eval(_138[2])}}}}var el=document.getElementById(id);if(el){Ext.removeNode(el)}if(typeof _131=="function"){_131()}});dom.innerHTML=html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,"");return this},load:function(){var um=this.getUpdater();um.update.apply(um,arguments);return this},getUpdater:function(){if(!this.updateManager){this.updateManager=new Ext.Updater(this)}return this.updateManager},unselectable:function(){this.dom.unselectable="on";this.swallowEvent("selectstart",true);this.applyStyles("-moz-user-select:none;-khtml-user-select:none;");this.addClass("x-unselectable");return this},getCenterXY:function(){return this.getAlignToXY(document,"c-c")},center:function(_13f){this.alignTo(_13f||document,"c-c");return this},isBorderBox:function(){return _140[this.dom.tagName.toLowerCase()]||Ext.isBorderBox},getBox:function(_141,_142){var xy;if(!_142){xy=this.getXY()}else{var left=parseInt(this.getStyle("left"),10)||0;var top=parseInt(this.getStyle("top"),10)||0;xy=[left,top]}var el=this.dom,w=el.offsetWidth,h=el.offsetHeight,bx;if(!_141){bx={x:xy[0],y:xy[1],0:xy[0],1:xy[1],width:w,height:h}}else{var l=this.getBorderWidth("l")+this.getPadding("l");var r=this.getBorderWidth("r")+this.getPadding("r");var t=this.getBorderWidth("t")+this.getPadding("t");var b=this.getBorderWidth("b")+this.getPadding("b");bx={x:xy[0]+l,y:xy[1]+t,0:xy[0]+l,1:xy[1]+t,width:w-(l+r),height:h-(t+b)}}bx.right=bx.x+bx.width;bx.bottom=bx.y+bx.height;return bx},getFrameWidth:function(_14e,_14f){return _14f&&Ext.isBorderBox?0:(this.getPadding(_14e)+this.getBorderWidth(_14e))},setBox:function(box,_151,_152){var w=box.width,h=box.height;if((_151&&!this.autoBoxAdjust)&&!this.isBorderBox()){w-=(this.getBorderWidth("lr")+this.getPadding("lr"));h-=(this.getBorderWidth("tb")+this.getPadding("tb"))}this.setBounds(box.x,box.y,w,h,this.preanim(arguments,2));return this},repaint:function(){var dom=this.dom;this.addClass("x-repaint");setTimeout(function(){Ext.get(dom).removeClass("x-repaint")},1);return this},getMargins:function(side){if(!side){return{top:parseInt(this.getStyle("margin-top"),10)||0,left:parseInt(this.getStyle("margin-left"),10)||0,bottom:parseInt(this.getStyle("margin-bottom"),10)||0,right:parseInt(this.getStyle("margin-right"),10)||0}}else{return this.addStyles(side,El.margins)}},addStyles:function(_157,_158){var val=0,v,w;for(var i=0,len=_157.length;i<len;i++){v=this.getStyle(_158[_157.charAt(i)]);if(v){w=parseInt(v,10);if(w){val+=(w>=0?w:-1*w)}}}return val},createProxy:function(_15e,_15f,_160){_15e=typeof _15e=="object"?_15e:{tag:"div",cls:_15e};var _161;if(_15f){_161=Ext.DomHelper.append(_15f,_15e,true)}else{_161=Ext.DomHelper.insertBefore(this.dom,_15e,true)}if(_160){_161.setBox(this.getBox())}return _161},mask:function(msg,_163){if(this.getStyle("position")=="static"){this.addClass("x-masked-relative")}if(this._maskMsg){this._maskMsg.remove()}if(this._mask){this._mask.remove()}this._mask=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask"},true);this.addClass("x-masked");this._mask.setDisplayed(true);if(typeof msg=="string"){this._maskMsg=Ext.DomHelper.append(this.dom,{cls:"ext-el-mask-msg",cn:{tag:"div"}},true);var mm=this._maskMsg;mm.dom.className=_163?"ext-el-mask-msg "+_163:"ext-el-mask-msg";mm.dom.firstChild.innerHTML=msg;mm.setDisplayed(true);mm.center(this)}if(Ext.isIE&&!(Ext.isIE7&&Ext.isStrict)&&this.getStyle("height")=="auto"){this._mask.setSize(this.getWidth(),this.getHeight())}return this._mask},unmask:function(){if(this._mask){if(this._maskMsg){this._maskMsg.remove();delete this._maskMsg}this._mask.remove();delete this._mask}this.removeClass(["x-masked","x-masked-relative"])},isMasked:function(){return this._mask&&this._mask.isVisible()},createShim:function(){var el=document.createElement("iframe");el.frameBorder="0";el.className="ext-shim";if(Ext.isIE&&Ext.isSecure){el.src=Ext.SSL_SECURE_URL}var shim=Ext.get(this.dom.parentNode.insertBefore(el,this.dom));shim.autoBoxAdjust=false;return shim},remove:function(){Ext.removeNode(this.dom);delete El.cache[this.dom.id]},hover:function(_167,_168,_169){var _16a=function(e){if(!e.within(this,true)){_167.apply(_169||this,arguments)}};var _16c=function(e){if(!e.within(this,true)){_168.apply(_169||this,arguments)}};this.on("mouseover",_16a,this.dom);this.on("mouseout",_16c,this.dom);return this},addClassOnOver:function(_16e){this.hover(function(){Ext.fly(this,"_internal").addClass(_16e)},function(){Ext.fly(this,"_internal").removeClass(_16e)});return this},addClassOnFocus:function(_16f){this.on("focus",function(){Ext.fly(this,"_internal").addClass(_16f)},this.dom);this.on("blur",function(){Ext.fly(this,"_internal").removeClass(_16f)},this.dom);return this},addClassOnClick:function(_170){var dom=this.dom;this.on("mousedown",function(){Ext.fly(dom,"_internal").addClass(_170);var d=Ext.getDoc();var fn=function(){Ext.fly(dom,"_internal").removeClass(_170);d.removeListener("mouseup",fn)};d.on("mouseup",fn)});return this},swallowEvent:function(_174,_175){var fn=function(e){e.stopPropagation();if(_175){e.preventDefault()}};if(Ext.isArray(_174)){for(var i=0,len=_174.length;i<len;i++){this.on(_174[i],fn)}return this}this.on(_174,fn);return this
11
+ },parent:function(_17a,_17b){return this.matchNode("parentNode","parentNode",_17a,_17b)},next:function(_17c,_17d){return this.matchNode("nextSibling","nextSibling",_17c,_17d)},prev:function(_17e,_17f){return this.matchNode("previousSibling","previousSibling",_17e,_17f)},first:function(_180,_181){return this.matchNode("nextSibling","firstChild",_180,_181)},last:function(_182,_183){return this.matchNode("previousSibling","lastChild",_182,_183)},matchNode:function(dir,_185,_186,_187){var n=this.dom[_185];while(n){if(n.nodeType==1&&(!_186||Ext.DomQuery.is(n,_186))){return !_187?Ext.get(n):n}n=n[dir]}return null},appendChild:function(el){el=Ext.get(el);el.appendTo(this);return this},createChild:function(_18a,_18b,_18c){_18a=_18a||{tag:"div"};if(_18b){return Ext.DomHelper.insertBefore(_18b,_18a,_18c!==true)}return Ext.DomHelper[!this.dom.firstChild?"overwrite":"append"](this.dom,_18a,_18c!==true)},appendTo:function(el){el=Ext.getDom(el);el.appendChild(this.dom);return this},insertBefore:function(el){el=Ext.getDom(el);el.parentNode.insertBefore(this.dom,el);return this},insertAfter:function(el){el=Ext.getDom(el);el.parentNode.insertBefore(this.dom,el.nextSibling);return this},insertFirst:function(el,_191){el=el||{};if(typeof el=="object"&&!el.nodeType&&!el.dom){return this.createChild(el,this.dom.firstChild,_191)}else{el=Ext.getDom(el);this.dom.insertBefore(el,this.dom.firstChild);return !_191?Ext.get(el):el}},insertSibling:function(el,_193,_194){var rt;if(Ext.isArray(el)){for(var i=0,len=el.length;i<len;i++){rt=this.insertSibling(el[i],_193,_194)}return rt}_193=_193?_193.toLowerCase():"before";el=el||{};var _198=_193=="before"?this.dom:this.dom.nextSibling;if(typeof el=="object"&&!el.nodeType&&!el.dom){if(_193=="after"&&!this.dom.nextSibling){rt=Ext.DomHelper.append(this.dom.parentNode,el,!_194)}else{rt=Ext.DomHelper[_193=="after"?"insertAfter":"insertBefore"](this.dom,el,!_194)}}else{rt=this.dom.parentNode.insertBefore(Ext.getDom(el),_198);if(!_194){rt=Ext.get(rt)}}return rt},wrap:function(_199,_19a){if(!_199){_199={tag:"div"}}var _19b=Ext.DomHelper.insertBefore(this.dom,_199,!_19a);_19b.dom?_19b.dom.appendChild(this.dom):_19b.appendChild(this.dom);return _19b},replace:function(el){el=Ext.get(el);this.insertBefore(el);el.remove();return this},replaceWith:function(el){if(typeof el=="object"&&!el.nodeType&&!el.dom){el=this.insertSibling(el,"before")}else{el=Ext.getDom(el);this.dom.parentNode.insertBefore(el,this.dom)}El.uncache(this.id);Ext.removeNode(this.dom);this.dom=el;this.id=Ext.id(el);El.cache[this.id]=this;return this},insertHtml:function(_19e,html,_1a0){var el=Ext.DomHelper.insertHtml(_19e,this.dom,html);return _1a0?Ext.get(el):el},set:function(o,_1a3){var el=this.dom;_1a3=typeof _1a3=="undefined"?(el.setAttribute?true:false):_1a3;for(var attr in o){if(attr=="style"||typeof o[attr]=="function"){continue}if(attr=="cls"){el.className=o.cls}else{if(o.hasOwnProperty(attr)){if(_1a3){el.setAttribute(attr,o[attr])}else{el[attr]=o[attr]}}}}if(o.style){Ext.DomHelper.applyStyles(el,o.style)}return this},addKeyListener:function(key,fn,_1a8){var _1a9;if(typeof key!="object"||Ext.isArray(key)){_1a9={key:key,fn:fn,scope:_1a8}}else{_1a9={key:key.key,shift:key.shift,ctrl:key.ctrl,alt:key.alt,fn:fn,scope:_1a8}}return new Ext.KeyMap(this,_1a9)},addKeyMap:function(_1aa){return new Ext.KeyMap(this,_1aa)},isScrollable:function(){var dom=this.dom;return dom.scrollHeight>dom.clientHeight||dom.scrollWidth>dom.clientWidth},scrollTo:function(side,_1ad,_1ae){var prop=side.toLowerCase()=="left"?"scrollLeft":"scrollTop";if(!_1ae||!A){this.dom[prop]=_1ad}else{var to=prop=="scrollLeft"?[_1ad,this.dom.scrollTop]:[this.dom.scrollLeft,_1ad];this.anim({scroll:{to:to}},this.preanim(arguments,2),"scroll")}return this},scroll:function(_1b1,_1b2,_1b3){if(!this.isScrollable()){return}var el=this.dom;var l=el.scrollLeft,t=el.scrollTop;var w=el.scrollWidth,h=el.scrollHeight;var cw=el.clientWidth,ch=el.clientHeight;_1b1=_1b1.toLowerCase();var _1bb=false;var a=this.preanim(arguments,2);switch(_1b1){case"l":case"left":if(w-l>cw){var v=Math.min(l+_1b2,w-cw);this.scrollTo("left",v,a);_1bb=true}break;case"r":case"right":if(l>0){var v=Math.max(l-_1b2,0);this.scrollTo("left",v,a);_1bb=true}break;case"t":case"top":case"up":if(t>0){var v=Math.max(t-_1b2,0);this.scrollTo("top",v,a);_1bb=true}break;case"b":case"bottom":case"down":if(h-t>ch){var v=Math.min(t+_1b2,h-ch);this.scrollTo("top",v,a);_1bb=true}break}return _1bb},translatePoints:function(x,y){if(typeof x=="object"||Ext.isArray(x)){y=x[1];x=x[0]}var p=this.getStyle("position");var o=this.getXY();var l=parseInt(this.getStyle("left"),10);var t=parseInt(this.getStyle("top"),10);if(isNaN(l)){l=(p=="relative")?0:this.dom.offsetLeft}if(isNaN(t)){t=(p=="relative")?0:this.dom.offsetTop}return{left:(x-o[0]+l),top:(y-o[1]+t)}},getScroll:function(){var d=this.dom,doc=document;if(d==doc||d==doc.body){var l,t;if(Ext.isIE&&Ext.isStrict){l=doc.documentElement.scrollLeft||(doc.body.scrollLeft||0);t=doc.documentElement.scrollTop||(doc.body.scrollTop||0)}else{l=window.pageXOffset||(doc.body.scrollLeft||0);t=window.pageYOffset||(doc.body.scrollTop||0)}return{left:l,top:t}}else{return{left:d.scrollLeft,top:d.scrollTop}}},getColor:function(attr,_1c9,_1ca){var v=this.getStyle(attr);if(!v||v=="transparent"||v=="inherit"){return _1c9}var _1cc=typeof _1ca=="undefined"?"#":_1ca;if(v.substr(0,4)=="rgb("){var rvs=v.slice(4,v.length-1).split(",");for(var i=0;i<3;i++){var h=parseInt(rvs[i]);var s=h.toString(16);if(h<16){s="0"+s}_1cc+=s}}else{if(v.substr(0,1)=="#"){if(v.length==4){for(var i=1;i<4;i++){var c=v.charAt(i);_1cc+=c+c}}else{if(v.length==7){_1cc+=v.substr(1)}}}}return(_1cc.length>5?_1cc.toLowerCase():_1c9)},boxWrap:function(cls){cls=cls||"x-box";var el=Ext.get(this.insertHtml("beforeBegin",String.format('<div class="{0}">'+El.boxMarkup+"</div>",cls)));el.child("."+cls+"-mc").dom.appendChild(this.dom);return el},getAttributeNS:Ext.isIE?function(ns,name){var d=this.dom;var type=typeof d[ns+":"+name];if(type!="undefined"&&type!="unknown"){return d[ns+":"+name]}return d[name]}:function(ns,name){var d=this.dom;return d.getAttributeNS(ns,name)||d.getAttribute(ns+":"+name)||d.getAttribute(name)||d[name]},getTextWidth:function(text,min,max){return(Ext.util.TextMetrics.measure(this.dom,Ext.value(text,this.dom.innerHTML,true)).width).constrain(min||0,max||1000000)}};var ep=El.prototype;ep.on=ep.addListener;ep.mon=ep.addListener;ep.getUpdateManager=ep.getUpdater;ep.un=ep.removeListener;ep.autoBoxAdjust=true;El.unitPattern=/\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;El.addUnits=function(v,_1e0){if(v===""||v=="auto"){return v}if(v===undefined){return""}if(typeof v=="number"||!El.unitPattern.test(v)){return v+(_1e0||"px")}return v};El.boxMarkup='<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';El.VISIBILITY=1;El.DISPLAY=2;El.borders={l:"border-left-width",r:"border-right-width",t:"border-top-width",b:"border-bottom-width"};El.paddings={l:"padding-left",r:"padding-right",t:"padding-top",b:"padding-bottom"};El.margins={l:"margin-left",r:"margin-right",t:"margin-top",b:"margin-bottom"};El.cache={};var _1e1;El.get=function(el){var ex,elm,id;if(!el){return null}if(typeof el=="string"){if(!(elm=document.getElementById(el))){return null}if(ex=El.cache[el]){ex.dom=elm}else{ex=El.cache[el]=new El(elm)}return ex}else{if(el.tagName){if(!(id=el.id)){id=Ext.id(el)}if(ex=El.cache[id]){ex.dom=el}else{ex=El.cache[id]=new El(el)}return ex}else{if(el instanceof El){if(el!=_1e1){el.dom=document.getElementById(el.id)||el.dom;El.cache[el.id]=el}return el}else{if(el.isComposite){return el}else{if(Ext.isArray(el)){return El.select(el)}else{if(el==document){if(!_1e1){var f=function(){};f.prototype=El.prototype;_1e1=new f();_1e1.dom=document}return _1e1}}}}}}return null};El.uncache=function(el){for(var i=0,a=arguments,len=a.length;
12
+ i<len;i++){if(a[i]){delete El.cache[a[i].id||a[i]]}}};El.garbageCollect=function(){if(!Ext.enableGarbageCollector){clearInterval(El.collectorThread);return}for(var eid in El.cache){var el=El.cache[eid],d=el.dom;if(!d||!d.parentNode||(!d.offsetParent&&!document.getElementById(eid))){delete El.cache[eid];if(d&&Ext.enableListenerCollection){Ext.EventManager.removeAll(d)}}}};El.collectorThreadId=setInterval(El.garbageCollect,30000);var _1ee=function(){};_1ee.prototype=El.prototype;var _cls=new _1ee();El.Flyweight=function(dom){this.dom=dom};El.Flyweight.prototype=_cls;El.Flyweight.prototype.isFlyweight=true;El._flyweights={};El.fly=function(el,_1f2){_1f2=_1f2||"_global";el=Ext.getDom(el);if(!el){return null}if(!El._flyweights[_1f2]){El._flyweights[_1f2]=new El.Flyweight()}El._flyweights[_1f2].dom=el;return El._flyweights[_1f2]};Ext.get=El.get;Ext.fly=El.fly;var _140=Ext.isStrict?{select:1}:{input:1,select:1,textarea:1};if(Ext.isIE||Ext.isGecko){_140.button=1}Ext.EventManager.on(window,"unload",function(){delete El.cache;delete El._flyweights})})();Ext.enableFx=true;Ext.Fx={slideIn:function(_1,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){_1=_1||"t";this.fixDisplay();var r=this.getFxRestore();var b=this.getBox();this.setSize(b);var _6=this.fxWrap(r.pos,o,"hidden");var st=this.dom.style;st.visibility="visible";st.position="absolute";var _8=function(){el.fxUnwrap(_6,r.pos,o);st.width=r.width;st.height=r.height;el.afterFx(o)};var a,pt={to:[b.x,b.y]},bw={to:b.width},bh={to:b.height};switch(_1.toLowerCase()){case"t":_6.setSize(b.width,0);st.left=st.bottom="0";a={height:bh};break;case"l":_6.setSize(0,b.height);st.right=st.top="0";a={width:bw};break;case"r":_6.setSize(0,b.height);_6.setX(b.right);st.left=st.top="0";a={width:bw,points:pt};break;case"b":_6.setSize(b.width,0);_6.setY(b.bottom);st.left=st.top="0";a={height:bh,points:pt};break;case"tl":_6.setSize(0,0);st.right=st.bottom="0";a={width:bw,height:bh};break;case"bl":_6.setSize(0,0);_6.setY(b.y+b.height);st.right=st.top="0";a={width:bw,height:bh,points:pt};break;case"br":_6.setSize(0,0);_6.setXY([b.right,b.bottom]);st.left=st.top="0";a={width:bw,height:bh,points:pt};break;case"tr":_6.setSize(0,0);_6.setX(b.x+b.width);st.left=st.bottom="0";a={width:bw,height:bh,points:pt};break}this.dom.style.visibility="visible";_6.show();arguments.callee.anim=_6.fxanim(a,o,"motion",0.5,"easeOut",_8)});return this},slideOut:function(_d,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){_d=_d||"t";var r=this.getFxRestore();var b=this.getBox();this.setSize(b);var _12=this.fxWrap(r.pos,o,"visible");var st=this.dom.style;st.visibility="visible";st.position="absolute";_12.setSize(b);var _14=function(){if(o.useDisplay){el.setDisplayed(false)}else{el.hide()}el.fxUnwrap(_12,r.pos,o);st.width=r.width;st.height=r.height;el.afterFx(o)};var a,_16={to:0};switch(_d.toLowerCase()){case"t":st.left=st.bottom="0";a={height:_16};break;case"l":st.right=st.top="0";a={width:_16};break;case"r":st.left=st.top="0";a={width:_16,points:{to:[b.right,b.y]}};break;case"b":st.left=st.top="0";a={height:_16,points:{to:[b.x,b.bottom]}};break;case"tl":st.right=st.bottom="0";a={width:_16,height:_16};break;case"bl":st.right=st.top="0";a={width:_16,height:_16,points:{to:[b.x,b.bottom]}};break;case"br":st.left=st.top="0";a={width:_16,height:_16,points:{to:[b.x+b.width,b.bottom]}};break;case"tr":st.left=st.bottom="0";a={width:_16,height:_16,points:{to:[b.right,b.y]}};break}arguments.callee.anim=_12.fxanim(a,o,"motion",0.5,"easeOut",_14)});return this},puff:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){this.clearOpacity();this.show();var r=this.getFxRestore();var st=this.dom.style;var _1b=function(){if(o.useDisplay){el.setDisplayed(false)}else{el.hide()}el.clearOpacity();el.setPositioning(r.pos);st.width=r.width;st.height=r.height;st.fontSize="";el.afterFx(o)};var _1c=this.getWidth();var _1d=this.getHeight();arguments.callee.anim=this.fxanim({width:{to:this.adjustWidth(_1c*2)},height:{to:this.adjustHeight(_1d*2)},points:{by:[-(_1c*0.5),-(_1d*0.5)]},opacity:{to:0},fontSize:{to:200,unit:"%"}},o,"motion",0.5,"easeOut",_1b)});return this},switchOff:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){this.clearOpacity();this.clip();var r=this.getFxRestore();var st=this.dom.style;var _22=function(){if(o.useDisplay){el.setDisplayed(false)}else{el.hide()}el.clearOpacity();el.setPositioning(r.pos);st.width=r.width;st.height=r.height;el.afterFx(o)};this.fxanim({opacity:{to:0.3}},null,null,0.1,null,function(){this.clearOpacity();(function(){this.fxanim({height:{to:1},points:{by:[0,this.getHeight()*0.5]}},o,"motion",0.3,"easeIn",_22)}).defer(100,this)})});return this},highlight:function(_23,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){_23=_23||"ffff9c";var _26=o.attr||"backgroundColor";this.clearOpacity();this.show();var _27=this.getColor(_26);var _28=this.dom.style[_26];var _29=(o.endColor||_27)||"ffffff";var _2a=function(){el.dom.style[_26]=_28;el.afterFx(o)};var a={};a[_26]={from:_23,to:_29};arguments.callee.anim=this.fxanim(a,o,"color",1,"easeIn",_2a)});return this},frame:function(_2c,_2d,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){_2c=_2c||"#C3DAF9";if(_2c.length==6){_2c="#"+_2c}_2d=_2d||1;var _30=o.duration||1;this.show();var b=this.getBox();var _32=function(){var _33=Ext.getBody().createChild({style:{visbility:"hidden",position:"absolute","z-index":"35000",border:"0px solid "+_2c}});var _34=Ext.isBorderBox?2:1;_33.animate({top:{from:b.y,to:b.y-20},left:{from:b.x,to:b.x-20},borderWidth:{from:0,to:10},opacity:{from:1,to:0},height:{from:b.height,to:(b.height+(20*_34))},width:{from:b.width,to:(b.width+(20*_34))}},_30,function(){_33.remove();if(--_2d>0){_32()}else{el.afterFx(o)}})};_32.call(this)});return this},pause:function(_35){var el=this.getFxEl();var o={};el.queueFx(o,function(){setTimeout(function(){el.afterFx(o)},_35*1000)});return this},fadeIn:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){this.setOpacity(0);this.fixDisplay();this.dom.style.visibility="visible";var to=o.endOpacity||1;arguments.callee.anim=this.fxanim({opacity:{to:to}},o,null,0.5,"easeOut",function(){if(to==1){this.clearOpacity()}el.afterFx(o)})});return this},fadeOut:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){var to=o.endOpacity||0;arguments.callee.anim=this.fxanim({opacity:{to:to}},o,null,0.5,"easeOut",function(){if(to===0){if(this.visibilityMode==Ext.Element.DISPLAY||o.useDisplay){this.dom.style.display="none"}else{this.dom.style.visibility="hidden"}this.clearOpacity()}el.afterFx(o)})});return this},scale:function(w,h,o){this.shift(Ext.apply({},o,{width:w,height:h}));return this},shift:function(o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){var a={},w=o.width,h=o.height,x=o.x,y=o.y,op=o.opacity;if(w!==undefined){a.width={to:this.adjustWidth(w)}}if(h!==undefined){a.height={to:this.adjustHeight(h)}}if(o.left!==undefined){a.left={to:o.left}}if(o.top!==undefined){a.top={to:o.top}}if(o.right!==undefined){a.right={to:o.right}}if(o.bottom!==undefined){a.bottom={to:o.bottom}}if(x!==undefined||y!==undefined){a.points={to:[x!==undefined?x:this.getX(),y!==undefined?y:this.getY()]}}if(op!==undefined){a.opacity={to:op}}if(o.xy!==undefined){a.points={to:o.xy}}arguments.callee.anim=this.fxanim(a,o,"motion",0.35,"easeOut",function(){el.afterFx(o)})});return this},ghost:function(_49,o){var el=this.getFxEl();o=o||{};el.queueFx(o,function(){_49=_49||"b";var r=this.getFxRestore();var w=this.getWidth(),h=this.getHeight();var st=this.dom.style;var _50=function(){if(o.useDisplay){el.setDisplayed(false)}else{el.hide()}el.clearOpacity();el.setPositioning(r.pos);st.width=r.width;st.height=r.height;el.afterFx(o)};var a={opacity:{to:0},points:{}},pt=a.points;switch(_49.toLowerCase()){case"t":pt.by=[0,-h];break;case"l":pt.by=[-w,0];break;case"r":pt.by=[w,0];break;case"b":pt.by=[0,h];break;case"tl":pt.by=[-w,-h];break;case"bl":pt.by=[-w,h];break;case"br":pt.by=[w,h];break;case"tr":pt.by=[w,-h];break
13
+ }arguments.callee.anim=this.fxanim(a,o,"motion",0.5,"easeOut",_50)});return this},syncFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:true,stopFx:false});return this},sequenceFx:function(){this.fxDefaults=Ext.apply(this.fxDefaults||{},{block:false,concurrent:false,stopFx:false});return this},nextFx:function(){var ef=this.fxQueue[0];if(ef){ef.call(this)}},hasActiveFx:function(){return this.fxQueue&&this.fxQueue[0]},stopFx:function(){if(this.hasActiveFx()){var cur=this.fxQueue[0];if(cur&&cur.anim&&cur.anim.isAnimated()){this.fxQueue=[cur];cur.anim.stop(true)}}return this},beforeFx:function(o){if(this.hasActiveFx()&&!o.concurrent){if(o.stopFx){this.stopFx();return true}return false}return true},hasFxBlock:function(){var q=this.fxQueue;return q&&q[0]&&q[0].block},queueFx:function(o,fn){if(!this.fxQueue){this.fxQueue=[]}if(!this.hasFxBlock()){Ext.applyIf(o,this.fxDefaults);if(!o.concurrent){var run=this.beforeFx(o);fn.block=o.block;this.fxQueue.push(fn);if(run){this.nextFx()}}else{fn.call(this)}}return this},fxWrap:function(pos,o,vis){var _5d;if(!o.wrap||!(_5d=Ext.get(o.wrap))){var _5e;if(o.fixPosition){_5e=this.getXY()}var div=document.createElement("div");div.style.visibility=vis;_5d=Ext.get(this.dom.parentNode.insertBefore(div,this.dom));_5d.setPositioning(pos);if(_5d.getStyle("position")=="static"){_5d.position("relative")}this.clearPositioning("auto");_5d.clip();_5d.dom.appendChild(this.dom);if(_5e){_5d.setXY(_5e)}}return _5d},fxUnwrap:function(_60,pos,o){this.clearPositioning();this.setPositioning(pos);if(!o.wrap){_60.dom.parentNode.insertBefore(this.dom,_60.dom);_60.remove()}},getFxRestore:function(){var st=this.dom.style;return{pos:this.getPositioning(),width:st.width,height:st.height}},afterFx:function(o){if(o.afterStyle){this.applyStyles(o.afterStyle)}if(o.afterCls){this.addClass(o.afterCls)}if(o.remove===true){this.remove()}Ext.callback(o.callback,o.scope,[this]);if(!o.concurrent){this.fxQueue.shift();this.nextFx()}},getFxEl:function(){return Ext.get(this.dom)},fxanim:function(_65,opt,_67,_68,_69,cb){_67=_67||"run";opt=opt||{};var _6b=Ext.lib.Anim[_67](this.dom,_65,(opt.duration||_68)||0.35,(opt.easing||_69)||"easeOut",function(){Ext.callback(cb,this)},this);opt.anim=_6b;return _6b}};Ext.Fx.resize=Ext.Fx.scale;Ext.apply(Ext.Element.prototype,Ext.Fx);Ext.CompositeElement=function(_1){this.elements=[];this.addElements(_1)};Ext.CompositeElement.prototype={isComposite:true,addElements:function(_2){if(!_2){return this}if(typeof _2=="string"){_2=Ext.Element.selectorFunction(_2)}var _3=this.elements;var _4=_3.length-1;for(var i=0,_6=_2.length;i<_6;i++){_3[++_4]=Ext.get(_2[i])}return this},fill:function(_7){this.elements=[];this.add(_7);return this},filter:function(_8){var _9=[];this.each(function(el){if(el.is(_8)){_9[_9.length]=el.dom}});this.fill(_9);return this},invoke:function(fn,_c){var _d=this.elements;for(var i=0,_f=_d.length;i<_f;i++){Ext.Element.prototype[fn].apply(_d[i],_c)}return this},add:function(els){if(typeof els=="string"){this.addElements(Ext.Element.selectorFunction(els))}else{if(els.length!==undefined){this.addElements(els)}else{this.addElements([els])}}return this},each:function(fn,_12){var els=this.elements;for(var i=0,len=els.length;i<len;i++){if(fn.call(_12||els[i],els[i],this,i)===false){break}}return this},item:function(_16){return this.elements[_16]||null},first:function(){return this.item(0)},last:function(){return this.item(this.elements.length-1)},getCount:function(){return this.elements.length},contains:function(el){return this.indexOf(el)!==-1},indexOf:function(el){return this.elements.indexOf(Ext.get(el))},removeElement:function(el,_1a){if(Ext.isArray(el)){for(var i=0,len=el.length;i<len;i++){this.removeElement(el[i])}return this}var _1d=typeof el=="number"?el:this.indexOf(el);if(_1d!==-1&&this.elements[_1d]){if(_1a){var d=this.elements[_1d];if(d.dom){d.remove()}else{Ext.removeNode(d)}}this.elements.splice(_1d,1)}return this},replaceElement:function(el,_20,_21){var _22=typeof el=="number"?el:this.indexOf(el);if(_22!==-1){if(_21){this.elements[_22].replaceWith(_20)}else{this.elements.splice(_22,1,Ext.get(_20))}}return this},clear:function(){this.elements=[]}};(function(){Ext.CompositeElement.createCall=function(_23,_24){if(!_23[_24]){_23[_24]=function(){return this.invoke(_24,arguments)}}};for(var _25 in Ext.Element.prototype){if(typeof Ext.Element.prototype[_25]=="function"){Ext.CompositeElement.createCall(Ext.CompositeElement.prototype,_25)}}})();Ext.CompositeElementLite=function(els){Ext.CompositeElementLite.superclass.constructor.call(this,els);this.el=new Ext.Element.Flyweight()};Ext.extend(Ext.CompositeElementLite,Ext.CompositeElement,{addElements:function(els){if(els){if(Ext.isArray(els)){this.elements=this.elements.concat(els)}else{var _28=this.elements;var _29=_28.length-1;for(var i=0,len=els.length;i<len;i++){_28[++_29]=els[i]}}}return this},invoke:function(fn,_2d){var els=this.elements;var el=this.el;for(var i=0,len=els.length;i<len;i++){el.dom=els[i];Ext.Element.prototype[fn].apply(el,_2d)}return this},item:function(_32){if(!this.elements[_32]){return null}this.el.dom=this.elements[_32];return this.el},addListener:function(_33,_34,_35,opt){var els=this.elements;for(var i=0,len=els.length;i<len;i++){Ext.EventManager.on(els[i],_33,_34,_35||els[i],opt)}return this},each:function(fn,_3b){var els=this.elements;var el=this.el;for(var i=0,len=els.length;i<len;i++){el.dom=els[i];if(fn.call(_3b||el,el,this,i)===false){break}}return this},indexOf:function(el){return this.elements.indexOf(Ext.getDom(el))},replaceElement:function(el,_42,_43){var _44=typeof el=="number"?el:this.indexOf(el);if(_44!==-1){_42=Ext.getDom(_42);if(_43){var d=this.elements[_44];d.parentNode.insertBefore(_42,d);Ext.removeNode(d)}this.elements.splice(_44,1,_42)}return this}});Ext.CompositeElementLite.prototype.on=Ext.CompositeElementLite.prototype.addListener;if(Ext.DomQuery){Ext.Element.selectorFunction=Ext.DomQuery.select}Ext.Element.select=function(_46,_47,_48){var els;if(typeof _46=="string"){els=Ext.Element.selectorFunction(_46,_48)}else{if(_46.length!==undefined){els=_46}else{throw"Invalid selector"}}if(_47===true){return new Ext.CompositeElement(els)}else{return new Ext.CompositeElementLite(els)}};Ext.select=Ext.Element.select;Ext.data.Connection=function(_1){Ext.apply(this,_1);this.addEvents("beforerequest","requestcomplete","requestexception");Ext.data.Connection.superclass.constructor.call(this)};Ext.extend(Ext.data.Connection,Ext.util.Observable,{timeout:30000,autoAbort:false,disableCaching:true,disableCachingParam:"_dc",request:function(o){if(this.fireEvent("beforerequest",this,o)!==false){var p=o.params;if(typeof p=="function"){p=p.call(o.scope||window,o)}if(typeof p=="object"){p=Ext.urlEncode(p)}if(this.extraParams){var _4=Ext.urlEncode(this.extraParams);p=p?(p+"&"+_4):_4}var _5=o.url||this.url;if(typeof _5=="function"){_5=_5.call(o.scope||window,o)}if(o.form){var _6=Ext.getDom(o.form);_5=_5||_6.action;var _7=_6.getAttribute("enctype");if(o.isUpload||(_7&&_7.toLowerCase()=="multipart/form-data")){return this.doFormUpload(o,p,_5)}var f=Ext.lib.Ajax.serializeForm(_6);p=p?(p+"&"+f):f}var hs=o.headers;if(this.defaultHeaders){hs=Ext.apply(hs||{},this.defaultHeaders);if(!o.headers){o.headers=hs}}var cb={success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{options:o},timeout:o.timeout||this.timeout};var _b=o.method||this.method||((p||o.xmlData||o.jsonData)?"POST":"GET");if(_b=="GET"&&(this.disableCaching&&o.disableCaching!==false)||o.disableCaching===true){var _c=o.disableCachingParam||this.disableCachingParam;_5+=(_5.indexOf("?")!=-1?"&":"?")+_c+"="+(new Date().getTime())}if(typeof o.autoAbort=="boolean"){if(o.autoAbort){this.abort()}}else{if(this.autoAbort!==false){this.abort()}}if((_b=="GET"||o.xmlData||o.jsonData)&&p){_5+=(_5.indexOf("?")!=-1?"&":"?")+p;p=""}this.transId=Ext.lib.Ajax.request(_b,_5,cb,p,o);return this.transId}else{Ext.callback(o.callback,o.scope,[o,null,null]);return null
14
+ }},isLoading:function(_d){if(_d){return Ext.lib.Ajax.isCallInProgress(_d)}else{return this.transId?true:false}},abort:function(_e){if(_e||this.isLoading()){Ext.lib.Ajax.abort(_e||this.transId)}},handleResponse:function(_f){this.transId=false;var _10=_f.argument.options;_f.argument=_10?_10.argument:null;this.fireEvent("requestcomplete",this,_f,_10);Ext.callback(_10.success,_10.scope,[_f,_10]);Ext.callback(_10.callback,_10.scope,[_10,true,_f])},handleFailure:function(_11,e){this.transId=false;var _13=_11.argument.options;_11.argument=_13?_13.argument:null;this.fireEvent("requestexception",this,_11,_13,e);Ext.callback(_13.failure,_13.scope,[_11,_13]);Ext.callback(_13.callback,_13.scope,[_13,false,_11])},doFormUpload:function(o,ps,url){var id=Ext.id();var _18=document.createElement("iframe");_18.id=id;_18.name=id;_18.className="x-hidden";if(Ext.isIE){_18.src=Ext.SSL_SECURE_URL}document.body.appendChild(_18);if(Ext.isIE){document.frames[id].name=id}var _19=Ext.getDom(o.form);_19.target=id;_19.method="POST";_19.enctype=_19.encoding="multipart/form-data";if(url){_19.action=url}var _1a,hd;if(ps){_1a=[];ps=Ext.urlDecode(ps,false);for(var k in ps){if(ps.hasOwnProperty(k)){hd=document.createElement("input");hd.type="hidden";hd.name=k;hd.value=ps[k];_19.appendChild(hd);_1a.push(hd)}}}function cb(){var r={responseText:"",responseXML:null};r.argument=o?o.argument:null;try{var doc;if(Ext.isIE){doc=_18.contentWindow.document}else{doc=(_18.contentDocument||window.frames[id].document)}if(doc&&doc.body){r.responseText=doc.body.innerHTML}if(doc&&doc.XMLDocument){r.responseXML=doc.XMLDocument}else{r.responseXML=doc}}catch(e){}Ext.EventManager.removeListener(_18,"load",cb,this);this.fireEvent("requestcomplete",this,r,o);Ext.callback(o.success,o.scope,[r,o]);Ext.callback(o.callback,o.scope,[o,true,r]);setTimeout(function(){Ext.removeNode(_18)},100)}Ext.EventManager.on(_18,"load",cb,this);_19.submit();if(_1a){for(var i=0,len=_1a.length;i<len;i++){Ext.removeNode(_1a[i])}}}});Ext.Ajax=new Ext.data.Connection({autoAbort:false,serializeForm:function(_21){return Ext.lib.Ajax.serializeForm(_21)}});Ext.Updater=Ext.extend(Ext.util.Observable,{constructor:function(el,_2){el=Ext.get(el);if(!_2&&el.updateManager){return el.updateManager}this.el=el;this.defaultUrl=null;this.addEvents("beforeupdate","update","failure");var d=Ext.Updater.defaults;this.sslBlankUrl=d.sslBlankUrl;this.disableCaching=d.disableCaching;this.indicatorText=d.indicatorText;this.showLoadIndicator=d.showLoadIndicator;this.timeout=d.timeout;this.loadScripts=d.loadScripts;this.transaction=null;this.refreshDelegate=this.refresh.createDelegate(this);this.updateDelegate=this.update.createDelegate(this);this.formUpdateDelegate=this.formUpdate.createDelegate(this);if(!this.renderer){this.renderer=this.getDefaultRenderer()}Ext.Updater.superclass.constructor.call(this)},getDefaultRenderer:function(){return new Ext.Updater.BasicRenderer()},getEl:function(){return this.el},update:function(_4,_5,_6,_7){if(this.fireEvent("beforeupdate",this.el,_4,_5)!==false){var _8,_9;if(typeof _4=="object"){_8=_4;_4=_8.url;_5=_5||_8.params;_6=_6||_8.callback;_7=_7||_8.discardUrl;_9=_8.scope;if(typeof _8.nocache!="undefined"){this.disableCaching=_8.nocache}if(typeof _8.text!="undefined"){this.indicatorText='<div class="loading-indicator">'+_8.text+"</div>"}if(typeof _8.scripts!="undefined"){this.loadScripts=_8.scripts}if(typeof _8.timeout!="undefined"){this.timeout=_8.timeout}}this.showLoading();if(!_7){this.defaultUrl=_4}if(typeof _4=="function"){_4=_4.call(this)}var o=Ext.apply({},{url:_4,params:(typeof _5=="function"&&_9)?_5.createDelegate(_9):_5,success:this.processSuccess,failure:this.processFailure,scope:this,callback:undefined,timeout:(this.timeout*1000),disableCaching:this.disableCaching,argument:{options:_8,url:_4,form:null,callback:_6,scope:_9||window,params:_5}},_8);this.transaction=Ext.Ajax.request(o)}},formUpdate:function(_b,_c,_d,_e){if(this.fireEvent("beforeupdate",this.el,_b,_c)!==false){if(typeof _c=="function"){_c=_c.call(this)}_b=Ext.getDom(_b);this.transaction=Ext.Ajax.request({form:_b,url:_c,success:this.processSuccess,failure:this.processFailure,scope:this,timeout:(this.timeout*1000),argument:{url:_c,form:_b,callback:_e,reset:_d}});this.showLoading.defer(1,this)}},refresh:function(_f){if(this.defaultUrl==null){return}this.update(this.defaultUrl,null,_f,true)},startAutoRefresh:function(_10,url,_12,_13,_14){if(_14){this.update(url||this.defaultUrl,_12,_13,true)}if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId)}this.autoRefreshProcId=setInterval(this.update.createDelegate(this,[url||this.defaultUrl,_12,_13,true]),_10*1000)},stopAutoRefresh:function(){if(this.autoRefreshProcId){clearInterval(this.autoRefreshProcId);delete this.autoRefreshProcId}},isAutoRefreshing:function(){return this.autoRefreshProcId?true:false},showLoading:function(){if(this.showLoadIndicator){this.el.update(this.indicatorText)}},processSuccess:function(_15){this.transaction=null;if(_15.argument.form&&_15.argument.reset){try{_15.argument.form.reset()}catch(e){}}if(this.loadScripts){this.renderer.render(this.el,_15,this,this.updateComplete.createDelegate(this,[_15]))}else{this.renderer.render(this.el,_15,this);this.updateComplete(_15)}},updateComplete:function(_16){this.fireEvent("update",this.el,_16);if(typeof _16.argument.callback=="function"){_16.argument.callback.call(_16.argument.scope,this.el,true,_16,_16.argument.options)}},processFailure:function(_17){this.transaction=null;this.fireEvent("failure",this.el,_17);if(typeof _17.argument.callback=="function"){_17.argument.callback.call(_17.argument.scope,this.el,false,_17,_17.argument.options)}},setRenderer:function(_18){this.renderer=_18},getRenderer:function(){return this.renderer},setDefaultUrl:function(_19){this.defaultUrl=_19},abort:function(){if(this.transaction){Ext.Ajax.abort(this.transaction)}},isUpdating:function(){if(this.transaction){return Ext.Ajax.isLoading(this.transaction)}return false}});Ext.Updater.defaults={timeout:30,loadScripts:false,sslBlankUrl:(Ext.SSL_SECURE_URL||"javascript:false"),disableCaching:false,showLoadIndicator:true,indicatorText:'<div class="loading-indicator">Loading...</div>'};Ext.Updater.updateElement=function(el,url,_1c,_1d){var um=Ext.get(el).getUpdater();Ext.apply(um,_1d);um.update(url,_1c,_1d?_1d.callback:null)};Ext.Updater.BasicRenderer=function(){};Ext.Updater.BasicRenderer.prototype={render:function(el,_20,_21,_22){el.update(_20.responseText,_21.loadScripts,_22)}};Ext.UpdateManager=Ext.Updater;(function(){function xf(_1){var _2=Array.prototype.slice.call(arguments,1);return _1.replace(/\{(\d+)\}/g,function(m,i){return _2[i]})}Date.formatCodeToRegex=function(_5,_6){var p=Date.parseCodes[_5];if(p){p=Ext.type(p)=="function"?p():p;Date.parseCodes[_5]=p}return p?Ext.applyIf({c:p.c?xf(p.c,_6||"{0}"):p.c},p):{g:0,c:null,s:Ext.escapeRe(_5)}};var $f=Date.formatCodeToRegex;Ext.apply(Date,{parseFunctions:{count:0},parseRegexes:[],formatFunctions:{count:0},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],y2kYear:50,MILLI:"ms",SECOND:"s",MINUTE:"mi",HOUR:"h",DAY:"d",MONTH:"mo",YEAR:"y",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNumbers:{Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},getShortMonthName:function(_9){return Date.monthNames[_9].substring(0,3)},getShortDayName:function(_a){return Date.dayNames[_a].substring(0,3)},getMonthNumber:function(_b){return Date.monthNumbers[_b.substring(0,1).toUpperCase()+_b.substring(1,3).toLowerCase()]},formatCodes:{d:"String.leftPad(this.getDate(), 2, '0')",D:"Date.getShortDayName(this.getDay())",j:"this.getDate()",l:"Date.dayNames[this.getDay()]",N:"(this.getDay() ? this.getDay() : 7)",S:"this.getSuffix()",w:"this.getDay()",z:"this.getDayOfYear()",W:"String.leftPad(this.getWeekOfYear(), 2, '0')",F:"Date.monthNames[this.getMonth()]",m:"String.leftPad(this.getMonth() + 1, 2, '0')",M:"Date.getShortMonthName(this.getMonth())",n:"(this.getMonth() + 1)",t:"this.getDaysInMonth()",L:"(this.isLeapYear() ? 1 : 0)",o:"(this.getFullYear() + (this.getWeekOfYear() == 1 && this.getMonth() > 0 ? +1 : (this.getWeekOfYear() >= 52 && this.getMonth() < 11 ? -1 : 0)))",Y:"this.getFullYear()",y:"('' + this.getFullYear()).substring(2, 4)",a:"(this.getHours() < 12 ? 'am' : 'pm')",A:"(this.getHours() < 12 ? 'AM' : 'PM')",g:"((this.getHours() % 12) ? this.getHours() % 12 : 12)",G:"this.getHours()",h:"String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0')",H:"String.leftPad(this.getHours(), 2, '0')",i:"String.leftPad(this.getMinutes(), 2, '0')",s:"String.leftPad(this.getSeconds(), 2, '0')",u:"String.leftPad(this.getMilliseconds(), 3, '0')",O:"this.getGMTOffset()",P:"this.getGMTOffset(true)",T:"this.getTimezone()",Z:"(this.getTimezoneOffset() * -60)",c:function(){for(var c="Y-m-dTH:i:sP",_d=[],i=0,l=c.length;
15
+ i<l;++i){var e=c.charAt(i);_d.push(e=="T"?"'T'":Date.getFormatCode(e))}return _d.join(" + ")},U:"Math.round(this.getTime() / 1000)"},parseDate:function(_11,_12){var p=Date.parseFunctions;if(p[_12]==null){Date.createParser(_12)}var _14=p[_12];return Date[_14](_11)},getFormatCode:function(_15){var f=Date.formatCodes[_15];if(f){f=Ext.type(f)=="function"?f():f;Date.formatCodes[_15]=f}return f||("'"+String.escape(_15)+"'")},createNewFormat:function(_17){var _18="format"+Date.formatFunctions.count++,_19="Date.prototype."+_18+" = function(){return ",_1a=false,ch="";Date.formatFunctions[_17]=_18;for(var i=0;i<_17.length;++i){ch=_17.charAt(i);if(!_1a&&ch=="\\"){_1a=true}else{if(_1a){_1a=false;_19+="'"+String.escape(ch)+"' + "}else{_19+=Date.getFormatCode(ch)+" + "}}}eval(_19.substring(0,_19.length-3)+";}")},createParser:function(){var _1d=["Date.{0} = function(input){","var y, m, d, h = 0, i = 0, s = 0, ms = 0, o, z, u, v;","input = String(input);","d = new Date();","y = d.getFullYear();","m = d.getMonth();","d = d.getDate();","var results = input.match(Date.parseRegexes[{1}]);","if(results && results.length > 0){","{2}","if(u){","v = new Date(u * 1000);","}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0 && ms >= 0){","v = new Date(y, m, d, h, i, s, ms);","}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0){","v = new Date(y, m, d, h, i, s);","}else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0){","v = new Date(y, m, d, h, i);","}else if (y >= 0 && m >= 0 && d > 0 && h >= 0){","v = new Date(y, m, d, h);","}else if (y >= 0 && m >= 0 && d > 0){","v = new Date(y, m, d);","}else if (y >= 0 && m >= 0){","v = new Date(y, m);","}else if (y >= 0){","v = new Date(y);","}","}","return (v && (z != null || o != null))? (Ext.type(z) == 'number' ? v.add(Date.SECOND, -v.getTimezoneOffset() * 60 - z) : v.add(Date.MINUTE, -v.getTimezoneOffset() + (sn == '+'? -1 : 1) * (hr * 60 + mn))) : v;","}"].join("\n");return function(_1e){var _1f="parse"+Date.parseFunctions.count++,_20=Date.parseRegexes.length,_21=1,_22="",_23="",_24=false,ch="";Date.parseFunctions[_1e]=_1f;for(var i=0;i<_1e.length;++i){ch=_1e.charAt(i);if(!_24&&ch=="\\"){_24=true}else{if(_24){_24=false;_23+=String.escape(ch)}else{var obj=$f(ch,_21);_21+=obj.g;_23+=obj.s;if(obj.g&&obj.c){_22+=obj.c}}}}Date.parseRegexes[_20]=new RegExp("^"+_23+"$","i");eval(xf(_1d,_1f,_20,_22))}}(),parseCodes:{d:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},j:{g:1,c:"d = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},D:function(){for(var a=[],i=0;i<7;a.push(Date.getShortDayName(i)),++i){}return{g:0,c:null,s:"(?:"+a.join("|")+")"}},l:function(){return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"}},N:{g:0,c:null,s:"[1-7]"},S:{g:0,c:null,s:"(?:st|nd|rd|th)"},w:{g:0,c:null,s:"[0-6]"},z:{g:0,c:null,s:"(?:\\d{1,3})"},W:{g:0,c:null,s:"(?:\\d{2})"},F:function(){return{g:1,c:"m = parseInt(Date.getMonthNumber(results[{0}]), 10);\n",s:"("+Date.monthNames.join("|")+")"}},M:function(){for(var a=[],i=0;i<12;a.push(Date.getShortMonthName(i)),++i){}return Ext.applyIf({s:"("+a.join("|")+")"},$f("F"))},m:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{2})"},n:{g:1,c:"m = parseInt(results[{0}], 10) - 1;\n",s:"(\\d{1,2})"},t:{g:0,c:null,s:"(?:\\d{2})"},L:{g:0,c:null,s:"(?:1|0)"},o:function(){return $f("Y")},Y:{g:1,c:"y = parseInt(results[{0}], 10);\n",s:"(\\d{4})"},y:{g:1,c:"var ty = parseInt(results[{0}], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"},a:{g:1,c:"if (results[{0}] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"},A:{g:1,c:"if (results[{0}] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"},g:function(){return $f("G")},G:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{1,2})"},h:function(){return $f("H")},H:{g:1,c:"h = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},i:{g:1,c:"i = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},s:{g:1,c:"s = parseInt(results[{0}], 10);\n",s:"(\\d{2})"},u:{g:1,c:"ms = results[{0}]; ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n",s:"(\\d+)"},O:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1);","var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);","var mn = o.substring(3,5) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{4})"},P:{g:1,c:["o = results[{0}];","var sn = o.substring(0,1);","var hr = o.substring(1,3)*1 + Math.floor(o.substring(4,6) / 60);","var mn = o.substring(4,6) % 60;","o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))? (sn + String.leftPad(hr, 2, '0') + String.leftPad(mn, 2, '0')) : null;\n"].join("\n"),s:"([+-]\\d{2}:\\d{2})"},T:{g:0,c:null,s:"[A-Z]{1,4}"},Z:{g:1,c:"z = results[{0}] * 1;\nz = (-43200 <= z && z <= 50400)? z : null;\n",s:"([+-]?\\d{1,5})"},c:function(){var _2c=[],arr=[$f("Y",1),$f("m",2),$f("d",3),$f("h",4),$f("i",5),$f("s",6),{c:"ms = (results[7] || '.0').substring(1); ms = parseInt(ms, 10)/Math.pow(10, ms.length - 3);\n"},{c:["if(results[9] == 'Z'){","z = 0;","}else{",$f("P",9).c,"}"].join("\n")}];for(var i=0,l=arr.length;i<l;++i){_2c.push(arr[i].c)}return{g:1,c:_2c.join(""),s:arr[0].s+"-"+arr[1].s+"-"+arr[2].s+"T"+arr[3].s+":"+arr[4].s+":"+arr[5].s+"((.|,)\\d+)?(Z|([+-]\\d{2}:\\d{2}))"}},U:{g:1,c:"u = parseInt(results[{0}], 10);\n",s:"(-?\\d+)"}}})}());Ext.apply(Date.prototype,{dateFormat:function(_30){if(Date.formatFunctions[_30]==null){Date.createNewFormat(_30)}var _31=Date.formatFunctions[_30];return this[_31]()},getTimezone:function(){return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},getGMTOffset:function(_32){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+(_32?":":"")+String.leftPad(Math.abs(this.getTimezoneOffset()%60),2,"0")},getDayOfYear:function(){var num=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var i=0;i<this.getMonth();++i){num+=Date.daysInMonth[i]}return num+this.getDate()-1},getWeekOfYear:function(){var _35=86400000,_36=7*_35;return function(){var DC3=Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+3)/_35,AWN=Math.floor(DC3/7),Wyr=new Date(AWN*_36).getUTCFullYear();return AWN-Math.floor(Date.UTC(Wyr,0,7)/_36)+1}}(),isLeapYear:function(){var _3a=this.getFullYear();return !!((_3a&3)==0&&(_3a%100||(_3a%400==0&&_3a)))},getFirstDayOfMonth:function(){var day=(this.getDay()-(this.getDate()-1))%7;return(day<0)?(day+7):day},getLastDayOfMonth:function(){var day=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return(day<0)?(day+7):day},getFirstDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),1)},getLastDateOfMonth:function(){return new Date(this.getFullYear(),this.getMonth(),this.getDaysInMonth())},getDaysInMonth:function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()]},getSuffix:function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}},clone:function(){return new Date(this.getTime())},clearTime:function(_3d){if(_3d){return this.clone().clearTime()}this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this},add:function(_3e,_3f){var d=this.clone();if(!_3e||_3f===0){return d}switch(_3e.toLowerCase()){case Date.MILLI:d.setMilliseconds(this.getMilliseconds()+_3f);break;case Date.SECOND:d.setSeconds(this.getSeconds()+_3f);break;case Date.MINUTE:d.setMinutes(this.getMinutes()+_3f);break;case Date.HOUR:d.setHours(this.getHours()+_3f);break;case Date.DAY:d.setDate(this.getDate()+_3f);break;case Date.MONTH:var day=this.getDate();if(day>28){day=Math.min(day,this.getFirstDateOfMonth().add("mo",_3f).getLastDateOfMonth().getDate())}d.setDate(day);d.setMonth(this.getMonth()+_3f);break;case Date.YEAR:d.setFullYear(this.getFullYear()+_3f);break}return d
16
+ },between:function(_42,end){var t=this.getTime();return _42.getTime()<=t&&t<=end.getTime()}});Date.prototype.format=Date.prototype.dateFormat;if(Ext.isSafari){Date.brokenSetMonth=Date.prototype.setMonth;Date.prototype.setMonth=function(num){if(num<=-1){var n=Math.ceil(-num);var _47=Math.ceil(n/12);var _48=(n%12)?12-n%12:0;this.setFullYear(this.getFullYear()-_47);return Date.brokenSetMonth.call(this,_48)}else{return Date.brokenSetMonth.apply(this,arguments)}}}Ext.util.DelayedTask=function(fn,_2,_3){var id=null,d,t;var _7=function(){var _8=new Date().getTime();if(_8-t>=d){clearInterval(id);id=null;fn.apply(_2,_3||[])}};this.delay=function(_9,_a,_b,_c){if(id&&_9!=d){this.cancel()}d=_9;t=new Date().getTime();fn=_a||fn;_2=_b||_2;_3=_c||_3;if(!id){id=setInterval(_7,d)}};this.cancel=function(){if(id){clearInterval(id);id=null}}};Ext.util.TaskRunner=function(_1){_1=_1||10;var _2=[],_3=[];var id=0;var _5=false;var _6=function(){_5=false;clearInterval(id);id=0};var _7=function(){if(!_5){_5=true;id=setInterval(_8,_1)}};var _9=function(t){_3.push(t);if(t.onStop){t.onStop.apply(t.scope||t)}};var _8=function(){if(_3.length>0){for(var i=0,_c=_3.length;i<_c;i++){_2.remove(_3[i])}_3=[];if(_2.length<1){_6();return}}var _d=new Date().getTime();for(var i=0,_c=_2.length;i<_c;++i){var t=_2[i];var _f=_d-t.taskRunTime;if(t.interval<=_f){var rt=t.run.apply(t.scope||t,t.args||[++t.taskRunCount]);t.taskRunTime=_d;if(rt===false||t.taskRunCount===t.repeat){_9(t);return}}if(t.duration&&t.duration<=(_d-t.taskStartTime)){_9(t)}}};this.start=function(_11){_2.push(_11);_11.taskStartTime=new Date().getTime();_11.taskRunTime=0;_11.taskRunCount=0;_7();return _11};this.stop=function(_12){_9(_12);return _12};this.stopAll=function(){_6();for(var i=0,len=_2.length;i<len;i++){if(_2[i].onStop){_2[i].onStop()}}_2=[];_3=[]}};Ext.TaskMgr=new Ext.util.TaskRunner();Ext.util.MixedCollection=function(_1,_2){this.items=[];this.map={};this.keys=[];this.length=0;this.addEvents("clear","add","replace","remove","sort");this.allowFunctions=_1===true;if(_2){this.getKey=_2}Ext.util.MixedCollection.superclass.constructor.call(this)};Ext.extend(Ext.util.MixedCollection,Ext.util.Observable,{allowFunctions:false,add:function(_3,o){if(arguments.length==1){o=arguments[0];_3=this.getKey(o)}if(typeof _3=="undefined"||_3===null){this.length++;this.items.push(o);this.keys.push(null)}else{var _5=this.map[_3];if(_5){return this.replace(_3,o)}this.length++;this.items.push(o);this.map[_3]=o;this.keys.push(_3)}this.fireEvent("add",this.length-1,o,_3);return o},getKey:function(o){return o.id},replace:function(_7,o){if(arguments.length==1){o=arguments[0];_7=this.getKey(o)}var _9=this.item(_7);if(typeof _7=="undefined"||_7===null||typeof _9=="undefined"){return this.add(_7,o)}var _a=this.indexOfKey(_7);this.items[_a]=o;this.map[_7]=o;this.fireEvent("replace",_7,_9,o);return o},addAll:function(_b){if(arguments.length>1||Ext.isArray(_b)){var _c=arguments.length>1?arguments:_b;for(var i=0,_e=_c.length;i<_e;i++){this.add(_c[i])}}else{for(var _f in _b){if(this.allowFunctions||typeof _b[_f]!="function"){this.add(_f,_b[_f])}}}},each:function(fn,_11){var _12=[].concat(this.items);for(var i=0,len=_12.length;i<len;i++){if(fn.call(_11||_12[i],_12[i],i,len)===false){break}}},eachKey:function(fn,_16){for(var i=0,len=this.keys.length;i<len;i++){fn.call(_16||window,this.keys[i],this.items[i],i,len)}},find:function(fn,_1a){for(var i=0,len=this.items.length;i<len;i++){if(fn.call(_1a||window,this.items[i],this.keys[i])){return this.items[i]}}return null},insert:function(_1d,key,o){if(arguments.length==2){o=arguments[1];key=this.getKey(o)}if(_1d>=this.length){return this.add(key,o)}this.length++;this.items.splice(_1d,0,o);if(typeof key!="undefined"&&key!=null){this.map[key]=o}this.keys.splice(_1d,0,key);this.fireEvent("add",_1d,o,key);return o},remove:function(o){return this.removeAt(this.indexOf(o))},removeAt:function(_21){if(_21<this.length&&_21>=0){this.length--;var o=this.items[_21];this.items.splice(_21,1);var key=this.keys[_21];if(typeof key!="undefined"){delete this.map[key]}this.keys.splice(_21,1);this.fireEvent("remove",o,key);return o}return false},removeKey:function(key){return this.removeAt(this.indexOfKey(key))},getCount:function(){return this.length},indexOf:function(o){return this.items.indexOf(o)},indexOfKey:function(key){return this.keys.indexOf(key)},item:function(key){var _28=typeof this.map[key]!="undefined"?this.map[key]:this.items[key];return typeof _28!="function"||this.allowFunctions?_28:null},itemAt:function(_29){return this.items[_29]},key:function(key){return this.map[key]},contains:function(o){return this.indexOf(o)!=-1},containsKey:function(key){return typeof this.map[key]!="undefined"},clear:function(){this.length=0;this.items=[];this.keys=[];this.map={};this.fireEvent("clear")},first:function(){return this.items[0]},last:function(){return this.items[this.length-1]},_sort:function(_2d,dir,fn){var dsc=String(dir).toUpperCase()=="DESC"?-1:1;fn=fn||function(a,b){return a-b};var c=[],k=this.keys,_35=this.items;for(var i=0,len=_35.length;i<len;i++){c[c.length]={key:k[i],value:_35[i],index:i}}c.sort(function(a,b){var v=fn(a[_2d],b[_2d])*dsc;if(v==0){v=(a.index<b.index?-1:1)}return v});for(var i=0,len=c.length;i<len;i++){_35[i]=c[i].value;k[i]=c[i].key}this.fireEvent("sort",this)},sort:function(dir,fn){this._sort("value",dir,fn)},keySort:function(dir,fn){this._sort("key",dir,fn||function(a,b){var v1=String(a).toUpperCase(),v2=String(b).toUpperCase();return v1>v2?1:(v1<v2?-1:0)})},getRange:function(_43,end){var _45=this.items;if(_45.length<1){return[]}_43=_43||0;end=Math.min(typeof end=="undefined"?this.length-1:end,this.length-1);var r=[];if(_43<=end){for(var i=_43;i<=end;i++){r[r.length]=_45[i]}}else{for(var i=_43;i>=end;i--){r[r.length]=_45[i]}}return r},filter:function(_48,_49,_4a,_4b){if(Ext.isEmpty(_49,false)){return this.clone()}_49=this.createValueMatcher(_49,_4a,_4b);return this.filterBy(function(o){return o&&_49.test(o[_48])})},filterBy:function(fn,_4e){var r=new Ext.util.MixedCollection();r.getKey=this.getKey;var k=this.keys,it=this.items;for(var i=0,len=it.length;i<len;i++){if(fn.call(_4e||this,it[i],k[i])){r.add(k[i],it[i])}}return r},findIndex:function(_54,_55,_56,_57,_58){if(Ext.isEmpty(_55,false)){return -1}_55=this.createValueMatcher(_55,_57,_58);return this.findIndexBy(function(o){return o&&_55.test(o[_54])},null,_56)},findIndexBy:function(fn,_5b,_5c){var k=this.keys,it=this.items;for(var i=(_5c||0),len=it.length;i<len;i++){if(fn.call(_5b||this,it[i],k[i])){return i}}if(typeof _5c=="number"&&_5c>0){for(var i=0;i<_5c;i++){if(fn.call(_5b||this,it[i],k[i])){return i}}}return -1},createValueMatcher:function(_61,_62,_63){if(!_61.exec){_61=String(_61);_61=new RegExp((_62===true?"":"^")+Ext.escapeRe(_61),_63?"":"i")}return _61},clone:function(){var r=new Ext.util.MixedCollection();var k=this.keys,it=this.items;for(var i=0,len=it.length;i<len;i++){r.add(k[i],it[i])}r.getKey=this.getKey;return r}});Ext.util.MixedCollection.prototype.get=Ext.util.MixedCollection.prototype.item;Ext.util.JSON=new (function(){var _1=!!{}.hasOwnProperty;var _2=function(n){return n<10?"0"+n:n};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var _5=function(s){if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c}c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"'}return'"'+s+'"'};var _a=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(v===null?"null":Ext.util.JSON.encode(v));b=true}}a.push("]");return a.join("")};this.encodeDate=function(o){return'"'+o.getFullYear()+"-"+_2(o.getMonth()+1)+"-"+_2(o.getDate())+"T"+_2(o.getHours())+":"+_2(o.getMinutes())+":"+_2(o.getSeconds())+'"'};this.encode=function(o){if(typeof o=="undefined"||o===null){return"null"}else{if(Ext.isArray(o)){return _a(o)}else{if(Ext.isDate(o)){return Ext.util.JSON.encodeDate(o)
17
+ }else{if(typeof o=="string"){return _5(o)}else{if(typeof o=="number"){return isFinite(o)?String(o):"null"}else{if(typeof o=="boolean"){return String(o)}else{var a=["{"],b,i,v;for(i in o){if(!_1||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(",")}a.push(this.encode(i),":",v===null?"null":this.encode(v));b=true}}}a.push("}");return a.join("")}}}}}}};this.decode=function(_17){return eval("("+_17+")")}})();Ext.encode=Ext.util.JSON.encode;Ext.decode=Ext.util.JSON.decode;Ext.util.Format=function(){var _1=/^\s+|\s+$/g;return{ellipsis:function(_2,_3){if(_2&&_2.length>_3){return _2.substr(0,_3-3)+"..."}return _2},undef:function(_4){return _4!==undefined?_4:""},defaultValue:function(_5,_6){return _5!==undefined&&_5!==""?_5:_6},htmlEncode:function(_7){return !_7?_7:String(_7).replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")},htmlDecode:function(_8){return !_8?_8:String(_8).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&quot;/g,'"').replace(/&amp;/g,"&")},trim:function(_9){return String(_9).replace(_1,"")},substr:function(_a,_b,_c){return String(_a).substr(_b,_c)},lowercase:function(_d){return String(_d).toLowerCase()},uppercase:function(_e){return String(_e).toUpperCase()},capitalize:function(_f){return !_f?_f:_f.charAt(0).toUpperCase()+_f.substr(1).toLowerCase()},call:function(_10,fn){if(arguments.length>2){var _12=Array.prototype.slice.call(arguments,2);_12.unshift(_10);return eval(fn).apply(window,_12)}else{return eval(fn).call(window,_10)}},usMoney:function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);v=String(v);var ps=v.split(".");var _15=ps[0];var sub=ps[1]?"."+ps[1]:".00";var r=/(\d+)(\d{3})/;while(r.test(_15)){_15=_15.replace(r,"$1,$2")}v=_15+sub;if(v.charAt(0)=="-"){return"-$"+v.substr(1)}return"$"+v},date:function(v,_19){if(!v){return""}if(!Ext.isDate(v)){v=new Date(Date.parse(v))}return v.dateFormat(_19||"m/d/Y")},dateRenderer:function(_1a){return function(v){return Ext.util.Format.date(v,_1a)}},stripTagsRE:/<\/?[^>]+>/gi,stripTags:function(v){return !v?v:String(v).replace(this.stripTagsRE,"")},stripScriptsRe:/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig,stripScripts:function(v){return !v?v:String(v).replace(this.stripScriptsRe,"")},fileSize:function(_1e){if(_1e<1024){return _1e+" bytes"}else{if(_1e<1048576){return(Math.round(((_1e*10)/1024))/10)+" KB"}else{return(Math.round(((_1e*10)/1048576))/10)+" MB"}}},math:function(){var fns={};return function(v,a){if(!fns[a]){fns[a]=new Function("v","return v "+a+";")}return fns[a](v)}}(),nl2br:function(v){return v===undefined||v===null?"":v.replace(/\n/g,"<br/>")}}}();Ext.XTemplate=function(){Ext.XTemplate.superclass.constructor.apply(this,arguments);var s=this.html;s=["<tpl>",s,"</tpl>"].join("");var re=/<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/;var _3=/^<tpl\b[^>]*?for="(.*?)"/;var _4=/^<tpl\b[^>]*?if="(.*?)"/;var _5=/^<tpl\b[^>]*?exec="(.*?)"/;var m,id=0;var _8=[];while(m=s.match(re)){var m2=m[0].match(_3);var m3=m[0].match(_4);var m4=m[0].match(_5);var _c=null,fn=null,_e=null;var _f=m2&&m2[1]?m2[1]:"";if(m3){_c=m3&&m3[1]?m3[1]:null;if(_c){fn=new Function("values","parent","xindex","xcount","with(values){ return "+(Ext.util.Format.htmlDecode(_c))+"; }")}}if(m4){_c=m4&&m4[1]?m4[1]:null;if(_c){_e=new Function("values","parent","xindex","xcount","with(values){ "+(Ext.util.Format.htmlDecode(_c))+"; }")}}if(_f){switch(_f){case".":_f=new Function("values","parent","with(values){ return values; }");break;case"..":_f=new Function("values","parent","with(values){ return parent; }");break;default:_f=new Function("values","parent","with(values){ return "+_f+"; }")}}_8.push({id:id,target:_f,exec:_e,test:fn,body:m[1]||""});s=s.replace(m[0],"{xtpl"+id+"}");++id}for(var i=_8.length-1;i>=0;--i){this.compileTpl(_8[i])}this.master=_8[_8.length-1];this.tpls=_8};Ext.extend(Ext.XTemplate,Ext.Template,{re:/\{([\w-\.\#]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?(\s?[\+\-\*\\]\s?[\d\.\+\-\*\\\(\)]+)?\}/g,codeRe:/\{\[((?:\\\]|.|\n)*?)\]\}/g,applySubTemplate:function(id,_12,_13,_14,_15){var t=this.tpls[id];if(t.test&&!t.test.call(this,_12,_13,_14,_15)){return""}if(t.exec&&t.exec.call(this,_12,_13,_14,_15)){return""}var vs=t.target?t.target.call(this,_12,_13):_12;_13=t.target?_12:_13;if(t.target&&Ext.isArray(vs)){var buf=[];for(var i=0,len=vs.length;i<len;i++){buf[buf.length]=t.compiled.call(this,vs[i],_13,i+1,len)}return buf.join("")}return t.compiled.call(this,vs,_13,_14,_15)},compileTpl:function(tpl){var fm=Ext.util.Format;var _1d=this.disableFormats!==true;var sep=Ext.isGecko?"+":",";var fn=function(m,_21,_22,_23,_24){if(_21.substr(0,4)=="xtpl"){return"'"+sep+"this.applySubTemplate("+_21.substr(4)+", values, parent, xindex, xcount)"+sep+"'"}var v;if(_21==="."){v="values"}else{if(_21==="#"){v="xindex"}else{if(_21.indexOf(".")!=-1){v=_21}else{v="values['"+_21+"']"}}}if(_24){v="("+v+_24+")"}if(_22&&_1d){_23=_23?","+_23:"";if(_22.substr(0,5)!="this."){_22="fm."+_22+"("}else{_22='this.call("'+_22.substr(5)+'", ';_23=", values"}}else{_23="";_22="("+v+" === undefined ? '' : "}return"'"+sep+_22+v+_23+")"+sep+"'"};var _26=function(m,_28){return"'"+sep+"("+_28+")"+sep+"'"};var _29;if(Ext.isGecko){_29="tpl.compiled = function(values, parent, xindex, xcount){ return '"+tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,_26)+"';};"}else{_29=["tpl.compiled = function(values, parent, xindex, xcount){ return ['"];_29.push(tpl.body.replace(/(\r\n|\n)/g,"\\n").replace(/'/g,"\\'").replace(this.re,fn).replace(this.codeRe,_26));_29.push("'].join('');};");_29=_29.join("")}eval(_29);return this},applyTemplate:function(_2a){return this.master.compiled.call(this,_2a,{},1,1)},compile:function(){return this}});Ext.XTemplate.prototype.apply=Ext.XTemplate.prototype.applyTemplate;Ext.XTemplate.from=function(el){el=Ext.getDom(el);return new Ext.XTemplate(el.value||el.innerHTML)};Ext.util.CSS=function(){var _1=null;var _2=document;var _3=/(-[a-z])/gi;var _4=function(m,a){return a.charAt(1).toUpperCase()};return{createStyleSheet:function(_7,id){var ss;var _a=_2.getElementsByTagName("head")[0];var _b=_2.createElement("style");_b.setAttribute("type","text/css");if(id){_b.setAttribute("id",id)}if(Ext.isIE){_a.appendChild(_b);ss=_b.styleSheet;ss.cssText=_7}else{try{_b.appendChild(_2.createTextNode(_7))}catch(e){_b.cssText=_7}_a.appendChild(_b);ss=_b.styleSheet?_b.styleSheet:(_b.sheet||_2.styleSheets[_2.styleSheets.length-1])}this.cacheStyleSheet(ss);return ss},removeStyleSheet:function(id){var _d=_2.getElementById(id);if(_d){_d.parentNode.removeChild(_d)}},swapStyleSheet:function(id,_f){this.removeStyleSheet(id);var ss=_2.createElement("link");ss.setAttribute("rel","stylesheet");ss.setAttribute("type","text/css");ss.setAttribute("id",id);ss.setAttribute("href",_f);_2.getElementsByTagName("head")[0].appendChild(ss)},refreshCache:function(){return this.getRules(true)},cacheStyleSheet:function(ss){if(!_1){_1={}}try{var _12=ss.cssRules||ss.rules;for(var j=_12.length-1;j>=0;--j){_1[_12[j].selectorText]=_12[j]}}catch(e){}},getRules:function(_14){if(_1==null||_14){_1={};var ds=_2.styleSheets;for(var i=0,len=ds.length;i<len;i++){try{this.cacheStyleSheet(ds[i])}catch(e){}}}return _1},getRule:function(_18,_19){var rs=this.getRules(_19);if(!Ext.isArray(_18)){return rs[_18]}for(var i=0;i<_18.length;i++){if(rs[_18[i]]){return rs[_18[i]]}}return null},updateRule:function(_1c,_1d,_1e){if(!Ext.isArray(_1c)){var _1f=this.getRule(_1c);if(_1f){_1f.style[_1d.replace(_3,_4)]=_1e;return true}}else{for(var i=0;i<_1c.length;i++){if(this.updateRule(_1c[i],_1d,_1e)){return true}}}return false}}}();Ext.util.ClickRepeater=function(el,_2){this.el=Ext.get(el);this.el.unselectable();Ext.apply(this,_2);this.addEvents("mousedown","click","mouseup");this.el.on("mousedown",this.handleMouseDown,this);if(this.preventDefault||this.stopDefault){this.el.on("click",function(e){if(this.preventDefault){e.preventDefault()
18
+ }if(this.stopDefault){e.stopEvent()}},this)}if(this.handler){this.on("click",this.handler,this.scope||this)}Ext.util.ClickRepeater.superclass.constructor.call(this)};Ext.extend(Ext.util.ClickRepeater,Ext.util.Observable,{interval:20,delay:250,preventDefault:true,stopDefault:false,timer:0,destroy:function(){Ext.destroy(this.el);this.purgeListeners()},handleMouseDown:function(){clearTimeout(this.timer);this.el.blur();if(this.pressClass){this.el.addClass(this.pressClass)}this.mousedownTime=new Date();Ext.getDoc().on("mouseup",this.handleMouseUp,this);this.el.on("mouseout",this.handleMouseOut,this);this.fireEvent("mousedown",this);this.fireEvent("click",this);if(this.accelerate){this.delay=400}this.timer=this.click.defer(this.delay||this.interval,this)},click:function(){this.fireEvent("click",this);this.timer=this.click.defer(this.accelerate?this.easeOutExpo(this.mousedownTime.getElapsed(),400,-390,12000):this.interval,this)},easeOutExpo:function(t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},handleMouseOut:function(){clearTimeout(this.timer);if(this.pressClass){this.el.removeClass(this.pressClass)}this.el.on("mouseover",this.handleMouseReturn,this)},handleMouseReturn:function(){this.el.un("mouseover",this.handleMouseReturn,this);if(this.pressClass){this.el.addClass(this.pressClass)}this.click()},handleMouseUp:function(){clearTimeout(this.timer);this.el.un("mouseover",this.handleMouseReturn,this);this.el.un("mouseout",this.handleMouseOut,this);Ext.getDoc().un("mouseup",this.handleMouseUp,this);this.el.removeClass(this.pressClass);this.fireEvent("mouseup",this)}});Ext.KeyNav=function(el,_2){this.el=Ext.get(el);Ext.apply(this,_2);if(!this.disabled){this.disabled=true;this.enable()}};Ext.KeyNav.prototype={disabled:false,defaultEventAction:"stopEvent",forceKeyDown:false,prepareEvent:function(e){var k=e.getKey();var h=this.keyToHandler[k];if(Ext.isSafari2&&h&&k>=37&&k<=40){e.stopEvent()}},relay:function(e){var k=e.getKey();var h=this.keyToHandler[k];if(h&&this[h]){if(this.doRelay(e,this[h],h)!==true){e[this.defaultEventAction]()}}},doRelay:function(e,h,_b){return h.call(this.scope||this,e)},enter:false,left:false,right:false,up:false,down:false,tab:false,esc:false,pageUp:false,pageDown:false,del:false,home:false,end:false,keyToHandler:{37:"left",39:"right",38:"up",40:"down",33:"pageUp",34:"pageDown",46:"del",36:"home",35:"end",13:"enter",27:"esc",9:"tab"},enable:function(){if(this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isSafari3||Ext.isAir){this.el.on("keydown",this.relay,this)}else{this.el.on("keydown",this.prepareEvent,this);this.el.on("keypress",this.relay,this)}this.disabled=false}},disable:function(){if(!this.disabled){if(this.forceKeyDown||Ext.isIE||Ext.isSafari3||Ext.isAir){this.el.un("keydown",this.relay,this)}else{this.el.un("keydown",this.prepareEvent,this);this.el.un("keypress",this.relay,this)}this.disabled=true}}};Ext.KeyMap=function(el,_2,_3){this.el=Ext.get(el);this.eventName=_3||"keydown";this.bindings=[];if(_2){this.addBinding(_2)}this.enable()};Ext.KeyMap.prototype={stopEvent:false,addBinding:function(_4){if(Ext.isArray(_4)){for(var i=0,_6=_4.length;i<_6;i++){this.addBinding(_4[i])}return}var _7=_4.key,_8=_4.shift,_9=_4.ctrl,_a=_4.alt,fn=_4.fn||_4.handler,_c=_4.scope;if(_4.stopEvent){this.stopEvent=_4.stopEvent}if(typeof _7=="string"){var ks=[];var _e=_7.toUpperCase();for(var j=0,_6=_e.length;j<_6;j++){ks.push(_e.charCodeAt(j))}_7=ks}var _10=Ext.isArray(_7);var _11=function(e){if((!_8||e.shiftKey)&&(!_9||e.ctrlKey)&&(!_a||e.altKey)){var k=e.getKey();if(_10){for(var i=0,_6=_7.length;i<_6;i++){if(_7[i]==k){if(this.stopEvent){e.stopEvent()}fn.call(_c||window,k,e);return}}}else{if(k==_7){if(this.stopEvent){e.stopEvent()}fn.call(_c||window,k,e)}}}};this.bindings.push(_11)},on:function(key,fn,_17){var _18,_19,_1a,alt;if(typeof key=="object"&&!Ext.isArray(key)){_18=key.key;_19=key.shift;_1a=key.ctrl;alt=key.alt}else{_18=key}this.addBinding({key:_18,shift:_19,ctrl:_1a,alt:alt,fn:fn,scope:_17})},handleKeyDown:function(e){if(this.enabled){var b=this.bindings;for(var i=0,len=b.length;i<len;i++){b[i].call(this,e)}}},isEnabled:function(){return this.enabled},enable:function(){if(!this.enabled){this.el.on(this.eventName,this.handleKeyDown,this);this.enabled=true}},disable:function(){if(this.enabled){this.el.removeListener(this.eventName,this.handleKeyDown,this);this.enabled=false}}};Ext.util.TextMetrics=function(){var _1;return{measure:function(el,_3,_4){if(!_1){_1=Ext.util.TextMetrics.Instance(el,_4)}_1.bind(el);_1.setFixedWidth(_4||"auto");return _1.getSize(_3)},createInstance:function(el,_6){return Ext.util.TextMetrics.Instance(el,_6)}}}();Ext.util.TextMetrics.Instance=function(_7,_8){var ml=new Ext.Element(document.createElement("div"));document.body.appendChild(ml.dom);ml.position("absolute");ml.setLeftTop(-1000,-1000);ml.hide();if(_8){ml.setWidth(_8)}var _a={getSize:function(_b){ml.update(_b);var s=ml.getSize();ml.update("");return s},bind:function(el){ml.setStyle(Ext.fly(el).getStyles("font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"))},setFixedWidth:function(_e){ml.setWidth(_e)},getWidth:function(_f){ml.dom.style.width="auto";return this.getSize(_f).width},getHeight:function(_10){return this.getSize(_10).height}};_a.bind(_7);return _a};Ext.Element.measureText=Ext.util.TextMetrics.measure;(function(){var _1=Ext.EventManager;var _2=Ext.lib.Dom;Ext.dd.DragDrop=function(id,_4,_5){if(id){this.init(id,_4,_5)}};Ext.dd.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},moveOnly:false,unlock:function(){this.locked=false},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},defaultPadding:{left:0,right:0,top:0,bottom:0},constrainTo:function(_1d,pad,_1f){if(typeof pad=="number"){pad={left:pad,right:pad,top:pad,bottom:pad}}pad=pad||this.defaultPadding;var b=Ext.get(this.getEl()).getBox();var ce=Ext.get(_1d);var s=ce.getScroll();var c,cd=ce.dom;if(cd==document.body){c={x:s.left,y:s.top,width:Ext.lib.Dom.getViewWidth(),height:Ext.lib.Dom.getViewHeight()}}else{var xy=ce.getXY();c={x:xy[0]+s.left,y:xy[1]+s.top,width:cd.clientWidth,height:cd.clientHeight}}var _26=b.y-c.y;var _27=b.x-c.x;this.resetConstraints();this.setXConstraint(_27-(pad.left||0),c.width-_27-b.width-(pad.right||0),this.xTickSize);this.setYConstraint(_26-(pad.top||0),c.height-_26-b.height-(pad.bottom||0),this.yTickSize)},getEl:function(){if(!this._domRef){this._domRef=Ext.getDom(this.id)}return this._domRef},getDragEl:function(){return Ext.getDom(this.dragElId)},init:function(id,_29,_2a){this.initTarget(id,_29,_2a);_1.on(this.id,"mousedown",this.handleMouseDown,this)},initTarget:function(id,_2c,_2d){this.config=_2d||{};this.DDM=Ext.dd.DDM;this.groups={};if(typeof id!=="string"){id=Ext.id(id)}this.id=id;this.addToGroup((_2c)?_2c:"default");this.handleElId=id;this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();this.handleOnAvailable()},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false)},handleOnAvailable:function(){this.available=true;
19
+ this.resetConstraints();this.onAvailable()},setPadding:function(_2e,_2f,_30,_31){if(!_2f&&0!==_2f){this.padding=[_2e,_2e,_2e,_2e]}else{if(!_30&&0!==_30){this.padding=[_2e,_2f,_2e,_2f]}else{this.padding=[_2e,_2f,_30,_31]}}},setInitPosition:function(_32,_33){var el=this.getEl();if(!this.DDM.verifyEl(el)){return}var dx=_32||0;var dy=_33||0;var p=_2.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p)},setStartPosition:function(pos){var p=pos||_2.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1]},addToGroup:function(_3a){this.groups[_3a]=true;this.DDM.regDragDrop(this,_3a)},removeFromGroup:function(_3b){if(this.groups[_3b]){delete this.groups[_3b]}this.DDM.removeDDFromGroup(this,_3b)},setDragElId:function(id){this.dragElId=id},setHandleElId:function(id){if(typeof id!=="string"){id=Ext.id(id)}this.handleElId=id;this.DDM.regHandle(this.id,id)},setOuterHandleElId:function(id){if(typeof id!=="string"){id=Ext.id(id)}_1.on(id,"mousedown",this.handleMouseDown,this);this.setHandleElId(id);this.hasOuterHandles=true},unreg:function(){_1.un(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},destroy:function(){this.unreg()},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(e,oDD){if(this.primaryButtonOnly&&e.button!=0){return}if(this.isLocked()){return}this.DDM.refreshCache(this.groups);var pt=new Ext.lib.Point(Ext.lib.Event.getPageX(e),Ext.lib.Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e)}else{}}},clickValidator:function(e){var _43=e.getTarget();return(this.isValidHandleChild(_43)&&(this.id==this.handleElId||this.DDM.handleWasClicked(_43,this.id)))},addInvalidHandleType:function(_44){var _45=_44.toUpperCase();this.invalidHandleTypes[_45]=_45},addInvalidHandleId:function(id){if(typeof id!=="string"){id=Ext.id(id)}this.invalidHandleIds[id]=id},addInvalidHandleClass:function(_47){this.invalidHandleClasses.push(_47)},removeInvalidHandleType:function(_48){var _49=_48.toUpperCase();delete this.invalidHandleTypes[_49]},removeInvalidHandleId:function(id){if(typeof id!=="string"){id=Ext.id(id)}delete this.invalidHandleIds[id]},removeInvalidHandleClass:function(_4b){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==_4b){delete this.invalidHandleClasses[i]}}},isValidHandleChild:function(_4e){var _4f=true;var _50;try{_50=_4e.nodeName.toUpperCase()}catch(e){_50=_4e.nodeName}_4f=_4f&&!this.invalidHandleTypes[_50];_4f=_4f&&!this.invalidHandleIds[_4e.id];for(var i=0,len=this.invalidHandleClasses.length;_4f&&i<len;++i){_4f=!Ext.fly(_4e).hasClass(this.invalidHandleClasses[i])}return _4f},setXTicks:function(_53,_54){this.xTicks=[];this.xTickSize=_54;var _55={};for(var i=this.initPageX;i>=this.minX;i=i-_54){if(!_55[i]){this.xTicks[this.xTicks.length]=i;_55[i]=true}}for(i=this.initPageX;i<=this.maxX;i=i+_54){if(!_55[i]){this.xTicks[this.xTicks.length]=i;_55[i]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(_57,_58){this.yTicks=[];this.yTickSize=_58;var _59={};for(var i=this.initPageY;i>=this.minY;i=i-_58){if(!_59[i]){this.yTicks[this.yTicks.length]=i;_59[i]=true}}for(i=this.initPageY;i<=this.maxY;i=i+_58){if(!_59[i]){this.yTicks[this.yTicks.length]=i;_59[i]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(_5b,_5c,_5d){this.leftConstraint=_5b;this.rightConstraint=_5c;this.minX=this.initPageX-_5b;this.maxX=this.initPageX+_5c;if(_5d){this.setXTicks(this.initPageX,_5d)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(iUp,_5f,_60){this.topConstraint=iUp;this.bottomConstraint=_5f;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+_5f;if(_60){this.setYTicks(this.initPageY,_60)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(val,_64){if(!_64){return val}else{if(_64[0]>=val){return _64[0]}else{for(var i=0,len=_64.length;i<len;++i){var _67=i+1;if(_64[_67]&&_64[_67]>=val){var _68=val-_64[i];var _69=_64[_67]-val;return(_69>_68)?_64[i]:_64[_67]}}return _64[_64.length-1]}}},toString:function(){return("DragDrop "+this.id)}}})();if(!Ext.dd.DragDropMgr){Ext.dd.DragDropMgr=function(){var _6a=Ext.EventManager;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,init:function(){this.initialized=true},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(_6b,_6c){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue}oDD[_6b].apply(oDD,_6c)}}},_onLoad:function(){this.init();_6a.on(document,"mouseup",this.handleMouseUp,this,true);_6a.on(document,"mousemove",this.handleMouseMove,this,true);_6a.on(window,"unload",this._onUnload,this,true);_6a.on(window,"resize",this._onResize,this,true)},_onResize:function(e){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:350,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,_72){if(!this.initialized){this.init()}if(!this.ids[_72]){this.ids[_72]={}}this.ids[_72][oDD.id]=oDD},removeDDFromGroup:function(oDD,_74){if(!this.ids[_74]){this.ids[_74]={}}var obj=this.ids[_74];if(obj&&obj[oDD.id]){delete obj[oDD.id]}},_remove:function(oDD){for(var g in oDD.groups){if(g&&this.ids[g]&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id]}}delete this.handleIds[oDD.id]},regHandle:function(_78,_79){if(!this.handleIds[_78]){this.handleIds[_78]={}}this.handleIds[_78][_79]=_79},isDragDrop:function(id){return(this.getDDById(id))?true:false},getRelated:function(_7b,_7c){var _7d=[];for(var i in _7b.groups){for(var j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue}if(!_7c||dd.isTarget){_7d[_7d.length]=dd}}}return _7d},isLegalTarget:function(oDD,_82){var _83=this.getRelated(oDD,true);for(var i=0,len=_83.length;i<len;++i){if(_83[i].id==_82.id){return true}}return false},isTypeOfDD:function(oDD){return(oDD&&oDD.__ygDragDrop)},isHandle:function(_87,_88){return(this.handleIds[_87]&&this.handleIds[_87][_88])},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id]}}return null},handleMouseDown:function(e,oDD){if(Ext.QuickTips){Ext.QuickTips.disable()}if(this.dragCurrent){this.handleMouseUp(e)}this.currentTarget=e.getTarget();this.dragCurrent=oDD;var el=oDD.getEl();this.startX=e.getPageX();this.startY=e.getPageY();this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=Ext.dd.DDM;DDM.startDrag(DDM.startX,DDM.startY)},this.clickTimeThresh)},startDrag:function(x,y){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y)}this.dragThreshMet=true},handleMouseUp:function(e){if(Ext.QuickTips){Ext.QuickTips.enable()}if(!this.dragCurrent){return}clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true)}else{}this.stopDrag(e);this.stopEvent(e)},stopEvent:function(e){if(this.stopPropagation){e.stopPropagation()}if(this.preventDefault){e.preventDefault()
20
+ }},stopDrag:function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e)}this.dragCurrent.onMouseUp(e)}this.dragCurrent=null;this.dragOvers={}},handleMouseMove:function(e){if(!this.dragCurrent){return true}if(Ext.isIE&&(e.button!==0&&e.button!==1&&e.button!==2)){this.stopEvent(e);return this.handleMouseUp(e)}if(!this.dragThreshMet){var _95=Math.abs(this.startX-e.getPageX());var _96=Math.abs(this.startY-e.getPageY());if(_95>this.clickPixelThresh||_96>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);if(!this.dragCurrent.moveOnly){this.fireEvents(e,false)}}this.stopEvent(e);return true},fireEvents:function(e,_98){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return}var pt=e.getPoint();var _9b=[];var _9c=[];var _9d=[];var _9e=[];var _9f=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue}if(!this.isOverTarget(pt,ddo,this.mode)){_9c.push(ddo)}_9b[i]=true;delete this.dragOvers[i]}for(var _a2 in dc.groups){if("string"!=typeof _a2){continue}for(i in this.ids[_a2]){var oDD=this.ids[_a2][i];if(!this.isTypeOfDD(oDD)){continue}if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(_98){_9e.push(oDD)}else{if(!_9b[oDD.id]){_9f.push(oDD)}else{_9d.push(oDD)}this.dragOvers[oDD.id]=oDD}}}}}if(this.mode){if(_9c.length){dc.b4DragOut(e,_9c);dc.onDragOut(e,_9c)}if(_9f.length){dc.onDragEnter(e,_9f)}if(_9d.length){dc.b4DragOver(e,_9d);dc.onDragOver(e,_9d)}if(_9e.length){dc.b4DragDrop(e,_9e);dc.onDragDrop(e,_9e)}}else{var len=0;for(i=0,len=_9c.length;i<len;++i){dc.b4DragOut(e,_9c[i].id);dc.onDragOut(e,_9c[i].id)}for(i=0,len=_9f.length;i<len;++i){dc.onDragEnter(e,_9f[i].id)}for(i=0,len=_9d.length;i<len;++i){dc.b4DragOver(e,_9d[i].id);dc.onDragOver(e,_9d[i].id)}for(i=0,len=_9e.length;i<len;++i){dc.b4DragDrop(e,_9e[i].id);dc.onDragDrop(e,_9e[i].id)}}if(_98&&!_9e.length){dc.onInvalidDrop(e)}},getBestMatch:function(dds){var _a6=null;var len=dds.length;if(len==1){_a6=dds[0]}else{for(var i=0;i<len;++i){var dd=dds[i];if(dd.cursorIsOver){_a6=dd;break}else{if(!_a6||_a6.overlap.getArea()<dd.overlap.getArea()){_a6=dd}}}}return _a6},refreshCache:function(_aa){for(var _ab in _aa){if("string"!=typeof _ab){continue}for(var i in this.ids[_ab]){var oDD=this.ids[_ab][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc}else{delete this.locationCache[oDD.id]}}}}},verifyEl:function(el){if(el){var _b0;if(Ext.isIE){try{_b0=el.offsetParent}catch(e){}}else{_b0=el.offsetParent}if(_b0){return true}}return false},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null}var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=Ext.lib.Dom.getXY(el)}catch(e){}if(!pos){return null}x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new Ext.lib.Region(t,r,b,l)},isOverTarget:function(pt,_bd,_be){var loc=this.locationCache[_bd.id];if(!loc||!this.useCache){loc=this.getLocation(_bd);this.locationCache[_bd.id]=loc}if(!loc){return false}_bd.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!_be&&!dc.constrainX&&!dc.constrainY)){return _bd.cursorIsOver}_bd.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var _c3=new Ext.lib.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var _c4=_c3.intersect(loc);if(_c4){_bd.overlap=_c4;return(_be)?true:_bd.cursorIsOver}else{return false}},_onUnload:function(e,me){Ext.dd.DragDropMgr.unregAll()},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null}this._execOnAll("unreg",[]);for(var i in this.elementCache){delete this.elementCache[i]}this.elementCache={};this.ids={}},elementCache:{},getElWrapper:function(id){var _c9=this.elementCache[id];if(!_c9||!_c9.el){_c9=this.elementCache[id]=new this.ElementWrapper(Ext.getDom(id))}return _c9},getElement:function(id){return Ext.getDom(id)},getCss:function(id){var el=Ext.getDom(id);return(el)?el.style:null},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style},getPosX:function(el){return Ext.lib.Dom.getX(el)},getPosY:function(el){return Ext.lib.Dom.getY(el)},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2)}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2)}else{if(n2==n1.nextSibling){p.insertBefore(n2,n1)}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s)}}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft}else{if(db){t=db.scrollTop;l=db.scrollLeft}else{}}return{top:t,left:l}},getStyle:function(el,_d9){return Ext.fly(el).getStyle(_d9)},getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(_da,_db){var _dc=Ext.lib.Dom.getXY(_db);Ext.lib.Dom.setXY(_da,_dc)},numericSort:function(a,b){return(a-b)},_timeoutCount:0,_addListeners:function(){var DDM=Ext.dd.DDM;if(Ext.lib.Event&&document){DDM._onLoad()}else{if(DDM._timeoutCount>2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1}}}},handleWasClicked:function(_e0,id){if(this.isHandle(id,_e0.id)){return true}else{var p=_e0.parentNode;while(p){if(this.isHandle(id,p.id)){return true}else{p=p.parentNode}}}return false}}}();Ext.dd.DDM=Ext.dd.DragDropMgr;Ext.dd.DDM._addListeners()}Ext.dd.DD=function(id,_e4,_e5){if(id){this.init(id,_e4,_e5)}};Ext.extend(Ext.dd.DD,Ext.dd.DragDrop,{scroll:true,autoOffset:function(_e6,_e7){var x=_e6-this.startPageX;var y=_e7-this.startPageY;this.setDelta(x,y)},setDelta:function(_ea,_eb){this.deltaX=_ea;this.deltaY=_eb},setDragElPos:function(_ec,_ed){var el=this.getDragEl();this.alignElWithMouse(el,_ec,_ed)},alignElWithMouse:function(el,_f0,_f1){var _f2=this.getTargetCoord(_f0,_f1);var fly=el.dom?el:Ext.fly(el,"_dd");if(!this.deltaSetXY){var _f4=[_f2.x,_f2.y];fly.setXY(_f4);var _f5=fly.getLeft(true);var _f6=fly.getTop(true);this.deltaSetXY=[_f5-_f2.x,_f6-_f2.y]}else{fly.setLeftTop(_f2.x+this.deltaSetXY[0],_f2.y+this.deltaSetXY[1])}this.cachePosition(_f2.x,_f2.y);this.autoScroll(_f2.x,_f2.y,el.offsetHeight,el.offsetWidth);return _f2},cachePosition:function(_f7,_f8){if(_f7){this.lastPageX=_f7;this.lastPageY=_f8}else{var _f9=Ext.lib.Dom.getXY(this.getEl());this.lastPageX=_f9[0];this.lastPageY=_f9[1]}},autoScroll:function(x,y,h,w){if(this.scroll){var _fe=Ext.lib.Dom.getViewHeight();var _ff=Ext.lib.Dom.getViewWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var _103=w+x;var _104=(_fe+st-y-this.deltaY);var _105=(_ff+sl-x-this.deltaX);var _106=40;var _107=(document.all)?80:30;if(bot>_fe&&_104<_106){window.scrollTo(sl,st+_107)}if(y<st&&st>0&&y-st<_106){window.scrollTo(sl,st-_107)}if(_103>_ff&&_105<_106){window.scrollTo(sl+_107,st)}if(x<sl&&sl>0&&x-sl<_106){window.scrollTo(sl-_107,st)}}},getTargetCoord:function(_108,_109){var x=_108-this.deltaX;var y=_109-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX}if(x>this.maxX){x=this.maxX}}if(this.constrainY){if(y<this.minY){y=this.minY}if(y>this.maxY){y=this.maxY}}x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y}},applyConfig:function(){Ext.dd.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(e){this.autoOffset(e.getPageX(),e.getPageY())},b4Drag:function(e){this.setDragElPos(e.getPageX(),e.getPageY())},toString:function(){return("DD "+this.id)}});Ext.dd.DDProxy=function(id,_10f,_110){if(id){this.init(id,_10f,_110);this.initFrame()}};Ext.dd.DDProxy.dragElId="ygddfdiv";Ext.extend(Ext.dd.DDProxy,Ext.dd.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this;var body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame()},50);return}var div=this.getDragEl();
21
+ if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;body.insertBefore(div,body.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){Ext.dd.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||Ext.dd.DDProxy.dragElId)},showFrame:function(_115,_116){var el=this.getEl();var _118=this.getDragEl();var s=_118.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2))}this.setDragElPos(_115,_116);Ext.fly(_118).show()},_resizeProxy:function(){if(this.resizeFrame){var el=this.getEl();Ext.fly(this.getDragEl()).setSize(el.offsetWidth,el.offsetHeight)}},b4MouseDown:function(e){var x=e.getPageX();var y=e.getPageY();this.autoOffset(x,y);this.setDragElPos(x,y)},b4StartDrag:function(x,y){this.showFrame(x,y)},b4EndDrag:function(e){Ext.fly(this.getDragEl()).hide()},endDrag:function(e){var lel=this.getEl();var del=this.getDragEl();del.style.visibility="";this.beforeMove();lel.style.visibility="hidden";Ext.dd.DDM.moveToEl(lel,del);del.style.visibility="hidden";lel.style.visibility="";this.afterDrag()},beforeMove:function(){},afterDrag:function(){},toString:function(){return("DDProxy "+this.id)}});Ext.dd.DDTarget=function(id,_125,_126){if(id){this.initTarget(id,_125,_126)}};Ext.extend(Ext.dd.DDTarget,Ext.dd.DragDrop,{toString:function(){return("DDTarget "+this.id)}});Ext.dd.DragTracker=function(_1){Ext.apply(this,_1);this.addEvents("mousedown","mouseup","mousemove","dragstart","dragend","drag");this.dragRegion=new Ext.lib.Region(0,0,0,0);if(this.el){this.initEl(this.el)}};Ext.extend(Ext.dd.DragTracker,Ext.util.Observable,{active:false,tolerance:5,autoStart:false,initEl:function(el){this.el=Ext.get(el);el.on("mousedown",this.onMouseDown,this,this.delegate?{delegate:this.delegate}:undefined)},destroy:function(){this.el.un("mousedown",this.onMouseDown,this)},onMouseDown:function(e,_4){if(this.fireEvent("mousedown",this,e)!==false&&this.onBeforeStart(e)!==false){this.startXY=this.lastXY=e.getXY();this.dragTarget=this.delegate?_4:this.el.dom;e.preventDefault();var _5=Ext.getDoc();_5.on("mouseup",this.onMouseUp,this);_5.on("mousemove",this.onMouseMove,this);_5.on("selectstart",this.stopSelect,this);if(this.autoStart){this.timer=this.triggerStart.defer(this.autoStart===true?1000:this.autoStart,this)}}},onMouseMove:function(e,_7){e.preventDefault();var xy=e.getXY(),s=this.startXY;this.lastXY=xy;if(!this.active){if(Math.abs(s[0]-xy[0])>this.tolerance||Math.abs(s[1]-xy[1])>this.tolerance){this.triggerStart()}else{return}}this.fireEvent("mousemove",this,e);this.onDrag(e);this.fireEvent("drag",this,e)},onMouseUp:function(e){var _b=Ext.getDoc();_b.un("mousemove",this.onMouseMove,this);_b.un("mouseup",this.onMouseUp,this);_b.un("selectstart",this.stopSelect,this);e.preventDefault();this.clearStart();this.active=false;delete this.elRegion;this.fireEvent("mouseup",this,e);this.onEnd(e);this.fireEvent("dragend",this,e)},triggerStart:function(_c){this.clearStart();this.active=true;this.onStart(this.startXY);this.fireEvent("dragstart",this,this.startXY)},clearStart:function(){if(this.timer){clearTimeout(this.timer);delete this.timer}},stopSelect:function(e){e.stopEvent();return false},onBeforeStart:function(e){},onStart:function(xy){},onDrag:function(e){},onEnd:function(e){},getDragTarget:function(){return this.dragTarget},getDragCt:function(){return this.el},getXY:function(_12){return _12?this.constrainModes[_12].call(this,this.lastXY):this.lastXY},getOffset:function(_13){var xy=this.getXY(_13);var s=this.startXY;return[s[0]-xy[0],s[1]-xy[1]]},constrainModes:{point:function(xy){if(!this.elRegion){this.elRegion=this.getDragCt().getRegion()}var dr=this.dragRegion;dr.left=xy[0];dr.top=xy[1];dr.right=xy[0];dr.bottom=xy[1];dr.constrainTo(this.elRegion);return[dr.left,dr.top]}}});Ext.dd.ScrollManager=function(){var _1=Ext.dd.DragDropMgr;var _2={};var _3=null;var _4={};var _5=function(e){_3=null;_7()};var _8=function(){if(_1.dragCurrent){_1.refreshCache(_1.dragCurrent.groups)}};var _9=function(){if(_1.dragCurrent){var _a=Ext.dd.ScrollManager;var _b=_4.el.ddScrollConfig?_4.el.ddScrollConfig.increment:_a.increment;if(!_a.animate){if(_4.el.scroll(_4.dir,_b)){_8()}}else{_4.el.scroll(_4.dir,_b,true,_a.animDuration,_8)}}};var _7=function(){if(_4.id){clearInterval(_4.id)}_4.id=0;_4.el=null;_4.dir=""};var _c=function(el,_e){_7();_4.el=el;_4.dir=_e;var _f=(el.ddScrollConfig&&el.ddScrollConfig.frequency)?el.ddScrollConfig.frequency:Ext.dd.ScrollManager.frequency;_4.id=setInterval(_9,_f)};var _10=function(e,_12){if(_12||!_1.dragCurrent){return}var dds=Ext.dd.ScrollManager;if(!_3||_3!=_1.dragCurrent){_3=_1.dragCurrent;dds.refreshCache()}var xy=Ext.lib.Event.getXY(e);var pt=new Ext.lib.Point(xy[0],xy[1]);for(var id in _2){var el=_2[id],r=el._region;var c=el.ddScrollConfig?el.ddScrollConfig:dds;if(r&&r.contains(pt)&&el.isScrollable()){if(r.bottom-pt.y<=c.vthresh){if(_4.el!=el){_c(el,"down")}return}else{if(r.right-pt.x<=c.hthresh){if(_4.el!=el){_c(el,"left")}return}else{if(pt.y-r.top<=c.vthresh){if(_4.el!=el){_c(el,"up")}return}else{if(pt.x-r.left<=c.hthresh){if(_4.el!=el){_c(el,"right")}return}}}}}}_7()};_1.fireEvents=_1.fireEvents.createSequence(_10,_1);_1.stopDrag=_1.stopDrag.createSequence(_5,_1);return{register:function(el){if(Ext.isArray(el)){for(var i=0,len=el.length;i<len;i++){this.register(el[i])}}else{el=Ext.get(el);_2[el.id]=el}},unregister:function(el){if(Ext.isArray(el)){for(var i=0,len=el.length;i<len;i++){this.unregister(el[i])}}else{el=Ext.get(el);delete _2[el.id]}},vthresh:25,hthresh:25,increment:100,frequency:500,animate:true,animDuration:0.4,refreshCache:function(){for(var id in _2){if(typeof _2[id]=="object"){_2[id]._region=_2[id].getRegion()}}}}}();Ext.dd.Registry=function(){var _1={};var _2={};var _3=0;var _4=function(el,_6){if(typeof el=="string"){return el}var id=el.id;if(!id&&_6!==false){id="extdd-"+(++_3);el.id=id}return id};return{register:function(el,_9){_9=_9||{};if(typeof el=="string"){el=document.getElementById(el)}_9.ddel=el;_1[_4(el)]=_9;if(_9.isHandle!==false){_2[_9.ddel.id]=_9}if(_9.handles){var hs=_9.handles;for(var i=0,_c=hs.length;i<_c;i++){_2[_4(hs[i])]=_9}}},unregister:function(el){var id=_4(el,false);var _f=_1[id];if(_f){delete _1[id];if(_f.handles){var hs=_f.handles;for(var i=0,len=hs.length;i<len;i++){delete _2[_4(hs[i],false)]}}}},getHandle:function(id){if(typeof id!="string"){id=id.id}return _2[id]},getHandleFromEvent:function(e){var t=Ext.lib.Event.getTarget(e);return t?_2[t.id]:null},getTarget:function(id){if(typeof id!="string"){id=id.id}return _1[id]},getTargetFromEvent:function(e){var t=Ext.lib.Event.getTarget(e);return t?_1[t.id]||_2[t.id]:null}}}();Ext.dd.StatusProxy=function(_1){Ext.apply(this,_1);this.id=this.id||Ext.id();this.el=new Ext.Layer({dh:{id:this.id,tag:"div",cls:"x-dd-drag-proxy "+this.dropNotAllowed,children:[{tag:"div",cls:"x-dd-drop-icon"},{tag:"div",cls:"x-dd-drag-ghost"}]},shadow:!_1||_1.shadow!==false});this.ghost=Ext.get(this.el.dom.childNodes[1]);this.dropStatus=this.dropNotAllowed};Ext.dd.StatusProxy.prototype={dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",setStatus:function(_2){_2=_2||this.dropNotAllowed;if(this.dropStatus!=_2){this.el.replaceClass(this.dropStatus,_2);this.dropStatus=_2}},reset:function(_3){this.el.dom.className="x-dd-drag-proxy "+this.dropNotAllowed;this.dropStatus=this.dropNotAllowed;if(_3){this.ghost.update("")}},update:function(_4){if(typeof _4=="string"){this.ghost.update(_4)}else{this.ghost.update("");_4.style.margin="0";this.ghost.dom.appendChild(_4)}var el=this.ghost.dom.firstChild;if(el){Ext.fly(el).setStyle(Ext.isIE?"styleFloat":"cssFloat","none")}},getEl:function(){return this.el},getGhost:function(){return this.ghost},hide:function(_6){this.el.hide();
22
+ if(_6){this.reset(true)}},stop:function(){if(this.anim&&this.anim.isAnimated&&this.anim.isAnimated()){this.anim.stop()}},show:function(){this.el.show()},sync:function(){this.el.sync()},repair:function(xy,_8,_9){this.callback=_8;this.scope=_9;if(xy&&this.animRepair!==false){this.el.addClass("x-dd-drag-repair");this.el.hideUnders(true);this.anim=this.el.shift({duration:this.repairDuration||0.5,easing:"easeOut",xy:xy,stopFx:true,callback:this.afterRepair,scope:this})}else{this.afterRepair()}},afterRepair:function(){this.hide(true);if(typeof this.callback=="function"){this.callback.call(this.scope||this)}this.callback=null;this.scope=null}};Ext.dd.DragSource=function(el,_2){this.el=Ext.get(el);if(!this.dragData){this.dragData={}}Ext.apply(this,_2);if(!this.proxy){this.proxy=new Ext.dd.StatusProxy()}Ext.dd.DragSource.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{dragElId:this.proxy.id,resizeFrame:false,isTarget:false,scroll:this.scroll===true});this.dragging=false};Ext.extend(Ext.dd.DragSource,Ext.dd.DDProxy,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",getDragData:function(e){return this.dragData},onDragEnter:function(e,id){var _6=Ext.dd.DragDropMgr.getDDById(id);this.cachedTarget=_6;if(this.beforeDragEnter(_6,e,id)!==false){if(_6.isNotifyTarget){var _7=_6.notifyEnter(this,e,this.dragData);this.proxy.setStatus(_7)}else{this.proxy.setStatus(this.dropAllowed)}if(this.afterDragEnter){this.afterDragEnter(_6,e,id)}}},beforeDragEnter:function(_8,e,id){return true},alignElWithMouse:function(){Ext.dd.DragSource.superclass.alignElWithMouse.apply(this,arguments);this.proxy.sync()},onDragOver:function(e,id){var _d=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(id);if(this.beforeDragOver(_d,e,id)!==false){if(_d.isNotifyTarget){var _e=_d.notifyOver(this,e,this.dragData);this.proxy.setStatus(_e)}if(this.afterDragOver){this.afterDragOver(_d,e,id)}}},beforeDragOver:function(_f,e,id){return true},onDragOut:function(e,id){var _14=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(id);if(this.beforeDragOut(_14,e,id)!==false){if(_14.isNotifyTarget){_14.notifyOut(this,e,this.dragData)}this.proxy.reset();if(this.afterDragOut){this.afterDragOut(_14,e,id)}}this.cachedTarget=null},beforeDragOut:function(_15,e,id){return true},onDragDrop:function(e,id){var _1a=this.cachedTarget||Ext.dd.DragDropMgr.getDDById(id);if(this.beforeDragDrop(_1a,e,id)!==false){if(_1a.isNotifyTarget){if(_1a.notifyDrop(this,e,this.dragData)){this.onValidDrop(_1a,e,id)}else{this.onInvalidDrop(_1a,e,id)}}else{this.onValidDrop(_1a,e,id)}if(this.afterDragDrop){this.afterDragDrop(_1a,e,id)}}delete this.cachedTarget},beforeDragDrop:function(_1b,e,id){return true},onValidDrop:function(_1e,e,id){this.hideProxy();if(this.afterValidDrop){this.afterValidDrop(_1e,e,id)}},getRepairXY:function(e,_22){return this.el.getXY()},onInvalidDrop:function(_23,e,id){this.beforeInvalidDrop(_23,e,id);if(this.cachedTarget){if(this.cachedTarget.isNotifyTarget){this.cachedTarget.notifyOut(this,e,this.dragData)}this.cacheTarget=null}this.proxy.repair(this.getRepairXY(e,this.dragData),this.afterRepair,this);if(this.afterInvalidDrop){this.afterInvalidDrop(e,id)}},afterRepair:function(){if(Ext.enableFx){this.el.highlight(this.hlColor||"c3daf9")}this.dragging=false},beforeInvalidDrop:function(_26,e,id){return true},handleMouseDown:function(e){if(this.dragging){return}var _2a=this.getDragData(e);if(_2a&&this.onBeforeDrag(_2a,e)!==false){this.dragData=_2a;this.proxy.stop();Ext.dd.DragSource.superclass.handleMouseDown.apply(this,arguments)}},onBeforeDrag:function(_2b,e){return true},onStartDrag:Ext.emptyFn,startDrag:function(x,y){this.proxy.reset();this.dragging=true;this.proxy.update("");this.onInitDrag(x,y);this.proxy.show()},onInitDrag:function(x,y){var _31=this.el.dom.cloneNode(true);_31.id=Ext.id();this.proxy.update(_31);this.onStartDrag(x,y);return true},getProxy:function(){return this.proxy},hideProxy:function(){this.proxy.hide();this.proxy.reset(true);this.dragging=false},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)},b4EndDrag:function(e){},endDrag:function(e){this.onEndDrag(this.dragData,e)},onEndDrag:function(_34,e){},autoOffset:function(x,y){this.setDelta(-12,-20)}});Ext.dd.DropTarget=function(el,_2){this.el=Ext.get(el);Ext.apply(this,_2);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}Ext.dd.DropTarget.superclass.constructor.call(this,this.el.dom,this.ddGroup||this.group,{isTarget:true})};Ext.extend(Ext.dd.DropTarget,Ext.dd.DDTarget,{dropAllowed:"x-dd-drop-ok",dropNotAllowed:"x-dd-drop-nodrop",isTarget:true,isNotifyTarget:true,notifyEnter:function(dd,e,_5){if(this.overClass){this.el.addClass(this.overClass)}return this.dropAllowed},notifyOver:function(dd,e,_8){return this.dropAllowed},notifyOut:function(dd,e,_b){if(this.overClass){this.el.removeClass(this.overClass)}},notifyDrop:function(dd,e,_e){return false}});Ext.dd.DragZone=function(el,_2){Ext.dd.DragZone.superclass.constructor.call(this,el,_2);if(this.containerScroll){Ext.dd.ScrollManager.register(this.el)}};Ext.extend(Ext.dd.DragZone,Ext.dd.DragSource,{getDragData:function(e){return Ext.dd.Registry.getHandleFromEvent(e)},onInitDrag:function(x,y){this.proxy.update(this.dragData.ddel.cloneNode(true));this.onStartDrag(x,y);return true},afterRepair:function(){if(Ext.enableFx){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false},getRepairXY:function(e){return Ext.Element.fly(this.dragData.ddel).getXY()}});Ext.dd.DropZone=function(el,_2){Ext.dd.DropZone.superclass.constructor.call(this,el,_2)};Ext.extend(Ext.dd.DropZone,Ext.dd.DropTarget,{getTargetFromEvent:function(e){return Ext.dd.Registry.getTargetFromEvent(e)},onNodeEnter:function(n,dd,e,_7){},onNodeOver:function(n,dd,e,_b){return this.dropAllowed},onNodeOut:function(n,dd,e,_f){},onNodeDrop:function(n,dd,e,_13){return false},onContainerOver:function(dd,e,_16){return this.dropNotAllowed},onContainerDrop:function(dd,e,_19){return false},notifyEnter:function(dd,e,_1c){return this.dropNotAllowed},notifyOver:function(dd,e,_1f){var n=this.getTargetFromEvent(e);if(!n){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,_1f);this.lastOverNode=null}return this.onContainerOver(dd,e,_1f)}if(this.lastOverNode!=n){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,_1f)}this.onNodeEnter(n,dd,e,_1f);this.lastOverNode=n}return this.onNodeOver(n,dd,e,_1f)},notifyOut:function(dd,e,_23){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,_23);this.lastOverNode=null}},notifyDrop:function(dd,e,_26){if(this.lastOverNode){this.onNodeOut(this.lastOverNode,dd,e,_26);this.lastOverNode=null}var n=this.getTargetFromEvent(e);return n?this.onNodeDrop(n,dd,e,_26):this.onContainerDrop(dd,e,_26)},triggerCacheRefresh:function(){Ext.dd.DDM.refreshCache(this.groups)}});Ext.data.SortTypes={none:function(s){return s},stripTagsRE:/<\/?[^>]+>/gi,asText:function(s){return String(s).replace(this.stripTagsRE,"")},asUCText:function(s){return String(s).toUpperCase().replace(this.stripTagsRE,"")},asUCString:function(s){return String(s).toUpperCase()},asDate:function(s){if(!s){return 0}if(Ext.isDate(s)){return s.getTime()}return Date.parse(String(s))},asFloat:function(s){var _7=parseFloat(String(s).replace(/,/g,""));if(isNaN(_7)){_7=0}return _7},asInt:function(s){var _9=parseInt(String(s).replace(/,/g,""));if(isNaN(_9)){_9=0}return _9}};Ext.data.Record=function(_1,id){this.id=(id||id===0)?id:++Ext.data.Record.AUTO_ID;this.data=_1};Ext.data.Record.create=function(o){var f=Ext.extend(Ext.data.Record,{});var p=f.prototype;p.fields=new Ext.util.MixedCollection(false,function(_6){return _6.name});for(var i=0,_8=o.length;i<_8;i++){p.fields.add(new Ext.data.Field(o[i]))}f.getField=function(_9){return p.fields.get(_9)};return f};Ext.data.Record.AUTO_ID=1000;Ext.data.Record.EDIT="edit";Ext.data.Record.REJECT="reject";Ext.data.Record.COMMIT="commit";Ext.data.Record.prototype={dirty:false,editing:false,error:null,modified:null,join:function(_a){this.store=_a
23
+ },set:function(_b,_c){if(String(this.data[_b])==String(_c)){return}this.dirty=true;if(!this.modified){this.modified={}}if(typeof this.modified[_b]=="undefined"){this.modified[_b]=this.data[_b]}this.data[_b]=_c;if(!this.editing&&this.store){this.store.afterEdit(this)}},get:function(_d){return this.data[_d]},beginEdit:function(){this.editing=true;this.modified={}},cancelEdit:function(){this.editing=false;delete this.modified},endEdit:function(){this.editing=false;if(this.dirty&&this.store){this.store.afterEdit(this)}},reject:function(_e){var m=this.modified;for(var n in m){if(typeof m[n]!="function"){this.data[n]=m[n]}}this.dirty=false;delete this.modified;this.editing=false;if(this.store&&_e!==true){this.store.afterReject(this)}},commit:function(_11){this.dirty=false;delete this.modified;this.editing=false;if(this.store&&_11!==true){this.store.afterCommit(this)}},getChanges:function(){var m=this.modified,cs={};for(var n in m){if(m.hasOwnProperty(n)){cs[n]=this.data[n]}}return cs},hasError:function(){return this.error!=null},clearError:function(){this.error=null},copy:function(_15){return new this.constructor(Ext.apply({},this.data),_15||this.id)},isModified:function(_16){return !!(this.modified&&this.modified.hasOwnProperty(_16))}};Ext.StoreMgr=Ext.apply(new Ext.util.MixedCollection(),{register:function(){for(var i=0,s;s=arguments[i];i++){this.add(s)}},unregister:function(){for(var i=0,s;s=arguments[i];i++){this.remove(this.lookup(s))}},lookup:function(id){return typeof id=="object"?id:this.get(id)},getKey:function(o){return o.storeId||o.id}});Ext.data.Store=function(_1){this.data=new Ext.util.MixedCollection(false);this.data.getKey=function(o){return o.id};this.baseParams={};this.paramNames={start:"start",limit:"limit",sort:"sort",dir:"dir"};if(_1&&_1.data){this.inlineData=_1.data;delete _1.data}Ext.apply(this,_1);if(this.url&&!this.proxy){this.proxy=new Ext.data.HttpProxy({url:this.url})}if(this.reader){if(!this.recordType){this.recordType=this.reader.recordType}if(this.reader.onMetaChange){this.reader.onMetaChange=this.onMetaChange.createDelegate(this)}}if(this.recordType){this.fields=this.recordType.prototype.fields}this.modified=[];this.addEvents("datachanged","metachange","add","remove","update","clear","beforeload","load","loadexception");if(this.proxy){this.relayEvents(this.proxy,["loadexception"])}this.sortToggle={};if(this.sortInfo){this.setDefaultSort(this.sortInfo.field,this.sortInfo.direction)}Ext.data.Store.superclass.constructor.call(this);if(this.storeId||this.id){Ext.StoreMgr.register(this)}if(this.inlineData){this.loadData(this.inlineData);delete this.inlineData}else{if(this.autoLoad){this.load.defer(10,this,[typeof this.autoLoad=="object"?this.autoLoad:undefined])}}};Ext.extend(Ext.data.Store,Ext.util.Observable,{remoteSort:false,pruneModifiedRecords:false,lastOptions:null,destroy:function(){if(this.storeId||this.id){Ext.StoreMgr.unregister(this)}this.data=null;this.purgeListeners()},add:function(_3){_3=[].concat(_3);if(_3.length<1){return}for(var i=0,_5=_3.length;i<_5;i++){_3[i].join(this)}var _6=this.data.length;this.data.addAll(_3);if(this.snapshot){this.snapshot.addAll(_3)}this.fireEvent("add",this,_3,_6)},addSorted:function(_7){var _8=this.findInsertIndex(_7);this.insert(_8,_7)},remove:function(_9){var _a=this.data.indexOf(_9);this.data.removeAt(_a);if(this.pruneModifiedRecords){this.modified.remove(_9)}if(this.snapshot){this.snapshot.remove(_9)}this.fireEvent("remove",this,_9,_a)},removeAt:function(_b){this.remove(this.getAt(_b))},removeAll:function(){this.data.clear();if(this.snapshot){this.snapshot.clear()}if(this.pruneModifiedRecords){this.modified=[]}this.fireEvent("clear",this)},insert:function(_c,_d){_d=[].concat(_d);for(var i=0,_f=_d.length;i<_f;i++){this.data.insert(_c,_d[i]);_d[i].join(this)}this.fireEvent("add",this,_d,_c)},indexOf:function(_10){return this.data.indexOf(_10)},indexOfId:function(id){return this.data.indexOfKey(id)},getById:function(id){return this.data.key(id)},getAt:function(_13){return this.data.itemAt(_13)},getRange:function(_14,end){return this.data.getRange(_14,end)},storeOptions:function(o){o=Ext.apply({},o);delete o.callback;delete o.scope;this.lastOptions=o},load:function(_17){_17=_17||{};if(this.fireEvent("beforeload",this,_17)!==false){this.storeOptions(_17);var p=Ext.apply(_17.params||{},this.baseParams);if(this.sortInfo&&this.remoteSort){var pn=this.paramNames;p[pn.sort]=this.sortInfo.field;p[pn.dir]=this.sortInfo.direction}this.proxy.load(p,this.reader,this.loadRecords,this,_17);return true}else{return false}},reload:function(_1a){this.load(Ext.applyIf(_1a||{},this.lastOptions))},loadRecords:function(o,_1c,_1d){if(!o||_1d===false){if(_1d!==false){this.fireEvent("load",this,[],_1c)}if(_1c.callback){_1c.callback.call(_1c.scope||this,[],_1c,false)}return}var r=o.records,t=o.totalRecords||r.length;if(!_1c||_1c.add!==true){if(this.pruneModifiedRecords){this.modified=[]}for(var i=0,len=r.length;i<len;i++){r[i].join(this)}if(this.snapshot){this.data=this.snapshot;delete this.snapshot}this.data.clear();this.data.addAll(r);this.totalLength=t;this.applySort();this.fireEvent("datachanged",this)}else{this.totalLength=Math.max(t,this.data.length+r.length);this.add(r)}this.fireEvent("load",this,r,_1c);if(_1c.callback){_1c.callback.call(_1c.scope||this,r,_1c,true)}},loadData:function(o,_23){var r=this.reader.readRecords(o);this.loadRecords(r,{add:_23},true)},getCount:function(){return this.data.length||0},getTotalCount:function(){return this.totalLength||0},getSortState:function(){return this.sortInfo},applySort:function(){if(this.sortInfo&&!this.remoteSort){var s=this.sortInfo,f=s.field;this.sortData(f,s.direction)}},sortData:function(f,_28){_28=_28||"ASC";var st=this.fields.get(f).sortType;var fn=function(r1,r2){var v1=st(r1.data[f]),v2=st(r2.data[f]);return v1>v2?1:(v1<v2?-1:0)};this.data.sort(_28,fn);if(this.snapshot&&this.snapshot!=this.data){this.snapshot.sort(_28,fn)}},setDefaultSort:function(_2f,dir){dir=dir?dir.toUpperCase():"ASC";this.sortInfo={field:_2f,direction:dir};this.sortToggle[_2f]=dir},sort:function(_31,dir){var f=this.fields.get(_31);if(!f){return false}if(!dir){if(this.sortInfo&&this.sortInfo.field==f.name){dir=(this.sortToggle[f.name]||"ASC").toggle("ASC","DESC")}else{dir=f.sortDir}}var st=(this.sortToggle)?this.sortToggle[f.name]:null;var si=(this.sortInfo)?this.sortInfo:null;this.sortToggle[f.name]=dir;this.sortInfo={field:f.name,direction:dir};if(!this.remoteSort){this.applySort();this.fireEvent("datachanged",this)}else{if(!this.load(this.lastOptions)){if(st){this.sortToggle[f.name]=st}if(si){this.sortInfo=si}}}},each:function(fn,_37){this.data.each(fn,_37)},getModifiedRecords:function(){return this.modified},createFilterFn:function(_38,_39,_3a,_3b){if(Ext.isEmpty(_39,false)){return false}_39=this.data.createValueMatcher(_39,_3a,_3b);return function(r){return _39.test(r.data[_38])}},sum:function(_3d,_3e,end){var rs=this.data.items,v=0;_3e=_3e||0;end=(end||end===0)?end:rs.length-1;for(var i=_3e;i<=end;i++){v+=(rs[i].data[_3d]||0)}return v},filter:function(_43,_44,_45,_46){var fn=this.createFilterFn(_43,_44,_45,_46);return fn?this.filterBy(fn):this.clearFilter()},filterBy:function(fn,_49){this.snapshot=this.snapshot||this.data;this.data=this.queryBy(fn,_49||this);this.fireEvent("datachanged",this)},query:function(_4a,_4b,_4c,_4d){var fn=this.createFilterFn(_4a,_4b,_4c,_4d);return fn?this.queryBy(fn):this.data.clone()},queryBy:function(fn,_50){var _51=this.snapshot||this.data;return _51.filterBy(fn,_50||this)},find:function(_52,_53,_54,_55,_56){var fn=this.createFilterFn(_52,_53,_55,_56);return fn?this.data.findIndexBy(fn,null,_54):-1},findBy:function(fn,_59,_5a){return this.data.findIndexBy(fn,_59,_5a)},collect:function(_5b,_5c,_5d){var d=(_5d===true&&this.snapshot)?this.snapshot.items:this.data.items;var v,sv,r=[],l={};for(var i=0,len=d.length;i<len;i++){v=d[i].data[_5b];sv=String(v);if((_5c||!Ext.isEmpty(v))&&!l[sv]){l[sv]=true;r[r.length]=v}}return r},clearFilter:function(_65){if(this.isFiltered()){this.data=this.snapshot;
24
+ delete this.snapshot;if(_65!==true){this.fireEvent("datachanged",this)}}},isFiltered:function(){return this.snapshot&&this.snapshot!=this.data},afterEdit:function(_66){if(this.modified.indexOf(_66)==-1){this.modified.push(_66)}this.fireEvent("update",this,_66,Ext.data.Record.EDIT)},afterReject:function(_67){this.modified.remove(_67);this.fireEvent("update",this,_67,Ext.data.Record.REJECT)},afterCommit:function(_68){this.modified.remove(_68);this.fireEvent("update",this,_68,Ext.data.Record.COMMIT)},commitChanges:function(){var m=this.modified.slice(0);this.modified=[];for(var i=0,len=m.length;i<len;i++){m[i].commit()}},rejectChanges:function(){var m=this.modified.slice(0);this.modified=[];for(var i=0,len=m.length;i<len;i++){m[i].reject()}},onMetaChange:function(_6f,_70,o){this.recordType=_70;this.fields=_70.prototype.fields;delete this.snapshot;this.sortInfo=_6f.sortInfo;this.modified=[];this.fireEvent("metachange",this,this.reader.meta)},findInsertIndex:function(_72){this.suspendEvents();var _73=this.data.clone();this.data.add(_72);this.applySort();var _74=this.data.indexOf(_72);this.data=_73;this.resumeEvents();return _74}});Ext.data.SimpleStore=function(_1){Ext.data.SimpleStore.superclass.constructor.call(this,Ext.apply(_1,{reader:new Ext.data.ArrayReader({id:_1.id},Ext.data.Record.create(_1.fields))}))};Ext.extend(Ext.data.SimpleStore,Ext.data.Store,{loadData:function(_2,_3){if(this.expandData===true){var r=[];for(var i=0,_6=_2.length;i<_6;i++){r[r.length]=[_2[i]]}_2=r}Ext.data.SimpleStore.superclass.loadData.call(this,_2,_3)}});Ext.data.JsonStore=function(c){Ext.data.JsonStore.superclass.constructor.call(this,Ext.apply(c,{proxy:c.proxy||(!c.data?new Ext.data.HttpProxy({url:c.url}):undefined),reader:new Ext.data.JsonReader(c,c.fields)}))};Ext.extend(Ext.data.JsonStore,Ext.data.Store);Ext.data.Field=function(_1){if(typeof _1=="string"){_1={name:_1}}Ext.apply(this,_1);if(!this.type){this.type="auto"}var st=Ext.data.SortTypes;if(typeof this.sortType=="string"){this.sortType=st[this.sortType]}if(!this.sortType){switch(this.type){case"string":this.sortType=st.asUCString;break;case"date":this.sortType=st.asDate;break;default:this.sortType=st.none}}var _3=/[\$,%]/g;if(!this.convert){var cv,_5=this.dateFormat;switch(this.type){case"":case"auto":case undefined:cv=function(v){return v};break;case"string":cv=function(v){return(v===undefined||v===null)?"":String(v)};break;case"int":cv=function(v){return v!==undefined&&v!==null&&v!==""?parseInt(String(v).replace(_3,""),10):""};break;case"float":cv=function(v){return v!==undefined&&v!==null&&v!==""?parseFloat(String(v).replace(_3,""),10):""};break;case"bool":case"boolean":cv=function(v){return v===true||v==="true"||v==1};break;case"date":cv=function(v){if(!v){return""}if(Ext.isDate(v)){return v}if(_5){if(_5=="timestamp"){return new Date(v*1000)}if(_5=="time"){return new Date(parseInt(v,10))}return Date.parseDate(v,_5)}var _c=Date.parse(v);return _c?new Date(_c):null};break}this.convert=cv}};Ext.data.Field.prototype={dateFormat:null,defaultValue:"",mapping:null,sortType:null,sortDir:"ASC"};Ext.data.DataReader=function(_1,_2){this.meta=_1;this.recordType=Ext.isArray(_2)?Ext.data.Record.create(_2):_2};Ext.data.DataReader.prototype={};Ext.data.DataProxy=function(){this.addEvents("beforeload","load");Ext.data.DataProxy.superclass.constructor.call(this)};Ext.extend(Ext.data.DataProxy,Ext.util.Observable);Ext.data.MemoryProxy=function(_1){Ext.data.MemoryProxy.superclass.constructor.call(this);this.data=_1};Ext.extend(Ext.data.MemoryProxy,Ext.data.DataProxy,{load:function(_2,_3,_4,_5,_6){_2=_2||{};var _7;try{_7=_3.readRecords(this.data)}catch(e){this.fireEvent("loadexception",this,_6,null,e);_4.call(_5,null,_6,false);return}_4.call(_5,_7,_6,true)},update:function(_8,_9){}});Ext.data.HttpProxy=function(_1){Ext.data.HttpProxy.superclass.constructor.call(this);this.conn=_1;this.useAjax=!_1||!_1.events};Ext.extend(Ext.data.HttpProxy,Ext.data.DataProxy,{getConnection:function(){return this.useAjax?Ext.Ajax:this.conn},load:function(_2,_3,_4,_5,_6){if(this.fireEvent("beforeload",this,_2)!==false){var o={params:_2||{},request:{callback:_4,scope:_5,arg:_6},reader:_3,callback:this.loadResponse,scope:this};if(this.useAjax){Ext.applyIf(o,this.conn);if(this.activeRequest){Ext.Ajax.abort(this.activeRequest)}this.activeRequest=Ext.Ajax.request(o)}else{this.conn.request(o)}}else{_4.call(_5||this,null,_6,false)}},loadResponse:function(o,_9,_a){delete this.activeRequest;if(!_9){this.fireEvent("loadexception",this,o,_a);o.request.callback.call(o.request.scope,null,o.request.arg,false);return}var _b;try{_b=o.reader.read(_a)}catch(e){this.fireEvent("loadexception",this,o,_a,e);o.request.callback.call(o.request.scope,null,o.request.arg,false);return}this.fireEvent("load",this,o,o.request.arg);o.request.callback.call(o.request.scope,_b,o.request.arg,true)},update:function(_c){},updateResponse:function(_d){}});Ext.data.ScriptTagProxy=function(_1){Ext.data.ScriptTagProxy.superclass.constructor.call(this);Ext.apply(this,_1);this.head=document.getElementsByTagName("head")[0]};Ext.data.ScriptTagProxy.TRANS_ID=1000;Ext.extend(Ext.data.ScriptTagProxy,Ext.data.DataProxy,{timeout:30000,callbackParam:"callback",nocache:true,load:function(_2,_3,_4,_5,_6){if(this.fireEvent("beforeload",this,_2)!==false){var p=Ext.urlEncode(Ext.apply(_2,this.extraParams));var _8=this.url;_8+=(_8.indexOf("?")!=-1?"&":"?")+p;if(this.nocache){_8+="&_dc="+(new Date().getTime())}var _9=++Ext.data.ScriptTagProxy.TRANS_ID;var _a={id:_9,cb:"stcCallback"+_9,scriptId:"stcScript"+_9,params:_2,arg:_6,url:_8,callback:_4,scope:_5,reader:_3};var _b=this;window[_a.cb]=function(o){_b.handleResponse(o,_a)};_8+=String.format("&{0}={1}",this.callbackParam,_a.cb);if(this.autoAbort!==false){this.abort()}_a.timeoutId=this.handleFailure.defer(this.timeout,this,[_a]);var _d=document.createElement("script");_d.setAttribute("src",_8);_d.setAttribute("type","text/javascript");_d.setAttribute("id",_a.scriptId);this.head.appendChild(_d);this.trans=_a}else{_4.call(_5||this,null,_6,false)}},isLoading:function(){return this.trans?true:false},abort:function(){if(this.isLoading()){this.destroyTrans(this.trans)}},destroyTrans:function(_e,_f){this.head.removeChild(document.getElementById(_e.scriptId));clearTimeout(_e.timeoutId);if(_f){window[_e.cb]=undefined;try{delete window[_e.cb]}catch(e){}}else{window[_e.cb]=function(){window[_e.cb]=undefined;try{delete window[_e.cb]}catch(e){}}}},handleResponse:function(o,_11){this.trans=false;this.destroyTrans(_11,true);var _12;try{_12=_11.reader.readRecords(o)}catch(e){this.fireEvent("loadexception",this,o,_11.arg,e);_11.callback.call(_11.scope||window,null,_11.arg,false);return}this.fireEvent("load",this,o,_11.arg);_11.callback.call(_11.scope||window,_12,_11.arg,true)},handleFailure:function(_13){this.trans=false;this.destroyTrans(_13,false);this.fireEvent("loadexception",this,null,_13.arg);_13.callback.call(_13.scope||window,null,_13.arg,false)}});Ext.data.JsonReader=function(_1,_2){_1=_1||{};Ext.data.JsonReader.superclass.constructor.call(this,_1,_2||_1.fields)};Ext.extend(Ext.data.JsonReader,Ext.data.DataReader,{read:function(_3){var _4=_3.responseText;var o=eval("("+_4+")");if(!o){throw {message:"JsonReader.read: Json object not found"}}return this.readRecords(o)},onMetaChange:function(_6,_7,o){},simpleAccess:function(_9,_a){return _9[_a]},getJsonAccessor:function(){var re=/[\[\.]/;return function(_c){try{return(re.test(_c))?new Function("obj","return obj."+_c):function(_d){return _d[_c]}}catch(e){}return Ext.emptyFn}}(),readRecords:function(o){this.jsonData=o;if(o.metaData){delete this.ef;this.meta=o.metaData;this.recordType=Ext.data.Record.create(o.metaData.fields);this.onMetaChange(this.meta,this.recordType,o)}var s=this.meta,_10=this.recordType,f=_10.prototype.fields,fi=f.items,fl=f.length;if(!this.ef){if(s.totalProperty){this.getTotal=this.getJsonAccessor(s.totalProperty)}if(s.successProperty){this.getSuccess=this.getJsonAccessor(s.successProperty)}this.getRoot=s.root?this.getJsonAccessor(s.root):function(p){return p
25
+ };if(s.id){var g=this.getJsonAccessor(s.id);this.getId=function(rec){var r=g(rec);return(r===undefined||r==="")?null:r}}else{this.getId=function(){return null}}this.ef=[];for(var i=0;i<fl;i++){f=fi[i];var map=(f.mapping!==undefined&&f.mapping!==null)?f.mapping:f.name;this.ef[i]=this.getJsonAccessor(map)}}var _1a=this.getRoot(o),c=_1a.length,_1c=c,_1d=true;if(s.totalProperty){var v=parseInt(this.getTotal(o),10);if(!isNaN(v)){_1c=v}}if(s.successProperty){var v=this.getSuccess(o);if(v===false||v==="false"){_1d=false}}var _1f=[];for(var i=0;i<c;i++){var n=_1a[i];var _21={};var id=this.getId(n);for(var j=0;j<fl;j++){f=fi[j];var v=this.ef[j](n);_21[f.name]=f.convert((v!==undefined)?v:f.defaultValue,n)}var _24=new _10(_21,id);_24.json=n;_1f[i]=_24}return{success:_1d,records:_1f,totalRecords:_1c}}});Ext.data.XmlReader=function(_1,_2){_1=_1||{};Ext.data.XmlReader.superclass.constructor.call(this,_1,_2||_1.fields)};Ext.extend(Ext.data.XmlReader,Ext.data.DataReader,{read:function(_3){var _4=_3.responseXML;if(!_4){throw {message:"XmlReader.read: XML Document not available"}}return this.readRecords(_4)},readRecords:function(_5){this.xmlData=_5;var _6=_5.documentElement||_5;var q=Ext.DomQuery;var _8=this.recordType,_9=_8.prototype.fields;var _a=this.meta.id;var _b=0,_c=true;if(this.meta.totalRecords){_b=q.selectNumber(this.meta.totalRecords,_6,0)}if(this.meta.success){var sv=q.selectValue(this.meta.success,_6,true);_c=sv!==false&&sv!=="false"}var _e=[];var ns=q.select(this.meta.record,_6);for(var i=0,len=ns.length;i<len;i++){var n=ns[i];var _13={};var id=_a?q.selectValue(_a,n):undefined;for(var j=0,_16=_9.length;j<_16;j++){var f=_9.items[j];var v=q.selectValue(f.mapping||f.name,n,f.defaultValue);v=f.convert(v,n);_13[f.name]=v}var _19=new _8(_13,id);_19.node=n;_e[_e.length]=_19}return{success:_c,records:_e,totalRecords:_b||_e.length}}});Ext.data.ArrayReader=Ext.extend(Ext.data.JsonReader,{readRecords:function(o){var _2=this.meta?this.meta.id:null;var _3=this.recordType,_4=_3.prototype.fields;var _5=[];var _6=o;for(var i=0;i<_6.length;i++){var n=_6[i];var _9={};var id=((_2||_2===0)&&n[_2]!==undefined&&n[_2]!==""?n[_2]:null);for(var j=0,_c=_4.length;j<_c;j++){var f=_4.items[j];var k=f.mapping!==undefined&&f.mapping!==null?f.mapping:j;var v=n[k]!==undefined?n[k]:f.defaultValue;v=f.convert(v,n);_9[f.name]=v}var _10=new _3(_9,id);_10.json=n;_5[_5.length]=_10}return{records:_5,totalRecords:_5.length}}});Ext.data.Tree=function(_1){this.nodeHash={};this.root=null;if(_1){this.setRootNode(_1)}this.addEvents("append","remove","move","insert","beforeappend","beforeremove","beforemove","beforeinsert");Ext.data.Tree.superclass.constructor.call(this)};Ext.extend(Ext.data.Tree,Ext.util.Observable,{pathSeparator:"/",proxyNodeEvent:function(){return this.fireEvent.apply(this,arguments)},getRootNode:function(){return this.root},setRootNode:function(_2){this.root=_2;_2.ownerTree=this;_2.isRoot=true;this.registerNode(_2);return _2},getNodeById:function(id){return this.nodeHash[id]},registerNode:function(_4){this.nodeHash[_4.id]=_4},unregisterNode:function(_5){delete this.nodeHash[_5.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"}});Ext.data.Node=function(_6){this.attributes=_6||{};this.leaf=this.attributes.leaf;this.id=this.attributes.id;if(!this.id){this.id=Ext.id(null,"ynode-");this.attributes.id=this.id}this.childNodes=[];if(!this.childNodes.indexOf){this.childNodes.indexOf=function(o){for(var i=0,_9=this.length;i<_9;i++){if(this[i]==o){return i}}return -1}}this.parentNode=null;this.firstChild=null;this.lastChild=null;this.previousSibling=null;this.nextSibling=null;this.addEvents({append:true,remove:true,move:true,insert:true,beforeappend:true,beforeremove:true,beforemove:true,beforeinsert:true});this.listeners=this.attributes.listeners;Ext.data.Node.superclass.constructor.call(this)};Ext.extend(Ext.data.Node,Ext.util.Observable,{fireEvent:function(_a){if(Ext.data.Node.superclass.fireEvent.apply(this,arguments)===false){return false}var ot=this.getOwnerTree();if(ot){if(ot.proxyNodeEvent.apply(ot,arguments)===false){return false}}return true},isLeaf:function(){return this.leaf===true},setFirstChild:function(_c){this.firstChild=_c},setLastChild:function(_d){this.lastChild=_d},isLast:function(){return(!this.parentNode?true:this.parentNode.lastChild==this)},isFirst:function(){return(!this.parentNode?true:this.parentNode.firstChild==this)},hasChildNodes:function(){return !this.isLeaf()&&this.childNodes.length>0},isExpandable:function(){return this.attributes.expandable||this.hasChildNodes()},appendChild:function(_e){var _f=false;if(Ext.isArray(_e)){_f=_e}else{if(arguments.length>1){_f=arguments}}if(_f){for(var i=0,len=_f.length;i<len;i++){this.appendChild(_f[i])}}else{if(this.fireEvent("beforeappend",this.ownerTree,this,_e)===false){return false}var _12=this.childNodes.length;var _13=_e.parentNode;if(_13){if(_e.fireEvent("beforemove",_e.getOwnerTree(),_e,_13,this,_12)===false){return false}_13.removeChild(_e)}_12=this.childNodes.length;if(_12==0){this.setFirstChild(_e)}this.childNodes.push(_e);_e.parentNode=this;var ps=this.childNodes[_12-1];if(ps){_e.previousSibling=ps;ps.nextSibling=_e}else{_e.previousSibling=null}_e.nextSibling=null;this.setLastChild(_e);_e.setOwnerTree(this.getOwnerTree());this.fireEvent("append",this.ownerTree,this,_e,_12);if(_13){_e.fireEvent("move",this.ownerTree,_e,_13,this,_12)}return _e}},removeChild:function(_15){var _16=this.childNodes.indexOf(_15);if(_16==-1){return false}if(this.fireEvent("beforeremove",this.ownerTree,this,_15)===false){return false}this.childNodes.splice(_16,1);if(_15.previousSibling){_15.previousSibling.nextSibling=_15.nextSibling}if(_15.nextSibling){_15.nextSibling.previousSibling=_15.previousSibling}if(this.firstChild==_15){this.setFirstChild(_15.nextSibling)}if(this.lastChild==_15){this.setLastChild(_15.previousSibling)}_15.setOwnerTree(null);_15.parentNode=null;_15.previousSibling=null;_15.nextSibling=null;this.fireEvent("remove",this.ownerTree,this,_15);return _15},insertBefore:function(_17,_18){if(!_18){return this.appendChild(_17)}if(_17==_18){return false}if(this.fireEvent("beforeinsert",this.ownerTree,this,_17,_18)===false){return false}var _19=this.childNodes.indexOf(_18);var _1a=_17.parentNode;var _1b=_19;if(_1a==this&&this.childNodes.indexOf(_17)<_19){_1b--}if(_1a){if(_17.fireEvent("beforemove",_17.getOwnerTree(),_17,_1a,this,_19,_18)===false){return false}_1a.removeChild(_17)}if(_1b==0){this.setFirstChild(_17)}this.childNodes.splice(_1b,0,_17);_17.parentNode=this;var ps=this.childNodes[_1b-1];if(ps){_17.previousSibling=ps;ps.nextSibling=_17}else{_17.previousSibling=null}_17.nextSibling=_18;_18.previousSibling=_17;_17.setOwnerTree(this.getOwnerTree());this.fireEvent("insert",this.ownerTree,this,_17,_18);if(_1a){_17.fireEvent("move",this.ownerTree,_17,_1a,this,_1b,_18)}return _17},remove:function(){this.parentNode.removeChild(this);return this},item:function(_1d){return this.childNodes[_1d]},replaceChild:function(_1e,_1f){var s=_1f?_1f.nextSibling:null;this.removeChild(_1f);this.insertBefore(_1e,s);return _1f},indexOf:function(_21){return this.childNodes.indexOf(_21)},getOwnerTree:function(){if(!this.ownerTree){var p=this;while(p){if(p.ownerTree){this.ownerTree=p.ownerTree;break}p=p.parentNode}}return this.ownerTree},getDepth:function(){var _23=0;var p=this;while(p.parentNode){++_23;p=p.parentNode}return _23},setOwnerTree:function(_25){if(_25!=this.ownerTree){if(this.ownerTree){this.ownerTree.unregisterNode(this)}this.ownerTree=_25;var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){cs[i].setOwnerTree(_25)}if(_25){_25.registerNode(this)}}},getPath:function(_29){_29=_29||"id";var p=this.parentNode;var b=[this.attributes[_29]];while(p){b.unshift(p.attributes[_29]);p=p.parentNode}var sep=this.getOwnerTree().pathSeparator;return sep+b.join(sep)},bubble:function(fn,_2e,_2f){var p=this;while(p){if(fn.apply(_2e||p,_2f||[p])===false){break}p=p.parentNode}},cascade:function(fn,_32,_33){if(fn.apply(_32||this,_33||[this])!==false){var cs=this.childNodes;
26
+ for(var i=0,len=cs.length;i<len;i++){cs[i].cascade(fn,_32,_33)}}},eachChild:function(fn,_38,_39){var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){if(fn.apply(_38||this,_39||[cs[i]])===false){break}}},findChild:function(_3d,_3e){var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){if(cs[i].attributes[_3d]==_3e){return cs[i]}}return null},findChildBy:function(fn,_43){var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){if(fn.call(_43||cs[i],cs[i])===true){return cs[i]}}return null},sort:function(fn,_48){var cs=this.childNodes;var len=cs.length;if(len>0){var _4b=_48?function(){fn.apply(_48,arguments)}:fn;cs.sort(_4b);for(var i=0;i<len;i++){var n=cs[i];n.previousSibling=cs[i-1];n.nextSibling=cs[i+1];if(i==0){this.setFirstChild(n)}if(i==len-1){this.setLastChild(n)}}}},contains:function(_4e){return _4e.isAncestor(this)},isAncestor:function(_4f){var p=this.parentNode;while(p){if(p==_4f){return true}p=p.parentNode}return false},toString:function(){return"[Node"+(this.id?" "+this.id:"")+"]"}});Ext.data.GroupingStore=Ext.extend(Ext.data.Store,{remoteGroup:false,groupOnSort:false,clearGrouping:function(){this.groupField=false;if(this.remoteGroup){if(this.baseParams){delete this.baseParams.groupBy}this.reload()}else{this.applySort();this.fireEvent("datachanged",this)}},groupBy:function(_1,_2){if(this.groupField==_1&&!_2){return}this.groupField=_1;if(this.remoteGroup){if(!this.baseParams){this.baseParams={}}this.baseParams.groupBy=_1}if(this.groupOnSort){this.sort(_1);return}if(this.remoteGroup){this.reload()}else{var si=this.sortInfo||{};if(si.field!=_1){this.applySort()}else{this.sortData(_1)}this.fireEvent("datachanged",this)}},applySort:function(){Ext.data.GroupingStore.superclass.applySort.call(this);if(!this.groupOnSort&&!this.remoteGroup){var gs=this.getGroupState();if(gs&&gs!=this.sortInfo.field){this.sortData(this.groupField)}}},applyGrouping:function(_5){if(this.groupField!==false){this.groupBy(this.groupField,true);return true}else{if(_5===true){this.fireEvent("datachanged",this)}return false}},getGroupState:function(){return this.groupOnSort&&this.groupField!==false?(this.sortInfo?this.sortInfo.field:undefined):this.groupField}});Ext.ComponentMgr=function(){var _1=new Ext.util.MixedCollection();var _2={};return{register:function(c){_1.add(c)},unregister:function(c){_1.remove(c)},get:function(id){return _1.get(id)},onAvailable:function(id,fn,_8){_1.on("add",function(_9,o){if(o.id==id){fn.call(_8||o,o);_1.un("add",fn,_8)}})},all:_1,registerType:function(_b,_c){_2[_b]=_c;_c.xtype=_b},create:function(_d,_e){return new _2[_d.xtype||_e](_d)}}}();Ext.reg=Ext.ComponentMgr.registerType;Ext.Component=function(_1){_1=_1||{};if(_1.initialConfig){if(_1.isAction){this.baseAction=_1}_1=_1.initialConfig}else{if(_1.tagName||_1.dom||typeof _1=="string"){_1={applyTo:_1,id:_1.id||_1}}}this.initialConfig=_1;Ext.apply(this,_1);this.addEvents("disable","enable","beforeshow","show","beforehide","hide","beforerender","render","beforedestroy","destroy","beforestaterestore","staterestore","beforestatesave","statesave");this.getId();Ext.ComponentMgr.register(this);Ext.Component.superclass.constructor.call(this);if(this.baseAction){this.baseAction.addComponent(this)}this.initComponent();if(this.plugins){if(Ext.isArray(this.plugins)){for(var i=0,_3=this.plugins.length;i<_3;i++){this.plugins[i]=this.initPlugin(this.plugins[i])}}else{this.plugins=this.initPlugin(this.plugins)}}if(this.stateful!==false){this.initState(_1)}if(this.applyTo){this.applyToMarkup(this.applyTo);delete this.applyTo}else{if(this.renderTo){this.render(this.renderTo);delete this.renderTo}}};Ext.Component.AUTO_ID=1000;Ext.extend(Ext.Component,Ext.util.Observable,{disabledClass:"x-item-disabled",allowDomMove:true,autoShow:false,hideMode:"display",hideParent:false,hidden:false,disabled:false,rendered:false,ctype:"Ext.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode]},initPlugin:function(p){p.init(this);return p},initComponent:Ext.emptyFn,render:function(_5,_6){if(!this.rendered&&this.fireEvent("beforerender",this)!==false){if(!_5&&this.el){this.el=Ext.get(this.el);_5=this.el.dom.parentNode;this.allowDomMove=false}this.container=Ext.get(_5);if(this.ctCls){this.container.addClass(this.ctCls)}this.rendered=true;if(_6!==undefined){if(typeof _6=="number"){_6=this.container.dom.childNodes[_6]}else{_6=Ext.getDom(_6)}}this.onRender(this.container,_6||null);if(this.autoShow){this.el.removeClass(["x-hidden","x-hide-"+this.hideMode])}if(this.cls){this.el.addClass(this.cls);delete this.cls}if(this.style){this.el.applyStyles(this.style);delete this.style}if(this.overCls){this.el.addClassOnOver(this.overCls)}this.fireEvent("render",this);this.afterRender(this.container);if(this.hidden){this.hide()}if(this.disabled){this.disable()}if(this.stateful!==false){this.initStateEvents()}}return this},initState:function(_7){if(Ext.state.Manager){var id=this.getStateId();if(id){var _9=Ext.state.Manager.get(id);if(_9){if(this.fireEvent("beforestaterestore",this,_9)!==false){this.applyState(_9);this.fireEvent("staterestore",this,_9)}}}}},getStateId:function(){return this.stateId||((this.id.indexOf("ext-comp-")==0||this.id.indexOf("ext-gen")==0)?null:this.id)},initStateEvents:function(){if(this.stateEvents){for(var i=0,e;e=this.stateEvents[i];i++){this.on(e,this.saveState,this,{delay:100})}}},applyState:function(_c,_d){if(_c){Ext.apply(this,_c)}},getState:function(){return null},saveState:function(){if(Ext.state.Manager){var id=this.getStateId();if(id){var _f=this.getState();if(this.fireEvent("beforestatesave",this,_f)!==false){Ext.state.Manager.set(id,_f);this.fireEvent("statesave",this,_f)}}}},applyToMarkup:function(el){this.allowDomMove=false;this.el=Ext.get(el);this.render(this.el.dom.parentNode)},addClass:function(cls){if(this.el){this.el.addClass(cls)}else{this.cls=this.cls?this.cls+" "+cls:cls}},removeClass:function(cls){if(this.el){this.el.removeClass(cls)}else{if(this.cls){this.cls=this.cls.split(" ").remove(cls).join(" ")}}},onRender:function(ct,_14){if(this.autoEl){if(typeof this.autoEl=="string"){this.el=document.createElement(this.autoEl)}else{var div=document.createElement("div");Ext.DomHelper.overwrite(div,this.autoEl);this.el=div.firstChild}if(!this.el.id){this.el.id=this.getId()}}if(this.el){this.el=Ext.get(this.el);if(this.allowDomMove!==false){ct.dom.insertBefore(this.el.dom,_14)}}},getAutoCreate:function(){var cfg=typeof this.autoCreate=="object"?this.autoCreate:Ext.apply({},this.defaultAutoCreate);if(this.id&&!cfg.id){cfg.id=this.id}return cfg},afterRender:Ext.emptyFn,destroy:function(){if(this.fireEvent("beforedestroy",this)!==false){this.beforeDestroy();if(this.rendered){this.el.removeAllListeners();this.el.remove();if(this.actionMode=="container"){this.container.remove()}}this.onDestroy();Ext.ComponentMgr.unregister(this);this.fireEvent("destroy",this);this.purgeListeners()}},beforeDestroy:Ext.emptyFn,onDestroy:Ext.emptyFn,getEl:function(){return this.el},getId:function(){return this.id||(this.id="ext-comp-"+(++Ext.Component.AUTO_ID))},getItemId:function(){return this.itemId||this.getId()},focus:function(_17,_18){if(_18){this.focus.defer(typeof _18=="number"?_18:10,this,[_17,false]);return}if(this.rendered){this.el.focus();if(_17===true){this.el.dom.select()}}return this},blur:function(){if(this.rendered){this.el.blur()}return this},disable:function(){if(this.rendered){this.onDisable()}this.disabled=true;this.fireEvent("disable",this);return this},onDisable:function(){this.getActionEl().addClass(this.disabledClass);this.el.dom.disabled=true},enable:function(){if(this.rendered){this.onEnable()}this.disabled=false;this.fireEvent("enable",this);return this},onEnable:function(){this.getActionEl().removeClass(this.disabledClass);this.el.dom.disabled=false},setDisabled:function(_19){this[_19?"disable":"enable"]()},show:function(){if(this.fireEvent("beforeshow",this)!==false){this.hidden=false;if(this.autoRender){this.render(typeof this.autoRender=="boolean"?Ext.getBody():this.autoRender)
27
+ }if(this.rendered){this.onShow()}this.fireEvent("show",this)}return this},onShow:function(){if(this.hideParent){this.container.removeClass("x-hide-"+this.hideMode)}else{this.getActionEl().removeClass("x-hide-"+this.hideMode)}},hide:function(){if(this.fireEvent("beforehide",this)!==false){this.hidden=true;if(this.rendered){this.onHide()}this.fireEvent("hide",this)}return this},onHide:function(){if(this.hideParent){this.container.addClass("x-hide-"+this.hideMode)}else{this.getActionEl().addClass("x-hide-"+this.hideMode)}},setVisible:function(_1a){if(_1a){this.show()}else{this.hide()}return this},isVisible:function(){return this.rendered&&this.getActionEl().isVisible()},cloneConfig:function(_1b){_1b=_1b||{};var id=_1b.id||Ext.id();var cfg=Ext.applyIf(_1b,this.initialConfig);cfg.id=id;return new this.constructor(cfg)},getXType:function(){return this.constructor.xtype},isXType:function(_1e,_1f){if(typeof _1e=="function"){_1e=_1e.xtype}else{if(typeof _1e=="object"){_1e=_1e.constructor.xtype}}return !_1f?("/"+this.getXTypes()+"/").indexOf("/"+_1e+"/")!=-1:this.constructor.xtype==_1e},getXTypes:function(){var tc=this.constructor;if(!tc.xtypes){var c=[],sc=this;while(sc&&sc.constructor.xtype){c.unshift(sc.constructor.xtype);sc=sc.constructor.superclass}tc.xtypeChain=c;tc.xtypes=c.join("/")}return tc.xtypes},findParentBy:function(fn){for(var p=this.ownerCt;(p!=null)&&!fn(p,this);p=p.ownerCt){}return p||null},findParentByType:function(_25){return typeof _25=="function"?this.findParentBy(function(p){return p.constructor===_25}):this.findParentBy(function(p){return p.constructor.xtype===_25})},mon:function(_28,_29,fn,_2b,opt){if(!this.mons){this.mons=[];this.on("beforedestroy",function(){for(var i=0,len=this.mons.length;i<len;i++){var m=this.mons[i];m.item.un(m.ename,m.fn,m.scope)}},this)}this.mons.push({item:_28,ename:_29,fn:fn,scope:_2b});_28.on(_29,fn,_2b,opt)}});Ext.reg("component",Ext.Component);Ext.Action=function(_1){this.initialConfig=_1;this.items=[]};Ext.Action.prototype={isAction:true,setText:function(_2){this.initialConfig.text=_2;this.callEach("setText",[_2])},getText:function(){return this.initialConfig.text},setIconClass:function(_3){this.initialConfig.iconCls=_3;this.callEach("setIconClass",[_3])},getIconClass:function(){return this.initialConfig.iconCls},setDisabled:function(v){this.initialConfig.disabled=v;this.callEach("setDisabled",[v])},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},isDisabled:function(){return this.initialConfig.disabled},setHidden:function(v){this.initialConfig.hidden=v;this.callEach("setVisible",[!v])},show:function(){this.setHidden(false)},hide:function(){this.setHidden(true)},isHidden:function(){return this.initialConfig.hidden},setHandler:function(fn,_7){this.initialConfig.handler=fn;this.initialConfig.scope=_7;this.callEach("setHandler",[fn,_7])},each:function(fn,_9){Ext.each(this.items,fn,_9)},callEach:function(_a,_b){var cs=this.items;for(var i=0,_e=cs.length;i<_e;i++){cs[i][_a].apply(cs[i],_b)}},addComponent:function(_f){this.items.push(_f);_f.on("destroy",this.removeComponent,this)},removeComponent:function(_10){this.items.remove(_10)},execute:function(){this.initialConfig.handler.apply(this.initialConfig.scope||window,arguments)}};(function(){Ext.Layer=function(_1,_2){_1=_1||{};var dh=Ext.DomHelper;var cp=_1.parentEl,_5=cp?Ext.getDom(cp):document.body;if(_2){this.dom=Ext.getDom(_2)}if(!this.dom){var o=_1.dh||{tag:"div",cls:"x-layer"};this.dom=dh.append(_5,o)}if(_1.cls){this.addClass(_1.cls)}this.constrain=_1.constrain!==false;this.visibilityMode=Ext.Element.VISIBILITY;if(_1.id){this.id=this.dom.id=_1.id}else{this.id=Ext.id(this.dom)}this.zindex=_1.zindex||this.getZIndex();this.position("absolute",this.zindex);if(_1.shadow){this.shadowOffset=_1.shadowOffset||4;this.shadow=new Ext.Shadow({offset:this.shadowOffset,mode:_1.shadow})}else{this.shadowOffset=0}this.useShim=_1.shim!==false&&Ext.useShims;this.useDisplay=_1.useDisplay;this.hide()};var _7=Ext.Element.prototype;var _8=[];Ext.extend(Ext.Layer,Ext.Element,{getZIndex:function(){return this.zindex||parseInt(this.getStyle("z-index"),10)||11000},getShim:function(){if(!this.useShim){return null}if(this.shim){return this.shim}var _9=_8.shift();if(!_9){_9=this.createShim();_9.enableDisplayMode("block");_9.dom.style.display="none";_9.dom.style.visibility="visible"}var pn=this.dom.parentNode;if(_9.dom.parentNode!=pn){pn.insertBefore(_9.dom,this.dom)}_9.setStyle("z-index",this.getZIndex()-2);this.shim=_9;return _9},hideShim:function(){if(this.shim){this.shim.setDisplayed(false);_8.push(this.shim);delete this.shim}},disableShadow:function(){if(this.shadow){this.shadowDisabled=true;this.shadow.hide();this.lastShadowOffset=this.shadowOffset;this.shadowOffset=0}},enableShadow:function(_b){if(this.shadow){this.shadowDisabled=false;this.shadowOffset=this.lastShadowOffset;delete this.lastShadowOffset;if(_b){this.sync(true)}}},sync:function(_c){var sw=this.shadow;if(!this.updating&&this.isVisible()&&(sw||this.useShim)){var sh=this.getShim();var w=this.getWidth(),h=this.getHeight();var l=this.getLeft(true),t=this.getTop(true);if(sw&&!this.shadowDisabled){if(_c&&!sw.isVisible()){sw.show(this)}else{sw.realign(l,t,w,h)}if(sh){if(_c){sh.show()}var a=sw.adjusts,s=sh.dom.style;s.left=(Math.min(l,l+a.l))+"px";s.top=(Math.min(t,t+a.t))+"px";s.width=(w+a.w)+"px";s.height=(h+a.h)+"px"}}else{if(sh){if(_c){sh.show()}sh.setSize(w,h);sh.setLeftTop(l,t)}}}},destroy:function(){this.hideShim();if(this.shadow){this.shadow.hide()}this.removeAllListeners();Ext.removeNode(this.dom);Ext.Element.uncache(this.id)},remove:function(){this.destroy()},beginUpdate:function(){this.updating=true},endUpdate:function(){this.updating=false;this.sync(true)},hideUnders:function(_15){if(this.shadow){this.shadow.hide()}this.hideShim()},constrainXY:function(){if(this.constrain){var vw=Ext.lib.Dom.getViewWidth(),vh=Ext.lib.Dom.getViewHeight();var s=Ext.getDoc().getScroll();var xy=this.getXY();var x=xy[0],y=xy[1];var w=this.dom.offsetWidth+this.shadowOffset,h=this.dom.offsetHeight+this.shadowOffset;var _1e=false;if((x+w)>vw+s.left){x=vw-w-this.shadowOffset;_1e=true}if((y+h)>vh+s.top){y=vh-h-this.shadowOffset;_1e=true}if(x<s.left){x=s.left;_1e=true}if(y<s.top){y=s.top;_1e=true}if(_1e){if(this.avoidY){var ay=this.avoidY;if(y<=ay&&(y+h)>=ay){y=ay-h-5}}xy=[x,y];this.storeXY(xy);_7.setXY.call(this,xy);this.sync()}}},isVisible:function(){return this.visible},showAction:function(){this.visible=true;if(this.useDisplay===true){this.setDisplayed("")}else{if(this.lastXY){_7.setXY.call(this,this.lastXY)}else{if(this.lastLT){_7.setLeftTop.call(this,this.lastLT[0],this.lastLT[1])}}}},hideAction:function(){this.visible=false;if(this.useDisplay===true){this.setDisplayed(false)}else{this.setLeftTop(-10000,-10000)}},setVisible:function(v,a,d,c,e){if(v){this.showAction()}if(a&&v){var cb=function(){this.sync(true);if(c){c()}}.createDelegate(this);_7.setVisible.call(this,true,true,d,cb,e)}else{if(!v){this.hideUnders(true)}var cb=c;if(a){cb=function(){this.hideAction();if(c){c()}}.createDelegate(this)}_7.setVisible.call(this,v,a,d,cb,e);if(v){this.sync(true)}else{if(!a){this.hideAction()}}}},storeXY:function(xy){delete this.lastLT;this.lastXY=xy},storeLeftTop:function(_27,top){delete this.lastXY;this.lastLT=[_27,top]},beforeFx:function(){this.beforeAction();return Ext.Layer.superclass.beforeFx.apply(this,arguments)},afterFx:function(){Ext.Layer.superclass.afterFx.apply(this,arguments);this.sync(this.isVisible())},beforeAction:function(){if(!this.updating&&this.shadow){this.shadow.hide()}},setLeft:function(_29){this.storeLeftTop(_29,this.getTop(true));_7.setLeft.apply(this,arguments);this.sync()},setTop:function(top){this.storeLeftTop(this.getLeft(true),top);_7.setTop.apply(this,arguments);this.sync()},setLeftTop:function(_2b,top){this.storeLeftTop(_2b,top);_7.setLeftTop.apply(this,arguments);this.sync()},setXY:function(xy,a,d,c,e){this.fixDisplay();this.beforeAction();this.storeXY(xy);var cb=this.createCB(c);
28
+ _7.setXY.call(this,xy,a,d,cb,e);if(!a){cb()}},createCB:function(c){var el=this;return function(){el.constrainXY();el.sync(true);if(c){c()}}},setX:function(x,a,d,c,e){this.setXY([x,this.getY()],a,d,c,e)},setY:function(y,a,d,c,e){this.setXY([this.getX(),y],a,d,c,e)},setSize:function(w,h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);_7.setSize.call(this,w,h,a,d,cb,e);if(!a){cb()}},setWidth:function(w,a,d,c,e){this.beforeAction();var cb=this.createCB(c);_7.setWidth.call(this,w,a,d,cb,e);if(!a){cb()}},setHeight:function(h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);_7.setHeight.call(this,h,a,d,cb,e);if(!a){cb()}},setBounds:function(x,y,w,h,a,d,c,e){this.beforeAction();var cb=this.createCB(c);if(!a){this.storeXY([x,y]);_7.setXY.call(this,[x,y]);_7.setSize.call(this,w,h,a,d,cb,e);cb()}else{_7.setBounds.call(this,x,y,w,h,a,d,cb,e)}return this},setZIndex:function(_5b){this.zindex=_5b;this.setStyle("z-index",_5b+2);if(this.shadow){this.shadow.setZIndex(_5b+1)}if(this.shim){this.shim.setStyle("z-index",_5b)}}})})();Ext.Shadow=function(_1){Ext.apply(this,_1);if(typeof this.mode!="string"){this.mode=this.defaultMode}var o=this.offset,a={h:0};var _4=Math.floor(this.offset/2);switch(this.mode.toLowerCase()){case"drop":a.w=0;a.l=a.t=o;a.t-=1;if(Ext.isIE){a.l-=this.offset+_4;a.t-=this.offset+_4;a.w-=_4;a.h-=_4;a.t+=1}break;case"sides":a.w=(o*2);a.l=-o;a.t=o-1;if(Ext.isIE){a.l-=(this.offset-_4);a.t-=this.offset+_4;a.l+=1;a.w-=(this.offset-_4)*2;a.w-=_4+1;a.h-=1}break;case"frame":a.w=a.h=(o*2);a.l=a.t=-o;a.t+=1;a.h-=2;if(Ext.isIE){a.l-=(this.offset-_4);a.t-=(this.offset-_4);a.l+=1;a.w-=(this.offset+_4+1);a.h-=(this.offset+_4);a.h+=1}break}this.adjusts=a};Ext.Shadow.prototype={offset:4,defaultMode:"drop",show:function(_5){_5=Ext.get(_5);if(!this.el){this.el=Ext.Shadow.Pool.pull();if(this.el.dom.nextSibling!=_5.dom){this.el.insertBefore(_5)}}this.el.setStyle("z-index",this.zIndex||parseInt(_5.getStyle("z-index"),10)-1);if(Ext.isIE){this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")"}this.realign(_5.getLeft(true),_5.getTop(true),_5.getWidth(),_5.getHeight());this.el.dom.style.display="block"},isVisible:function(){return this.el?true:false},realign:function(l,t,w,h){if(!this.el){return}var a=this.adjusts,d=this.el.dom,s=d.style;var _d=0;s.left=(l+a.l)+"px";s.top=(t+a.t)+"px";var sw=(w+a.w),sh=(h+a.h),sws=sw+"px",shs=sh+"px";if(s.width!=sws||s.height!=shs){s.width=sws;s.height=shs;if(!Ext.isIE){var cn=d.childNodes;var sww=Math.max(0,(sw-12))+"px";cn[0].childNodes[1].style.width=sww;cn[1].childNodes[1].style.width=sww;cn[2].childNodes[1].style.width=sww;cn[1].style.height=Math.max(0,(sh-12))+"px"}}},hide:function(){if(this.el){this.el.dom.style.display="none";Ext.Shadow.Pool.push(this.el);delete this.el}},setZIndex:function(z){this.zIndex=z;if(this.el){this.el.setStyle("z-index",z)}}};Ext.Shadow.Pool=function(){var p=[];var _16=Ext.isIE?'<div class="x-ie-shadow"></div>':'<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';return{pull:function(){var sh=p.shift();if(!sh){sh=Ext.get(Ext.DomHelper.insertHtml("beforeBegin",document.body.firstChild,_16));sh.autoBoxAdjust=false}return sh},push:function(sh){p.push(sh)}}}();Ext.BoxComponent=Ext.extend(Ext.Component,{initComponent:function(){Ext.BoxComponent.superclass.initComponent.call(this);this.addEvents("resize","move")},boxReady:false,deferHeight:false,setSize:function(w,h){if(typeof w=="object"){h=w.height;w=w.width}if(!this.boxReady){this.width=w;this.height=h;return this}if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return this}this.lastSize={width:w,height:h};var _3=this.adjustSize(w,h);var aw=_3.width,ah=_3.height;if(aw!==undefined||ah!==undefined){var rz=this.getResizeEl();if(!this.deferHeight&&aw!==undefined&&ah!==undefined){rz.setSize(aw,ah)}else{if(!this.deferHeight&&ah!==undefined){rz.setHeight(ah)}else{if(aw!==undefined){rz.setWidth(aw)}}}this.onResize(aw,ah,w,h);this.fireEvent("resize",this,aw,ah,w,h)}return this},setWidth:function(_7){return this.setSize(_7)},setHeight:function(_8){return this.setSize(undefined,_8)},getSize:function(){return this.el.getSize()},getPosition:function(_9){if(_9===true){return[this.el.getLeft(true),this.el.getTop(true)]}return this.xy||this.el.getXY()},getBox:function(_a){var s=this.el.getSize();if(_a===true){s.x=this.el.getLeft(true);s.y=this.el.getTop(true)}else{var xy=this.xy||this.el.getXY();s.x=xy[0];s.y=xy[1]}return s},updateBox:function(_d){this.setSize(_d.width,_d.height);this.setPagePosition(_d.x,_d.y);return this},getResizeEl:function(){return this.resizeEl||this.el},getPositionEl:function(){return this.positionEl||this.el},setPosition:function(x,y){if(x&&typeof x[1]=="number"){y=x[1];x=x[0]}this.x=x;this.y=y;if(!this.boxReady){return this}var adj=this.adjustPosition(x,y);var ax=adj.x,ay=adj.y;var el=this.getPositionEl();if(ax!==undefined||ay!==undefined){if(ax!==undefined&&ay!==undefined){el.setLeftTop(ax,ay)}else{if(ax!==undefined){el.setLeft(ax)}else{if(ay!==undefined){el.setTop(ay)}}}this.onPosition(ax,ay);this.fireEvent("move",this,ax,ay)}return this},setPagePosition:function(x,y){if(x&&typeof x[1]=="number"){y=x[1];x=x[0]}this.pageX=x;this.pageY=y;if(!this.boxReady){return}if(x===undefined||y===undefined){return}var p=this.el.translatePoints(x,y);this.setPosition(p.left,p.top);return this},onRender:function(ct,_18){Ext.BoxComponent.superclass.onRender.call(this,ct,_18);if(this.resizeEl){this.resizeEl=Ext.get(this.resizeEl)}if(this.positionEl){this.positionEl=Ext.get(this.positionEl)}},afterRender:function(){Ext.BoxComponent.superclass.afterRender.call(this);this.boxReady=true;this.setSize(this.width,this.height);if(this.x||this.y){this.setPosition(this.x,this.y)}else{if(this.pageX||this.pageY){this.setPagePosition(this.pageX,this.pageY)}}},syncSize:function(){delete this.lastSize;this.setSize(this.autoWidth?undefined:this.el.getWidth(),this.autoHeight?undefined:this.el.getHeight());return this},onResize:function(_19,_1a,_1b,_1c){},onPosition:function(x,y){},adjustSize:function(w,h){if(this.autoWidth){w="auto"}if(this.autoHeight){h="auto"}return{width:w,height:h}},adjustPosition:function(x,y){return{x:x,y:y}}});Ext.reg("box",Ext.BoxComponent);Ext.SplitBar=function(_1,_2,_3,_4,_5){this.el=Ext.get(_1,true);this.el.dom.unselectable="on";this.resizingEl=Ext.get(_2,true);this.orientation=_3||Ext.SplitBar.HORIZONTAL;this.minSize=0;this.maxSize=2000;this.animate=false;this.useShim=false;this.shim=null;if(!_5){this.proxy=Ext.SplitBar.createProxy(this.orientation)}else{this.proxy=Ext.get(_5).dom}this.dd=new Ext.dd.DDProxy(this.el.dom.id,"XSplitBars",{dragElId:this.proxy.id});this.dd.b4StartDrag=this.onStartProxyDrag.createDelegate(this);this.dd.endDrag=this.onEndProxyDrag.createDelegate(this);this.dragSpecs={};this.adapter=new Ext.SplitBar.BasicLayoutAdapter();this.adapter.init(this);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.placement=_4||(this.el.getX()>this.resizingEl.getX()?Ext.SplitBar.LEFT:Ext.SplitBar.RIGHT);this.el.addClass("x-splitbar-h")}else{this.placement=_4||(this.el.getY()>this.resizingEl.getY()?Ext.SplitBar.TOP:Ext.SplitBar.BOTTOM);this.el.addClass("x-splitbar-v")}this.addEvents("resize","moved","beforeresize","beforeapply");Ext.SplitBar.superclass.constructor.call(this)};Ext.extend(Ext.SplitBar,Ext.util.Observable,{onStartProxyDrag:function(x,y){this.fireEvent("beforeresize",this);this.overlay=Ext.DomHelper.append(document.body,{cls:"x-drag-overlay",html:"&#160;"},true);this.overlay.unselectable();this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();Ext.get(this.proxy).setDisplayed("block");var _8=this.adapter.getElementSize(this);
29
+ this.activeMinSize=this.getMinimumSize();this.activeMaxSize=this.getMaximumSize();var c1=_8-this.activeMinSize;var c2=Math.max(this.activeMaxSize-_8,0);if(this.orientation==Ext.SplitBar.HORIZONTAL){this.dd.resetConstraints();this.dd.setXConstraint(this.placement==Ext.SplitBar.LEFT?c1:c2,this.placement==Ext.SplitBar.LEFT?c2:c1);this.dd.setYConstraint(0,0)}else{this.dd.resetConstraints();this.dd.setXConstraint(0,0);this.dd.setYConstraint(this.placement==Ext.SplitBar.TOP?c1:c2,this.placement==Ext.SplitBar.TOP?c2:c1)}this.dragSpecs.startSize=_8;this.dragSpecs.startPoint=[x,y];Ext.dd.DDProxy.prototype.b4StartDrag.call(this.dd,x,y)},onEndProxyDrag:function(e){Ext.get(this.proxy).setDisplayed(false);var _c=Ext.lib.Event.getXY(e);if(this.overlay){Ext.destroy(this.overlay);delete this.overlay}var _d;if(this.orientation==Ext.SplitBar.HORIZONTAL){_d=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.LEFT?_c[0]-this.dragSpecs.startPoint[0]:this.dragSpecs.startPoint[0]-_c[0])}else{_d=this.dragSpecs.startSize+(this.placement==Ext.SplitBar.TOP?_c[1]-this.dragSpecs.startPoint[1]:this.dragSpecs.startPoint[1]-_c[1])}_d=Math.min(Math.max(_d,this.activeMinSize),this.activeMaxSize);if(_d!=this.dragSpecs.startSize){if(this.fireEvent("beforeapply",this,_d)!==false){this.adapter.setElementSize(this,_d);this.fireEvent("moved",this,_d);this.fireEvent("resize",this,_d)}}},getAdapter:function(){return this.adapter},setAdapter:function(_e){this.adapter=_e;this.adapter.init(this)},getMinimumSize:function(){return this.minSize},setMinimumSize:function(_f){this.minSize=_f},getMaximumSize:function(){return this.maxSize},setMaximumSize:function(_10){this.maxSize=_10},setCurrentSize:function(_11){var _12=this.animate;this.animate=false;this.adapter.setElementSize(this,_11);this.animate=_12},destroy:function(_13){if(this.shim){this.shim.remove()}this.dd.unreg();Ext.destroy(Ext.get(this.proxy));if(_13){this.el.remove()}}});Ext.SplitBar.createProxy=function(dir){var _15=new Ext.Element(document.createElement("div"));_15.unselectable();var cls="x-splitbar-proxy";_15.addClass(cls+" "+(dir==Ext.SplitBar.HORIZONTAL?cls+"-h":cls+"-v"));document.body.appendChild(_15.dom);return _15.dom};Ext.SplitBar.BasicLayoutAdapter=function(){};Ext.SplitBar.BasicLayoutAdapter.prototype={init:function(s){},getElementSize:function(s){if(s.orientation==Ext.SplitBar.HORIZONTAL){return s.resizingEl.getWidth()}else{return s.resizingEl.getHeight()}},setElementSize:function(s,_1a,_1b){if(s.orientation==Ext.SplitBar.HORIZONTAL){if(!s.animate){s.resizingEl.setWidth(_1a);if(_1b){_1b(s,_1a)}}else{s.resizingEl.setWidth(_1a,true,0.1,_1b,"easeOut")}}else{if(!s.animate){s.resizingEl.setHeight(_1a);if(_1b){_1b(s,_1a)}}else{s.resizingEl.setHeight(_1a,true,0.1,_1b,"easeOut")}}}};Ext.SplitBar.AbsoluteLayoutAdapter=function(_1c){this.basic=new Ext.SplitBar.BasicLayoutAdapter();this.container=Ext.get(_1c)};Ext.SplitBar.AbsoluteLayoutAdapter.prototype={init:function(s){this.basic.init(s)},getElementSize:function(s){return this.basic.getElementSize(s)},setElementSize:function(s,_20,_21){this.basic.setElementSize(s,_20,this.moveSplitter.createDelegate(this,[s]))},moveSplitter:function(s){var yes=Ext.SplitBar;switch(s.placement){case yes.LEFT:s.el.setX(s.resizingEl.getRight());break;case yes.RIGHT:s.el.setStyle("right",(this.container.getWidth()-s.resizingEl.getLeft())+"px");break;case yes.TOP:s.el.setY(s.resizingEl.getBottom());break;case yes.BOTTOM:s.el.setY(s.resizingEl.getTop()-s.el.getHeight());break}}};Ext.SplitBar.VERTICAL=1;Ext.SplitBar.HORIZONTAL=2;Ext.SplitBar.LEFT=1;Ext.SplitBar.RIGHT=2;Ext.SplitBar.TOP=3;Ext.SplitBar.BOTTOM=4;Ext.Container=Ext.extend(Ext.BoxComponent,{autoDestroy:true,defaultType:"panel",initComponent:function(){Ext.Container.superclass.initComponent.call(this);this.addEvents("afterlayout","beforeadd","beforeremove","add","remove");var _1=this.items;if(_1){delete this.items;if(Ext.isArray(_1)&&_1.length>0){this.add.apply(this,_1)}else{this.add(_1)}}},initItems:function(){if(!this.items){this.items=new Ext.util.MixedCollection(false,this.getComponentId);this.getLayout()}},setLayout:function(_2){if(this.layout&&this.layout!=_2){this.layout.setContainer(null)}this.initItems();this.layout=_2;_2.setContainer(this)},render:function(){Ext.Container.superclass.render.apply(this,arguments);if(this.layout){if(typeof this.layout=="string"){this.layout=new Ext.Container.LAYOUTS[this.layout.toLowerCase()](this.layoutConfig)}this.setLayout(this.layout);if(this.activeItem!==undefined){var _3=this.activeItem;delete this.activeItem;this.layout.setActiveItem(_3);return}}if(!this.ownerCt){this.doLayout()}if(this.monitorResize===true){Ext.EventManager.onWindowResize(this.doLayout,this,[false])}},getLayoutTarget:function(){return this.el},getComponentId:function(_4){return _4.itemId||_4.id},add:function(_5){if(!this.items){this.initItems()}var a=arguments,_7=a.length;if(_7>1){for(var i=0;i<_7;i++){this.add(a[i])}return}var c=this.lookupComponent(this.applyDefaults(_5));var _a=this.items.length;if(this.fireEvent("beforeadd",this,c,_a)!==false&&this.onBeforeAdd(c)!==false){this.items.add(c);c.ownerCt=this;this.fireEvent("add",this,c,_a)}return c},insert:function(_b,_c){if(!this.items){this.initItems()}var a=arguments,_e=a.length;if(_e>2){for(var i=_e-1;i>=1;--i){this.insert(_b,a[i])}return}var c=this.lookupComponent(this.applyDefaults(_c));if(c.ownerCt==this&&this.items.indexOf(c)<_b){--_b}if(this.fireEvent("beforeadd",this,c,_b)!==false&&this.onBeforeAdd(c)!==false){this.items.insert(_b,c);c.ownerCt=this;this.fireEvent("add",this,c,_b)}return c},applyDefaults:function(c){if(this.defaults){if(typeof c=="string"){c=Ext.ComponentMgr.get(c);Ext.apply(c,this.defaults)}else{if(!c.events){Ext.applyIf(c,this.defaults)}else{Ext.apply(c,this.defaults)}}}return c},onBeforeAdd:function(_12){if(_12.ownerCt){_12.ownerCt.remove(_12,false)}if(this.hideBorders===true){_12.border=(_12.border===true)}},remove:function(_13,_14){var c=this.getComponent(_13);if(c&&this.fireEvent("beforeremove",this,c)!==false){this.items.remove(c);delete c.ownerCt;if(_14===true||(_14!==false&&this.autoDestroy)){c.destroy()}if(this.layout&&this.layout.activeItem==c){delete this.layout.activeItem}this.fireEvent("remove",this,c)}return c},removeAll:function(_16){var _17,_18=[];while((_17=this.items.last())){_18.unshift(this.remove(_17,_16))}return _18},getComponent:function(_19){if(typeof _19=="object"){return _19}return this.items.get(_19)},lookupComponent:function(_1a){if(typeof _1a=="string"){return Ext.ComponentMgr.get(_1a)}else{if(!_1a.events){return this.createComponent(_1a)}}return _1a},createComponent:function(_1b){return Ext.ComponentMgr.create(_1b,this.defaultType)},doLayout:function(_1c){if(this.rendered&&this.layout){this.layout.layout()}if(_1c!==false&&this.items){var cs=this.items.items;for(var i=0,len=cs.length;i<len;i++){var c=cs[i];if(c.doLayout){c.doLayout()}}}},getLayout:function(){if(!this.layout){var _21=new Ext.layout.ContainerLayout(this.layoutConfig);this.setLayout(_21)}return this.layout},beforeDestroy:function(){if(this.items){Ext.destroy.apply(Ext,this.items.items)}if(this.monitorResize){Ext.EventManager.removeResizeListener(this.doLayout,this)}if(this.layout&&this.layout.destroy){this.layout.destroy()}Ext.Container.superclass.beforeDestroy.call(this)},bubble:function(fn,_23,_24){var p=this;while(p){if(fn.apply(_23||p,_24||[p])===false){break}p=p.ownerCt}},cascade:function(fn,_27,_28){if(fn.apply(_27||this,_28||[this])!==false){if(this.items){var cs=this.items.items;for(var i=0,len=cs.length;i<len;i++){if(cs[i].cascade){cs[i].cascade(fn,_27,_28)}else{fn.apply(_27||cs[i],_28||[cs[i]])}}}}},findById:function(id){var m,ct=this;this.cascade(function(c){if(ct!=c&&c.id===id){m=c;return false}});return m||null},findByType:function(_30,_31){return this.findBy(function(c){return c.isXType(_30,_31)})},find:function(_33,_34){return this.findBy(function(c){return c[_33]===_34})},findBy:function(fn,_37){var m=[],ct=this;this.cascade(function(c){if(ct!=c&&fn.call(_37||c,c,ct)===true){m.push(c)
30
+ }});return m}});Ext.Container.LAYOUTS={};Ext.reg("container",Ext.Container);Ext.layout.ContainerLayout=function(_1){Ext.apply(this,_1)};Ext.layout.ContainerLayout.prototype={monitorResize:false,activeItem:null,layout:function(){var _2=this.container.getLayoutTarget();this.onLayout(this.container,_2);this.container.fireEvent("afterlayout",this.container,this)},onLayout:function(ct,_4){this.renderAll(ct,_4)},isValidParent:function(c,_6){var el=c.getPositionEl?c.getPositionEl():c.getEl();return el.dom.parentNode==_6.dom},renderAll:function(ct,_9){var _a=ct.items.items;for(var i=0,_c=_a.length;i<_c;i++){var c=_a[i];if(c&&(!c.rendered||!this.isValidParent(c,_9))){this.renderItem(c,i,_9)}}},renderItem:function(c,_f,_10){if(c&&!c.rendered){c.render(_10,_f);if(this.extraCls){var t=c.getPositionEl?c.getPositionEl():c;t.addClass(this.extraCls)}if(this.renderHidden&&c!=this.activeItem){c.hide()}}else{if(c&&!this.isValidParent(c,_10)){if(this.extraCls){var t=c.getPositionEl?c.getPositionEl():c;t.addClass(this.extraCls)}if(typeof _f=="number"){_f=_10.dom.childNodes[_f]}_10.dom.insertBefore(c.getEl().dom,_f||null);if(this.renderHidden&&c!=this.activeItem){c.hide()}}}},onResize:function(){if(this.container.collapsed){return}var b=this.container.bufferResize;if(b){if(!this.resizeTask){this.resizeTask=new Ext.util.DelayedTask(this.layout,this);this.resizeBuffer=typeof b=="number"?b:100}this.resizeTask.delay(this.resizeBuffer)}else{this.layout()}},setContainer:function(ct){if(this.monitorResize&&ct!=this.container){if(this.container){this.container.un("resize",this.onResize,this)}if(ct){ct.on("resize",this.onResize,this)}}this.container=ct},parseMargins:function(v){var ms=v.split(" ");var len=ms.length;if(len==1){ms[1]=ms[0];ms[2]=ms[0];ms[3]=ms[0]}if(len==2){ms[2]=ms[0];ms[3]=ms[1]}return{top:parseInt(ms[0],10)||0,right:parseInt(ms[1],10)||0,bottom:parseInt(ms[2],10)||0,left:parseInt(ms[3],10)||0}},destroy:Ext.emptyFn};Ext.Container.LAYOUTS.auto=Ext.layout.ContainerLayout;Ext.layout.FitLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,onLayout:function(ct,_2){Ext.layout.FitLayout.superclass.onLayout.call(this,ct,_2);if(!this.container.collapsed){this.setItemSize(this.activeItem||ct.items.itemAt(0),_2.getStyleSize())}},setItemSize:function(_3,_4){if(_3&&_4.height>0){_3.setSize(_4)}}});Ext.Container.LAYOUTS.fit=Ext.layout.FitLayout;Ext.layout.CardLayout=Ext.extend(Ext.layout.FitLayout,{deferredRender:false,renderHidden:true,setActiveItem:function(_1){_1=this.container.getComponent(_1);if(this.activeItem!=_1){if(this.activeItem){this.activeItem.hide()}this.activeItem=_1;_1.show();this.layout()}},renderAll:function(ct,_3){if(this.deferredRender){this.renderItem(this.activeItem,undefined,_3)}else{Ext.layout.CardLayout.superclass.renderAll.call(this,ct,_3)}}});Ext.Container.LAYOUTS.card=Ext.layout.CardLayout;Ext.layout.AnchorLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,getAnchorViewSize:function(ct,_2){return _2.dom==document.body?_2.getViewSize():_2.getStyleSize()},onLayout:function(ct,_4){Ext.layout.AnchorLayout.superclass.onLayout.call(this,ct,_4);var _5=this.getAnchorViewSize(ct,_4);var w=_5.width,h=_5.height;if(w<20||h<20){return}var aw,ah;if(ct.anchorSize){if(typeof ct.anchorSize=="number"){aw=ct.anchorSize}else{aw=ct.anchorSize.width;ah=ct.anchorSize.height}}else{aw=ct.initialConfig.width;ah=ct.initialConfig.height}var cs=ct.items.items,_b=cs.length,i,c,a,cw,ch;for(i=0;i<_b;i++){c=cs[i];if(c.anchor){a=c.anchorSpec;if(!a){var vs=c.anchor.split(" ");c.anchorSpec=a={right:this.parseAnchor(vs[0],c.initialConfig.width,aw),bottom:this.parseAnchor(vs[1],c.initialConfig.height,ah)}}cw=a.right?this.adjustWidthAnchor(a.right(w),c):undefined;ch=a.bottom?this.adjustHeightAnchor(a.bottom(h),c):undefined;if(cw||ch){c.setSize(cw||undefined,ch||undefined)}}}},parseAnchor:function(a,_13,_14){if(a&&a!="none"){var _15;if(/^(r|right|b|bottom)$/i.test(a)){var _16=_14-_13;return function(v){if(v!==_15){_15=v;return v-_16}}}else{if(a.indexOf("%")!=-1){var _18=parseFloat(a.replace("%",""))*0.01;return function(v){if(v!==_15){_15=v;return Math.floor(v*_18)}}}else{a=parseInt(a,10);if(!isNaN(a)){return function(v){if(v!==_15){_15=v;return v+a}}}}}}return false},adjustWidthAnchor:function(_1b,_1c){return _1b},adjustHeightAnchor:function(_1d,_1e){return _1d}});Ext.Container.LAYOUTS.anchor=Ext.layout.AnchorLayout;Ext.layout.ColumnLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,extraCls:"x-column",scrollOffset:0,isValidParent:function(c,_2){return(c.getPositionEl?c.getPositionEl():c.getEl()).dom.parentNode==this.innerCt.dom},onLayout:function(ct,_4){var cs=ct.items.items,_6=cs.length,c,i;if(!this.innerCt){_4.addClass("x-column-layout-ct");this.innerCt=_4.createChild({cls:"x-column-inner"});this.innerCt.createChild({cls:"x-clear"})}this.renderAll(ct,this.innerCt);var _9=Ext.isIE&&_4.dom!=Ext.getBody().dom?_4.getStyleSize():_4.getViewSize();if(_9.width<1&&_9.height<1){return}var w=_9.width-_4.getPadding("lr")-this.scrollOffset,h=_9.height-_4.getPadding("tb"),pw=w;this.innerCt.setWidth(w);for(i=0;i<_6;i++){c=cs[i];if(!c.columnWidth){pw-=(c.getSize().width+c.getEl().getMargins("lr"))}}pw=pw<0?0:pw;for(i=0;i<_6;i++){c=cs[i];if(c.columnWidth){c.setSize(Math.floor(c.columnWidth*pw)-c.getEl().getMargins("lr"))}}}});Ext.Container.LAYOUTS.column=Ext.layout.ColumnLayout;Ext.layout.BorderLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:true,rendered:false,onLayout:function(ct,_2){var _3;if(!this.rendered){_2.position();_2.addClass("x-border-layout-ct");var _4=ct.items.items;_3=[];for(var i=0,_6=_4.length;i<_6;i++){var c=_4[i];var _8=c.region;if(c.collapsed){_3.push(c)}c.collapsed=false;if(!c.rendered){c.cls=c.cls?c.cls+" x-border-panel":"x-border-panel";c.render(_2,i)}this[_8]=_8!="center"&&c.split?new Ext.layout.BorderLayout.SplitRegion(this,c.initialConfig,_8):new Ext.layout.BorderLayout.Region(this,c.initialConfig,_8);this[_8].render(_2,c)}this.rendered=true}var _9=_2.getViewSize();if(_9.width<20||_9.height<20){if(_3){this.restoreCollapsed=_3}return}else{if(this.restoreCollapsed){_3=this.restoreCollapsed;delete this.restoreCollapsed}}var w=_9.width,h=_9.height;var _c=w,_d=h,_e=0,_f=0;var n=this.north,s=this.south,_12=this.west,e=this.east,c=this.center;if(!c&&Ext.layout.BorderLayout.WARN!==false){throw"No center region defined in BorderLayout "+ct.id}if(n&&n.isVisible()){var b=n.getSize();var m=n.getMargins();b.width=w-(m.left+m.right);b.x=m.left;b.y=m.top;_e=b.height+b.y+m.bottom;_d-=_e;n.applyLayout(b)}if(s&&s.isVisible()){var b=s.getSize();var m=s.getMargins();b.width=w-(m.left+m.right);b.x=m.left;var _16=(b.height+m.top+m.bottom);b.y=h-_16+m.top;_d-=_16;s.applyLayout(b)}if(_12&&_12.isVisible()){var b=_12.getSize();var m=_12.getMargins();b.height=_d-(m.top+m.bottom);b.x=m.left;b.y=_e+m.top;var _17=(b.width+m.left+m.right);_f+=_17;_c-=_17;_12.applyLayout(b)}if(e&&e.isVisible()){var b=e.getSize();var m=e.getMargins();b.height=_d-(m.top+m.bottom);var _17=(b.width+m.left+m.right);b.x=w-_17+m.left;b.y=_e+m.top;_c-=_17;e.applyLayout(b)}if(c){var m=c.getMargins();var _18={x:_f+m.left,y:_e+m.top,width:_c-(m.left+m.right),height:_d-(m.top+m.bottom)};c.applyLayout(_18)}if(_3){for(var i=0,_6=_3.length;i<_6;i++){_3[i].collapse(false)}}if(Ext.isIE&&Ext.isStrict){_2.repaint()}},destroy:function(){var r=["north","south","east","west"];for(var i=0;i<r.length;i++){var _1b=this[r[i]];if(_1b){if(_1b.destroy){_1b.destroy()}else{if(_1b.split){_1b.split.destroy(true)}}}}Ext.layout.BorderLayout.superclass.destroy.call(this)}});Ext.layout.BorderLayout.Region=function(_1c,_1d,pos){Ext.apply(this,_1d);this.layout=_1c;this.position=pos;this.state={};if(typeof this.margins=="string"){this.margins=this.layout.parseMargins(this.margins)}this.margins=Ext.applyIf(this.margins||{},this.defaultMargins);if(this.collapsible){if(typeof this.cmargins=="string"){this.cmargins=this.layout.parseMargins(this.cmargins)}if(this.collapseMode=="mini"&&!this.cmargins){this.cmargins={left:0,top:0,right:0,bottom:0}
31
+ }else{this.cmargins=Ext.applyIf(this.cmargins||{},pos=="north"||pos=="south"?this.defaultNSCMargins:this.defaultEWCMargins)}}};Ext.layout.BorderLayout.Region.prototype={collapsible:false,split:false,floatable:true,minWidth:50,minHeight:50,defaultMargins:{left:0,top:0,right:0,bottom:0},defaultNSCMargins:{left:5,top:5,right:5,bottom:5},defaultEWCMargins:{left:5,top:0,right:5,bottom:0},isCollapsed:false,render:function(ct,p){this.panel=p;p.el.enableDisplayMode();this.targetEl=ct;this.el=p.el;var gs=p.getState,ps=this.position;p.getState=function(){return Ext.apply(gs.call(p)||{},this.state)}.createDelegate(this);if(ps!="center"){p.allowQueuedExpand=false;p.on({beforecollapse:this.beforeCollapse,collapse:this.onCollapse,beforeexpand:this.beforeExpand,expand:this.onExpand,hide:this.onHide,show:this.onShow,scope:this});if(this.collapsible||this.floatable){p.collapseEl="el";p.slideAnchor=this.getSlideAnchor()}if(p.tools&&p.tools.toggle){p.tools.toggle.addClass("x-tool-collapse-"+ps);p.tools.toggle.addClassOnOver("x-tool-collapse-"+ps+"-over")}}},getCollapsedEl:function(){if(!this.collapsedEl){if(!this.toolTemplate){var tt=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');tt.disableFormats=true;tt.compile();Ext.layout.BorderLayout.Region.prototype.toolTemplate=tt}this.collapsedEl=this.targetEl.createChild({cls:"x-layout-collapsed x-layout-collapsed-"+this.position,id:this.panel.id+"-xcollapsed"});this.collapsedEl.enableDisplayMode("block");if(this.collapseMode=="mini"){this.collapsedEl.addClass("x-layout-cmini-"+this.position);this.miniCollapsedEl=this.collapsedEl.createChild({cls:"x-layout-mini x-layout-mini-"+this.position,html:"&#160;"});this.miniCollapsedEl.addClassOnOver("x-layout-mini-over");this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this.onExpandClick,this,{stopEvent:true})}else{if(this.collapsible!==false&&!this.hideCollapseTool){var t=this.toolTemplate.append(this.collapsedEl.dom,{id:"expand-"+this.position},true);t.addClassOnOver("x-tool-expand-"+this.position+"-over");t.on("click",this.onExpandClick,this,{stopEvent:true})}if(this.floatable!==false||this.titleCollapse){this.collapsedEl.addClassOnOver("x-layout-collapsed-over");this.collapsedEl.on("click",this[this.floatable?"collapseClick":"onExpandClick"],this)}}}return this.collapsedEl},onExpandClick:function(e){if(this.isSlid){this.afterSlideIn();this.panel.expand(false)}else{this.panel.expand()}},onCollapseClick:function(e){this.panel.collapse()},beforeCollapse:function(p,_28){this.lastAnim=_28;if(this.splitEl){this.splitEl.hide()}this.getCollapsedEl().show();this.panel.el.setStyle("z-index",100);this.isCollapsed=true;this.layout.layout()},onCollapse:function(_29){this.panel.el.setStyle("z-index",1);if(this.lastAnim===false||this.panel.animCollapse===false){this.getCollapsedEl().dom.style.visibility="visible"}else{this.getCollapsedEl().slideIn(this.panel.slideAnchor,{duration:0.2})}this.state.collapsed=true;this.panel.saveState()},beforeExpand:function(_2a){var c=this.getCollapsedEl();this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,c.getHeight())}else{this.panel.setSize(c.getWidth(),undefined)}c.hide();c.dom.style.visibility="hidden";this.panel.el.setStyle("z-index",100)},onExpand:function(){this.isCollapsed=false;if(this.splitEl){this.splitEl.show()}this.layout.layout();this.panel.el.setStyle("z-index",1);this.state.collapsed=false;this.panel.saveState()},collapseClick:function(e){if(this.isSlid){e.stopPropagation();this.slideIn()}else{e.stopPropagation();this.slideOut()}},onHide:function(){if(this.isCollapsed){this.getCollapsedEl().hide()}else{if(this.splitEl){this.splitEl.hide()}}},onShow:function(){if(this.isCollapsed){this.getCollapsedEl().show()}else{if(this.splitEl){this.splitEl.show()}}},isVisible:function(){return !this.panel.hidden},getMargins:function(){return this.isCollapsed&&this.cmargins?this.cmargins:this.margins},getSize:function(){return this.isCollapsed?this.getCollapsedEl().getSize():this.panel.getSize()},setPanel:function(_2d){this.panel=_2d},getMinWidth:function(){return this.minWidth},getMinHeight:function(){return this.minHeight},applyLayoutCollapsed:function(box){var ce=this.getCollapsedEl();ce.setLeftTop(box.x,box.y);ce.setSize(box.width,box.height)},applyLayout:function(box){if(this.isCollapsed){this.applyLayoutCollapsed(box)}else{this.panel.setPosition(box.x,box.y);this.panel.setSize(box.width,box.height)}},beforeSlide:function(){this.panel.beforeEffect()},afterSlide:function(){this.panel.afterEffect()},initAutoHide:function(){if(this.autoHide!==false){if(!this.autoHideHd){var st=new Ext.util.DelayedTask(this.slideIn,this);this.autoHideHd={mouseout:function(e){if(!e.within(this.el,true)){st.delay(500)}},mouseover:function(e){st.cancel()},scope:this}}this.el.on(this.autoHideHd)}},clearAutoHide:function(){if(this.autoHide!==false){this.el.un("mouseout",this.autoHideHd.mouseout);this.el.un("mouseover",this.autoHideHd.mouseover)}},clearMonitor:function(){Ext.getDoc().un("click",this.slideInIf,this)},slideOut:function(){if(this.isSlid||this.el.hasActiveFx()){return}this.isSlid=true;var ts=this.panel.tools;if(ts&&ts.toggle){ts.toggle.hide()}this.el.show();if(this.position=="east"||this.position=="west"){this.panel.setSize(undefined,this.collapsedEl.getHeight())}else{this.panel.setSize(this.collapsedEl.getWidth(),undefined)}this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.el.setStyle("z-index",102);this.panel.el.replaceClass("x-panel-collapsed","x-panel-floating");if(this.animFloat!==false){this.beforeSlide();this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)},scope:this,block:true})}else{this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this)}},afterSlideIn:function(){this.clearAutoHide();this.isSlid=false;this.clearMonitor();this.el.setStyle("z-index","");this.panel.el.replaceClass("x-panel-floating","x-panel-collapsed");this.el.dom.style.left=this.restoreLT[0];this.el.dom.style.top=this.restoreLT[1];var ts=this.panel.tools;if(ts&&ts.toggle){ts.toggle.show()}},slideIn:function(cb){if(!this.isSlid||this.el.hasActiveFx()){Ext.callback(cb);return}this.isSlid=false;if(this.animFloat!==false){this.beforeSlide();this.el.slideOut(this.getSlideAnchor(),{callback:function(){this.el.hide();this.afterSlide();this.afterSlideIn();Ext.callback(cb)},scope:this,block:true})}else{this.el.hide();this.afterSlideIn()}},slideInIf:function(e){if(!e.within(this.el)){this.slideIn()}},anchors:{west:"left",east:"right",north:"top",south:"bottom"},sanchors:{west:"l",east:"r",north:"t",south:"b"},canchors:{west:"tl-tr",east:"tr-tl",north:"tl-bl",south:"bl-tl"},getAnchor:function(){return this.anchors[this.position]},getCollapseAnchor:function(){return this.canchors[this.position]},getSlideAnchor:function(){return this.sanchors[this.position]},getAlignAdj:function(){var cm=this.cmargins;switch(this.position){case"west":return[0,0];break;case"east":return[0,0];break;case"north":return[0,0];break;case"south":return[0,0];break}},getExpandAdj:function(){var c=this.collapsedEl,cm=this.cmargins;switch(this.position){case"west":return[-(cm.right+c.getWidth()+cm.left),0];break;case"east":return[cm.right+c.getWidth()+cm.left,0];break;case"north":return[0,-(cm.top+cm.bottom+c.getHeight())];break;case"south":return[0,cm.top+cm.bottom+c.getHeight()];break}}};Ext.layout.BorderLayout.SplitRegion=function(_3b,_3c,pos){Ext.layout.BorderLayout.SplitRegion.superclass.constructor.call(this,_3b,_3c,pos);this.applyLayout=this.applyFns[pos]};Ext.extend(Ext.layout.BorderLayout.SplitRegion,Ext.layout.BorderLayout.Region,{splitTip:"Drag to resize.",collapsibleSplitTip:"Drag to resize. Double click to hide.",useSplitTips:false,splitSettings:{north:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.TOP,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},south:{orientation:Ext.SplitBar.VERTICAL,placement:Ext.SplitBar.BOTTOM,maxFn:"getVMaxSize",minProp:"minHeight",maxProp:"maxHeight"},east:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.RIGHT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"},west:{orientation:Ext.SplitBar.HORIZONTAL,placement:Ext.SplitBar.LEFT,maxFn:"getHMaxSize",minProp:"minWidth",maxProp:"maxWidth"}},applyFns:{west:function(box){if(this.isCollapsed){return this.applyLayoutCollapsed(box)
32
+ }var sd=this.splitEl.dom,s=sd.style;this.panel.setPosition(box.x,box.y);var sw=sd.offsetWidth;s.left=(box.x+box.width-sw)+"px";s.top=(box.y)+"px";s.height=Math.max(0,box.height)+"px";this.panel.setSize(box.width-sw,box.height)},east:function(box){if(this.isCollapsed){return this.applyLayoutCollapsed(box)}var sd=this.splitEl.dom,s=sd.style;var sw=sd.offsetWidth;this.panel.setPosition(box.x+sw,box.y);s.left=(box.x)+"px";s.top=(box.y)+"px";s.height=Math.max(0,box.height)+"px";this.panel.setSize(box.width-sw,box.height)},north:function(box){if(this.isCollapsed){return this.applyLayoutCollapsed(box)}var sd=this.splitEl.dom,s=sd.style;var sh=sd.offsetHeight;this.panel.setPosition(box.x,box.y);s.left=(box.x)+"px";s.top=(box.y+box.height-sh)+"px";s.width=Math.max(0,box.width)+"px";this.panel.setSize(box.width,box.height-sh)},south:function(box){if(this.isCollapsed){return this.applyLayoutCollapsed(box)}var sd=this.splitEl.dom,s=sd.style;var sh=sd.offsetHeight;this.panel.setPosition(box.x,box.y+sh);s.left=(box.x)+"px";s.top=(box.y)+"px";s.width=Math.max(0,box.width)+"px";this.panel.setSize(box.width,box.height-sh)}},render:function(ct,p){Ext.layout.BorderLayout.SplitRegion.superclass.render.call(this,ct,p);var ps=this.position;this.splitEl=ct.createChild({cls:"x-layout-split x-layout-split-"+ps,html:"&#160;",id:this.panel.id+"-xsplit"});if(this.collapseMode=="mini"){this.miniSplitEl=this.splitEl.createChild({cls:"x-layout-mini x-layout-mini-"+ps,html:"&#160;"});this.miniSplitEl.addClassOnOver("x-layout-mini-over");this.miniSplitEl.on("click",this.onCollapseClick,this,{stopEvent:true})}var s=this.splitSettings[ps];this.split=new Ext.SplitBar(this.splitEl.dom,p.el,s.orientation);this.split.placement=s.placement;this.split.getMaximumSize=this[s.maxFn].createDelegate(this);this.split.minSize=this.minSize||this[s.minProp];this.split.on("beforeapply",this.onSplitMove,this);this.split.useShim=this.useShim===true;this.maxSize=this.maxSize||this[s.maxProp];if(p.hidden){this.splitEl.hide()}if(this.useSplitTips){this.splitEl.dom.title=this.collapsible?this.collapsibleSplitTip:this.splitTip}if(this.collapsible){this.splitEl.on("dblclick",this.onCollapseClick,this)}},getSize:function(){if(this.isCollapsed){return this.collapsedEl.getSize()}var s=this.panel.getSize();if(this.position=="north"||this.position=="south"){s.height+=this.splitEl.dom.offsetHeight}else{s.width+=this.splitEl.dom.offsetWidth}return s},getHMaxSize:function(){var _53=this.maxSize||10000;var _54=this.layout.center;return Math.min(_53,(this.el.getWidth()+_54.el.getWidth())-_54.getMinWidth())},getVMaxSize:function(){var _55=this.maxSize||10000;var _56=this.layout.center;return Math.min(_55,(this.el.getHeight()+_56.el.getHeight())-_56.getMinHeight())},onSplitMove:function(_57,_58){var s=this.panel.getSize();this.lastSplitSize=_58;if(this.position=="north"||this.position=="south"){this.panel.setSize(s.width,_58);this.state.height=_58}else{this.panel.setSize(_58,s.height);this.state.width=_58}this.layout.layout();this.panel.saveState();return false},getSplitBar:function(){return this.split},destroy:function(){Ext.destroy(this.miniSplitEl,this.split,this.splitEl)}});Ext.Container.LAYOUTS.border=Ext.layout.BorderLayout;Ext.layout.FormLayout=Ext.extend(Ext.layout.AnchorLayout,{labelSeparator:":",getAnchorViewSize:function(ct,_2){return(ct.body||ct.el).getStyleSize()},setContainer:function(ct){Ext.layout.FormLayout.superclass.setContainer.call(this,ct);if(ct.labelAlign){ct.addClass("x-form-label-"+ct.labelAlign)}if(ct.hideLabels){this.labelStyle="display:none";this.elementStyle="padding-left:0;";this.labelAdjust=0}else{this.labelSeparator=ct.labelSeparator||this.labelSeparator;ct.labelWidth=ct.labelWidth||100;if(typeof ct.labelWidth=="number"){var _4=(typeof ct.labelPad=="number"?ct.labelPad:5);this.labelAdjust=ct.labelWidth+_4;this.labelStyle="width:"+ct.labelWidth+"px;";this.elementStyle="padding-left:"+(ct.labelWidth+_4)+"px"}if(ct.labelAlign=="top"){this.labelStyle="width:auto;";this.labelAdjust=0;this.elementStyle="padding-left:0;"}}if(!this.fieldTpl){var t=new Ext.Template('<div class="x-form-item {5}" tabIndex="-1">','<label for="{0}" style="{2}" class="x-form-item-label">{1}{4}</label>','<div class="x-form-element" id="x-form-el-{0}" style="{3}">','</div><div class="{6}"></div>',"</div>");t.disableFormats=true;t.compile();Ext.layout.FormLayout.prototype.fieldTpl=t}},getLabelStyle:function(s){var ls="",_8=[this.labelStyle,s];for(var i=0,_a=_8.length;i<_a;++i){if(_8[i]){ls+=_8[i];if(ls.substr(-1,1)!=";"){ls+=";"}}}return ls},renderItem:function(c,_c,_d){if(c&&!c.rendered&&c.isFormField&&c.inputType!="hidden"){var _e=[c.id,c.fieldLabel,this.getLabelStyle(c.labelStyle),this.elementStyle||"",typeof c.labelSeparator=="undefined"?this.labelSeparator:c.labelSeparator,(c.itemCls||this.container.itemCls||"")+(c.hideLabel?" x-hide-label":""),c.clearCls||"x-form-clear-left"];if(typeof _c=="number"){_c=_d.dom.childNodes[_c]||null}if(_c){this.fieldTpl.insertBefore(_c,_e)}else{this.fieldTpl.append(_d,_e)}c.render("x-form-el-"+c.id)}else{Ext.layout.FormLayout.superclass.renderItem.apply(this,arguments)}},adjustWidthAnchor:function(_f,_10){return _f-(_10.isFormField?(_10.hideLabel?0:this.labelAdjust):0)},isValidParent:function(c,_12){return true}});Ext.Container.LAYOUTS.form=Ext.layout.FormLayout;Ext.layout.Accordion=Ext.extend(Ext.layout.FitLayout,{fill:true,autoWidth:true,titleCollapse:true,hideCollapseTool:false,collapseFirst:false,animate:false,sequence:false,activeOnTop:false,setActiveItem:function(_1){_1=this.container.getComponent(_1);this.activeItem=_1;this.layout()},renderItem:function(c){if(this.animate===false){c.animCollapse=false}c.collapsible=true;if(this.autoWidth){c.autoWidth=true}if(this.titleCollapse){c.titleCollapse=true}if(this.hideCollapseTool){c.hideCollapseTool=true}if(this.collapseFirst!==undefined){c.collapseFirst=this.collapseFirst}if(!this.activeItem&&!c.collapsed){this.activeItem=c}else{if(this.activeItem&&this.activeItem!=c){c.collapsed=true}}Ext.layout.Accordion.superclass.renderItem.apply(this,arguments);c.header.addClass("x-accordion-hd");c.on("beforeexpand",this.beforeExpand,this)},beforeExpand:function(p,_4){var ai=this.activeItem;if(ai){if(this.sequence){delete this.activeItem;if(!ai.collapsed){ai.collapse({callback:function(){p.expand(_4||true)},scope:this});return false}}else{ai.collapse(this.animate)}}this.activeItem=p;if(this.activeOnTop){p.el.dom.parentNode.insertBefore(p.el.dom,p.el.dom.parentNode.firstChild)}this.layout()},setItemSize:function(_6,_7){if(this.fill&&_6){var _8=this.container.items.items;var hh=0;for(var i=0,_b=_8.length;i<_b;i++){var p=_8[i];if(p!=_6){hh+=(p.getSize().height-p.bwrap.getHeight())}}_7.height-=hh;_6.setSize(_7)}}});Ext.Container.LAYOUTS.accordion=Ext.layout.Accordion;Ext.layout.TableLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:false,setContainer:function(ct){Ext.layout.TableLayout.superclass.setContainer.call(this,ct);this.currentRow=0;this.currentColumn=0;this.cells=[]},onLayout:function(ct,_3){var cs=ct.items.items,_5=cs.length,c,i;if(!this.table){_3.addClass("x-table-layout-ct");this.table=_3.createChild({tag:"table",cls:"x-table-layout",cellspacing:0,cn:{tag:"tbody"}},null,true);this.renderAll(ct,_3)}},getRow:function(_8){var _9=this.table.tBodies[0].childNodes[_8];if(!_9){_9=document.createElement("tr");this.table.tBodies[0].appendChild(_9)}return _9},getNextCell:function(c){var _b=this.getNextNonSpan(this.currentColumn,this.currentRow);var _c=this.currentColumn=_b[0],_d=this.currentRow=_b[1];for(var _e=_d;_e<_d+(c.rowspan||1);_e++){if(!this.cells[_e]){this.cells[_e]=[]}for(var _f=_c;_f<_c+(c.colspan||1);_f++){this.cells[_e][_f]=true}}var td=document.createElement("td");if(c.cellId){td.id=c.cellId}var cls="x-table-layout-cell";if(c.cellCls){cls+=" "+c.cellCls}td.className=cls;if(c.colspan){td.colSpan=c.colspan}if(c.rowspan){td.rowSpan=c.rowspan}this.getRow(_d).appendChild(td);return td},getNextNonSpan:function(_12,_13){var _14=this.columns;
33
+ while((_14&&_12>=_14)||(this.cells[_13]&&this.cells[_13][_12])){if(_14&&_12>=_14){_13++;_12=0}else{_12++}}return[_12,_13]},renderItem:function(c,_16,_17){if(c&&!c.rendered){c.render(this.getNextCell(c));if(this.extraCls){var t=c.getPositionEl?c.getPositionEl():c;t.addClass(this.extraCls)}}},isValidParent:function(c,_1a){return true}});Ext.Container.LAYOUTS.table=Ext.layout.TableLayout;Ext.layout.AbsoluteLayout=Ext.extend(Ext.layout.AnchorLayout,{extraCls:"x-abs-layout-item",isForm:false,setContainer:function(ct){Ext.layout.AbsoluteLayout.superclass.setContainer.call(this,ct);if(ct.isXType("form")){this.isForm=true}},onLayout:function(ct,_3){if(this.isForm){ct.body.position()}else{_3.position()}Ext.layout.AbsoluteLayout.superclass.onLayout.call(this,ct,_3)},getAnchorViewSize:function(ct,_5){return this.isForm?ct.body.getStyleSize():Ext.layout.AbsoluteLayout.superclass.getAnchorViewSize.call(this,ct,_5)},isValidParent:function(c,_7){return this.isForm?true:Ext.layout.AbsoluteLayout.superclass.isValidParent.call(this,c,_7)},adjustWidthAnchor:function(_8,_9){return _8?_8-_9.getPosition(true)[0]:_8},adjustHeightAnchor:function(_a,_b){return _a?_a-_b.getPosition(true)[1]:_a}});Ext.Container.LAYOUTS.absolute=Ext.layout.AbsoluteLayout;Ext.Viewport=Ext.extend(Ext.Container,{initComponent:function(){Ext.Viewport.superclass.initComponent.call(this);document.getElementsByTagName("html")[0].className+=" x-viewport";this.el=Ext.getBody();this.el.setHeight=Ext.emptyFn;this.el.setWidth=Ext.emptyFn;this.el.setSize=Ext.emptyFn;this.el.dom.scroll="no";this.allowDomMove=false;this.autoWidth=true;this.autoHeight=true;Ext.EventManager.onWindowResize(this.fireResize,this);this.renderTo=this.el},fireResize:function(w,h){this.fireEvent("resize",this,w,h,w,h)}});Ext.reg("viewport",Ext.Viewport);Ext.Panel=Ext.extend(Ext.Container,{baseCls:"x-panel",collapsedCls:"x-panel-collapsed",maskDisabled:true,animCollapse:Ext.enableFx,headerAsText:true,buttonAlign:"right",collapsed:false,collapseFirst:true,minButtonWidth:75,elements:"body",toolTarget:"header",collapseEl:"bwrap",slideAnchor:"t",disabledClass:"",deferHeight:true,expandDefaults:{duration:0.25},collapseDefaults:{duration:0.25},initComponent:function(){Ext.Panel.superclass.initComponent.call(this);this.addEvents("bodyresize","titlechange","iconchange","collapse","expand","beforecollapse","beforeexpand","beforeclose","close","activate","deactivate");if(this.tbar){this.elements+=",tbar";if(typeof this.tbar=="object"){this.topToolbar=this.tbar}delete this.tbar}if(this.bbar){this.elements+=",bbar";if(typeof this.bbar=="object"){this.bottomToolbar=this.bbar}delete this.bbar}if(this.header===true){this.elements+=",header";delete this.header}else{if(this.title&&this.header!==false){this.elements+=",header"}}if(this.footer===true){this.elements+=",footer";delete this.footer}if(this.buttons){var _1=this.buttons;this.buttons=[];for(var i=0,_3=_1.length;i<_3;i++){if(_1[i].render){_1[i].ownerCt=this;this.buttons.push(_1[i])}else{this.addButton(_1[i])}}}if(this.autoLoad){this.on("render",this.doAutoLoad,this,{delay:10})}},createElement:function(_4,_5){if(this[_4]){_5.appendChild(this[_4].dom);return}if(_4==="bwrap"||this.elements.indexOf(_4)!=-1){if(this[_4+"Cfg"]){this[_4]=Ext.fly(_5).createChild(this[_4+"Cfg"])}else{var el=document.createElement("div");el.className=this[_4+"Cls"];this[_4]=Ext.get(_5.appendChild(el))}if(this[_4+"CssClass"]){this[_4].addClass(this[_4+"CssClass"])}if(this[_4+"Style"]){this[_4].applyStyles(this[_4+"Style"])}}},onRender:function(ct,_8){Ext.Panel.superclass.onRender.call(this,ct,_8);this.createClasses();if(this.el){this.el.addClass(this.baseCls);this.header=this.el.down("."+this.headerCls);this.bwrap=this.el.down("."+this.bwrapCls);var cp=this.bwrap?this.bwrap:this.el;this.tbar=cp.down("."+this.tbarCls);this.body=cp.down("."+this.bodyCls);this.bbar=cp.down("."+this.bbarCls);this.footer=cp.down("."+this.footerCls);this.fromMarkup=true}else{this.el=ct.createChild({id:this.id,cls:this.baseCls},_8)}var el=this.el,d=el.dom;if(this.cls){this.el.addClass(this.cls)}if(this.buttons){this.elements+=",footer"}if(this.frame){el.insertHtml("afterBegin",String.format(Ext.Element.boxMarkup,this.baseCls));this.createElement("header",d.firstChild.firstChild.firstChild);this.createElement("bwrap",d);var bw=this.bwrap.dom;var ml=d.childNodes[1],bl=d.childNodes[2];bw.appendChild(ml);bw.appendChild(bl);var mc=bw.firstChild.firstChild.firstChild;this.createElement("tbar",mc);this.createElement("body",mc);this.createElement("bbar",mc);this.createElement("footer",bw.lastChild.firstChild.firstChild);if(!this.footer){this.bwrap.dom.lastChild.className+=" x-panel-nofooter"}}else{this.createElement("header",d);this.createElement("bwrap",d);var bw=this.bwrap.dom;this.createElement("tbar",bw);this.createElement("body",bw);this.createElement("bbar",bw);this.createElement("footer",bw);if(!this.header){this.body.addClass(this.bodyCls+"-noheader");if(this.tbar){this.tbar.addClass(this.tbarCls+"-noheader")}}}if(this.border===false){this.el.addClass(this.baseCls+"-noborder");this.body.addClass(this.bodyCls+"-noborder");if(this.header){this.header.addClass(this.headerCls+"-noborder")}if(this.footer){this.footer.addClass(this.footerCls+"-noborder")}if(this.tbar){this.tbar.addClass(this.tbarCls+"-noborder")}if(this.bbar){this.bbar.addClass(this.bbarCls+"-noborder")}}if(this.bodyBorder===false){this.body.addClass(this.bodyCls+"-noborder")}this.bwrap.enableDisplayMode("block");if(this.header){this.header.unselectable();if(this.headerAsText){this.header.dom.innerHTML='<span class="'+this.headerTextCls+'">'+this.header.dom.innerHTML+"</span>";if(this.iconCls){this.setIconClass(this.iconCls)}}}if(this.floating){this.makeFloating(this.floating)}if(this.collapsible){this.tools=this.tools?this.tools.slice(0):[];if(!this.hideCollapseTool){this.tools[this.collapseFirst?"unshift":"push"]({id:"toggle",handler:this.toggleCollapse,scope:this})}if(this.titleCollapse&&this.header){this.header.on("click",this.toggleCollapse,this);this.header.setStyle("cursor","pointer")}}if(this.tools){var ts=this.tools;this.tools={};this.addTool.apply(this,ts)}else{this.tools={}}if(this.buttons&&this.buttons.length>0){var tb=this.footer.createChild({cls:"x-panel-btns-ct",cn:{cls:"x-panel-btns x-panel-btns-"+this.buttonAlign,html:'<table cellspacing="0"><tbody><tr></tr></tbody></table><div class="x-clear"></div>'}},null,true);var tr=tb.getElementsByTagName("tr")[0];for(var i=0,len=this.buttons.length;i<len;i++){var b=this.buttons[i];var td=document.createElement("td");td.className="x-panel-btn-td";b.render(tr.appendChild(td))}}if(this.tbar&&this.topToolbar){if(Ext.isArray(this.topToolbar)){this.topToolbar=new Ext.Toolbar(this.topToolbar)}this.topToolbar.render(this.tbar);this.topToolbar.ownerCt=this}if(this.bbar&&this.bottomToolbar){if(Ext.isArray(this.bottomToolbar)){this.bottomToolbar=new Ext.Toolbar(this.bottomToolbar)}this.bottomToolbar.render(this.bbar);this.bottomToolbar.ownerCt=this}},setIconClass:function(cls){var old=this.iconCls;this.iconCls=cls;if(this.rendered&&this.header){if(this.frame){this.header.addClass("x-panel-icon");this.header.replaceClass(old,this.iconCls)}else{var hd=this.header.dom;var img=hd.firstChild&&String(hd.firstChild.tagName).toLowerCase()=="img"?hd.firstChild:null;if(img){Ext.fly(img).replaceClass(old,this.iconCls)}else{Ext.DomHelper.insertBefore(hd.firstChild,{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-panel-inline-icon "+this.iconCls})}}}this.fireEvent("iconchange",this,cls,old)},makeFloating:function(cfg){this.floating=true;this.el=new Ext.Layer(typeof cfg=="object"?cfg:{shadow:this.shadow!==undefined?this.shadow:"sides",shadowOffset:this.shadowOffset,constrain:false,shim:this.shim===false?false:undefined},this.el)},getTopToolbar:function(){return this.topToolbar},getBottomToolbar:function(){return this.bottomToolbar},addButton:function(_1c,_1d,_1e){var bc={handler:_1d,scope:_1e,minWidth:this.minButtonWidth,hideParent:true};if(typeof _1c=="string"){bc.text=_1c
34
+ }else{Ext.apply(bc,_1c)}var btn=new Ext.Button(bc);btn.ownerCt=this;if(!this.buttons){this.buttons=[]}this.buttons.push(btn);return btn},addTool:function(){if(!this[this.toolTarget]){return}if(!this.toolTemplate){var tt=new Ext.Template('<div class="x-tool x-tool-{id}">&#160;</div>');tt.disableFormats=true;tt.compile();Ext.Panel.prototype.toolTemplate=tt}for(var i=0,a=arguments,len=a.length;i<len;i++){var tc=a[i];if(!this.tools[tc.id]){var _26="x-tool-"+tc.id+"-over";var t=this.toolTemplate.insertFirst((tc.align!=="left")?this[this.toolTarget]:this[this.toolTarget].child("span"),tc,true);this.tools[tc.id]=t;t.enableDisplayMode("block");t.on("click",this.createToolHandler(t,tc,_26,this));if(tc.on){t.on(tc.on)}if(tc.hidden){t.hide()}if(tc.qtip){if(typeof tc.qtip=="object"){Ext.QuickTips.register(Ext.apply({target:t.id},tc.qtip))}else{t.dom.qtip=tc.qtip}}t.addClassOnOver(_26)}}},onShow:function(){if(this.floating){return this.el.show()}Ext.Panel.superclass.onShow.call(this)},onHide:function(){if(this.floating){return this.el.hide()}Ext.Panel.superclass.onHide.call(this)},createToolHandler:function(t,tc,_2a,_2b){return function(e){t.removeClass(_2a);e.stopEvent();if(tc.handler){tc.handler.call(tc.scope||t,e,t,_2b)}}},afterRender:function(){if(this.fromMarkup&&this.height===undefined&&!this.autoHeight){this.height=this.el.getHeight()}if(this.floating&&!this.hidden&&!this.initHidden){this.el.show()}if(this.title){this.setTitle(this.title)}this.setAutoScroll();if(this.html){this.body.update(typeof this.html=="object"?Ext.DomHelper.markup(this.html):this.html);delete this.html}if(this.contentEl){var ce=Ext.getDom(this.contentEl);Ext.fly(ce).removeClass(["x-hidden","x-hide-display"]);this.body.dom.appendChild(ce)}if(this.collapsed){this.collapsed=false;this.collapse(false)}Ext.Panel.superclass.afterRender.call(this);this.initEvents()},setAutoScroll:function(){if(this.rendered&&this.autoScroll){var el=this.body||this.el;if(el){el.setOverflow("auto")}}},getKeyMap:function(){if(!this.keyMap){this.keyMap=new Ext.KeyMap(this.el,this.keys)}return this.keyMap},initEvents:function(){if(this.keys){this.getKeyMap()}if(this.draggable){this.initDraggable()}},initDraggable:function(){this.dd=new Ext.Panel.DD(this,typeof this.draggable=="boolean"?null:this.draggable)},beforeEffect:function(){if(this.floating){this.el.beforeAction()}this.el.addClass("x-panel-animated")},afterEffect:function(){this.syncShadow();this.el.removeClass("x-panel-animated")},createEffect:function(a,cb,_31){var o={scope:_31,block:true};if(a===true){o.callback=cb;return o}else{if(!a.callback){o.callback=cb}else{o.callback=function(){cb.call(_31);Ext.callback(a.callback,a.scope)}}}return Ext.applyIf(o,a)},collapse:function(_33){if(this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforecollapse",this,_33)===false){return}var _34=_33===true||(_33!==false&&this.animCollapse);this.beforeEffect();this.onCollapse(_34,_33);return this},onCollapse:function(_35,_36){if(_35){this[this.collapseEl].slideOut(this.slideAnchor,Ext.apply(this.createEffect(_36||true,this.afterCollapse,this),this.collapseDefaults))}else{this[this.collapseEl].hide();this.afterCollapse()}},afterCollapse:function(){this.collapsed=true;this.el.addClass(this.collapsedCls);this.afterEffect();this.fireEvent("collapse",this)},expand:function(_37){if(!this.collapsed||this.el.hasFxBlock()||this.fireEvent("beforeexpand",this,_37)===false){return}var _38=_37===true||(_37!==false&&this.animCollapse);this.el.removeClass(this.collapsedCls);this.beforeEffect();this.onExpand(_38,_37);return this},onExpand:function(_39,_3a){if(_39){this[this.collapseEl].slideIn(this.slideAnchor,Ext.apply(this.createEffect(_3a||true,this.afterExpand,this),this.expandDefaults))}else{this[this.collapseEl].show();this.afterExpand()}},afterExpand:function(){this.collapsed=false;this.afterEffect();this.fireEvent("expand",this)},toggleCollapse:function(_3b){this[this.collapsed?"expand":"collapse"](_3b);return this},onDisable:function(){if(this.rendered&&this.maskDisabled){this.el.mask()}Ext.Panel.superclass.onDisable.call(this)},onEnable:function(){if(this.rendered&&this.maskDisabled){this.el.unmask()}Ext.Panel.superclass.onEnable.call(this)},onResize:function(w,h){if(w!==undefined||h!==undefined){if(!this.collapsed){if(typeof w=="number"){this.body.setWidth(this.adjustBodyWidth(w-this.getFrameWidth()))}else{if(w=="auto"){this.body.setWidth(w)}}if(typeof h=="number"){this.body.setHeight(this.adjustBodyHeight(h-this.getFrameHeight()))}else{if(h=="auto"){this.body.setHeight(h)}}if(this.disabled&&this.el._mask){this.el._mask.setSize(this.el.dom.clientWidth,this.el.getHeight())}}else{this.queuedBodySize={width:w,height:h};if(!this.queuedExpand&&this.allowQueuedExpand!==false){this.queuedExpand=true;this.on("expand",function(){delete this.queuedExpand;this.onResize(this.queuedBodySize.width,this.queuedBodySize.height);this.doLayout()},this,{single:true})}}this.fireEvent("bodyresize",this,w,h)}this.syncShadow()},adjustBodyHeight:function(h){return h},adjustBodyWidth:function(w){return w},onPosition:function(){this.syncShadow()},getFrameWidth:function(){var w=this.el.getFrameWidth("lr");if(this.frame){var l=this.bwrap.dom.firstChild;w+=(Ext.fly(l).getFrameWidth("l")+Ext.fly(l.firstChild).getFrameWidth("r"));var mc=this.bwrap.dom.firstChild.firstChild.firstChild;w+=Ext.fly(mc).getFrameWidth("lr")}return w},getFrameHeight:function(){var h=this.el.getFrameWidth("tb");h+=(this.tbar?this.tbar.getHeight():0)+(this.bbar?this.bbar.getHeight():0);if(this.frame){var hd=this.el.dom.firstChild;var ft=this.bwrap.dom.lastChild;h+=(hd.offsetHeight+ft.offsetHeight);var mc=this.bwrap.dom.firstChild.firstChild.firstChild;h+=Ext.fly(mc).getFrameWidth("tb")}else{h+=(this.header?this.header.getHeight():0)+(this.footer?this.footer.getHeight():0)}return h},getInnerWidth:function(){return this.getSize().width-this.getFrameWidth()},getInnerHeight:function(){return this.getSize().height-this.getFrameHeight()},syncShadow:function(){if(this.floating){this.el.sync(true)}},getLayoutTarget:function(){return this.body},setTitle:function(_47,_48){this.title=_47;if(this.header&&this.headerAsText){this.header.child("span").update(_47)}if(_48){this.setIconClass(_48)}this.fireEvent("titlechange",this,_47);return this},getUpdater:function(){return this.body.getUpdater()},load:function(){var um=this.body.getUpdater();um.update.apply(um,arguments);return this},beforeDestroy:function(){if(this.header){this.header.removeAllListeners();if(this.headerAsText){Ext.Element.uncache(this.header.child("span"))}}Ext.Element.uncache(this.header,this.tbar,this.bbar,this.footer,this.body,this.bwrap);if(this.tools){for(var k in this.tools){Ext.destroy(this.tools[k])}}if(this.buttons){for(var b in this.buttons){Ext.destroy(this.buttons[b])}}Ext.destroy(this.topToolbar,this.bottomToolbar);Ext.Panel.superclass.beforeDestroy.call(this)},createClasses:function(){this.headerCls=this.baseCls+"-header";this.headerTextCls=this.baseCls+"-header-text";this.bwrapCls=this.baseCls+"-bwrap";this.tbarCls=this.baseCls+"-tbar";this.bodyCls=this.baseCls+"-body";this.bbarCls=this.baseCls+"-bbar";this.footerCls=this.baseCls+"-footer"},createGhost:function(cls,_4d,_4e){var el=document.createElement("div");el.className="x-panel-ghost "+(cls?cls:"");if(this.header){el.appendChild(this.el.dom.firstChild.cloneNode(true))}Ext.fly(el.appendChild(document.createElement("ul"))).setHeight(this.bwrap.getHeight());el.style.width=this.el.dom.offsetWidth+"px";if(!_4e){this.container.dom.appendChild(el)}else{Ext.getDom(_4e).appendChild(el)}if(_4d!==false&&this.el.useShim!==false){var _50=new Ext.Layer({shadow:false,useDisplay:true,constrain:false},el);_50.show();return _50}else{return new Ext.Element(el)}},doAutoLoad:function(){var u=this.body.getUpdater();if(this.renderer){u.setRenderer(this.renderer)}u.update(typeof this.autoLoad=="object"?this.autoLoad:{url:this.autoLoad})},getTool:function(id){return this.tools[id]}});Ext.reg("panel",Ext.Panel);Ext.Window=Ext.extend(Ext.Panel,{baseCls:"x-window",resizable:true,draggable:true,closable:true,constrain:false,constrainHeader:false,plain:false,minimizable:false,maximizable:false,minHeight:100,minWidth:200,expandOnShow:true,closeAction:"close",elements:"header,body",collapsible:false,initHidden:true,monitorResize:true,frame:true,floating:true,initComponent:function(){Ext.Window.superclass.initComponent.call(this);
35
+ this.addEvents("resize","maximize","minimize","restore")},getState:function(){return Ext.apply(Ext.Window.superclass.getState.call(this)||{},this.getBox())},onRender:function(ct,_2){Ext.Window.superclass.onRender.call(this,ct,_2);if(this.plain){this.el.addClass("x-window-plain")}this.focusEl=this.el.createChild({tag:"a",href:"#",cls:"x-dlg-focus",tabIndex:"-1",html:"&#160;"});this.focusEl.swallowEvent("click",true);this.proxy=this.el.createProxy("x-window-proxy");this.proxy.enableDisplayMode("block");if(this.modal){this.mask=this.container.createChild({cls:"ext-el-mask"},this.el.dom);this.mask.enableDisplayMode("block");this.mask.hide();this.mask.on("click",this.focus,this)}this.initTools()},initEvents:function(){Ext.Window.superclass.initEvents.call(this);if(this.animateTarget){this.setAnimateTarget(this.animateTarget)}if(this.resizable){this.resizer=new Ext.Resizable(this.el,{minWidth:this.minWidth,minHeight:this.minHeight,handles:this.resizeHandles||"all",pinned:true,resizeElement:this.resizerAction});this.resizer.window=this;this.resizer.on("beforeresize",this.beforeResize,this)}if(this.draggable){this.header.addClass("x-window-draggable")}this.el.on("mousedown",this.toFront,this);this.manager=this.manager||Ext.WindowMgr;this.manager.register(this);this.hidden=true;if(this.maximized){this.maximized=false;this.maximize()}if(this.closable){var km=this.getKeyMap();km.on(27,this.onEsc,this);km.disable()}},initDraggable:function(){this.dd=new Ext.Window.DD(this)},onEsc:function(){this[this.closeAction]()},beforeDestroy:function(){if(this.rendered){this.hide();if(this.doAnchor){Ext.EventManager.removeResizeListener(this.doAnchor,this);Ext.EventManager.un(window,"scroll",this.doAnchor,this)}Ext.destroy(this.focusEl,this.resizer,this.dd,this.proxy,this.mask)}Ext.Window.superclass.beforeDestroy.call(this)},onDestroy:function(){if(this.manager){this.manager.unregister(this)}Ext.Window.superclass.onDestroy.call(this)},initTools:function(){if(this.minimizable){this.addTool({id:"minimize",handler:this.minimize.createDelegate(this,[])})}if(this.maximizable){this.addTool({id:"maximize",handler:this.maximize.createDelegate(this,[])});this.addTool({id:"restore",handler:this.restore.createDelegate(this,[]),hidden:true});this.header.on("dblclick",this.toggleMaximize,this)}if(this.closable){this.addTool({id:"close",handler:this[this.closeAction].createDelegate(this,[])})}},resizerAction:function(){var _4=this.proxy.getBox();this.proxy.hide();this.window.handleResize(_4);return _4},beforeResize:function(){this.resizer.minHeight=Math.max(this.minHeight,this.getFrameHeight()+40);this.resizer.minWidth=Math.max(this.minWidth,this.getFrameWidth()+40);this.resizeBox=this.el.getBox()},updateHandles:function(){if(Ext.isIE&&this.resizer){this.resizer.syncHandleHeight();this.el.repaint()}},handleResize:function(_5){var rz=this.resizeBox;if(rz.x!=_5.x||rz.y!=_5.y){this.updateBox(_5)}else{this.setSize(_5)}this.focus();this.updateHandles();this.saveState();if(this.layout){this.doLayout()}this.fireEvent("resize",this,_5.width,_5.height)},focus:function(){var f=this.focusEl,db=this.defaultButton,t=typeof db;if(t!="undefined"){if(t=="number"){f=this.buttons[db]}else{if(t=="string"){f=Ext.getCmp(db)}else{f=db}}}f.focus.defer(10,f)},setAnimateTarget:function(el){el=Ext.get(el);this.animateTarget=el},beforeShow:function(){delete this.el.lastXY;delete this.el.lastLT;if(this.x===undefined||this.y===undefined){var xy=this.el.getAlignToXY(this.container,"c-c");var _c=this.el.translatePoints(xy[0],xy[1]);this.x=this.x===undefined?_c.left:this.x;this.y=this.y===undefined?_c.top:this.y}this.el.setLeftTop(this.x,this.y);if(this.expandOnShow){this.expand(false)}if(this.modal){Ext.getBody().addClass("x-body-masked");this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.mask.show()}},show:function(_d,cb,_f){if(!this.rendered){this.render(Ext.getBody())}if(this.hidden===false){this.toFront();return}if(this.fireEvent("beforeshow",this)===false){return}if(cb){this.on("show",cb,_f,{single:true})}this.hidden=false;if(_d!==undefined){this.setAnimateTarget(_d)}this.beforeShow();if(this.animateTarget){this.animShow()}else{this.afterShow()}},afterShow:function(){this.proxy.hide();this.el.setStyle("display","block");this.el.show();if(this.maximized){this.fitContainer()}if(Ext.isMac&&Ext.isGecko){this.cascade(this.setAutoScroll)}if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.onWindowResize(this.onWindowResize,this)}this.doConstrain();if(this.layout){this.doLayout()}if(this.keyMap){this.keyMap.enable()}this.toFront();this.updateHandles();this.fireEvent("show",this)},animShow:function(){this.proxy.show();this.proxy.setBox(this.animateTarget.getBox());this.proxy.setOpacity(0);var b=this.getBox(false);b.callback=this.afterShow;b.scope=this;b.duration=0.25;b.easing="easeNone";b.opacity=0.5;b.block=true;this.el.setStyle("display","none");this.proxy.shift(b)},hide:function(_11,cb,_13){if(this.activeGhost){this.hide.defer(100,this,[_11,cb,_13]);return}if(this.hidden||this.fireEvent("beforehide",this)===false){return}if(cb){this.on("hide",cb,_13,{single:true})}this.hidden=true;if(_11!==undefined){this.setAnimateTarget(_11)}if(this.animateTarget){this.animHide()}else{this.el.hide();this.afterHide()}},afterHide:function(){this.proxy.hide();if(this.monitorResize||this.modal||this.constrain||this.constrainHeader){Ext.EventManager.removeResizeListener(this.onWindowResize,this)}if(this.modal){this.mask.hide();Ext.getBody().removeClass("x-body-masked")}if(this.keyMap){this.keyMap.disable()}this.fireEvent("hide",this)},animHide:function(){this.proxy.setOpacity(0.5);this.proxy.show();var tb=this.getBox(false);this.proxy.setBox(tb);this.el.hide();var b=this.animateTarget.getBox();b.callback=this.afterHide;b.scope=this;b.duration=0.25;b.easing="easeNone";b.block=true;b.opacity=0;this.proxy.shift(b)},onWindowResize:function(){if(this.maximized){this.fitContainer()}if(this.modal){this.mask.setSize("100%","100%");var _16=this.mask.dom.offsetHeight;this.mask.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true))}this.doConstrain()},doConstrain:function(){if(this.constrain||this.constrainHeader){var _17;if(this.constrain){_17={right:this.el.shadowOffset,left:this.el.shadowOffset,bottom:this.el.shadowOffset}}else{var s=this.getSize();_17={right:-(s.width-100),bottom:-(s.height-25)}}var xy=this.el.getConstrainToXY(this.container,true,_17);if(xy){this.setPosition(xy[0],xy[1])}}},ghost:function(cls){var _1b=this.createGhost(cls);var box=this.getBox(true);_1b.setLeftTop(box.x,box.y);_1b.setWidth(box.width);this.el.hide();this.activeGhost=_1b;return _1b},unghost:function(_1d,_1e){if(_1d!==false){this.el.show();this.focus();if(Ext.isMac&&Ext.isGecko){this.cascade(this.setAutoScroll)}}if(_1e!==false){this.setPosition(this.activeGhost.getLeft(true),this.activeGhost.getTop(true))}this.activeGhost.hide();this.activeGhost.remove();delete this.activeGhost},minimize:function(){this.fireEvent("minimize",this)},close:function(){if(this.fireEvent("beforeclose",this)!==false){this.hide(null,function(){this.fireEvent("close",this);this.destroy()},this)}},maximize:function(){if(!this.maximized){this.expand(false);this.restoreSize=this.getSize();this.restorePos=this.getPosition(true);if(this.maximizable){this.tools.maximize.hide();this.tools.restore.show()}this.maximized=true;this.el.disableShadow();if(this.dd){this.dd.lock()}if(this.collapsible){this.tools.toggle.hide()}this.el.addClass("x-window-maximized");this.container.addClass("x-window-maximized-ct");this.setPosition(0,0);this.fitContainer();this.fireEvent("maximize",this)}},restore:function(){if(this.maximized){this.el.removeClass("x-window-maximized");this.tools.restore.hide();this.tools.maximize.show();this.setPosition(this.restorePos[0],this.restorePos[1]);this.setSize(this.restoreSize.width,this.restoreSize.height);delete this.restorePos;delete this.restoreSize;this.maximized=false;this.el.enableShadow(true);
36
+ if(this.dd){this.dd.unlock()}if(this.collapsible){this.tools.toggle.show()}this.container.removeClass("x-window-maximized-ct");this.doConstrain();this.fireEvent("restore",this)}},toggleMaximize:function(){this[this.maximized?"restore":"maximize"]()},fitContainer:function(){var vs=this.container.getViewSize();this.setSize(vs.width,vs.height)},setZIndex:function(_20){if(this.modal){this.mask.setStyle("z-index",_20)}this.el.setZIndex(++_20);_20+=5;if(this.resizer){this.resizer.proxy.setStyle("z-index",++_20)}this.lastZIndex=_20},alignTo:function(_21,_22,_23){var xy=this.el.getAlignToXY(_21,_22,_23);this.setPagePosition(xy[0],xy[1]);return this},anchorTo:function(el,_26,_27,_28){if(this.doAnchor){Ext.EventManager.removeResizeListener(this.doAnchor,this);Ext.EventManager.un(window,"scroll",this.doAnchor,this)}this.doAnchor=function(){this.alignTo(el,_26,_27)};Ext.EventManager.onWindowResize(this.doAnchor,this);var tm=typeof _28;if(tm!="undefined"){Ext.EventManager.on(window,"scroll",this.doAnchor,this,{buffer:tm=="number"?_28:50})}this.doAnchor();return this},toFront:function(e){if(this.manager.bringToFront(this)){if(!e||!e.getTarget().focus){this.focus()}}return this},setActive:function(_2b){if(_2b){if(!this.maximized){this.el.enableShadow(true)}this.fireEvent("activate",this)}else{this.el.disableShadow();this.fireEvent("deactivate",this)}},toBack:function(){this.manager.sendToBack(this);return this},center:function(){var xy=this.el.getAlignToXY(this.container,"c-c");this.setPagePosition(xy[0],xy[1]);return this}});Ext.reg("window",Ext.Window);Ext.Window.DD=function(win){this.win=win;Ext.Window.DD.superclass.constructor.call(this,win.el.id,"WindowDD-"+win.id);this.setHandleElId(win.header.id);this.scroll=false};Ext.extend(Ext.Window.DD,Ext.dd.DD,{moveOnly:true,headerOffsets:[100,25],startDrag:function(){var w=this.win;this.proxy=w.ghost();if(w.constrain!==false){var so=w.el.shadowOffset;this.constrainTo(w.container,{right:so,left:so,bottom:so})}else{if(w.constrainHeader!==false){var s=this.proxy.getSize();this.constrainTo(w.container,{right:-(s.width-this.headerOffsets[0]),bottom:-(s.height-this.headerOffsets[1])})}}},b4Drag:Ext.emptyFn,onDrag:function(e){this.alignElWithMouse(this.proxy,e.getPageX(),e.getPageY())},endDrag:function(e){this.win.unghost();this.win.saveState()}});Ext.WindowGroup=function(){var _1={};var _2=[];var _3=null;var _4=function(d1,d2){return(!d1._lastAccess||d1._lastAccess<d2._lastAccess)?-1:1};var _7=function(){var a=_2,_9=a.length;if(_9>0){a.sort(_4);var _a=a[0].manager.zseed;for(var i=0;i<_9;i++){var _c=a[i];if(_c&&!_c.hidden){_c.setZIndex(_a+(i*10))}}}_d()};var _e=function(_f){if(_f!=_3){if(_3){_3.setActive(false)}_3=_f;if(_f){_f.setActive(true)}}};var _d=function(){for(var i=_2.length-1;i>=0;--i){if(!_2[i].hidden){_e(_2[i]);return}}_e(null)};return{zseed:9000,register:function(win){_1[win.id]=win;_2.push(win);win.on("hide",_d)},unregister:function(win){delete _1[win.id];win.un("hide",_d);_2.remove(win)},get:function(id){return typeof id=="object"?id:_1[id]},bringToFront:function(win){win=this.get(win);if(win!=_3){win._lastAccess=new Date().getTime();_7();return true}return false},sendToBack:function(win){win=this.get(win);win._lastAccess=-(new Date().getTime());_7();return win},hideAll:function(){for(var id in _1){if(_1[id]&&typeof _1[id]!="function"&&_1[id].isVisible()){_1[id].hide()}}},getActive:function(){return _3},getBy:function(fn,_18){var r=[];for(var i=_2.length-1;i>=0;--i){var win=_2[i];if(fn.call(_18||win,win)!==false){r.push(win)}}return r},each:function(fn,_1d){for(var id in _1){if(_1[id]&&typeof _1[id]!="function"){if(fn.call(_1d||_1[id],_1[id])===false){return}}}}}};Ext.WindowMgr=new Ext.WindowGroup();Ext.dd.PanelProxy=function(_1,_2){this.panel=_1;this.id=this.panel.id+"-ddproxy";Ext.apply(this,_2)};Ext.dd.PanelProxy.prototype={insertProxy:true,setStatus:Ext.emptyFn,reset:Ext.emptyFn,update:Ext.emptyFn,stop:Ext.emptyFn,sync:Ext.emptyFn,getEl:function(){return this.ghost},getGhost:function(){return this.ghost},getProxy:function(){return this.proxy},hide:function(){if(this.ghost){if(this.proxy){this.proxy.remove();delete this.proxy}this.panel.el.dom.style.display="";this.ghost.remove();delete this.ghost}},show:function(){if(!this.ghost){this.ghost=this.panel.createGhost(undefined,undefined,Ext.getBody());this.ghost.setXY(this.panel.el.getXY());if(this.insertProxy){this.proxy=this.panel.el.insertSibling({cls:"x-panel-dd-spacer"});this.proxy.setSize(this.panel.getSize())}this.panel.el.dom.style.display="none"}},repair:function(xy,_4,_5){this.hide();if(typeof _4=="function"){_4.call(_5||this)}},moveProxy:function(_6,_7){if(this.proxy){_6.insertBefore(this.proxy.dom,_7)}}};Ext.Panel.DD=function(_8,_9){this.panel=_8;this.dragData={panel:_8};this.proxy=new Ext.dd.PanelProxy(_8,_9);Ext.Panel.DD.superclass.constructor.call(this,_8.el,_9);var h=_8.header;if(h){this.setHandleElId(h.id)}(h?h:this.panel.body).setStyle("cursor","move");this.scroll=false};Ext.extend(Ext.Panel.DD,Ext.dd.DragSource,{showFrame:Ext.emptyFn,startDrag:Ext.emptyFn,b4StartDrag:function(x,y){this.proxy.show()},b4MouseDown:function(e){var x=e.getPageX();var y=e.getPageY();this.autoOffset(x,y)},onInitDrag:function(x,y){this.onStartDrag(x,y);return true},createFrame:Ext.emptyFn,getDragEl:function(e){return this.proxy.ghost.dom},endDrag:function(e){this.proxy.hide();this.panel.saveState()},autoOffset:function(x,y){x-=this.startPageX;y-=this.startPageY;this.setDelta(x,y)}});Ext.state.Provider=function(){this.addEvents("statechange");this.state={};Ext.state.Provider.superclass.constructor.call(this)};Ext.extend(Ext.state.Provider,Ext.util.Observable,{get:function(_1,_2){return typeof this.state[_1]=="undefined"?_2:this.state[_1]},clear:function(_3){delete this.state[_3];this.fireEvent("statechange",this,_3,null)},set:function(_4,_5){this.state[_4]=_5;this.fireEvent("statechange",this,_4,_5)},decodeValue:function(_6){var re=/^(a|n|d|b|s|o)\:(.*)$/;var _8=re.exec(unescape(_6));if(!_8||!_8[1]){return}var _9=_8[1];var v=_8[2];switch(_9){case"n":return parseFloat(v);case"d":return new Date(Date.parse(v));case"b":return(v=="1");case"a":var _b=[];var _c=v.split("^");for(var i=0,_e=_c.length;i<_e;i++){_b.push(this.decodeValue(_c[i]))}return _b;case"o":var _b={};var _c=v.split("^");for(var i=0,_e=_c.length;i<_e;i++){var kv=_c[i].split("=");_b[kv[0]]=this.decodeValue(kv[1])}return _b;default:return v}},encodeValue:function(v){var enc;if(typeof v=="number"){enc="n:"+v}else{if(typeof v=="boolean"){enc="b:"+(v?"1":"0")}else{if(Ext.isDate(v)){enc="d:"+v.toGMTString()}else{if(Ext.isArray(v)){var _12="";for(var i=0,len=v.length;i<len;i++){_12+=this.encodeValue(v[i]);if(i!=len-1){_12+="^"}}enc="a:"+_12}else{if(typeof v=="object"){var _12="";for(var key in v){if(typeof v[key]!="function"&&v[key]!==undefined){_12+=key+"="+this.encodeValue(v[key])+"^"}}enc="o:"+_12.substring(0,_12.length-1)}else{enc="s:"+v}}}}}return escape(enc)}});Ext.state.Manager=function(){var _1=new Ext.state.Provider();return{setProvider:function(_2){_1=_2},get:function(_3,_4){return _1.get(_3,_4)},set:function(_5,_6){_1.set(_5,_6)},clear:function(_7){_1.clear(_7)},getProvider:function(){return _1}}}();Ext.state.CookieProvider=function(_1){Ext.state.CookieProvider.superclass.constructor.call(this);this.path="/";this.expires=new Date(new Date().getTime()+(1000*60*60*24*7));this.domain=null;this.secure=false;Ext.apply(this,_1);this.state=this.readCookies()};Ext.extend(Ext.state.CookieProvider,Ext.state.Provider,{set:function(_2,_3){if(typeof _3=="undefined"||_3===null){this.clear(_2);return}this.setCookie(_2,_3);Ext.state.CookieProvider.superclass.set.call(this,_2,_3)},clear:function(_4){this.clearCookie(_4);Ext.state.CookieProvider.superclass.clear.call(this,_4)},readCookies:function(){var _5={};var c=document.cookie+";";var re=/\s?(.*?)=(.*?);/g;var _8;while((_8=re.exec(c))!=null){var _9=_8[1];var _a=_8[2];if(_9&&_9.substring(0,3)=="ys-"){_5[_9.substr(3)]=this.decodeValue(_a)}}return _5},setCookie:function(_b,_c){document.cookie="ys-"+_b+"="+this.encodeValue(_c)+((this.expires==null)?"":("; expires="+this.expires.toGMTString()))+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")
37
+ },clearCookie:function(_d){document.cookie="ys-"+_d+"=null; expires=Thu, 01-Jan-70 00:00:01 GMT"+((this.path==null)?"":("; path="+this.path))+((this.domain==null)?"":("; domain="+this.domain))+((this.secure==true)?"; secure":"")}});Ext.DataView=Ext.extend(Ext.BoxComponent,{selectedClass:"x-view-selected",emptyText:"",deferEmptyText:true,trackOver:false,last:false,initComponent:function(){Ext.DataView.superclass.initComponent.call(this);if(typeof this.tpl=="string"||Ext.isArray(this.tpl)){this.tpl=new Ext.XTemplate(this.tpl)}this.addEvents("beforeclick","click","mouseenter","mouseleave","containerclick","dblclick","contextmenu","selectionchange","beforeselect");this.all=new Ext.CompositeElementLite();this.selected=new Ext.CompositeElementLite()},onRender:function(){if(!this.el){this.el=document.createElement("div");this.el.id=this.id}Ext.DataView.superclass.onRender.apply(this,arguments)},afterRender:function(){Ext.DataView.superclass.afterRender.call(this);this.el.on({click:this.onClick,dblclick:this.onDblClick,contextmenu:this.onContextMenu,scope:this});if(this.overClass||this.trackOver){this.el.on({mouseover:this.onMouseOver,mouseout:this.onMouseOut,scope:this})}if(this.store){this.setStore(this.store,true)}},refresh:function(){this.clearSelections(false,true);this.el.update("");var _1=this.store.getRange();if(_1.length<1){if(!this.deferEmptyText||this.hasSkippedEmptyText){this.el.update(this.emptyText)}this.all.clear();return}else{this.tpl.overwrite(this.el,this.collectData(_1,0));this.all.fill(Ext.query(this.itemSelector,this.el.dom));this.updateIndexes(0)}this.hasSkippedEmptyText=true},prepareData:function(_2){return _2},collectData:function(_3,_4){var r=[];for(var i=0,_7=_3.length;i<_7;i++){r[r.length]=this.prepareData(_3[i].data,_4+i,_3[i])}return r},bufferRender:function(_8){var _9=document.createElement("div");this.tpl.overwrite(_9,this.collectData(_8));return Ext.query(this.itemSelector,_9)},onUpdate:function(ds,_b){var _c=this.store.indexOf(_b);var _d=this.isSelected(_c);var _e=this.all.elements[_c];var _f=this.bufferRender([_b],_c)[0];this.all.replaceElement(_c,_f,true);if(_d){this.selected.replaceElement(_e,_f);this.all.item(_c).addClass(this.selectedClass)}this.updateIndexes(_c,_c)},onAdd:function(ds,_11,_12){if(this.all.getCount()==0){this.refresh();return}var _13=this.bufferRender(_11,_12),n,a=this.all.elements;if(_12<this.all.getCount()){n=this.all.item(_12).insertSibling(_13,"before",true);a.splice.apply(a,[_12,0].concat(_13))}else{n=this.all.last().insertSibling(_13,"after",true);a.push.apply(a,_13)}this.updateIndexes(_12)},onRemove:function(ds,_17,_18){this.deselect(_18);this.all.removeElement(_18,true);this.updateIndexes(_18);if(this.store.getCount()==0){this.refresh()}},refreshNode:function(_19){this.onUpdate(this.store,this.store.getAt(_19))},updateIndexes:function(_1a,_1b){var ns=this.all.elements;_1a=_1a||0;_1b=_1b||((_1b===0)?0:(ns.length-1));for(var i=_1a;i<=_1b;i++){ns[i].viewIndex=i}},getStore:function(){return this.store},setStore:function(_1e,_1f){if(!_1f&&this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("datachanged",this.refresh,this);this.store.un("add",this.onAdd,this);this.store.un("remove",this.onRemove,this);this.store.un("update",this.onUpdate,this);this.store.un("clear",this.refresh,this)}if(_1e){_1e=Ext.StoreMgr.lookup(_1e);_1e.on("beforeload",this.onBeforeLoad,this);_1e.on("datachanged",this.refresh,this);_1e.on("add",this.onAdd,this);_1e.on("remove",this.onRemove,this);_1e.on("update",this.onUpdate,this);_1e.on("clear",this.refresh,this)}this.store=_1e;if(_1e){this.refresh()}},findItemFromChild:function(_20){return Ext.fly(_20).findParent(this.itemSelector,this.el)},onClick:function(e){var _22=e.getTarget(this.itemSelector,this.el);if(_22){var _23=this.indexOf(_22);if(this.onItemClick(_22,_23,e)!==false){this.fireEvent("click",this,_23,_22,e)}}else{if(this.fireEvent("containerclick",this,e)!==false){this.clearSelections()}}},onContextMenu:function(e){var _25=e.getTarget(this.itemSelector,this.el);if(_25){this.fireEvent("contextmenu",this,this.indexOf(_25),_25,e)}},onDblClick:function(e){var _27=e.getTarget(this.itemSelector,this.el);if(_27){this.fireEvent("dblclick",this,this.indexOf(_27),_27,e)}},onMouseOver:function(e){var _29=e.getTarget(this.itemSelector,this.el);if(_29&&_29!==this.lastItem){this.lastItem=_29;Ext.fly(_29).addClass(this.overClass);this.fireEvent("mouseenter",this,this.indexOf(_29),_29,e)}},onMouseOut:function(e){if(this.lastItem){if(!e.within(this.lastItem,true,true)){Ext.fly(this.lastItem).removeClass(this.overClass);this.fireEvent("mouseleave",this,this.indexOf(this.lastItem),this.lastItem,e);delete this.lastItem}}},onItemClick:function(_2b,_2c,e){if(this.fireEvent("beforeclick",this,_2c,_2b,e)===false){return false}if(this.multiSelect){this.doMultiSelection(_2b,_2c,e);e.preventDefault()}else{if(this.singleSelect){this.doSingleSelection(_2b,_2c,e);e.preventDefault()}}return true},doSingleSelection:function(_2e,_2f,e){if(e.ctrlKey&&this.isSelected(_2f)){this.deselect(_2f)}else{this.select(_2f,false)}},doMultiSelection:function(_31,_32,e){if(e.shiftKey&&this.last!==false){var _34=this.last;this.selectRange(_34,_32,e.ctrlKey);this.last=_34}else{if((e.ctrlKey||this.simpleSelect)&&this.isSelected(_32)){this.deselect(_32)}else{this.select(_32,e.ctrlKey||e.shiftKey||this.simpleSelect)}}},getSelectionCount:function(){return this.selected.getCount()},getSelectedNodes:function(){return this.selected.elements},getSelectedIndexes:function(){var _35=[],s=this.selected.elements;for(var i=0,len=s.length;i<len;i++){_35.push(s[i].viewIndex)}return _35},getSelectedRecords:function(){var r=[],s=this.selected.elements;for(var i=0,len=s.length;i<len;i++){r[r.length]=this.store.getAt(s[i].viewIndex)}return r},getRecords:function(_3d){var r=[],s=_3d;for(var i=0,len=s.length;i<len;i++){r[r.length]=this.store.getAt(s[i].viewIndex)}return r},getRecord:function(_42){return this.store.getAt(_42.viewIndex)},clearSelections:function(_43,_44){if((this.multiSelect||this.singleSelect)&&this.selected.getCount()>0){if(!_44){this.selected.removeClass(this.selectedClass)}this.selected.clear();this.last=false;if(!_43){this.fireEvent("selectionchange",this,this.selected.elements)}}},isSelected:function(_45){return this.selected.contains(this.getNode(_45))},deselect:function(_46){if(this.isSelected(_46)){_46=this.getNode(_46);this.selected.removeElement(_46);if(this.last==_46.viewIndex){this.last=false}Ext.fly(_46).removeClass(this.selectedClass);this.fireEvent("selectionchange",this,this.selected.elements)}},select:function(_47,_48,_49){if(Ext.isArray(_47)){if(!_48){this.clearSelections(true)}for(var i=0,len=_47.length;i<len;i++){this.select(_47[i],true,true)}if(!_49){this.fireEvent("selectionchange",this,this.selected.elements)}}else{var _4c=this.getNode(_47);if(!_48){this.clearSelections(true)}if(_4c&&!this.isSelected(_4c)){if(this.fireEvent("beforeselect",this,_4c,this.selected.elements)!==false){Ext.fly(_4c).addClass(this.selectedClass);this.selected.add(_4c);this.last=_4c.viewIndex;if(!_49){this.fireEvent("selectionchange",this,this.selected.elements)}}}}},selectRange:function(_4d,end,_4f){if(!_4f){this.clearSelections(true)}this.select(this.getNodes(_4d,end),true)},getNode:function(_50){if(typeof _50=="string"){return document.getElementById(_50)}else{if(typeof _50=="number"){return this.all.elements[_50]}}return _50},getNodes:function(_51,end){var ns=this.all.elements;_51=_51||0;end=typeof end=="undefined"?Math.max(ns.length-1,0):end;var _54=[],i;if(_51<=end){for(i=_51;i<=end&&ns[i];i++){_54.push(ns[i])}}else{for(i=_51;i>=end&&ns[i];i--){_54.push(ns[i])}}return _54},indexOf:function(_56){_56=this.getNode(_56);if(typeof _56.viewIndex=="number"){return _56.viewIndex}return this.all.indexOf(_56)},onBeforeLoad:function(){if(this.loadingText){this.clearSelections(false,true);this.el.update('<div class="loading-indicator">'+this.loadingText+"</div>");this.all.clear()}},onDestroy:function(){Ext.DataView.superclass.onDestroy.call(this);
38
+ this.setStore(null)}});Ext.reg("dataview",Ext.DataView);Ext.ColorPalette=function(_1){Ext.ColorPalette.superclass.constructor.call(this,_1);this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope,true)}};Ext.extend(Ext.ColorPalette,Ext.Component,{itemCls:"x-color-palette",value:null,clickEvent:"click",ctype:"Ext.ColorPalette",allowReselect:false,colors:["000000","993300","333300","003300","003366","000080","333399","333333","800000","FF6600","808000","008000","008080","0000FF","666699","808080","FF0000","FF9900","99CC00","339966","33CCCC","3366FF","800080","969696","FF00FF","FFCC00","FFFF00","00FF00","00FFFF","00CCFF","993366","C0C0C0","FF99CC","FFCC99","FFFF99","CCFFCC","CCFFFF","99CCFF","CC99FF","FFFFFF"],onRender:function(_2,_3){var t=this.tpl||new Ext.XTemplate('<tpl for="."><a href="#" class="color-{.}" hidefocus="on"><em><span style="background:#{.}" unselectable="on">&#160;</span></em></a></tpl>');var el=document.createElement("div");el.id=this.getId();el.className=this.itemCls;t.overwrite(el,this.colors);_2.dom.insertBefore(el,_3);this.el=Ext.get(el);this.el.on(this.clickEvent,this.handleClick,this,{delegate:"a"});if(this.clickEvent!="click"){this.el.on("click",Ext.emptyFn,this,{delegate:"a",preventDefault:true})}},afterRender:function(){Ext.ColorPalette.superclass.afterRender.call(this);if(this.value){var s=this.value;this.value=null;this.select(s)}},handleClick:function(e,t){e.preventDefault();if(!this.disabled){var c=t.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];this.select(c.toUpperCase())}},select:function(_a){_a=_a.replace("#","");if(_a!=this.value||this.allowReselect){var el=this.el;if(this.value){el.child("a.color-"+this.value).removeClass("x-color-palette-sel")}el.child("a.color-"+_a).addClass("x-color-palette-sel");this.value=_a;this.fireEvent("select",this,_a)}}});Ext.reg("colorpalette",Ext.ColorPalette);Ext.DatePicker=Ext.extend(Ext.Component,{todayText:"Today",okText:"&#160;OK&#160;",cancelText:"Cancel",todayTip:"{0} (Spacebar)",minText:"This date is before the minimum date",maxText:"This date is after the maximum date",format:"m/d/y",disabledDaysText:"Disabled",disabledDatesText:"Disabled",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:"Next Month (Control+Right)",prevText:"Previous Month (Control+Left)",monthYearText:"Choose a month (Control+Up/Down to move years)",startDay:0,showToday:true,initComponent:function(){Ext.DatePicker.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime():new Date().clearTime();this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope||this)}this.initDisabledDays()},initDisabledDays:function(){if(!this.disabledDatesRE&&this.disabledDates){var dd=this.disabledDates;var re="(?:";for(var i=0;i<dd.length;i++){re+=dd[i];if(i!=dd.length-1){re+="|"}}this.disabledDatesRE=new RegExp(re+")")}},setDisabledDates:function(dd){if(Ext.isArray(dd)){this.disabledDates=dd;this.disabledDatesRE=null}else{this.disabledDatesRE=dd}this.initDisabledDays();this.update(this.value,true)},setDisabledDays:function(dd){this.disabledDays=dd;this.update(this.value,true)},setMinDate:function(dt){this.minDate=dt;this.update(this.value,true)},setMaxDate:function(dt){this.maxDate=dt;this.update(this.value,true)},setValue:function(_8){var _9=this.value;this.value=_8.clearTime(true);if(this.el){this.update(this.value)}},getValue:function(){return this.value},focus:function(){if(this.el){this.update(this.activeDate)}},onRender:function(_a,_b){var m=['<table cellspacing="0">','<tr><td class="x-date-left"><a href="#" title="',this.prevText,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="',this.nextText,'">&#160;</a></td></tr>','<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'];var dn=this.dayNames;for(var i=0;i<7;i++){var d=this.startDay+i;if(d>6){d=d-7}m.push("<th><span>",dn[d].substr(0,1),"</span></th>")}m[m.length]="</tr></thead><tbody><tr>";for(var i=0;i<42;i++){if(i%7==0&&i!=0){m[m.length]="</tr><tr>"}m[m.length]='<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>'}m.push("</tr></tbody></table></td></tr>",this.showToday?'<tr><td colspan="3" class="x-date-bottom" align="center"></td></tr>':"",'</table><div class="x-date-mp"></div>');var el=document.createElement("div");el.className="x-date-picker";el.innerHTML=m.join("");_a.dom.insertBefore(el,_b);this.el=Ext.get(el);this.eventEl=Ext.get(el.firstChild);this.leftClickRpt=new Ext.util.ClickRepeater(this.el.child("td.x-date-left a"),{handler:this.showPrevMonth,scope:this,preventDefault:true,stopDefault:true});this.rightClickRpt=new Ext.util.ClickRepeater(this.el.child("td.x-date-right a"),{handler:this.showNextMonth,scope:this,preventDefault:true,stopDefault:true});this.eventEl.on("mousewheel",this.handleMouseWheel,this);this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");var kn=new Ext.KeyNav(this.eventEl,{left:function(e){e.ctrlKey?this.showPrevMonth():this.update(this.activeDate.add("d",-1))},right:function(e){e.ctrlKey?this.showNextMonth():this.update(this.activeDate.add("d",1))},up:function(e){e.ctrlKey?this.showNextYear():this.update(this.activeDate.add("d",-7))},down:function(e){e.ctrlKey?this.showPrevYear():this.update(this.activeDate.add("d",7))},pageUp:function(e){this.showNextMonth()},pageDown:function(e){this.showPrevMonth()},enter:function(e){e.stopPropagation();return true},scope:this});this.eventEl.on("click",this.handleDateClick,this,{delegate:"a.x-date-date"});this.el.unselectable();this.cells=this.el.select("table.x-date-inner tbody td");this.textNodes=this.el.query("table.x-date-inner tbody span");this.mbtn=new Ext.Button({text:"&#160;",tooltip:this.monthYearText,renderTo:this.el.child("td.x-date-middle",true)});this.mbtn.on("click",this.showMonthPicker,this);this.mbtn.el.child(this.mbtn.menuClassTarget).addClass("x-btn-with-menu");if(this.showToday){this.todayKeyListener=this.eventEl.addKeyListener(Ext.EventObject.SPACE,this.selectToday,this);var _19=(new Date()).dateFormat(this.format);this.todayBtn=new Ext.Button({renderTo:this.el.child("td.x-date-bottom",true),text:String.format(this.todayText,_19),tooltip:String.format(this.todayTip,_19),handler:this.selectToday,scope:this})}if(Ext.isIE){this.el.repaint()}this.update(this.value)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var buf=['<table border="0" cellspacing="0">'];for(var i=0;i<6;i++){buf.push('<tr><td class="x-date-mp-month"><a href="#">',this.monthNames[i].substr(0,3),"</a></td>",'<td class="x-date-mp-month x-date-mp-sep"><a href="#">',this.monthNames[i+6].substr(0,3),"</a></td>",i==0?'<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>':'<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>')}buf.push('<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',this.okText,'</button><button type="button" class="x-date-mp-cancel">',this.cancelText,"</button></td></tr>","</table>");this.monthPicker.update(buf.join(""));this.monthPicker.on("click",this.onMonthClick,this);this.monthPicker.on("dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(m,a,i){i+=1;if((i%2)==0){m.dom.xmonth=5+Math.round(i*0.5)}else{m.dom.xmonth=Math.round((i-1)*0.5)}})}},showMonthPicker:function(){this.createMonthPicker();var _1f=this.el.getSize();this.monthPicker.setSize(_1f);this.monthPicker.child("table").setSize(_1f);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.slideIn("t",{duration:0.2})
39
+ },updateMPYear:function(y){this.mpyear=y;var ys=this.mpYears.elements;for(var i=1;i<=10;i++){var td=ys[i-1],y2;if((i%2)==0){y2=y+Math.round(i*0.5);td.firstChild.innerHTML=y2;td.xyear=y2}else{y2=y-(5-Math.round(i*0.5));td.firstChild.innerHTML=y2;td.xyear=y2}this.mpYears.item(i-1)[y2==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(sm){this.mpMonths.each(function(m,a,i){m[m.dom.xmonth==sm?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(m){},onMonthClick:function(e,t){e.stopEvent();var el=new Ext.Element(t),pn;if(el.is("button.x-date-mp-cancel")){this.hideMonthPicker()}else{if(el.is("button.x-date-mp-ok")){var d=new Date(this.mpSelYear,this.mpSelMonth,(this.activeDate||this.value).getDate());if(d.getMonth()!=this.mpSelMonth){d=new Date(this.mpSelYear,this.mpSelMonth,1).getLastDateOfMonth()}this.update(d);this.hideMonthPicker()}else{if(pn=el.up("td.x-date-mp-month",2)){this.mpMonths.removeClass("x-date-mp-sel");pn.addClass("x-date-mp-sel");this.mpSelMonth=pn.dom.xmonth}else{if(pn=el.up("td.x-date-mp-year",2)){this.mpYears.removeClass("x-date-mp-sel");pn.addClass("x-date-mp-sel");this.mpSelYear=pn.dom.xyear}else{if(el.is("a.x-date-mp-prev")){this.updateMPYear(this.mpyear-10)}else{if(el.is("a.x-date-mp-next")){this.updateMPYear(this.mpyear+10)}}}}}}},onMonthDblClick:function(e,t){e.stopEvent();var el=new Ext.Element(t),pn;if(pn=el.up("td.x-date-mp-month",2)){this.update(new Date(this.mpSelYear,pn.dom.xmonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}else{if(pn=el.up("td.x-date-mp-year",2)){this.update(new Date(pn.dom.xyear,this.mpSelMonth,(this.activeDate||this.value).getDate()));this.hideMonthPicker()}}},hideMonthPicker:function(_33){if(this.monthPicker){if(_33===true){this.monthPicker.hide()}else{this.monthPicker.slideOut("t",{duration:0.2})}}},showPrevMonth:function(e){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(e){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},handleMouseWheel:function(e){var _37=e.getWheelDelta();if(_37>0){this.showPrevMonth();e.stopEvent()}else{if(_37<0){this.showNextMonth();e.stopEvent()}}},handleDateClick:function(e,t){e.stopEvent();if(t.dateValue&&!Ext.fly(t.parentNode).hasClass("x-date-disabled")){this.setValue(new Date(t.dateValue));this.fireEvent("select",this,this.value)}},selectToday:function(){if(this.todayBtn&&!this.todayBtn.disabled){this.setValue(new Date().clearTime());this.fireEvent("select",this,this.value)}},update:function(_3a,_3b){var vd=this.activeDate;this.activeDate=_3a;if(!_3b&&vd&&this.el){var t=_3a.getTime();if(vd.getMonth()==_3a.getMonth()&&vd.getFullYear()==_3a.getFullYear()){this.cells.removeClass("x-date-selected");this.cells.each(function(c){if(c.dom.firstChild.dateValue==t){c.addClass("x-date-selected");setTimeout(function(){try{c.dom.firstChild.focus()}catch(e){}},50);return false}});return}}var _3f=_3a.getDaysInMonth();var _40=_3a.getFirstDateOfMonth();var _41=_40.getDay()-this.startDay;if(_41<=this.startDay){_41+=7}var pm=_3a.add("mo",-1);var _43=pm.getDaysInMonth()-_41;var _44=this.cells.elements;var _45=this.textNodes;_3f+=_41;var day=86400000;var d=(new Date(pm.getFullYear(),pm.getMonth(),_43)).clearTime();var _48=new Date().clearTime().getTime();var sel=_3a.clearTime().getTime();var min=this.minDate?this.minDate.clearTime():Number.NEGATIVE_INFINITY;var max=this.maxDate?this.maxDate.clearTime():Number.POSITIVE_INFINITY;var _4c=this.disabledDatesRE;var _4d=this.disabledDatesText;var _4e=this.disabledDays?this.disabledDays.join(""):false;var _4f=this.disabledDaysText;var _50=this.format;if(this.showToday){var td=new Date().clearTime();var _52=(td<min||td>max||(_4c&&_50&&_4c.test(td.dateFormat(_50)))||(_4e&&_4e.indexOf(td.getDay())!=-1));this.todayBtn.setDisabled(_52);this.todayKeyListener[_52?"disable":"enable"]()}var _53=function(cal,_55){_55.title="";var t=d.getTime();_55.firstChild.dateValue=t;if(t==_48){_55.className+=" x-date-today";_55.title=cal.todayText}if(t==sel){_55.className+=" x-date-selected";setTimeout(function(){try{_55.firstChild.focus()}catch(e){}},50)}if(t<min){_55.className=" x-date-disabled";_55.title=cal.minText;return}if(t>max){_55.className=" x-date-disabled";_55.title=cal.maxText;return}if(_4e){if(_4e.indexOf(d.getDay())!=-1){_55.title=_4f;_55.className=" x-date-disabled"}}if(_4c&&_50){var _57=d.dateFormat(_50);if(_4c.test(_57)){_55.title=_4d.replace("%0",_57);_55.className=" x-date-disabled"}}};var i=0;for(;i<_41;i++){_45[i].innerHTML=(++_43);d.setDate(d.getDate()+1);_44[i].className="x-date-prevday";_53(this,_44[i])}for(;i<_3f;i++){var _59=i-_41+1;_45[i].innerHTML=(_59);d.setDate(d.getDate()+1);_44[i].className="x-date-active";_53(this,_44[i])}var _5a=0;for(;i<42;i++){_45[i].innerHTML=(++_5a);d.setDate(d.getDate()+1);_44[i].className="x-date-nextday";_53(this,_44[i])}this.mbtn.setText(this.monthNames[_3a.getMonth()]+" "+_3a.getFullYear());if(!this.internalRender){var _5b=this.el.dom.firstChild;var w=_5b.offsetWidth;this.el.setWidth(w+this.el.getBorderWidth("lr"));Ext.fly(_5b).setWidth(w);this.internalRender=true;if(Ext.isOpera&&!this.secondPass){_5b.rows[0].cells[1].style.width=(w-(_5b.rows[0].cells[0].offsetWidth+_5b.rows[0].cells[2].offsetWidth))+"px";this.secondPass=true;this.update.defer(10,this,[_3a])}}},beforeDestroy:function(){if(this.rendered){Ext.destroy(this.leftClickRpt,this.rightClickRpt,this.monthPicker,this.eventEl,this.mbtn,this.todayBtn)}}});Ext.reg("datepicker",Ext.DatePicker);Ext.TabPanel=Ext.extend(Ext.Panel,{monitorResize:true,deferredRender:true,tabWidth:120,minTabWidth:30,resizeTabs:false,enableTabScroll:false,scrollIncrement:0,scrollRepeatInterval:400,scrollDuration:0.35,animScroll:true,tabPosition:"top",baseCls:"x-tab-panel",autoTabs:false,autoTabSelector:"div.x-tab",activeTab:null,tabMargin:2,plain:false,wheelIncrement:20,idDelimiter:"__",itemCls:"x-tab-item",elements:"body",headerAsText:false,frame:false,hideBorders:true,initComponent:function(){this.frame=false;Ext.TabPanel.superclass.initComponent.call(this);this.addEvents("beforetabchange","tabchange","contextmenu");this.setLayout(new Ext.layout.CardLayout({deferredRender:this.deferredRender}));if(this.tabPosition=="top"){this.elements+=",header";this.stripTarget="header"}else{this.elements+=",footer";this.stripTarget="footer"}if(!this.stack){this.stack=Ext.TabPanel.AccessStack()}this.initItems()},render:function(){Ext.TabPanel.superclass.render.apply(this,arguments);if(this.activeTab!==undefined){var _1=this.activeTab;delete this.activeTab;this.setActiveTab(_1)}},onRender:function(ct,_3){Ext.TabPanel.superclass.onRender.call(this,ct,_3);if(this.plain){var _4=this.tabPosition=="top"?"header":"footer";this[_4].addClass("x-tab-panel-"+_4+"-plain")}var st=this[this.stripTarget];this.stripWrap=st.createChild({cls:"x-tab-strip-wrap",cn:{tag:"ul",cls:"x-tab-strip x-tab-strip-"+this.tabPosition}});var _6=(this.tabPosition=="bottom"?this.stripWrap:null);this.stripSpacer=st.createChild({cls:"x-tab-strip-spacer"},_6);this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.edge=this.strip.createChild({tag:"li",cls:"x-tab-edge"});this.strip.createChild({cls:"x-clear"});this.body.addClass("x-tab-panel-body-"+this.tabPosition);if(!this.itemTpl){var tt=new Ext.Template('<li class="{cls}" id="{id}"><a class="x-tab-strip-close" onclick="return false;"></a>','<a class="x-tab-right" href="#" onclick="return false;"><em class="x-tab-left">','<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',"</em></a></li>");tt.disableFormats=true;tt.compile();Ext.TabPanel.prototype.itemTpl=tt}this.items.each(this.initTab,this)},afterRender:function(){Ext.TabPanel.superclass.afterRender.call(this);if(this.autoTabs){this.readTabs(false)}},initEvents:function(){Ext.TabPanel.superclass.initEvents.call(this);this.on("add",this.onAdd,this);this.on("remove",this.onRemove,this);
40
+ this.strip.on("mousedown",this.onStripMouseDown,this);this.strip.on("contextmenu",this.onStripContextMenu,this);if(this.enableTabScroll){this.strip.on("mousewheel",this.onWheel,this)}},findTargets:function(e){var _9=null;var _a=e.getTarget("li",this.strip);if(_a){_9=this.getComponent(_a.id.split(this.idDelimiter)[1]);if(_9.disabled){return{close:null,item:null,el:null}}}return{close:e.getTarget(".x-tab-strip-close",this.strip),item:_9,el:_a}},onStripMouseDown:function(e){if(e.button!=0){return}e.preventDefault();var t=this.findTargets(e);if(t.close){this.remove(t.item);return}if(t.item&&t.item!=this.activeTab){this.setActiveTab(t.item)}},onStripContextMenu:function(e){e.preventDefault();var t=this.findTargets(e);if(t.item){this.fireEvent("contextmenu",this,t.item,e)}},readTabs:function(_f){if(_f===true){this.items.each(function(_10){this.remove(_10)},this)}var _11=this.el.query(this.autoTabSelector);for(var i=0,len=_11.length;i<len;i++){var tab=_11[i];var _15=tab.getAttribute("title");tab.removeAttribute("title");this.add({title:_15,contentEl:tab})}},initTab:function(_16,_17){var _18=this.strip.dom.childNodes[_17];var cls=_16.closable?"x-tab-strip-closable":"";if(_16.disabled){cls+=" x-item-disabled"}if(_16.iconCls){cls+=" x-tab-with-icon"}if(_16.tabCls){cls+=" "+_16.tabCls}var p={id:this.id+this.idDelimiter+_16.getItemId(),text:_16.title,cls:cls,iconCls:_16.iconCls||""};var el=_18?this.itemTpl.insertBefore(_18,p):this.itemTpl.append(this.strip,p);Ext.fly(el).addClassOnOver("x-tab-strip-over");if(_16.tabTip){Ext.fly(el).child("span.x-tab-strip-text",true).qtip=_16.tabTip}_16.tabEl=el;_16.on("disable",this.onItemDisabled,this);_16.on("enable",this.onItemEnabled,this);_16.on("titlechange",this.onItemTitleChanged,this);_16.on("iconchange",this.onItemIconChanged,this);_16.on("beforeshow",this.onBeforeShowItem,this)},onAdd:function(tp,_1d,_1e){this.initTab(_1d,_1e);if(this.items.getCount()==1){this.syncSize()}this.delegateUpdates()},onBeforeAdd:function(_1f){var _20=_1f.events?(this.items.containsKey(_1f.getItemId())?_1f:null):this.items.get(_1f);if(_20){this.setActiveTab(_1f);return false}Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var es=_1f.elements;_1f.elements=es?es.replace(",header",""):es;_1f.border=(_1f.border===true)},onRemove:function(tp,_23){Ext.destroy(Ext.get(this.getTabEl(_23)));this.stack.remove(_23);_23.un("disable",this.onItemDisabled,this);_23.un("enable",this.onItemEnabled,this);_23.un("titlechange",this.onItemTitleChanged,this);_23.un("iconchange",this.onItemIconChanged,this);_23.un("beforeshow",this.onBeforeShowItem,this);if(_23==this.activeTab){var _24=this.stack.next();if(_24){this.setActiveTab(_24)}else{if(this.items.getCount()>0){this.setActiveTab(0)}else{this.activeTab=null}}}this.delegateUpdates()},onBeforeShowItem:function(_25){if(_25!=this.activeTab){this.setActiveTab(_25);return false}},onItemDisabled:function(_26){var el=this.getTabEl(_26);if(el){Ext.fly(el).addClass("x-item-disabled")}this.stack.remove(_26)},onItemEnabled:function(_28){var el=this.getTabEl(_28);if(el){Ext.fly(el).removeClass("x-item-disabled")}},onItemTitleChanged:function(_2a){var el=this.getTabEl(_2a);if(el){Ext.fly(el).child("span.x-tab-strip-text",true).innerHTML=_2a.title}},onItemIconChanged:function(_2c,_2d,_2e){var el=this.getTabEl(_2c);if(el){Ext.fly(el).child("span.x-tab-strip-text").replaceClass(_2e,_2d)}},getTabEl:function(_30){var _31=(typeof _30==="number")?this.items.items[_30].getItemId():_30.getItemId();return document.getElementById(this.id+this.idDelimiter+_31)},onResize:function(){Ext.TabPanel.superclass.onResize.apply(this,arguments);this.delegateUpdates()},beginUpdate:function(){this.suspendUpdates=true},endUpdate:function(){this.suspendUpdates=false;this.delegateUpdates()},hideTabStripItem:function(_32){_32=this.getComponent(_32);var el=this.getTabEl(_32);if(el){el.style.display="none";this.delegateUpdates()}this.stack.remove(_32)},unhideTabStripItem:function(_34){_34=this.getComponent(_34);var el=this.getTabEl(_34);if(el){el.style.display="";this.delegateUpdates()}},delegateUpdates:function(){if(this.suspendUpdates){return}if(this.resizeTabs&&this.rendered){this.autoSizeTabs()}if(this.enableTabScroll&&this.rendered){this.autoScrollTabs()}},autoSizeTabs:function(){var _36=this.items.length;var ce=this.tabPosition!="bottom"?"header":"footer";var ow=this[ce].dom.offsetWidth;var aw=this[ce].dom.clientWidth;if(!this.resizeTabs||_36<1||!aw){return}var _3a=Math.max(Math.min(Math.floor((aw-4)/_36)-this.tabMargin,this.tabWidth),this.minTabWidth);this.lastTabWidth=_3a;var lis=this.stripWrap.dom.getElementsByTagName("li");for(var i=0,len=lis.length-1;i<len;i++){var li=lis[i];var _3f=li.childNodes[1].firstChild.firstChild;var tw=li.offsetWidth;var iw=_3f.offsetWidth;_3f.style.width=(_3a-(tw-iw))+"px"}},adjustBodyWidth:function(w){if(this.header){this.header.setWidth(w)}if(this.footer){this.footer.setWidth(w)}return w},setActiveTab:function(_43){_43=this.getComponent(_43);if(!_43||this.fireEvent("beforetabchange",this,_43,this.activeTab)===false){return}if(!this.rendered){this.activeTab=_43;return}if(this.activeTab!=_43){if(this.activeTab){var _44=this.getTabEl(this.activeTab);if(_44){Ext.fly(_44).removeClass("x-tab-strip-active")}this.activeTab.fireEvent("deactivate",this.activeTab)}var el=this.getTabEl(_43);Ext.fly(el).addClass("x-tab-strip-active");this.activeTab=_43;this.stack.add(_43);this.layout.setActiveItem(_43);if(this.layoutOnTabChange&&_43.doLayout){_43.doLayout()}if(this.scrolling){this.scrollToTab(_43,this.animScroll)}_43.fireEvent("activate",_43);this.fireEvent("tabchange",this,_43)}},getActiveTab:function(){return this.activeTab||null},getItem:function(_46){return this.getComponent(_46)},autoScrollTabs:function(){this.pos=this.tabPosition=="bottom"?this.footer:this.header;var _47=this.items.length;var ow=this.pos.dom.offsetWidth;var tw=this.pos.dom.clientWidth;var _4a=this.stripWrap;var wd=_4a.dom;var cw=wd.offsetWidth;var pos=this.getScrollPos();var l=this.edge.getOffsetsTo(this.stripWrap)[0]+pos;if(!this.enableTabScroll||_47<1||cw<20){return}if(l<=tw){wd.scrollLeft=0;_4a.setWidth(tw);if(this.scrolling){this.scrolling=false;this.pos.removeClass("x-tab-scrolling");this.scrollLeft.hide();this.scrollRight.hide();if(Ext.isAir||Ext.isSafari){wd.style.marginLeft="";wd.style.marginRight=""}}}else{if(!this.scrolling){this.pos.addClass("x-tab-scrolling");if(Ext.isAir||Ext.isSafari){wd.style.marginLeft="18px";wd.style.marginRight="18px"}}tw-=_4a.getMargins("lr");_4a.setWidth(tw>20?tw:20);if(!this.scrolling){if(!this.scrollLeft){this.createScrollers()}else{this.scrollLeft.show();this.scrollRight.show()}}this.scrolling=true;if(pos>(l-tw)){wd.scrollLeft=l-tw}else{this.scrollToTab(this.activeTab,false)}this.updateScrollButtons()}},createScrollers:function(){this.pos.addClass("x-tab-scrolling-"+this.tabPosition);var h=this.stripWrap.dom.offsetHeight;var sl=this.pos.insertFirst({cls:"x-tab-scroller-left"});sl.setHeight(h);sl.addClassOnOver("x-tab-scroller-left-over");this.leftRepeater=new Ext.util.ClickRepeater(sl,{interval:this.scrollRepeatInterval,handler:this.onScrollLeft,scope:this});this.scrollLeft=sl;var sr=this.pos.insertFirst({cls:"x-tab-scroller-right"});sr.setHeight(h);sr.addClassOnOver("x-tab-scroller-right-over");this.rightRepeater=new Ext.util.ClickRepeater(sr,{interval:this.scrollRepeatInterval,handler:this.onScrollRight,scope:this});this.scrollRight=sr},getScrollWidth:function(){return this.edge.getOffsetsTo(this.stripWrap)[0]+this.getScrollPos()},getScrollPos:function(){return parseInt(this.stripWrap.dom.scrollLeft,10)||0},getScrollArea:function(){return parseInt(this.stripWrap.dom.clientWidth,10)||0},getScrollAnim:function(){return{duration:this.scrollDuration,callback:this.updateScrollButtons,scope:this}},getScrollIncrement:function(){return this.scrollIncrement||(this.resizeTabs?this.lastTabWidth+2:100)},scrollToTab:function(_52,_53){if(!_52){return}var el=this.getTabEl(_52);var pos=this.getScrollPos(),_56=this.getScrollArea();
41
+ var _57=Ext.fly(el).getOffsetsTo(this.stripWrap)[0]+pos;var _58=_57+el.offsetWidth;if(_57<pos){this.scrollTo(_57,_53)}else{if(_58>(pos+_56)){this.scrollTo(_58-_56,_53)}}},scrollTo:function(pos,_5a){this.stripWrap.scrollTo("left",pos,_5a?this.getScrollAnim():false);if(!_5a){this.updateScrollButtons()}},onWheel:function(e){var d=e.getWheelDelta()*this.wheelIncrement*-1;e.stopEvent();var pos=this.getScrollPos();var _5e=pos+d;var sw=this.getScrollWidth()-this.getScrollArea();var s=Math.max(0,Math.min(sw,_5e));if(s!=pos){this.scrollTo(s,false)}},onScrollRight:function(){var sw=this.getScrollWidth()-this.getScrollArea();var pos=this.getScrollPos();var s=Math.min(sw,pos+this.getScrollIncrement());if(s!=pos){this.scrollTo(s,this.animScroll)}},onScrollLeft:function(){var pos=this.getScrollPos();var s=Math.max(0,pos-this.getScrollIncrement());if(s!=pos){this.scrollTo(s,this.animScroll)}},updateScrollButtons:function(){var pos=this.getScrollPos();this.scrollLeft[pos==0?"addClass":"removeClass"]("x-tab-scroller-left-disabled");this.scrollRight[pos>=(this.getScrollWidth()-this.getScrollArea())?"addClass":"removeClass"]("x-tab-scroller-right-disabled")},beforeDestroy:function(){if(this.items){this.items.each(function(_67){if(_67&&_67.tabEl){Ext.get(_67.tabEl).removeAllListeners();_67.tabEl=null}},this)}if(this.strip){this.strip.removeAllListeners()}Ext.TabPanel.superclass.beforeDestroy.apply(this)}});Ext.reg("tabpanel",Ext.TabPanel);Ext.TabPanel.prototype.activate=Ext.TabPanel.prototype.setActiveTab;Ext.TabPanel.AccessStack=function(){var _68=[];return{add:function(_69){_68.push(_69);if(_68.length>10){_68.shift()}},remove:function(_6a){var s=[];for(var i=0,len=_68.length;i<len;i++){if(_68[i]!=_6a){s.push(_68[i])}}_68=s},next:function(){return _68.pop()}}};Ext.Button=Ext.extend(Ext.Component,{hidden:false,disabled:false,pressed:false,enableToggle:false,menuAlign:"tl-bl?",type:"button",menuClassTarget:"tr",clickEvent:"click",handleMouseEvents:true,tooltipType:"qtip",buttonSelector:"button:first-child",initComponent:function(){Ext.Button.superclass.initComponent.call(this);this.addEvents("click","toggle","mouseover","mouseout","menushow","menuhide","menutriggerover","menutriggerout");if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu)}if(typeof this.toggleGroup==="string"){this.enableToggle=true}},onRender:function(ct,_2){if(!this.template){if(!Ext.Button.buttonTemplate){Ext.Button.buttonTemplate=new Ext.Template('<table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap"><tbody><tr>','<td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><em unselectable="on"><button class="x-btn-text" type="{1}">{0}</button></em></td><td class="x-btn-right"><i>&#160;</i></td>',"</tr></tbody></table>")}this.template=Ext.Button.buttonTemplate}var _3,_4=[this.text||"&#160;",this.type];if(_2){_3=this.template.insertBefore(_2,_4,true)}else{_3=this.template.append(ct,_4,true)}var _5=this.btnEl=_3.child(this.buttonSelector);_5.on("focus",this.onFocus,this);_5.on("blur",this.onBlur,this);this.initButtonEl(_3,_5);if(this.menu){this.el.child(this.menuClassTarget).addClass("x-btn-with-menu")}Ext.ButtonToggleMgr.register(this)},initButtonEl:function(_6,_7){this.el=_6;_6.addClass("x-btn");if(this.id){this.el.dom.id=this.el.id=this.id}if(this.icon){_7.setStyle("background-image","url("+this.icon+")")}if(this.iconCls){_7.addClass(this.iconCls);if(!this.cls){_6.addClass(this.text?"x-btn-text-icon":"x-btn-icon")}}if(this.tabIndex!==undefined){_7.dom.tabIndex=this.tabIndex}if(this.tooltip){if(typeof this.tooltip=="object"){Ext.QuickTips.register(Ext.apply({target:_7.id},this.tooltip))}else{_7.dom[this.tooltipType]=this.tooltip}}if(this.pressed){this.el.addClass("x-btn-pressed")}if(this.handleMouseEvents){_6.on("mouseover",this.onMouseOver,this);_6.on("mousedown",this.onMouseDown,this)}if(this.menu){this.menu.on("show",this.onMenuShow,this);this.menu.on("hide",this.onMenuHide,this)}if(this.repeat){var _8=new Ext.util.ClickRepeater(_6,typeof this.repeat=="object"?this.repeat:{});_8.on("click",this.onClick,this)}_6.on(this.clickEvent,this.onClick,this)},afterRender:function(){Ext.Button.superclass.afterRender.call(this);if(Ext.isIE6){this.autoWidth.defer(1,this)}else{this.autoWidth()}},setIconClass:function(_9){if(this.el){this.btnEl.replaceClass(this.iconCls,_9)}this.iconCls=_9},beforeDestroy:function(){if(this.rendered){if(this.btnEl){if(typeof this.tooltip=="object"){Ext.QuickTips.unregister(this.btnEl)}Ext.destroy(this.btnEl)}}Ext.destroy(this.menu)},onDestroy:function(){if(this.rendered){Ext.ButtonToggleMgr.unregister(this)}},autoWidth:function(){if(this.el){this.el.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var ib=this.btnEl;if(ib&&ib.getWidth()>20){ib.clip();ib.setWidth(Ext.util.TextMetrics.measure(ib,this.text).width+ib.getFrameWidth("lr"))}}if(this.minWidth){if(this.el.getWidth()<this.minWidth){this.el.setWidth(this.minWidth)}}}},setHandler:function(_b,_c){this.handler=_b;this.scope=_c},setText:function(_d){this.text=_d;if(this.el){this.el.child("td.x-btn-center "+this.buttonSelector).update(_d)}this.autoWidth()},getText:function(){return this.text},toggle:function(_e,_f){_e=_e===undefined?!this.pressed:!!_e;if(_e!=this.pressed){this.el[_e?"addClass":"removeClass"]("x-btn-pressed");this.pressed=_e;if(!_f){this.fireEvent("toggle",this,_e);if(this.toggleHandler){this.toggleHandler.call(this.scope||this,this,_e)}}}},focus:function(){this.btnEl.focus()},onDisable:function(){if(this.el){if(!Ext.isIE6||!this.text){this.el.addClass(this.disabledClass)}this.el.dom.disabled=true}this.disabled=true},onEnable:function(){if(this.el){if(!Ext.isIE6||!this.text){this.el.removeClass(this.disabledClass)}this.el.dom.disabled=false}this.disabled=false},showMenu:function(){if(this.menu){this.menu.show(this.el,this.menuAlign)}return this},hideMenu:function(){if(this.menu){this.menu.hide()}return this},hasVisibleMenu:function(){return this.menu&&this.menu.isVisible()},onClick:function(e){if(e){e.preventDefault()}if(e.button!=0){return}if(!this.disabled){if(this.enableToggle&&(this.allowDepress!==false||!this.pressed)){this.toggle()}if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("click",this,e);if(this.handler){this.handler.call(this.scope||this,this,e)}}},isMenuTriggerOver:function(e,_12){return this.menu&&!_12},isMenuTriggerOut:function(e,_14){return this.menu&&!_14},onMouseOver:function(e){if(!this.disabled){var _16=e.within(this.el,true);if(!_16){this.el.addClass("x-btn-over");if(!this.monitoringMouseOver){Ext.getDoc().on("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=true}this.fireEvent("mouseover",this,e)}if(this.isMenuTriggerOver(e,_16)){this.fireEvent("menutriggerover",this,this.menu,e)}}},monitorMouseOver:function(e){if(e.target!=this.el.dom&&!e.within(this.el)){if(this.monitoringMouseOver){Ext.getDoc().un("mouseover",this.monitorMouseOver,this);this.monitoringMouseOver=false}this.onMouseOut(e)}},onMouseOut:function(e){var _19=e.within(this.el)&&e.target!=this.el.dom;this.el.removeClass("x-btn-over");this.fireEvent("mouseout",this,e);if(this.isMenuTriggerOut(e,_19)){this.fireEvent("menutriggerout",this,this.menu,e)}},onFocus:function(e){if(!this.disabled){this.el.addClass("x-btn-focus")}},onBlur:function(e){this.el.removeClass("x-btn-focus")},getClickEl:function(e,_1d){return this.el},onMouseDown:function(e){if(!this.disabled&&e.button==0){this.getClickEl(e).addClass("x-btn-click");Ext.getDoc().on("mouseup",this.onMouseUp,this)}},onMouseUp:function(e){if(e.button==0){this.getClickEl(e,true).removeClass("x-btn-click");Ext.getDoc().un("mouseup",this.onMouseUp,this)}},onMenuShow:function(e){this.ignoreNextClick=0;this.el.addClass("x-btn-menu-active");this.fireEvent("menushow",this,this.menu)},onMenuHide:function(e){this.el.removeClass("x-btn-menu-active");this.ignoreNextClick=this.restoreClick.defer(250,this);this.fireEvent("menuhide",this,this.menu)},restoreClick:function(){this.ignoreNextClick=0}});Ext.reg("button",Ext.Button);
42
+ Ext.ButtonToggleMgr=function(){var _22={};function toggleGroup(btn,_24){if(_24){var g=_22[btn.toggleGroup];for(var i=0,l=g.length;i<l;i++){if(g[i]!=btn){g[i].toggle(false)}}}}return{register:function(btn){if(!btn.toggleGroup){return}var g=_22[btn.toggleGroup];if(!g){g=_22[btn.toggleGroup]=[]}g.push(btn);btn.on("toggle",toggleGroup)},unregister:function(btn){if(!btn.toggleGroup){return}var g=_22[btn.toggleGroup];if(g){g.remove(btn);btn.un("toggle",toggleGroup)}}}}();Ext.SplitButton=Ext.extend(Ext.Button,{arrowSelector:"button:last",initComponent:function(){Ext.SplitButton.superclass.initComponent.call(this);this.addEvents("arrowclick")},onRender:function(ct,_2){var _3=new Ext.Template('<table cellspacing="0" class="x-btn-menu-wrap x-btn"><tr><td>','<table cellspacing="0" class="x-btn-wrap x-btn-menu-text-wrap"><tbody>','<tr><td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><button class="x-btn-text" type="{1}">{0}</button></td></tr>',"</tbody></table></td><td>",'<table cellspacing="0" class="x-btn-wrap x-btn-menu-arrow-wrap"><tbody>','<tr><td class="x-btn-center"><button class="x-btn-menu-arrow-el" type="button">&#160;</button></td><td class="x-btn-right"><i>&#160;</i></td></tr>',"</tbody></table></td></tr></table>");var _4,_5=[this.text||"&#160;",this.type];if(_2){_4=_3.insertBefore(_2,_5,true)}else{_4=_3.append(ct,_5,true)}var _6=_4.child(this.buttonSelector);this.initButtonEl(_4,_6);this.arrowBtnTable=_4.child("table:last");if(this.arrowTooltip){_4.child(this.arrowSelector).dom[this.tooltipType]=this.arrowTooltip}},autoWidth:function(){if(this.el){var _7=this.el.child("table:first");var _8=this.el.child("table:last");this.el.setWidth("auto");_7.setWidth("auto");if(Ext.isIE7&&Ext.isStrict){var ib=this.el.child(this.buttonSelector);if(ib&&ib.getWidth()>20){ib.clip();ib.setWidth(Ext.util.TextMetrics.measure(ib,this.text).width+ib.getFrameWidth("lr"))}}if(this.minWidth){if((_7.getWidth()+_8.getWidth())<this.minWidth){_7.setWidth(this.minWidth-_8.getWidth())}}this.el.setWidth(_7.getWidth()+_8.getWidth())}},setArrowHandler:function(_a,_b){this.arrowHandler=_a;this.scope=_b},onClick:function(e){e.preventDefault();if(!this.disabled){if(e.getTarget(".x-btn-menu-arrow-wrap")){if(this.menu&&!this.menu.isVisible()&&!this.ignoreNextClick){this.showMenu()}this.fireEvent("arrowclick",this,e);if(this.arrowHandler){this.arrowHandler.call(this.scope||this,this,e)}}else{if(this.enableToggle){this.toggle()}this.fireEvent("click",this,e);if(this.handler){this.handler.call(this.scope||this,this,e)}}}},getClickEl:function(e,_e){if(!_e){return(this.lastClickEl=e.getTarget("table",10,true))}return this.lastClickEl},onDisable:function(){if(this.el){if(!Ext.isIE6){this.el.addClass("x-item-disabled")}this.el.child(this.buttonSelector).dom.disabled=true;this.el.child(this.arrowSelector).dom.disabled=true}this.disabled=true},onEnable:function(){if(this.el){if(!Ext.isIE6){this.el.removeClass("x-item-disabled")}this.el.child(this.buttonSelector).dom.disabled=false;this.el.child(this.arrowSelector).dom.disabled=false}this.disabled=false},isMenuTriggerOver:function(e){return this.menu&&e.within(this.arrowBtnTable)&&!e.within(this.arrowBtnTable,true)},isMenuTriggerOut:function(e,_11){return this.menu&&!e.within(this.arrowBtnTable)},onDestroy:function(){Ext.destroy(this.arrowBtnTable);Ext.SplitButton.superclass.onDestroy.call(this)}});Ext.MenuButton=Ext.SplitButton;Ext.reg("splitbutton",Ext.SplitButton);Ext.CycleButton=Ext.extend(Ext.SplitButton,{getItemText:function(_1){if(_1&&this.showText===true){var _2="";if(this.prependText){_2+=this.prependText}_2+=_1.text;return _2}return undefined},setActiveItem:function(_3,_4){if(typeof _3!="object"){_3=this.menu.items.get(_3)}if(_3){if(!this.rendered){this.text=this.getItemText(_3);this.iconCls=_3.iconCls}else{var t=this.getItemText(_3);if(t){this.setText(t)}this.setIconClass(_3.iconCls)}this.activeItem=_3;if(!_3.checked){_3.setChecked(true,true)}if(this.forceIcon){this.setIconClass(this.forceIcon)}if(!_4){this.fireEvent("change",this,_3)}}},getActiveItem:function(){return this.activeItem},initComponent:function(){this.addEvents("change");if(this.changeHandler){this.on("change",this.changeHandler,this.scope||this);delete this.changeHandler}this.itemCount=this.items.length;this.menu={cls:"x-cycle-menu",items:[]};var _6;for(var i=0,_8=this.itemCount;i<_8;i++){var _9=this.items[i];_9.group=_9.group||this.id;_9.itemIndex=i;_9.checkHandler=this.checkHandler;_9.scope=this;_9.checked=_9.checked||false;this.menu.items.push(_9);if(_9.checked){_6=_9}}this.setActiveItem(_6,true);Ext.CycleButton.superclass.initComponent.call(this);this.on("click",this.toggleSelected,this)},checkHandler:function(_a,_b){if(_b){this.setActiveItem(_a)}},toggleSelected:function(){this.menu.render();var _c,_d;for(var i=1;i<this.itemCount;i++){_c=(this.activeItem.itemIndex+i)%this.itemCount;_d=this.menu.items.itemAt(_c);if(!_d.disabled){_d.setChecked(true);break}}}});Ext.reg("cycle",Ext.CycleButton);Ext.Toolbar=function(_1){if(Ext.isArray(_1)){_1={buttons:_1}}Ext.Toolbar.superclass.constructor.call(this,_1)};(function(){var T=Ext.Toolbar;Ext.extend(T,Ext.BoxComponent,{trackMenus:true,initComponent:function(){T.superclass.initComponent.call(this);if(this.items){this.buttons=this.items}this.items=new Ext.util.MixedCollection(false,function(o){return o.itemId||o.id||Ext.id()})},autoCreate:{cls:"x-toolbar x-small-editor",html:'<table cellspacing="0"><tr></tr></table>'},onRender:function(ct,_5){this.el=ct.createChild(Ext.apply({id:this.id},this.autoCreate),_5);this.tr=this.el.child("tr",true)},afterRender:function(){T.superclass.afterRender.call(this);if(this.buttons){this.add.apply(this,this.buttons);delete this.buttons}},add:function(){var a=arguments,l=a.length;for(var i=0;i<l;i++){var el=a[i];if(el.isFormField){this.addField(el)}else{if(el.render){this.addItem(el)}else{if(typeof el=="string"){if(el=="separator"||el=="-"){this.addSeparator()}else{if(el==" "){this.addSpacer()}else{if(el=="->"){this.addFill()}else{this.addText(el)}}}}else{if(el.tagName){this.addElement(el)}else{if(typeof el=="object"){if(el.xtype){this.addField(Ext.ComponentMgr.create(el,"button"))}else{this.addButton(el)}}}}}}}},addSeparator:function(){return this.addItem(new T.Separator())},addSpacer:function(){return this.addItem(new T.Spacer())},addFill:function(){return this.addItem(new T.Fill())},addElement:function(el){return this.addItem(new T.Item(el))},addItem:function(_b){var td=this.nextBlock();this.initMenuTracking(_b);_b.render(td);this.items.add(_b);return _b},addButton:function(_d){if(Ext.isArray(_d)){var _e=[];for(var i=0,len=_d.length;i<len;i++){_e.push(this.addButton(_d[i]))}return _e}var b=_d;if(!(_d instanceof T.Button)){b=_d.split?new T.SplitButton(_d):new T.Button(_d)}var td=this.nextBlock();this.initMenuTracking(b);b.render(td);this.items.add(b);return b},initMenuTracking:function(_13){if(this.trackMenus&&_13.menu){_13.on({menutriggerover:this.onButtonTriggerOver,menushow:this.onButtonMenuShow,menuhide:this.onButtonMenuHide,scope:this})}},addText:function(_14){return this.addItem(new T.TextItem(_14))},insertButton:function(_15,_16){if(Ext.isArray(_16)){var _17=[];for(var i=0,len=_16.length;i<len;i++){_17.push(this.insertButton(_15+i,_16[i]))}return _17}if(!(_16 instanceof T.Button)){_16=new T.Button(_16)}var td=document.createElement("td");this.tr.insertBefore(td,this.tr.childNodes[_15]);this.initMenuTracking(_16);_16.render(td);this.items.insert(_15,_16);return _16},addDom:function(_1b,_1c){var td=this.nextBlock();Ext.DomHelper.overwrite(td,_1b);var ti=new T.Item(td.firstChild);ti.render(td);this.items.add(ti);return ti},addField:function(_1f){var td=this.nextBlock();_1f.render(td);var ti=new T.Item(td.firstChild);ti.render(td);this.items.add(_1f);return ti},nextBlock:function(){var td=document.createElement("td");this.tr.appendChild(td);return td},onDestroy:function(){Ext.Toolbar.superclass.onDestroy.call(this);if(this.rendered){if(this.items){Ext.destroy.apply(Ext,this.items.items)
43
+ }Ext.Element.uncache(this.tr)}},onDisable:function(){this.items.each(function(_23){if(_23.disable){_23.disable()}})},onEnable:function(){this.items.each(function(_24){if(_24.enable){_24.enable()}})},onButtonTriggerOver:function(btn){if(this.activeMenuBtn&&this.activeMenuBtn!=btn){this.activeMenuBtn.hideMenu();btn.showMenu();this.activeMenuBtn=btn}},onButtonMenuShow:function(btn){this.activeMenuBtn=btn},onButtonMenuHide:function(btn){delete this.activeMenuBtn}});Ext.reg("toolbar",Ext.Toolbar);T.Item=function(el){this.el=Ext.getDom(el);this.id=Ext.id(this.el);this.hidden=false};T.Item.prototype={getEl:function(){return this.el},render:function(td){this.td=td;td.appendChild(this.el)},destroy:function(){if(this.el){var el=Ext.get(this.el);Ext.destroy(el)}Ext.removeNode(this.td)},show:function(){this.hidden=false;this.td.style.display=""},hide:function(){this.hidden=true;this.td.style.display="none"},setVisible:function(_2b){if(_2b){this.show()}else{this.hide()}},focus:function(){Ext.fly(this.el).focus()},disable:function(){Ext.fly(this.td).addClass("x-item-disabled");this.disabled=true;this.el.disabled=true},enable:function(){Ext.fly(this.td).removeClass("x-item-disabled");this.disabled=false;this.el.disabled=false}};Ext.reg("tbitem",T.Item);T.Separator=function(){var s=document.createElement("span");s.className="ytb-sep";T.Separator.superclass.constructor.call(this,s)};Ext.extend(T.Separator,T.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbseparator",T.Separator);T.Spacer=function(){var s=document.createElement("div");s.className="ytb-spacer";T.Spacer.superclass.constructor.call(this,s)};Ext.extend(T.Spacer,T.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbspacer",T.Spacer);T.Fill=Ext.extend(T.Spacer,{render:function(td){td.style.width="100%";T.Fill.superclass.render.call(this,td)}});Ext.reg("tbfill",T.Fill);T.TextItem=function(t){var s=document.createElement("span");s.className="ytb-text";s.innerHTML=t.text?t.text:t;T.TextItem.superclass.constructor.call(this,s)};Ext.extend(T.TextItem,T.Item,{enable:Ext.emptyFn,disable:Ext.emptyFn,focus:Ext.emptyFn});Ext.reg("tbtext",T.TextItem);T.Button=Ext.extend(Ext.Button,{hideParent:true,onDestroy:function(){T.Button.superclass.onDestroy.call(this);if(this.container){this.container.remove()}}});Ext.reg("tbbutton",T.Button);T.SplitButton=Ext.extend(Ext.SplitButton,{hideParent:true,onDestroy:function(){T.SplitButton.superclass.onDestroy.call(this);if(this.container){this.container.remove()}}});Ext.reg("tbsplit",T.SplitButton);T.MenuButton=T.SplitButton})();Ext.PagingToolbar=Ext.extend(Ext.Toolbar,{pageSize:20,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No data to display",beforePageText:"Page",afterPageText:"of {0}",firstText:"First Page",prevText:"Previous Page",nextText:"Next Page",lastText:"Last Page",refreshText:"Refresh",paramNames:{start:"start",limit:"limit"},initComponent:function(){this.addEvents("change","beforechange");Ext.PagingToolbar.superclass.initComponent.call(this);this.cursor=0;this.bind(this.store)},onRender:function(ct,_2){Ext.PagingToolbar.superclass.onRender.call(this,ct,_2);this.first=this.addButton({tooltip:this.firstText,iconCls:"x-tbar-page-first",disabled:true,handler:this.onClick.createDelegate(this,["first"])});this.prev=this.addButton({tooltip:this.prevText,iconCls:"x-tbar-page-prev",disabled:true,handler:this.onClick.createDelegate(this,["prev"])});this.addSeparator();this.add(this.beforePageText);this.field=Ext.get(this.addDom({tag:"input",type:"text",size:"3",value:"1",cls:"x-tbar-page-number"}).el);this.field.on("keydown",this.onPagingKeydown,this);this.field.on("focus",function(){this.dom.select()});this.field.on("blur",this.onPagingBlur,this);this.afterTextEl=this.addText(String.format(this.afterPageText,1));this.field.setHeight(18);this.addSeparator();this.next=this.addButton({tooltip:this.nextText,iconCls:"x-tbar-page-next",disabled:true,handler:this.onClick.createDelegate(this,["next"])});this.last=this.addButton({tooltip:this.lastText,iconCls:"x-tbar-page-last",disabled:true,handler:this.onClick.createDelegate(this,["last"])});this.addSeparator();this.loading=this.addButton({tooltip:this.refreshText,iconCls:"x-tbar-loading",handler:this.onClick.createDelegate(this,["refresh"])});if(this.displayInfo){this.displayEl=Ext.fly(this.el.dom).createChild({cls:"x-paging-info"})}if(this.dsLoaded){this.onLoad.apply(this,this.dsLoaded)}},updateInfo:function(){if(this.displayEl){var _3=this.store.getCount();var _4=_3==0?this.emptyMsg:String.format(this.displayMsg,this.cursor+1,this.cursor+_3,this.store.getTotalCount());this.displayEl.update(_4)}},onLoad:function(_5,r,o){if(!this.rendered){this.dsLoaded=[_5,r,o];return}this.cursor=o.params?o.params[this.paramNames.start]:0;var d=this.getPageData(),ap=d.activePage,ps=d.pages;this.afterTextEl.el.innerHTML=String.format(this.afterPageText,d.pages);this.field.dom.value=ap;this.first.setDisabled(ap==1);this.prev.setDisabled(ap==1);this.next.setDisabled(ap==ps);this.last.setDisabled(ap==ps);this.loading.enable();this.updateInfo();this.fireEvent("change",this,d)},getPageData:function(){var _b=this.store.getTotalCount();return{total:_b,activePage:Math.ceil((this.cursor+this.pageSize)/this.pageSize),pages:_b<this.pageSize?1:Math.ceil(_b/this.pageSize)}},onLoadError:function(){if(!this.rendered){return}this.loading.enable()},readPage:function(d){var v=this.field.dom.value,_e;if(!v||isNaN(_e=parseInt(v,10))){this.field.dom.value=d.activePage;return false}return _e},onPagingBlur:function(e){this.field.dom.value=this.getPageData().activePage},onPagingKeydown:function(e){var k=e.getKey(),d=this.getPageData(),_13;if(k==e.RETURN){e.stopEvent();_13=this.readPage(d);if(_13!==false){_13=Math.min(Math.max(1,_13),d.pages)-1;this.doLoad(_13*this.pageSize)}}else{if(k==e.HOME||k==e.END){e.stopEvent();_13=k==e.HOME?1:d.pages;this.field.dom.value=_13}else{if(k==e.UP||k==e.PAGEUP||k==e.DOWN||k==e.PAGEDOWN){e.stopEvent();if(_13=this.readPage(d)){var _14=e.shiftKey?10:1;if(k==e.DOWN||k==e.PAGEDOWN){_14*=-1}_13+=_14;if(_13>=1&_13<=d.pages){this.field.dom.value=_13}}}}}},beforeLoad:function(){if(this.rendered&&this.loading){this.loading.disable()}},doLoad:function(_15){var o={},pn=this.paramNames;o[pn.start]=_15;o[pn.limit]=this.pageSize;if(this.fireEvent("beforechange",this,o)!==false){this.store.load({params:o})}},changePage:function(_18){this.doLoad(((_18-1)*this.pageSize).constrain(0,this.store.getTotalCount()))},onClick:function(_19){var _1a=this.store;switch(_19){case"first":this.doLoad(0);break;case"prev":this.doLoad(Math.max(0,this.cursor-this.pageSize));break;case"next":this.doLoad(this.cursor+this.pageSize);break;case"last":var _1b=_1a.getTotalCount();var _1c=_1b%this.pageSize;var _1d=_1c?(_1b-_1c):_1b-this.pageSize;this.doLoad(_1d);break;case"refresh":this.doLoad(this.cursor);break}},unbind:function(_1e){_1e=Ext.StoreMgr.lookup(_1e);_1e.un("beforeload",this.beforeLoad,this);_1e.un("load",this.onLoad,this);_1e.un("loadexception",this.onLoadError,this);this.store=undefined},bind:function(_1f){_1f=Ext.StoreMgr.lookup(_1f);_1f.on("beforeload",this.beforeLoad,this);_1f.on("load",this.onLoad,this);_1f.on("loadexception",this.onLoadError,this);this.store=_1f;if(_1f.getCount()>0){this.onLoad(_1f,null,{})}},onDestroy:function(){if(this.store){this.unbind(this.store)}Ext.PagingToolbar.superclass.onDestroy.call(this)}});Ext.reg("paging",Ext.PagingToolbar);Ext.Resizable=function(el,_2){this.el=Ext.get(el);if(_2&&_2.wrap){_2.resizeChild=this.el;this.el=this.el.wrap(typeof _2.wrap=="object"?_2.wrap:{cls:"xresizable-wrap"});this.el.id=this.el.dom.id=_2.resizeChild.id+"-rzwrap";this.el.setStyle("overflow","hidden");this.el.setPositioning(_2.resizeChild.getPositioning());_2.resizeChild.clearPositioning();if(!_2.width||!_2.height){var _3=_2.resizeChild.getSize();this.el.setSize(_3.width,_3.height)}if(_2.pinned&&!_2.adjustments){_2.adjustments="auto"}}this.proxy=this.el.createProxy({tag:"div",cls:"x-resizable-proxy",id:this.el.id+"-rzproxy"},Ext.getBody());
44
+ this.proxy.unselectable();this.proxy.enableDisplayMode("block");Ext.apply(this,_2);if(this.pinned){this.disableTrackOver=true;this.el.addClass("x-resizable-pinned")}var _4=this.el.getStyle("position");if(_4!="absolute"&&_4!="fixed"){this.el.setStyle("position","relative")}if(!this.handles){this.handles="s,e,se";if(this.multiDirectional){this.handles+=",n,w"}}if(this.handles=="all"){this.handles="n s e w ne nw se sw"}var hs=this.handles.split(/\s*?[,;]\s*?| /);var ps=Ext.Resizable.positions;for(var i=0,_8=hs.length;i<_8;i++){if(hs[i]&&ps[hs[i]]){var _9=ps[hs[i]];this[_9]=new Ext.Resizable.Handle(this,_9,this.disableTrackOver,this.transparent)}}this.corner=this.southeast;if(this.handles.indexOf("n")!=-1||this.handles.indexOf("w")!=-1){this.updateBox=true}this.activeHandle=null;if(this.resizeChild){if(typeof this.resizeChild=="boolean"){this.resizeChild=Ext.get(this.el.dom.firstChild,true)}else{this.resizeChild=Ext.get(this.resizeChild,true)}}if(this.adjustments=="auto"){var rc=this.resizeChild;var hw=this.west,he=this.east,hn=this.north,hs=this.south;if(rc&&(hw||hn)){rc.position("relative");rc.setLeft(hw?hw.el.getWidth():0);rc.setTop(hn?hn.el.getHeight():0)}this.adjustments=[(he?-he.el.getWidth():0)+(hw?-hw.el.getWidth():0),(hn?-hn.el.getHeight():0)+(hs?-hs.el.getHeight():0)-1]}if(this.draggable){this.dd=this.dynamic?this.el.initDD(null):this.el.initDDProxy(null,{dragElId:this.proxy.id});this.dd.setHandleElId(this.resizeChild?this.resizeChild.id:this.el.id)}this.addEvents("beforeresize","resize");if(this.width!==null&&this.height!==null){this.resizeTo(this.width,this.height)}else{this.updateChildSize()}if(Ext.isIE){this.el.dom.style.zoom=1}Ext.Resizable.superclass.constructor.call(this)};Ext.extend(Ext.Resizable,Ext.util.Observable,{resizeChild:false,adjustments:[0,0],minWidth:5,minHeight:5,maxWidth:10000,maxHeight:10000,enabled:true,animate:false,duration:0.35,dynamic:false,handles:false,multiDirectional:false,disableTrackOver:false,easing:"easeOutStrong",widthIncrement:0,heightIncrement:0,pinned:false,width:null,height:null,preserveRatio:false,transparent:false,minX:0,minY:0,draggable:false,resizeTo:function(_e,_f){this.el.setSize(_e,_f);this.updateChildSize();this.fireEvent("resize",this,_e,_f,null)},startSizing:function(e,_11){this.fireEvent("beforeresize",this,e);if(this.enabled){if(!this.overlay){this.overlay=this.el.createProxy({tag:"div",cls:"x-resizable-overlay",html:"&#160;"},Ext.getBody());this.overlay.unselectable();this.overlay.enableDisplayMode("block");this.overlay.on("mousemove",this.onMouseMove,this);this.overlay.on("mouseup",this.onMouseUp,this)}this.overlay.setStyle("cursor",_11.el.getStyle("cursor"));this.resizing=true;this.startBox=this.el.getBox();this.startPoint=e.getXY();this.offsets=[(this.startBox.x+this.startBox.width)-this.startPoint[0],(this.startBox.y+this.startBox.height)-this.startPoint[1]];this.overlay.setSize(Ext.lib.Dom.getViewWidth(true),Ext.lib.Dom.getViewHeight(true));this.overlay.show();if(this.constrainTo){var ct=Ext.get(this.constrainTo);this.resizeRegion=ct.getRegion().adjust(ct.getFrameWidth("t"),ct.getFrameWidth("l"),-ct.getFrameWidth("b"),-ct.getFrameWidth("r"))}this.proxy.setStyle("visibility","hidden");this.proxy.show();this.proxy.setBox(this.startBox);if(!this.dynamic){this.proxy.setStyle("visibility","visible")}}},onMouseDown:function(_13,e){if(this.enabled){e.stopEvent();this.activeHandle=_13;this.startSizing(e,_13)}},onMouseUp:function(e){var _16=this.resizeElement();this.resizing=false;this.handleOut();this.overlay.hide();this.proxy.hide();this.fireEvent("resize",this,_16.width,_16.height,e)},updateChildSize:function(){if(this.resizeChild){var el=this.el;var _18=this.resizeChild;var adj=this.adjustments;if(el.dom.offsetWidth){var b=el.getSize(true);_18.setSize(b.width+adj[0],b.height+adj[1])}if(Ext.isIE){setTimeout(function(){if(el.dom.offsetWidth){var b=el.getSize(true);_18.setSize(b.width+adj[0],b.height+adj[1])}},10)}}},snap:function(_1c,inc,min){if(!inc||!_1c){return _1c}var _1f=_1c;var m=_1c%inc;if(m>0){if(m>(inc/2)){_1f=_1c+(inc-m)}else{_1f=_1c-m}}return Math.max(min,_1f)},resizeElement:function(){var box=this.proxy.getBox();if(this.updateBox){this.el.setBox(box,false,this.animate,this.duration,null,this.easing)}else{this.el.setSize(box.width,box.height,this.animate,this.duration,null,this.easing)}this.updateChildSize();if(!this.dynamic){this.proxy.hide()}return box},constrain:function(v,_23,m,mx){if(v-_23<m){_23=v-m}else{if(v-_23>mx){_23=mx-v}}return _23},onMouseMove:function(e){if(this.enabled){try{if(this.resizeRegion&&!this.resizeRegion.contains(e.getPoint())){return}var _27=this.curSize||this.startBox;var x=this.startBox.x,y=this.startBox.y;var ox=x,oy=y;var w=_27.width,h=_27.height;var ow=w,oh=h;var mw=this.minWidth,mh=this.minHeight;var mxw=this.maxWidth,mxh=this.maxHeight;var wi=this.widthIncrement;var hi=this.heightIncrement;var _36=e.getXY();var _37=-(this.startPoint[0]-Math.max(this.minX,_36[0]));var _38=-(this.startPoint[1]-Math.max(this.minY,_36[1]));var pos=this.activeHandle.position;switch(pos){case"east":w+=_37;w=Math.min(Math.max(mw,w),mxw);break;case"south":h+=_38;h=Math.min(Math.max(mh,h),mxh);break;case"southeast":w+=_37;h+=_38;w=Math.min(Math.max(mw,w),mxw);h=Math.min(Math.max(mh,h),mxh);break;case"north":_38=this.constrain(h,_38,mh,mxh);y+=_38;h-=_38;break;case"west":_37=this.constrain(w,_37,mw,mxw);x+=_37;w-=_37;break;case"northeast":w+=_37;w=Math.min(Math.max(mw,w),mxw);_38=this.constrain(h,_38,mh,mxh);y+=_38;h-=_38;break;case"northwest":_37=this.constrain(w,_37,mw,mxw);_38=this.constrain(h,_38,mh,mxh);y+=_38;h-=_38;x+=_37;w-=_37;break;case"southwest":_37=this.constrain(w,_37,mw,mxw);h+=_38;h=Math.min(Math.max(mh,h),mxh);x+=_37;w-=_37;break}var sw=this.snap(w,wi,mw);var sh=this.snap(h,hi,mh);if(sw!=w||sh!=h){switch(pos){case"northeast":y-=sh-h;break;case"north":y-=sh-h;break;case"southwest":x-=sw-w;break;case"west":x-=sw-w;break;case"northwest":x-=sw-w;y-=sh-h;break}w=sw;h=sh}if(this.preserveRatio){switch(pos){case"southeast":case"east":h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);w=ow*(h/oh);break;case"south":w=ow*(h/oh);w=Math.min(Math.max(mw,w),mxw);h=oh*(w/ow);break;case"northeast":w=ow*(h/oh);w=Math.min(Math.max(mw,w),mxw);h=oh*(w/ow);break;case"north":var tw=w;w=ow*(h/oh);w=Math.min(Math.max(mw,w),mxw);h=oh*(w/ow);x+=(tw-w)/2;break;case"southwest":h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);var tw=w;w=ow*(h/oh);x+=tw-w;break;case"west":var th=h;h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);y+=(th-h)/2;var tw=w;w=ow*(h/oh);x+=tw-w;break;case"northwest":var tw=w;var th=h;h=oh*(w/ow);h=Math.min(Math.max(mh,h),mxh);w=ow*(h/oh);y+=th-h;x+=tw-w;break}}this.proxy.setBounds(x,y,w,h);if(this.dynamic){this.resizeElement()}}catch(e){}}},handleOver:function(){if(this.enabled){this.el.addClass("x-resizable-over")}},handleOut:function(){if(!this.resizing){this.el.removeClass("x-resizable-over")}},getEl:function(){return this.el},getResizeChild:function(){return this.resizeChild},destroy:function(_3e){if(this.dd){this.dd.destroy()}if(this.overlay){Ext.destroy(this.overlay);this.overlay=null}Ext.destroy(this.proxy);this.proxy=null;var ps=Ext.Resizable.positions;for(var k in ps){if(typeof ps[k]!="function"&&this[ps[k]]){this[ps[k]].destroy()}}if(_3e){this.el.update("");Ext.destroy(this.el);this.el=null}},syncHandleHeight:function(){var h=this.el.getHeight(true);if(this.west){this.west.el.setHeight(h)}if(this.east){this.east.el.setHeight(h)}}});Ext.Resizable.positions={n:"north",s:"south",e:"east",w:"west",se:"southeast",sw:"southwest",nw:"northwest",ne:"northeast"};Ext.Resizable.Handle=function(rz,pos,_44,_45){if(!this.tpl){var tpl=Ext.DomHelper.createTemplate({tag:"div",cls:"x-resizable-handle x-resizable-handle-{0}"});tpl.compile();Ext.Resizable.Handle.prototype.tpl=tpl}this.position=pos;this.rz=rz;this.el=this.tpl.append(rz.el.dom,[this.position],true);this.el.unselectable();if(_45){this.el.setOpacity(0)}this.el.on("mousedown",this.onMouseDown,this);if(!_44){this.el.on("mouseover",this.onMouseOver,this);
45
+ this.el.on("mouseout",this.onMouseOut,this)}};Ext.Resizable.Handle.prototype={afterResize:function(rz){},onMouseDown:function(e){this.rz.onMouseDown(this,e)},onMouseOver:function(e){this.rz.handleOver(this,e)},onMouseOut:function(e){this.rz.handleOut(this,e)},destroy:function(){Ext.destroy(this.el);this.el=null}};Ext.Editor=function(_1,_2){this.field=_1;Ext.Editor.superclass.constructor.call(this,_2)};Ext.extend(Ext.Editor,Ext.Component,{value:"",alignment:"c-c?",shadow:"frame",constrain:false,swallowKeys:true,completeOnEnter:false,cancelOnEsc:false,updateEl:false,initComponent:function(){Ext.Editor.superclass.initComponent.call(this);this.addEvents("beforestartedit","startedit","beforecomplete","complete","canceledit","specialkey")},onRender:function(ct,_4){this.el=new Ext.Layer({shadow:this.shadow,cls:"x-editor",parentEl:ct,shim:this.shim,shadowOffset:4,id:this.id,constrain:this.constrain});this.el.setStyle("overflow",Ext.isGecko?"auto":"hidden");if(this.field.msgTarget!="title"){this.field.msgTarget="qtip"}this.field.inEditor=true;this.field.render(this.el);if(Ext.isGecko){this.field.el.dom.setAttribute("autocomplete","off")}this.field.on("specialkey",this.onSpecialKey,this);if(this.swallowKeys){this.field.el.swallowEvent(["keydown","keypress"])}this.field.show();this.field.on("blur",this.onBlur,this);if(this.field.grow){this.field.on("autosize",this.el.sync,this.el,{delay:1})}},onSpecialKey:function(_5,e){var _7=e.getKey();if(this.completeOnEnter&&_7==e.ENTER){e.stopEvent();this.completeEdit()}else{if(this.cancelOnEsc&&_7==e.ESC){this.cancelEdit()}else{this.fireEvent("specialkey",_5,e)}}if(this.field.triggerBlur&&(_7==e.ENTER||_7==e.ESC||_7==e.TAB)){this.field.triggerBlur()}},startEdit:function(el,_9){if(this.editing){this.completeEdit()}this.boundEl=Ext.get(el);var v=_9!==undefined?_9:this.boundEl.dom.innerHTML;if(!this.rendered){this.render(this.parentEl||document.body)}if(this.fireEvent("beforestartedit",this,this.boundEl,v)===false){return}this.startValue=v;this.field.setValue(v);this.doAutoSize();this.el.alignTo(this.boundEl,this.alignment);this.editing=true;this.show()},doAutoSize:function(){if(this.autoSize){var sz=this.boundEl.getSize();switch(this.autoSize){case"width":this.setSize(sz.width,"");break;case"height":this.setSize("",sz.height);break;default:this.setSize(sz.width,sz.height)}}},setSize:function(w,h){delete this.field.lastSize;this.field.setSize(w,h);if(this.el){if(Ext.isGecko2||Ext.isOpera){this.el.setSize(w,h)}this.el.sync()}},realign:function(){this.el.alignTo(this.boundEl,this.alignment)},completeEdit:function(_e){if(!this.editing){return}var v=this.getValue();if(this.revertInvalid!==false&&!this.field.isValid()){v=this.startValue;this.cancelEdit(true)}if(String(v)===String(this.startValue)&&this.ignoreNoChange){this.editing=false;this.hide();return}if(this.fireEvent("beforecomplete",this,v,this.startValue)!==false){this.editing=false;if(this.updateEl&&this.boundEl){this.boundEl.update(v)}if(_e!==true){this.hide()}this.fireEvent("complete",this,v,this.startValue)}},onShow:function(){this.el.show();if(this.hideEl!==false){this.boundEl.hide()}this.field.show();if(Ext.isIE&&!this.fixIEFocus){this.fixIEFocus=true;this.deferredFocus.defer(50,this)}else{this.field.focus()}this.fireEvent("startedit",this.boundEl,this.startValue)},deferredFocus:function(){if(this.editing){this.field.focus()}},cancelEdit:function(_10){if(this.editing){var v=this.getValue();this.setValue(this.startValue);if(_10!==true){this.hide()}this.fireEvent("canceledit",this,v,this.startValue)}},onBlur:function(){if(this.allowBlur!==true&&this.editing){this.completeEdit()}},onHide:function(){if(this.editing){this.completeEdit();return}this.field.blur();if(this.field.collapse){this.field.collapse()}this.el.hide();if(this.hideEl!==false){this.boundEl.show()}},setValue:function(v){this.field.setValue(v)},getValue:function(){return this.field.getValue()},beforeDestroy:function(){Ext.destroy(this.field);this.field=null}});Ext.reg("editor",Ext.Editor);Ext.MessageBox=function(){var _1,_2,_3,_4;var _5,_6,_7,_8,_9,pp,_b,_c;var _d,_e,_f,_10="";var _11=function(_12){if(_1.isVisible()){_1.hide();Ext.callback(_2.fn,_2.scope||window,[_12,_e.dom.value,_2],1)}};var _13=function(){if(_2&&_2.cls){_1.el.removeClass(_2.cls)}_9.reset()};var _14=function(d,k,e){if(_2&&_2.closable!==false){_1.hide()}if(e){e.stopEvent()}};var _18=function(b){var _1a=0;if(!b){_d.ok.hide();_d.cancel.hide();_d.yes.hide();_d.no.hide();return _1a}_1.footer.dom.style.display="";for(var k in _d){if(typeof _d[k]!="function"){if(b[k]){_d[k].show();_d[k].setText(typeof b[k]=="string"?b[k]:Ext.MessageBox.buttonText[k]);_1a+=_d[k].el.getWidth()+15}else{_d[k].hide()}}}return _1a};return{getDialog:function(_1c){if(!_1){_1=new Ext.Window({autoCreate:true,title:_1c,resizable:false,constrain:true,constrainHeader:true,minimizable:false,maximizable:false,stateful:false,modal:true,shim:true,buttonAlign:"center",width:400,height:100,minHeight:80,plain:true,footer:true,closable:true,close:function(){if(_2&&_2.buttons&&_2.buttons.no&&!_2.buttons.cancel){_11("no")}else{_11("cancel")}}});_d={};var bt=this.buttonText;_d.ok=_1.addButton(bt.ok,_11.createCallback("ok"));_d.yes=_1.addButton(bt.yes,_11.createCallback("yes"));_d.no=_1.addButton(bt.no,_11.createCallback("no"));_d.cancel=_1.addButton(bt.cancel,_11.createCallback("cancel"));_d.ok.hideMode=_d.yes.hideMode=_d.no.hideMode=_d.cancel.hideMode="offsets";_1.render(document.body);_1.getEl().addClass("x-window-dlg");_3=_1.mask;_5=_1.body.createChild({html:'<div class="ext-mb-icon"></div><div class="ext-mb-content"><span class="ext-mb-text"></span><br /><div class="ext-mb-fix-cursor"><input type="text" class="ext-mb-input" /><textarea class="ext-mb-textarea"></textarea></div></div>'});_b=Ext.get(_5.dom.firstChild);var _1e=_5.dom.childNodes[1];_6=Ext.get(_1e.firstChild);_7=Ext.get(_1e.childNodes[2].firstChild);_7.enableDisplayMode();_7.addKeyListener([10,13],function(){if(_1.isVisible()&&_2&&_2.buttons){if(_2.buttons.ok){_11("ok")}else{if(_2.buttons.yes){_11("yes")}}}});_8=Ext.get(_1e.childNodes[2].childNodes[1]);_8.enableDisplayMode();_9=new Ext.ProgressBar({renderTo:_5});_5.createChild({cls:"x-clear"})}return _1},updateText:function(_1f){if(!_1.isVisible()&&!_2.width){_1.setSize(this.maxWidth,100)}_6.update(_1f||"&#160;");var iw=_10!=""?(_b.getWidth()+_b.getMargins("lr")):0;var mw=_6.getWidth()+_6.getMargins("lr");var fw=_1.getFrameWidth("lr");var bw=_1.body.getFrameWidth("lr");if(Ext.isIE&&iw>0){iw+=3}var w=Math.max(Math.min(_2.width||iw+mw+fw+bw,this.maxWidth),Math.max(_2.minWidth||this.minWidth,_f||0));if(_2.prompt===true){_e.setWidth(w-iw-fw-bw)}if(_2.progress===true||_2.wait===true){_9.setSize(w-iw-fw-bw)}if(Ext.isIE&&w==_f){w+=4}_1.setSize(w,"auto").center();return this},updateProgress:function(_25,_26,msg){_9.updateProgress(_25,_26);if(msg){this.updateText(msg)}return this},isVisible:function(){return _1&&_1.isVisible()},hide:function(){var _28=_1?_1.activeGhost:null;if(this.isVisible()||_28){_1.hide();_13();if(_28){_28.hide()}}return this},show:function(_29){if(this.isVisible()){this.hide()}_2=_29;var d=this.getDialog(_2.title||"&#160;");d.setTitle(_2.title||"&#160;");var _2b=(_2.closable!==false&&_2.progress!==true&&_2.wait!==true);d.tools.close.setDisplayed(_2b);_e=_7;_2.prompt=_2.prompt||(_2.multiline?true:false);if(_2.prompt){if(_2.multiline){_7.hide();_8.show();_8.setHeight(typeof _2.multiline=="number"?_2.multiline:this.defaultTextHeight);_e=_8}else{_7.show();_8.hide()}}else{_7.hide();_8.hide()}_e.dom.value=_2.value||"";if(_2.prompt){d.focusEl=_e}else{var bs=_2.buttons;var db=null;if(bs&&bs.ok){db=_d.ok}else{if(bs&&bs.yes){db=_d.yes}}if(db){d.focusEl=db}}if(_2.iconCls){d.setIconClass(_2.iconCls)}this.setIcon(_2.icon);_f=_18(_2.buttons);_9.setVisible(_2.progress===true||_2.wait===true);this.updateProgress(0,_2.progressText);this.updateText(_2.msg);if(_2.cls){d.el.addClass(_2.cls)}d.proxyDrag=_2.proxyDrag===true;d.modal=_2.modal!==false;d.mask=_2.modal!==false?_3:false;
46
+ if(!d.isVisible()){document.body.appendChild(_1.el.dom);d.setAnimateTarget(_2.animEl);d.show(_2.animEl)}d.on("show",function(){if(_2b===true){d.keyMap.enable()}else{d.keyMap.disable()}},this,{single:true});if(_2.wait===true){_9.wait(_2.waitConfig)}return this},setIcon:function(_2e){if(_2e&&_2e!=""){_b.removeClass("x-hidden");_b.replaceClass(_10,_2e);_5.addClass("x-dlg-icon");_10=_2e}else{_b.replaceClass(_10,"x-hidden");_5.removeClass("x-dlg-icon");_10=""}return this},progress:function(_2f,msg,_31){this.show({title:_2f,msg:msg,buttons:false,progress:true,closable:false,minWidth:this.minProgressWidth,progressText:_31});return this},wait:function(msg,_33,_34){this.show({title:_33,msg:msg,buttons:false,closable:false,wait:true,modal:true,minWidth:this.minProgressWidth,waitConfig:_34});return this},alert:function(_35,msg,fn,_38){this.show({title:_35,msg:msg,buttons:this.OK,fn:fn,scope:_38});return this},confirm:function(_39,msg,fn,_3c){this.show({title:_39,msg:msg,buttons:this.YESNO,fn:fn,scope:_3c,icon:this.QUESTION});return this},prompt:function(_3d,msg,fn,_40,_41,_42){this.show({title:_3d,msg:msg,buttons:this.OKCANCEL,fn:fn,minWidth:250,scope:_40,prompt:true,multiline:_41,value:_42});return this},OK:{ok:true},CANCEL:{cancel:true},OKCANCEL:{ok:true,cancel:true},YESNO:{yes:true,no:true},YESNOCANCEL:{yes:true,no:true,cancel:true},INFO:"ext-mb-info",WARNING:"ext-mb-warning",QUESTION:"ext-mb-question",ERROR:"ext-mb-error",defaultTextHeight:75,maxWidth:600,minWidth:100,minProgressWidth:250,buttonText:{ok:"OK",cancel:"Cancel",yes:"Yes",no:"No"}}}();Ext.Msg=Ext.MessageBox;Ext.Tip=Ext.extend(Ext.Panel,{minWidth:40,maxWidth:300,shadow:"sides",defaultAlign:"tl-bl?",autoRender:true,quickShowInterval:250,frame:true,hidden:true,baseCls:"x-tip",floating:{shadow:true,shim:true,useDisplay:true,constrain:false},autoHeight:true,initComponent:function(){Ext.Tip.superclass.initComponent.call(this);if(this.closable&&!this.title){this.elements+=",header"}},afterRender:function(){Ext.Tip.superclass.afterRender.call(this);if(this.closable){this.addTool({id:"close",handler:this.hide,scope:this})}},showAt:function(xy){Ext.Tip.superclass.show.call(this);if(this.measureWidth!==false&&(!this.initialConfig||typeof this.initialConfig.width!="number")){this.doAutoWidth()}if(this.constrainPosition){xy=this.el.adjustForConstraints(xy)}this.setPagePosition(xy[0],xy[1])},doAutoWidth:function(){var bw=this.body.getTextWidth();if(this.title){bw=Math.max(bw,this.header.child("span").getTextWidth(this.title))}bw+=this.getFrameWidth()+(this.closable?20:0)+this.body.getPadding("lr");this.setWidth(bw.constrain(this.minWidth,this.maxWidth));if(Ext.isIE7&&!this.repainted){this.el.repaint();this.repainted=true}},showBy:function(el,_4){if(!this.rendered){this.render(Ext.getBody())}this.showAt(this.el.getAlignToXY(el,_4||this.defaultAlign))},initDraggable:function(){this.dd=new Ext.Tip.DD(this,typeof this.draggable=="boolean"?null:this.draggable);this.header.addClass("x-tip-draggable")}});Ext.Tip.DD=function(_5,_6){Ext.apply(this,_6);this.tip=_5;Ext.Tip.DD.superclass.constructor.call(this,_5.el.id,"WindowDD-"+_5.id);this.setHandleElId(_5.header.id);this.scroll=false};Ext.extend(Ext.Tip.DD,Ext.dd.DD,{moveOnly:true,scroll:false,headerOffsets:[100,25],startDrag:function(){this.tip.el.disableShadow()},endDrag:function(e){this.tip.el.enableShadow(true)}});Ext.ToolTip=Ext.extend(Ext.Tip,{showDelay:500,hideDelay:200,dismissDelay:5000,mouseOffset:[15,18],trackMouse:false,constrainPosition:true,initComponent:function(){Ext.ToolTip.superclass.initComponent.call(this);this.lastActive=new Date();this.initTarget()},initTarget:function(){if(this.target){this.target=Ext.get(this.target);this.target.on("mouseover",this.onTargetOver,this);this.target.on("mouseout",this.onTargetOut,this);this.target.on("mousemove",this.onMouseMove,this)}},onMouseMove:function(e){this.targetXY=e.getXY();if(!this.hidden&&this.trackMouse){this.setPagePosition(this.getTargetXY())}},getTargetXY:function(){return[this.targetXY[0]+this.mouseOffset[0],this.targetXY[1]+this.mouseOffset[1]]},onTargetOver:function(e){if(this.disabled||e.within(this.target.dom,true)){return}this.clearTimer("hide");this.targetXY=e.getXY();this.delayShow()},delayShow:function(){if(this.hidden&&!this.showTimer){if(this.lastActive.getElapsed()<this.quickShowInterval){this.show()}else{this.showTimer=this.show.defer(this.showDelay,this)}}else{if(!this.hidden&&this.autoHide!==false){this.show()}}},onTargetOut:function(e){if(this.disabled||e.within(this.target.dom,true)){return}this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},delayHide:function(){if(!this.hidden&&!this.hideTimer){this.hideTimer=this.hide.defer(this.hideDelay,this)}},hide:function(){this.clearTimer("dismiss");this.lastActive=new Date();Ext.ToolTip.superclass.hide.call(this)},show:function(){this.showAt(this.getTargetXY())},showAt:function(xy){this.lastActive=new Date();this.clearTimers();Ext.ToolTip.superclass.showAt.call(this,xy);if(this.dismissDelay&&this.autoHide!==false){this.dismissTimer=this.hide.defer(this.dismissDelay,this)}},clearTimer:function(_5){_5=_5+"Timer";clearTimeout(this[_5]);delete this[_5]},clearTimers:function(){this.clearTimer("show");this.clearTimer("dismiss");this.clearTimer("hide")},onShow:function(){Ext.ToolTip.superclass.onShow.call(this);Ext.getDoc().on("mousedown",this.onDocMouseDown,this)},onHide:function(){Ext.ToolTip.superclass.onHide.call(this);Ext.getDoc().un("mousedown",this.onDocMouseDown,this)},onDocMouseDown:function(e){if(this.autoHide!==false&&!e.within(this.el.dom)){this.disable();this.enable.defer(100,this)}},onDisable:function(){this.clearTimers();this.hide()},adjustPosition:function(x,y){var ay=this.targetXY[1],h=this.getSize().height;if(this.constrainPosition&&y<=ay&&(y+h)>=ay){y=ay-h-5}return{x:x,y:y}},onDestroy:function(){Ext.ToolTip.superclass.onDestroy.call(this);if(this.target){this.target.un("mouseover",this.onTargetOver,this);this.target.un("mouseout",this.onTargetOut,this);this.target.un("mousemove",this.onMouseMove,this)}}});Ext.QuickTip=Ext.extend(Ext.ToolTip,{interceptTitles:false,tagConfig:{namespace:"ext",attribute:"qtip",width:"qwidth",target:"target",title:"qtitle",hide:"hide",cls:"qclass",align:"qalign"},initComponent:function(){this.target=this.target||Ext.getDoc();this.targets=this.targets||{};Ext.QuickTip.superclass.initComponent.call(this)},register:function(_1){var cs=Ext.isArray(_1)?_1:arguments;for(var i=0,_4=cs.length;i<_4;i++){var c=cs[i];var _6=c.target;if(_6){if(Ext.isArray(_6)){for(var j=0,_8=_6.length;j<_8;j++){this.targets[Ext.id(_6[j])]=c}}else{this.targets[Ext.id(_6)]=c}}}},unregister:function(el){delete this.targets[Ext.id(el)]},onTargetOver:function(e){if(this.disabled){return}this.targetXY=e.getXY();var t=e.getTarget();if(!t||t.nodeType!==1||t==document||t==document.body){return}if(this.activeTarget&&t==this.activeTarget.el){this.clearTimer("hide");this.show();return}if(t&&this.targets[t.id]){this.activeTarget=this.targets[t.id];this.activeTarget.el=t;this.delayShow();return}var _c,et=Ext.fly(t),_e=this.tagConfig;var ns=_e.namespace;if(this.interceptTitles&&t.title){_c=t.title;t.qtip=_c;t.removeAttribute("title");e.preventDefault()}else{_c=t.qtip||et.getAttributeNS(ns,_e.attribute)}if(_c){var _10=et.getAttributeNS(ns,_e.hide);this.activeTarget={el:t,text:_c,width:et.getAttributeNS(ns,_e.width),autoHide:_10!="user"&&_10!=="false",title:et.getAttributeNS(ns,_e.title),cls:et.getAttributeNS(ns,_e.cls),align:et.getAttributeNS(ns,_e.align)};this.delayShow()}},onTargetOut:function(e){this.clearTimer("show");if(this.autoHide!==false){this.delayHide()}},showAt:function(xy){var t=this.activeTarget;if(t){if(!this.rendered){this.render(Ext.getBody());this.activeTarget=t}if(t.width){this.setWidth(t.width);this.body.setWidth(this.adjustBodyWidth(t.width-this.getFrameWidth()));this.measureWidth=false}else{this.measureWidth=true}this.setTitle(t.title||"");this.body.update(t.text);this.autoHide=t.autoHide;this.dismissDelay=t.dismissDelay||this.dismissDelay;
47
+ if(this.lastCls){this.el.removeClass(this.lastCls);delete this.lastCls}if(t.cls){this.el.addClass(t.cls);this.lastCls=t.cls}if(t.align){xy=this.el.getAlignToXY(t.el,t.align);this.constrainPosition=false}else{this.constrainPosition=true}}Ext.QuickTip.superclass.showAt.call(this,xy)},hide:function(){delete this.activeTarget;Ext.QuickTip.superclass.hide.call(this)}});Ext.QuickTips=function(){var _1,_2=[];return{init:function(_3){if(!_1){if(!Ext.isReady){Ext.onReady(function(){Ext.QuickTips.init(_3)});return}_1=new Ext.QuickTip({elements:"header,body"});if(_3!==false){_1.render(Ext.getBody())}}},enable:function(){if(_1){_2.pop();if(_2.length<1){_1.enable()}}},disable:function(){if(_1){_1.disable()}_2.push(1)},isEnabled:function(){return _1!==undefined&&!_1.disabled},getQuickTip:function(){return _1},register:function(){_1.register.apply(_1,arguments)},unregister:function(){_1.unregister.apply(_1,arguments)},tips:function(){_1.register.apply(_1,arguments)}}}();Ext.tree.TreePanel=Ext.extend(Ext.Panel,{rootVisible:true,animate:Ext.enableFx,lines:true,enableDD:false,hlDrop:Ext.enableFx,pathSeparator:"/",initComponent:function(){Ext.tree.TreePanel.superclass.initComponent.call(this);if(!this.eventModel){this.eventModel=new Ext.tree.TreeEventModel(this)}var l=this.loader;if(!l){l=new Ext.tree.TreeLoader({dataUrl:this.dataUrl})}else{if(typeof l=="object"&&!l.load){l=new Ext.tree.TreeLoader(l)}}this.loader=l;this.nodeHash={};if(this.root){this.setRootNode(this.root)}this.addEvents("append","remove","movenode","insert","beforeappend","beforeremove","beforemovenode","beforeinsert","beforeload","load","textchange","beforeexpandnode","beforecollapsenode","expandnode","disabledchange","collapsenode","beforeclick","click","checkchange","dblclick","contextmenu","beforechildrenrendered","startdrag","enddrag","dragdrop","beforenodedrop","nodedrop","nodedragover");if(this.singleExpand){this.on("beforeexpandnode",this.restrictExpand,this)}},proxyNodeEvent:function(_2,a1,a2,a3,a4,a5,a6){if(_2=="collapse"||_2=="expand"||_2=="beforecollapse"||_2=="beforeexpand"||_2=="move"||_2=="beforemove"){_2=_2+"node"}return this.fireEvent(_2,a1,a2,a3,a4,a5,a6)},getRootNode:function(){return this.root},setRootNode:function(_9){if(!_9.render){_9=this.loader.createNode(_9)}this.root=_9;_9.ownerTree=this;_9.isRoot=true;this.registerNode(_9);if(!this.rootVisible){var _a=_9.attributes.uiProvider;_9.ui=_a?new _a(_9):new Ext.tree.RootTreeNodeUI(_9)}return _9},getNodeById:function(id){return this.nodeHash[id]},registerNode:function(_c){this.nodeHash[_c.id]=_c},unregisterNode:function(_d){delete this.nodeHash[_d.id]},toString:function(){return"[Tree"+(this.id?" "+this.id:"")+"]"},restrictExpand:function(_e){var p=_e.parentNode;if(p){if(p.expandedChild&&p.expandedChild.parentNode==p){p.expandedChild.collapse()}p.expandedChild=_e}},getChecked:function(a,_11){_11=_11||this.root;var r=[];var f=function(){if(this.attributes.checked){r.push(!a?this:(a=="id"?this.id:this.attributes[a]))}};_11.cascade(f);return r},getEl:function(){return this.el},getLoader:function(){return this.loader},expandAll:function(){this.root.expand(true)},collapseAll:function(){this.root.collapse(true)},getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.tree.DefaultSelectionModel()}return this.selModel},expandPath:function(_14,_15,_16){_15=_15||"id";var _17=_14.split(this.pathSeparator);var _18=this.root;if(_18.attributes[_15]!=_17[1]){if(_16){_16(false,null)}return}var _19=1;var f=function(){if(++_19==_17.length){if(_16){_16(true,_18)}return}var c=_18.findChild(_15,_17[_19]);if(!c){if(_16){_16(false,_18)}return}_18=c;c.expand(false,false,f)};_18.expand(false,false,f)},selectPath:function(_1c,_1d,_1e){_1d=_1d||"id";var _1f=_1c.split(this.pathSeparator);var v=_1f.pop();if(_1f.length>0){var f=function(_22,_23){if(_22&&_23){var n=_23.findChild(_1d,v);if(n){n.select();if(_1e){_1e(true,n)}}else{if(_1e){_1e(false,n)}}}else{if(_1e){_1e(false,n)}}};this.expandPath(_1f.join(this.pathSeparator),_1d,f)}else{this.root.select();if(_1e){_1e(true,this.root)}}},getTreeEl:function(){return this.body},onRender:function(ct,_26){Ext.tree.TreePanel.superclass.onRender.call(this,ct,_26);this.el.addClass("x-tree");this.innerCt=this.body.createChild({tag:"ul",cls:"x-tree-root-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")})},initEvents:function(){Ext.tree.TreePanel.superclass.initEvents.call(this);if(this.containerScroll){Ext.dd.ScrollManager.register(this.body)}if((this.enableDD||this.enableDrop)&&!this.dropZone){this.dropZone=new Ext.tree.TreeDropZone(this,this.dropConfig||{ddGroup:this.ddGroup||"TreeDD",appendOnly:this.ddAppendOnly===true})}if((this.enableDD||this.enableDrag)&&!this.dragZone){this.dragZone=new Ext.tree.TreeDragZone(this,this.dragConfig||{ddGroup:this.ddGroup||"TreeDD",scroll:this.ddScroll})}this.getSelectionModel().init(this)},afterRender:function(){Ext.tree.TreePanel.superclass.afterRender.call(this);this.root.render();if(!this.rootVisible){this.root.renderChildren()}},onDestroy:function(){if(this.rendered){this.body.removeAllListeners();Ext.dd.ScrollManager.unregister(this.body);if(this.dropZone){this.dropZone.unreg()}if(this.dragZone){this.dragZone.unreg()}}this.root.destroy();this.nodeHash=null;Ext.tree.TreePanel.superclass.onDestroy.call(this)}});Ext.tree.TreePanel.nodeTypes={};Ext.reg("treepanel",Ext.tree.TreePanel);Ext.tree.TreeEventModel=function(_1){this.tree=_1;this.tree.on("render",this.initEvents,this)};Ext.tree.TreeEventModel.prototype={initEvents:function(){var el=this.tree.getTreeEl();el.on("click",this.delegateClick,this);if(this.tree.trackMouseOver!==false){el.on("mouseover",this.delegateOver,this);el.on("mouseout",this.delegateOut,this)}el.on("dblclick",this.delegateDblClick,this);el.on("contextmenu",this.delegateContextMenu,this)},getNode:function(e){var t;if(t=e.getTarget(".x-tree-node-el",10)){var id=Ext.fly(t,"_treeEvents").getAttributeNS("ext","tree-node-id");if(id){return this.tree.getNodeById(id)}}return null},getNodeTarget:function(e){var t=e.getTarget(".x-tree-node-icon",1);if(!t){t=e.getTarget(".x-tree-node-el",6)}return t},delegateOut:function(e,t){if(!this.beforeEvent(e)){return}if(e.getTarget(".x-tree-ec-icon",1)){var n=this.getNode(e);this.onIconOut(e,n);if(n==this.lastEcOver){delete this.lastEcOver}}if((t=this.getNodeTarget(e))&&!e.within(t,true)){this.onNodeOut(e,this.getNode(e))}},delegateOver:function(e,t){if(!this.beforeEvent(e)){return}if(this.lastEcOver){this.onIconOut(e,this.lastEcOver);delete this.lastEcOver}if(e.getTarget(".x-tree-ec-icon",1)){this.lastEcOver=this.getNode(e);this.onIconOver(e,this.lastEcOver)}if(t=this.getNodeTarget(e)){this.onNodeOver(e,this.getNode(e))}},delegateClick:function(e,t){if(!this.beforeEvent(e)){return}if(e.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(e,this.getNode(e))}else{if(e.getTarget(".x-tree-ec-icon",1)){this.onIconClick(e,this.getNode(e))}else{if(this.getNodeTarget(e)){this.onNodeClick(e,this.getNode(e))}}}},delegateDblClick:function(e,t){if(this.beforeEvent(e)&&this.getNodeTarget(e)){this.onNodeDblClick(e,this.getNode(e))}},delegateContextMenu:function(e,t){if(this.beforeEvent(e)&&this.getNodeTarget(e)){this.onNodeContextMenu(e,this.getNode(e))}},onNodeClick:function(e,_14){_14.ui.onClick(e)},onNodeOver:function(e,_16){_16.ui.onOver(e)},onNodeOut:function(e,_18){_18.ui.onOut(e)},onIconOver:function(e,_1a){_1a.ui.addClass("x-tree-ec-over")},onIconOut:function(e,_1c){_1c.ui.removeClass("x-tree-ec-over")},onIconClick:function(e,_1e){_1e.ui.ecClick(e)},onCheckboxClick:function(e,_20){_20.ui.onCheckChange(e)},onNodeDblClick:function(e,_22){_22.ui.onDblClick(e)},onNodeContextMenu:function(e,_24){_24.ui.onContextMenu(e)},beforeEvent:function(e){if(this.disabled){e.stopEvent();return false}return true},disable:function(){this.disabled=true},enable:function(){this.disabled=false}};Ext.tree.DefaultSelectionModel=function(_1){this.selNode=null;this.addEvents("selectionchange","beforeselect");Ext.apply(this,_1);
48
+ Ext.tree.DefaultSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.tree.DefaultSelectionModel,Ext.util.Observable,{init:function(_2){this.tree=_2;_2.getTreeEl().on("keydown",this.onKeyDown,this);_2.on("click",this.onNodeClick,this)},onNodeClick:function(_3,e){this.select(_3)},select:function(_5){var _6=this.selNode;if(_6!=_5&&this.fireEvent("beforeselect",this,_5,_6)!==false){if(_6){_6.ui.onSelectedChange(false)}this.selNode=_5;_5.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,_5,_6)}return _5},unselect:function(_7){if(this.selNode==_7){this.clearSelections()}},clearSelections:function(){var n=this.selNode;if(n){n.ui.onSelectedChange(false);this.selNode=null;this.fireEvent("selectionchange",this,null)}return n},getSelectedNode:function(){return this.selNode},isSelected:function(_9){return this.selNode==_9},selectPrevious:function(){var s=this.selNode||this.lastSelNode;if(!s){return null}var ps=s.previousSibling;if(ps){if(!ps.isExpanded()||ps.childNodes.length<1){return this.select(ps)}else{var lc=ps.lastChild;while(lc&&lc.isExpanded()&&lc.childNodes.length>0){lc=lc.lastChild}return this.select(lc)}}else{if(s.parentNode&&(this.tree.rootVisible||!s.parentNode.isRoot)){return this.select(s.parentNode)}}return null},selectNext:function(){var s=this.selNode||this.lastSelNode;if(!s){return null}if(s.firstChild&&s.isExpanded()){return this.select(s.firstChild)}else{if(s.nextSibling){return this.select(s.nextSibling)}else{if(s.parentNode){var _e=null;s.parentNode.bubble(function(){if(this.nextSibling){_e=this.getOwnerTree().selModel.select(this.nextSibling);return false}});return _e}}}return null},onKeyDown:function(e){var s=this.selNode||this.lastSelNode;var sm=this;if(!s){return}var k=e.getKey();switch(k){case e.DOWN:e.stopEvent();this.selectNext();break;case e.UP:e.stopEvent();this.selectPrevious();break;case e.RIGHT:e.preventDefault();if(s.hasChildNodes()){if(!s.isExpanded()){s.expand()}else{if(s.firstChild){this.select(s.firstChild,e)}}}break;case e.LEFT:e.preventDefault();if(s.hasChildNodes()&&s.isExpanded()){s.collapse()}else{if(s.parentNode&&(this.tree.rootVisible||s.parentNode!=this.tree.getRootNode())){this.select(s.parentNode,e)}}break}}});Ext.tree.MultiSelectionModel=function(_13){this.selNodes=[];this.selMap={};this.addEvents("selectionchange");Ext.apply(this,_13);Ext.tree.MultiSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.tree.MultiSelectionModel,Ext.util.Observable,{init:function(_14){this.tree=_14;_14.getTreeEl().on("keydown",this.onKeyDown,this);_14.on("click",this.onNodeClick,this)},onNodeClick:function(_15,e){this.select(_15,e,e.ctrlKey)},select:function(_17,e,_19){if(_19!==true){this.clearSelections(true)}if(this.isSelected(_17)){this.lastSelNode=_17;return _17}this.selNodes.push(_17);this.selMap[_17.id]=_17;this.lastSelNode=_17;_17.ui.onSelectedChange(true);this.fireEvent("selectionchange",this,this.selNodes);return _17},unselect:function(_1a){if(this.selMap[_1a.id]){_1a.ui.onSelectedChange(false);var sn=this.selNodes;var _1c=sn.indexOf(_1a);if(_1c!=-1){this.selNodes.splice(_1c,1)}delete this.selMap[_1a.id];this.fireEvent("selectionchange",this,this.selNodes)}},clearSelections:function(_1d){var sn=this.selNodes;if(sn.length>0){for(var i=0,len=sn.length;i<len;i++){sn[i].ui.onSelectedChange(false)}this.selNodes=[];this.selMap={};if(_1d!==true){this.fireEvent("selectionchange",this,this.selNodes)}}},isSelected:function(_21){return this.selMap[_21.id]?true:false},getSelectedNodes:function(){return this.selNodes},onKeyDown:Ext.tree.DefaultSelectionModel.prototype.onKeyDown,selectNext:Ext.tree.DefaultSelectionModel.prototype.selectNext,selectPrevious:Ext.tree.DefaultSelectionModel.prototype.selectPrevious});Ext.tree.TreeNode=function(_1){_1=_1||{};if(typeof _1=="string"){_1={text:_1}}this.childrenRendered=false;this.rendered=false;Ext.tree.TreeNode.superclass.constructor.call(this,_1);this.expanded=_1.expanded===true;this.isTarget=_1.isTarget!==false;this.draggable=_1.draggable!==false&&_1.allowDrag!==false;this.allowChildren=_1.allowChildren!==false&&_1.allowDrop!==false;this.text=_1.text;this.disabled=_1.disabled===true;this.addEvents("textchange","beforeexpand","beforecollapse","expand","disabledchange","collapse","beforeclick","click","checkchange","dblclick","contextmenu","beforechildrenrendered");var _2=this.attributes.uiProvider||this.defaultUI||Ext.tree.TreeNodeUI;this.ui=new _2(this)};Ext.extend(Ext.tree.TreeNode,Ext.data.Node,{preventHScroll:true,isExpanded:function(){return this.expanded},getUI:function(){return this.ui},getLoader:function(){var _3;return this.loader||((_3=this.getOwnerTree())&&_3.loader?_3.loader:new Ext.tree.TreeLoader())},setFirstChild:function(_4){var of=this.firstChild;Ext.tree.TreeNode.superclass.setFirstChild.call(this,_4);if(this.childrenRendered&&of&&_4!=of){of.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},setLastChild:function(_6){var ol=this.lastChild;Ext.tree.TreeNode.superclass.setLastChild.call(this,_6);if(this.childrenRendered&&ol&&_6!=ol){ol.renderIndent(true,true)}if(this.rendered){this.renderIndent(true,true)}},appendChild:function(n){if(!n.render&&!Ext.isArray(n)){n=this.getLoader().createNode(n)}var _9=Ext.tree.TreeNode.superclass.appendChild.call(this,n);if(_9&&this.childrenRendered){_9.render()}this.ui.updateExpandIcon();return _9},removeChild:function(_a){this.ownerTree.getSelectionModel().unselect(_a);Ext.tree.TreeNode.superclass.removeChild.apply(this,arguments);if(this.childrenRendered){_a.ui.remove()}if(this.childNodes.length<1){this.collapse(false,false)}else{this.ui.updateExpandIcon()}if(!this.firstChild&&!this.isHiddenRoot()){this.childrenRendered=false}return _a},insertBefore:function(_b,_c){if(!_b.render){_b=this.getLoader().createNode(_b)}var _d=Ext.tree.TreeNode.superclass.insertBefore.apply(this,arguments);if(_d&&_c&&this.childrenRendered){_b.render()}this.ui.updateExpandIcon();return _d},setText:function(_e){var _f=this.text;this.text=_e;this.attributes.text=_e;if(this.rendered){this.ui.onTextChange(this,_e,_f)}this.fireEvent("textchange",this,_e,_f)},select:function(){this.getOwnerTree().getSelectionModel().select(this)},unselect:function(){this.getOwnerTree().getSelectionModel().unselect(this)},isSelected:function(){return this.getOwnerTree().getSelectionModel().isSelected(this)},expand:function(_10,_11,_12){if(!this.expanded){if(this.fireEvent("beforeexpand",this,_10,_11)===false){return}if(!this.childrenRendered){this.renderChildren()}this.expanded=true;if(!this.isHiddenRoot()&&(this.getOwnerTree().animate&&_11!==false)||_11){this.ui.animExpand(function(){this.fireEvent("expand",this);if(typeof _12=="function"){_12(this)}if(_10===true){this.expandChildNodes(true)}}.createDelegate(this));return}else{this.ui.expand();this.fireEvent("expand",this);if(typeof _12=="function"){_12(this)}}}else{if(typeof _12=="function"){_12(this)}}if(_10===true){this.expandChildNodes(true)}},isHiddenRoot:function(){return this.isRoot&&!this.getOwnerTree().rootVisible},collapse:function(_13,_14){if(this.expanded&&!this.isHiddenRoot()){if(this.fireEvent("beforecollapse",this,_13,_14)===false){return}this.expanded=false;if((this.getOwnerTree().animate&&_14!==false)||_14){this.ui.animCollapse(function(){this.fireEvent("collapse",this);if(_13===true){this.collapseChildNodes(true)}}.createDelegate(this));return}else{this.ui.collapse();this.fireEvent("collapse",this)}}if(_13===true){var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){cs[i].collapse(true,false)}}},delayedExpand:function(_18){if(!this.expandProcId){this.expandProcId=this.expand.defer(_18,this)}},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId)}this.expandProcId=false},toggle:function(){if(this.expanded){this.collapse()}else{this.expand()}},ensureVisible:function(_19){var _1a=this.getOwnerTree();_1a.expandPath(this.parentNode?this.parentNode.getPath():this.getPath(),false,function(){var _1b=_1a.getNodeById(this.id);_1a.getTreeEl().scrollChildIntoView(_1b.ui.anchor);
49
+ Ext.callback(_19)}.createDelegate(this))},expandChildNodes:function(_1c){var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){cs[i].expand(_1c)}},collapseChildNodes:function(_20){var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){cs[i].collapse(_20)}},disable:function(){this.disabled=true;this.unselect();if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,true)}this.fireEvent("disabledchange",this,true)},enable:function(){this.disabled=false;if(this.rendered&&this.ui.onDisableChange){this.ui.onDisableChange(this,false)}this.fireEvent("disabledchange",this,false)},renderChildren:function(_24){if(_24!==false){this.fireEvent("beforechildrenrendered",this)}var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){cs[i].render(true)}this.childrenRendered=true},sort:function(fn,_29){Ext.tree.TreeNode.superclass.sort.apply(this,arguments);if(this.childrenRendered){var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){cs[i].render(true)}}},render:function(_2d){this.ui.render(_2d);if(!this.rendered){this.getOwnerTree().registerNode(this);this.rendered=true;if(this.expanded){this.expanded=false;this.expand(false,false)}}},renderIndent:function(_2e,_2f){if(_2f){this.ui.childIndent=null}this.ui.renderIndent();if(_2e===true&&this.childrenRendered){var cs=this.childNodes;for(var i=0,len=cs.length;i<len;i++){cs[i].renderIndent(true,_2f)}}},beginUpdate:function(){this.childrenRendered=false},endUpdate:function(){if(this.expanded&&this.rendered){this.renderChildren()}},destroy:function(){if(this.childNodes){for(var i=0,l=this.childNodes.length;i<l;i++){this.childNodes[i].destroy()}this.childNodes=null}if(this.ui.destroy){this.ui.destroy()}}});Ext.tree.TreePanel.nodeTypes.node=Ext.tree.TreeNode;Ext.tree.AsyncTreeNode=function(_1){this.loaded=_1&&_1.loaded===true;this.loading=false;Ext.tree.AsyncTreeNode.superclass.constructor.apply(this,arguments);this.addEvents("beforeload","load")};Ext.extend(Ext.tree.AsyncTreeNode,Ext.tree.TreeNode,{expand:function(_2,_3,_4){if(this.loading){var _5;var f=function(){if(!this.loading){clearInterval(_5);this.expand(_2,_3,_4)}}.createDelegate(this);_5=setInterval(f,200);return}if(!this.loaded){if(this.fireEvent("beforeload",this)===false){return}this.loading=true;this.ui.beforeLoad(this);var _7=this.loader||this.attributes.loader||this.getOwnerTree().getLoader();if(_7){_7.load(this,this.loadComplete.createDelegate(this,[_2,_3,_4]));return}}Ext.tree.AsyncTreeNode.superclass.expand.call(this,_2,_3,_4)},isLoading:function(){return this.loading},loadComplete:function(_8,_9,_a){this.loading=false;this.loaded=true;this.ui.afterLoad(this);this.fireEvent("load",this);this.expand(_8,_9,_a)},isLoaded:function(){return this.loaded},hasChildNodes:function(){if(!this.isLeaf()&&!this.loaded){return true}else{return Ext.tree.AsyncTreeNode.superclass.hasChildNodes.call(this)}},reload:function(_b){this.collapse(false,false);while(this.firstChild){this.removeChild(this.firstChild).destroy()}this.childrenRendered=false;this.loaded=false;if(this.isHiddenRoot()){this.expanded=false}this.expand(false,false,_b)}});Ext.tree.TreePanel.nodeTypes.async=Ext.tree.AsyncTreeNode;Ext.tree.TreeNodeUI=function(_1){this.node=_1;this.rendered=false;this.animating=false;this.wasLeaf=true;this.ecc="x-tree-ec-icon x-tree-elbow";this.emptyIcon=Ext.BLANK_IMAGE_URL};Ext.tree.TreeNodeUI.prototype={removeChild:function(_2){if(this.rendered){this.ctNode.removeChild(_2.ui.getEl())}},beforeLoad:function(){this.addClass("x-tree-node-loading")},afterLoad:function(){this.removeClass("x-tree-node-loading")},onTextChange:function(_3,_4,_5){if(this.rendered){this.textNode.innerHTML=_4}},onDisableChange:function(_6,_7){this.disabled=_7;if(this.checkbox){this.checkbox.disabled=_7}if(_7){this.addClass("x-tree-node-disabled")}else{this.removeClass("x-tree-node-disabled")}},onSelectedChange:function(_8){if(_8){this.focus();this.addClass("x-tree-selected")}else{this.removeClass("x-tree-selected")}},onMove:function(_9,_a,_b,_c,_d,_e){this.childIndent=null;if(this.rendered){var _f=_c.ui.getContainer();if(!_f){this.holder=document.createElement("div");this.holder.appendChild(this.wrap);return}var _10=_e?_e.ui.getEl():null;if(_10){_f.insertBefore(this.wrap,_10)}else{_f.appendChild(this.wrap)}this.node.renderIndent(true)}},addClass:function(cls){if(this.elNode){Ext.fly(this.elNode).addClass(cls)}},removeClass:function(cls){if(this.elNode){Ext.fly(this.elNode).removeClass(cls)}},remove:function(){if(this.rendered){this.holder=document.createElement("div");this.holder.appendChild(this.wrap)}},fireEvent:function(){return this.node.fireEvent.apply(this.node,arguments)},initEvents:function(){this.node.on("move",this.onMove,this);if(this.node.disabled){this.addClass("x-tree-node-disabled");if(this.checkbox){this.checkbox.disabled=true}}if(this.node.hidden){this.hide()}var ot=this.node.getOwnerTree();var dd=ot.enableDD||ot.enableDrag||ot.enableDrop;if(dd&&(!this.node.isRoot||ot.rootVisible)){Ext.dd.Registry.register(this.elNode,{node:this.node,handles:this.getDDHandles(),isHandle:false})}},getDDHandles:function(){return[this.iconNode,this.textNode,this.elNode]},hide:function(){this.node.hidden=true;if(this.wrap){this.wrap.style.display="none"}},show:function(){this.node.hidden=false;if(this.wrap){this.wrap.style.display=""}},onContextMenu:function(e){if(this.node.hasListener("contextmenu")||this.node.getOwnerTree().hasListener("contextmenu")){e.preventDefault();this.focus();this.fireEvent("contextmenu",this.node,e)}},onClick:function(e){if(this.dropping){e.stopEvent();return}if(this.fireEvent("beforeclick",this.node,e)!==false){var a=e.getTarget("a");if(!this.disabled&&this.node.attributes.href&&a){this.fireEvent("click",this.node,e);return}else{if(a&&e.ctrlKey){e.stopEvent()}}e.preventDefault();if(this.disabled){return}if(this.node.attributes.singleClickExpand&&!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("click",this.node,e)}else{e.stopEvent()}},onDblClick:function(e){e.preventDefault();if(this.disabled){return}if(this.checkbox){this.toggleCheck()}if(!this.animating&&this.node.isExpandable()){this.node.toggle()}this.fireEvent("dblclick",this.node,e)},onOver:function(e){this.addClass("x-tree-node-over")},onOut:function(e){this.removeClass("x-tree-node-over")},onCheckChange:function(){var _1b=this.checkbox.checked;this.checkbox.defaultChecked=_1b;this.node.attributes.checked=_1b;this.fireEvent("checkchange",this.node,_1b)},ecClick:function(e){if(!this.animating&&this.node.isExpandable()){this.node.toggle()}},startDrop:function(){this.dropping=true},endDrop:function(){setTimeout(function(){this.dropping=false}.createDelegate(this),50)},expand:function(){this.updateExpandIcon();this.ctNode.style.display=""},focus:function(){if(!this.node.preventHScroll){try{this.anchor.focus()}catch(e){}}else{try{var _1d=this.node.getOwnerTree().getTreeEl().dom;var l=_1d.scrollLeft;this.anchor.focus();_1d.scrollLeft=l}catch(e){}}},toggleCheck:function(_1f){var cb=this.checkbox;if(cb){cb.checked=(_1f===undefined?!cb.checked:_1f);this.onCheckChange()}},blur:function(){try{this.anchor.blur()}catch(e){}},animExpand:function(_21){var ct=Ext.get(this.ctNode);ct.stopFx();if(!this.node.isExpandable()){this.updateExpandIcon();this.ctNode.style.display="";Ext.callback(_21);return}this.animating=true;this.updateExpandIcon();ct.slideIn("t",{callback:function(){this.animating=false;Ext.callback(_21)},scope:this,duration:this.node.ownerTree.duration||0.25})},highlight:function(){var _23=this.node.getOwnerTree();Ext.fly(this.wrap).highlight(_23.hlColor||"C3DAF9",{endColor:_23.hlBaseColor})},collapse:function(){this.updateExpandIcon();this.ctNode.style.display="none"},animCollapse:function(_24){var ct=Ext.get(this.ctNode);ct.enableDisplayMode("block");ct.stopFx();this.animating=true;this.updateExpandIcon();ct.slideOut("t",{callback:function(){this.animating=false;Ext.callback(_24)},scope:this,duration:this.node.ownerTree.duration||0.25})},getContainer:function(){return this.ctNode
50
+ },getEl:function(){return this.wrap},appendDDGhost:function(_26){_26.appendChild(this.elNode.cloneNode(true))},getDDRepairXY:function(){return Ext.lib.Dom.getXY(this.iconNode)},onRender:function(){this.render()},render:function(_27){var n=this.node,a=n.attributes;var _2a=n.parentNode?n.parentNode.ui.getContainer():n.ownerTree.innerCt.dom;if(!this.rendered){this.rendered=true;this.renderElements(n,a,_2a,_27);if(a.qtip){if(this.textNode.setAttributeNS){this.textNode.setAttributeNS("ext","qtip",a.qtip);if(a.qtipTitle){this.textNode.setAttributeNS("ext","qtitle",a.qtipTitle)}}else{this.textNode.setAttribute("ext:qtip",a.qtip);if(a.qtipTitle){this.textNode.setAttribute("ext:qtitle",a.qtipTitle)}}}else{if(a.qtipCfg){a.qtipCfg.target=Ext.id(this.textNode);Ext.QuickTips.register(a.qtipCfg)}}this.initEvents();if(!this.node.expanded){this.updateExpandIcon(true)}}else{if(_27===true){_2a.appendChild(this.wrap)}}},renderElements:function(n,a,_2d,_2e){this.indentMarkup=n.parentNode?n.parentNode.ui.getChildIndent():"";var cb=typeof a.checked=="boolean";var _30=a.href?a.href:Ext.isGecko?"":"#";var buf=['<li class="x-tree-node"><div ext:tree-node-id="',n.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',a.cls,'" unselectable="on">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />','<img src="',a.icon||this.emptyIcon,'" class="x-tree-node-icon',(a.icon?" x-tree-node-inline-icon":""),(a.iconCls?" "+a.iconCls:""),'" unselectable="on" />',cb?('<input class="x-tree-node-cb" type="checkbox" '+(a.checked?'checked="checked" />':"/>")):"",'<a hidefocus="on" class="x-tree-node-anchor" href="',_30,'" tabIndex="1" ',a.hrefTarget?' target="'+a.hrefTarget+'"':"",'><span unselectable="on">',n.text,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"].join("");var nel;if(_2e!==true&&n.nextSibling&&(nel=n.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",nel,buf)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",_2d,buf)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var cs=this.elNode.childNodes;this.indentNode=cs[0];this.ecNode=cs[1];this.iconNode=cs[2];var _34=3;if(cb){this.checkbox=cs[3];this.checkbox.defaultChecked=this.checkbox.checked;_34++}this.anchor=cs[_34];this.textNode=cs[_34].firstChild},getAnchor:function(){return this.anchor},getTextEl:function(){return this.textNode},getIconEl:function(){return this.iconNode},isChecked:function(){return this.checkbox?this.checkbox.checked:false},updateExpandIcon:function(){if(this.rendered){var n=this.node,c1,c2;var cls=n.isLast()?"x-tree-elbow-end":"x-tree-elbow";if(n.isExpandable()){if(n.expanded){cls+="-minus";c1="x-tree-node-collapsed";c2="x-tree-node-expanded"}else{cls+="-plus";c1="x-tree-node-expanded";c2="x-tree-node-collapsed"}if(this.wasLeaf){this.removeClass("x-tree-node-leaf");this.wasLeaf=false}if(this.c1!=c1||this.c2!=c2){Ext.fly(this.elNode).replaceClass(c1,c2);this.c1=c1;this.c2=c2}}else{if(!this.wasLeaf){Ext.fly(this.elNode).replaceClass("x-tree-node-expanded","x-tree-node-leaf");delete this.c1;delete this.c2;this.wasLeaf=true}}var ecc="x-tree-ec-icon "+cls;if(this.ecc!=ecc){this.ecNode.className=ecc;this.ecc=ecc}}},getChildIndent:function(){if(!this.childIndent){var buf=[];var p=this.node;while(p){if(!p.isRoot||(p.isRoot&&p.ownerTree.rootVisible)){if(!p.isLast()){buf.unshift('<img src="'+this.emptyIcon+'" class="x-tree-elbow-line" />')}else{buf.unshift('<img src="'+this.emptyIcon+'" class="x-tree-icon" />')}}p=p.parentNode}this.childIndent=buf.join("")}return this.childIndent},renderIndent:function(){if(this.rendered){var _3c="";var p=this.node.parentNode;if(p){_3c=p.ui.getChildIndent()}if(this.indentMarkup!=_3c){this.indentNode.innerHTML=_3c;this.indentMarkup=_3c}this.updateExpandIcon()}},destroy:function(){if(this.elNode){Ext.dd.Registry.unregister(this.elNode.id)}delete this.elNode;delete this.ctNode;delete this.indentNode;delete this.ecNode;delete this.iconNode;delete this.checkbox;delete this.anchor;delete this.textNode;if(this.holder){delete this.wrap;Ext.removeNode(this.holder);delete this.holder}else{Ext.removeNode(this.wrap);delete this.wrap}}};Ext.tree.RootTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{render:function(){if(!this.rendered){var _3e=this.node.ownerTree.innerCt.dom;this.node.expanded=true;_3e.innerHTML='<div class="x-tree-root-node"></div>';this.wrap=this.ctNode=_3e.firstChild}},collapse:Ext.emptyFn,expand:Ext.emptyFn});Ext.tree.TreeLoader=function(_1){this.baseParams={};Ext.apply(this,_1);this.addEvents("beforeload","load","loadexception");Ext.tree.TreeLoader.superclass.constructor.call(this)};Ext.extend(Ext.tree.TreeLoader,Ext.util.Observable,{uiProviders:{},clearOnLoad:true,load:function(_2,_3){if(this.clearOnLoad){while(_2.firstChild){_2.removeChild(_2.firstChild)}}if(this.doPreload(_2)){if(typeof _3=="function"){_3()}}else{if(this.dataUrl||this.url){this.requestData(_2,_3)}}},doPreload:function(_4){if(_4.attributes.children){if(_4.childNodes.length<1){var cs=_4.attributes.children;_4.beginUpdate();for(var i=0,_7=cs.length;i<_7;i++){var cn=_4.appendChild(this.createNode(cs[i]));if(this.preloadChildren){this.doPreload(cn)}}_4.endUpdate()}return true}else{return false}},getParams:function(_9){var _a=[],bp=this.baseParams;for(var _c in bp){if(typeof bp[_c]!="function"){_a.push(encodeURIComponent(_c),"=",encodeURIComponent(bp[_c]),"&")}}_a.push("node=",encodeURIComponent(_9.id));return _a.join("")},requestData:function(_d,_e){if(this.fireEvent("beforeload",this,_d,_e)!==false){this.transId=Ext.Ajax.request({method:this.requestMethod,url:this.dataUrl||this.url,success:this.handleResponse,failure:this.handleFailure,scope:this,argument:{callback:_e,node:_d},params:this.getParams(_d)})}else{if(typeof _e=="function"){_e()}}},isLoading:function(){return !!this.transId},abort:function(){if(this.isLoading()){Ext.Ajax.abort(this.transId)}},createNode:function(_f){if(this.baseAttrs){Ext.applyIf(_f,this.baseAttrs)}if(this.applyLoader!==false){_f.loader=this}if(typeof _f.uiProvider=="string"){_f.uiProvider=this.uiProviders[_f.uiProvider]||eval(_f.uiProvider)}if(_f.nodeType){return new Ext.tree.TreePanel.nodeTypes[_f.nodeType](_f)}else{return _f.leaf?new Ext.tree.TreeNode(_f):new Ext.tree.AsyncTreeNode(_f)}},processResponse:function(_10,_11,_12){var _13=_10.responseText;try{var o=eval("("+_13+")");_11.beginUpdate();for(var i=0,len=o.length;i<len;i++){var n=this.createNode(o[i]);if(n){_11.appendChild(n)}}_11.endUpdate();if(typeof _12=="function"){_12(this,_11)}}catch(e){this.handleFailure(_10)}},handleResponse:function(_18){this.transId=false;var a=_18.argument;this.processResponse(_18,a.node,a.callback);this.fireEvent("load",this,a.node,_18)},handleFailure:function(_1a){this.transId=false;var a=_1a.argument;this.fireEvent("loadexception",this,a.node,_1a);if(typeof a.callback=="function"){a.callback(this,a.node)}}});Ext.tree.TreeFilter=function(_1,_2){this.tree=_1;this.filtered={};Ext.apply(this,_2)};Ext.tree.TreeFilter.prototype={clearBlank:false,reverse:false,autoClear:false,remove:false,filter:function(_3,_4,_5){_4=_4||"text";var f;if(typeof _3=="string"){var _7=_3.length;if(_7==0&&this.clearBlank){this.clear();return}_3=_3.toLowerCase();f=function(n){return n.attributes[_4].substr(0,_7).toLowerCase()==_3}}else{if(_3.exec){f=function(n){return _3.test(n.attributes[_4])}}else{throw"Illegal filter type, must be string or regex"}}this.filterBy(f,null,_5)},filterBy:function(fn,_b,_c){_c=_c||this.tree.root;if(this.autoClear){this.clear()}var af=this.filtered,rv=this.reverse;var f=function(n){if(n==_c){return true}if(af[n.id]){return false}var m=fn.call(_b||n,n);if(!m||rv){af[n.id]=n;n.ui.hide();return false}return true};_c.cascade(f);if(this.remove){for(var id in af){if(typeof id!="function"){var n=af[id];if(n&&n.parentNode){n.parentNode.removeChild(n)}}}}},clear:function(){var t=this.tree;var af=this.filtered;for(var id in af){if(typeof id!="function"){var n=af[id];
51
+ if(n){n.ui.show()}}}this.filtered={}}};Ext.tree.TreeSorter=function(_1,_2){Ext.apply(this,_2);_1.on("beforechildrenrendered",this.doSort,this);_1.on("append",this.updateSort,this);_1.on("insert",this.updateSort,this);_1.on("textchange",this.updateSortParent,this);var _3=this.dir&&this.dir.toLowerCase()=="desc";var p=this.property||"text";var _5=this.sortType;var fs=this.folderSort;var cs=this.caseSensitive===true;var _8=this.leafAttr||"leaf";this.sortFn=function(n1,n2){if(fs){if(n1.attributes[_8]&&!n2.attributes[_8]){return 1}if(!n1.attributes[_8]&&n2.attributes[_8]){return -1}}var v1=_5?_5(n1):(cs?n1.attributes[p]:n1.attributes[p].toUpperCase());var v2=_5?_5(n2):(cs?n2.attributes[p]:n2.attributes[p].toUpperCase());if(v1<v2){return _3?+1:-1}else{if(v1>v2){return _3?-1:+1}else{return 0}}}};Ext.tree.TreeSorter.prototype={doSort:function(_d){_d.sort(this.sortFn)},compareNodes:function(n1,n2){return(n1.text.toUpperCase()>n2.text.toUpperCase()?1:-1)},updateSort:function(_10,_11){if(_11.childrenRendered){this.doSort.defer(1,this,[_11])}},updateSortParent:function(_12){var p=_12.parentNode;if(p&&p.childrenRendered){this.doSort.defer(1,this,[p])}}};if(Ext.dd.DropZone){Ext.tree.TreeDropZone=function(_1,_2){this.allowParentInsert=false;this.allowContainerDrop=false;this.appendOnly=false;Ext.tree.TreeDropZone.superclass.constructor.call(this,_1.innerCt,_2);this.tree=_1;this.dragOverData={};this.lastInsertClass="x-tree-no-status"};Ext.extend(Ext.tree.TreeDropZone,Ext.dd.DropZone,{ddGroup:"TreeDD",expandDelay:1000,expandNode:function(_3){if(_3.hasChildNodes()&&!_3.isExpanded()){_3.expand(false,null,this.triggerCacheRefresh.createDelegate(this))}},queueExpand:function(_4){this.expandProcId=this.expandNode.defer(this.expandDelay,this,[_4])},cancelExpand:function(){if(this.expandProcId){clearTimeout(this.expandProcId);this.expandProcId=false}},isValidDropPoint:function(n,pt,dd,e,_9){if(!n||!_9){return false}var _a=n.node;var _b=_9.node;if(!(_a&&_a.isTarget&&pt)){return false}if(pt=="append"&&_a.allowChildren===false){return false}if((pt=="above"||pt=="below")&&(_a.parentNode&&_a.parentNode.allowChildren===false)){return false}if(_b&&(_a==_b||_b.contains(_a))){return false}var _c=this.dragOverData;_c.tree=this.tree;_c.target=_a;_c.data=_9;_c.point=pt;_c.source=dd;_c.rawEvent=e;_c.dropNode=_b;_c.cancel=false;var _d=this.tree.fireEvent("nodedragover",_c);return _c.cancel===false&&_d!==false},getDropPoint:function(e,n,dd){var tn=n.node;if(tn.isRoot){return tn.allowChildren!==false?"append":false}var _12=n.ddel;var t=Ext.lib.Dom.getY(_12),b=t+_12.offsetHeight;var y=Ext.lib.Event.getPageY(e);var _16=tn.allowChildren===false||tn.isLeaf();if(this.appendOnly||tn.parentNode.allowChildren===false){return _16?false:"append"}var _17=false;if(!this.allowParentInsert){_17=tn.hasChildNodes()&&tn.isExpanded()}var q=(b-t)/(_16?2:3);if(y>=t&&y<(t+q)){return"above"}else{if(!_17&&(_16||y>=b-q&&y<=b)){return"below"}else{return"append"}}},onNodeEnter:function(n,dd,e,_1c){this.cancelExpand()},onNodeOver:function(n,dd,e,_20){var pt=this.getDropPoint(e,n,dd);var _22=n.node;if(!this.expandProcId&&pt=="append"&&_22.hasChildNodes()&&!n.node.isExpanded()){this.queueExpand(_22)}else{if(pt!="append"){this.cancelExpand()}}var _23=this.dropNotAllowed;if(this.isValidDropPoint(n,pt,dd,e,_20)){if(pt){var el=n.ddel;var cls;if(pt=="above"){_23=n.node.isFirst()?"x-tree-drop-ok-above":"x-tree-drop-ok-between";cls="x-tree-drag-insert-above"}else{if(pt=="below"){_23=n.node.isLast()?"x-tree-drop-ok-below":"x-tree-drop-ok-between";cls="x-tree-drag-insert-below"}else{_23="x-tree-drop-ok-append";cls="x-tree-drag-append"}}if(this.lastInsertClass!=cls){Ext.fly(el).replaceClass(this.lastInsertClass,cls);this.lastInsertClass=cls}}}return _23},onNodeOut:function(n,dd,e,_29){this.cancelExpand();this.removeDropIndicators(n)},onNodeDrop:function(n,dd,e,_2d){var _2e=this.getDropPoint(e,n,dd);var _2f=n.node;_2f.ui.startDrop();if(!this.isValidDropPoint(n,_2e,dd,e,_2d)){_2f.ui.endDrop();return false}var _30=_2d.node||(dd.getTreeNode?dd.getTreeNode(_2d,_2f,_2e,e):null);var _31={tree:this.tree,target:_2f,data:_2d,point:_2e,source:dd,rawEvent:e,dropNode:_30,cancel:!_30,dropStatus:false};var _32=this.tree.fireEvent("beforenodedrop",_31);if(_32===false||_31.cancel===true||!_31.dropNode){_2f.ui.endDrop();return _31.dropStatus}_2f=_31.target;if(_2e=="append"&&!_2f.isExpanded()){_2f.expand(false,null,function(){this.completeDrop(_31)}.createDelegate(this))}else{this.completeDrop(_31)}return true},completeDrop:function(de){var ns=de.dropNode,p=de.point,t=de.target;if(!Ext.isArray(ns)){ns=[ns]}var n;for(var i=0,len=ns.length;i<len;i++){n=ns[i];if(p=="above"){t.parentNode.insertBefore(n,t)}else{if(p=="below"){t.parentNode.insertBefore(n,t.nextSibling)}else{t.appendChild(n)}}}n.ui.focus();if(Ext.enableFx&&this.tree.hlDrop){n.ui.highlight()}t.ui.endDrop();this.tree.fireEvent("nodedrop",de)},afterNodeMoved:function(dd,_3b,e,_3d,_3e){if(Ext.enableFx&&this.tree.hlDrop){_3e.ui.focus();_3e.ui.highlight()}this.tree.fireEvent("nodedrop",this.tree,_3d,_3b,dd,e)},getTree:function(){return this.tree},removeDropIndicators:function(n){if(n&&n.ddel){var el=n.ddel;Ext.fly(el).removeClass(["x-tree-drag-insert-above","x-tree-drag-insert-below","x-tree-drag-append"]);this.lastInsertClass="_noclass"}},beforeDragDrop:function(_41,e,id){this.cancelExpand();return true},afterRepair:function(_44){if(_44&&Ext.enableFx){_44.node.ui.highlight()}this.hideProxy()}})}if(Ext.dd.DragZone){Ext.tree.TreeDragZone=function(_1,_2){Ext.tree.TreeDragZone.superclass.constructor.call(this,_1.getTreeEl(),_2);this.tree=_1};Ext.extend(Ext.tree.TreeDragZone,Ext.dd.DragZone,{ddGroup:"TreeDD",onBeforeDrag:function(_3,e){var n=_3.node;return n&&n.draggable&&!n.disabled},onInitDrag:function(e){var _7=this.dragData;this.tree.getSelectionModel().select(_7.node);this.tree.eventModel.disable();this.proxy.update("");_7.node.ui.appendDDGhost(this.proxy.ghost.dom);this.tree.fireEvent("startdrag",this.tree,_7.node,e)},getRepairXY:function(e,_9){return _9.node.ui.getDDRepairXY()},onEndDrag:function(_a,e){this.tree.eventModel.enable.defer(100,this.tree.eventModel);this.tree.fireEvent("enddrag",this.tree,_a.node,e)},onValidDrop:function(dd,e,id){this.tree.fireEvent("dragdrop",this.tree,this.dragData.node,dd,e);this.hideProxy()},beforeInvalidDrop:function(e,id){var sm=this.tree.getSelectionModel();sm.clearSelections();sm.select(this.dragData.node)},afterRepair:function(){if(Ext.enableFx&&this.tree.hlDrop){Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor||"c3daf9")}this.dragging=false}})}Ext.tree.TreeEditor=function(_1,fc,_3){fc=fc||{};var _4=fc.events?fc:new Ext.form.TextField(fc);Ext.tree.TreeEditor.superclass.constructor.call(this,_4,_3);this.tree=_1;if(!_1.rendered){_1.on("render",this.initEditor,this)}else{this.initEditor(_1)}};Ext.extend(Ext.tree.TreeEditor,Ext.Editor,{alignment:"l-l",autoSize:false,hideEl:false,cls:"x-small-editor x-tree-editor",shim:false,shadow:"frame",maxWidth:250,editDelay:350,initEditor:function(_5){_5.on("beforeclick",this.beforeNodeClick,this);_5.on("dblclick",this.onNodeDblClick,this);this.on("complete",this.updateNode,this);this.on("beforestartedit",this.fitToTree,this);this.on("startedit",this.bindScroll,this,{delay:10});this.on("specialkey",this.onSpecialKey,this)},fitToTree:function(ed,el){var td=this.tree.getTreeEl().dom,nd=el.dom;if(td.scrollLeft>nd.offsetLeft){td.scrollLeft=nd.offsetLeft}var w=Math.min(this.maxWidth,(td.clientWidth>20?td.clientWidth:td.offsetWidth)-Math.max(0,nd.offsetLeft-td.scrollLeft)-5);this.setSize(w,"")},triggerEdit:function(_b,_c){this.completeEdit();if(_b.attributes.editable!==false){this.editNode=_b;if(this.tree.autoScroll){_b.ui.getEl().scrollIntoView(this.tree.body)}var _d=_b.text||"";if(!Ext.isGecko&&Ext.isEmpty(_b.text)){_b.setText("&nbsp;")}this.autoEditTimer=this.startEdit.defer(this.editDelay,this,[_b.ui.textNode,_d]);return false}},bindScroll:function(){this.tree.getTreeEl().on("scroll",this.cancelEdit,this)},beforeNodeClick:function(_e,e){clearTimeout(this.autoEditTimer);
52
+ if(this.tree.getSelectionModel().isSelected(_e)){e.stopEvent();return this.triggerEdit(_e)}},onNodeDblClick:function(_10,e){clearTimeout(this.autoEditTimer)},updateNode:function(ed,_13){this.tree.getTreeEl().un("scroll",this.cancelEdit,this);this.editNode.setText(_13)},onHide:function(){Ext.tree.TreeEditor.superclass.onHide.call(this);if(this.editNode){this.editNode.ui.focus.defer(50,this.editNode.ui)}},onSpecialKey:function(_14,e){var k=e.getKey();if(k==e.ESC){e.stopEvent();this.cancelEdit()}else{if(k==e.ENTER&&!e.hasModifier()){e.stopEvent();this.completeEdit()}}}});Ext.menu.Menu=function(_1){if(Ext.isArray(_1)){_1={items:_1}}Ext.apply(this,_1);this.id=this.id||Ext.id();this.addEvents("beforeshow","beforehide","show","hide","click","mouseover","mouseout","itemclick");Ext.menu.MenuMgr.register(this);Ext.menu.Menu.superclass.constructor.call(this);var _2=this.items;this.items=new Ext.util.MixedCollection();if(_2){this.add.apply(this,_2)}};Ext.extend(Ext.menu.Menu,Ext.util.Observable,{minWidth:120,shadow:"sides",subMenuAlign:"tl-tr?",defaultAlign:"tl-bl?",allowOtherMenus:false,ignoreParentClicks:false,hidden:true,createEl:function(){return new Ext.Layer({cls:"x-menu",shadow:this.shadow,constrain:false,parentEl:this.parentEl||document.body,zindex:15000})},render:function(){if(this.el){return}var el=this.el=this.createEl();if(!this.keyNav){this.keyNav=new Ext.menu.MenuNav(this)}if(this.plain){el.addClass("x-menu-plain")}if(this.cls){el.addClass(this.cls)}this.focusEl=el.createChild({tag:"a",cls:"x-menu-focus",href:"#",onclick:"return false;",tabIndex:"-1"});var ul=el.createChild({tag:"ul",cls:"x-menu-list"});ul.on("click",this.onClick,this);ul.on("mouseover",this.onMouseOver,this);ul.on("mouseout",this.onMouseOut,this);this.items.each(function(_5){var li=document.createElement("li");li.className="x-menu-list-item";ul.dom.appendChild(li);_5.render(li,this)},this);this.ul=ul;this.autoWidth()},autoWidth:function(){var el=this.el,ul=this.ul;if(!el){return}var w=this.width;if(w){el.setWidth(w)}else{if(Ext.isIE){el.setWidth(this.minWidth);var t=el.dom.offsetWidth;el.setWidth(ul.getWidth()+el.getFrameWidth("lr"))}}},delayAutoWidth:function(){if(this.el){if(!this.awTask){this.awTask=new Ext.util.DelayedTask(this.autoWidth,this)}this.awTask.delay(20)}},findTargetItem:function(e){var t=e.getTarget(".x-menu-list-item",this.ul,true);if(t&&t.menuItemId){return this.items.get(t.menuItemId)}},onClick:function(e){var t;if(t=this.findTargetItem(e)){if(t.menu&&this.ignoreParentClicks){t.expandMenu()}else{t.onClick(e);this.fireEvent("click",this,t,e)}}},setActiveItem:function(_f,_10){if(_f!=this.activeItem){if(this.activeItem){this.activeItem.deactivate()}this.activeItem=_f;_f.activate(_10)}else{if(_10){_f.expandMenu()}}},tryActivate:function(_11,_12){var _13=this.items;for(var i=_11,len=_13.length;i>=0&&i<len;i+=_12){var _16=_13.get(i);if(!_16.disabled&&_16.canActivate){this.setActiveItem(_16,false);return _16}}return false},onMouseOver:function(e){var t;if(t=this.findTargetItem(e)){if(t.canActivate&&!t.disabled){this.setActiveItem(t,true)}}this.over=true;this.fireEvent("mouseover",this,e,t)},onMouseOut:function(e){var t;if(t=this.findTargetItem(e)){if(t==this.activeItem&&t.shouldDeactivate(e)){this.activeItem.deactivate();delete this.activeItem}}this.over=false;this.fireEvent("mouseout",this,e,t)},isVisible:function(){return this.el&&!this.hidden},show:function(el,pos,_1d){this.parentMenu=_1d;if(!this.el){this.render()}this.fireEvent("beforeshow",this);this.showAt(this.el.getAlignToXY(el,pos||this.defaultAlign),_1d,false)},showAt:function(xy,_1f,_e){this.parentMenu=_1f;if(!this.el){this.render()}if(_e!==false){this.fireEvent("beforeshow",this);xy=this.el.adjustForConstraints(xy)}this.el.setXY(xy);this.el.show();this.hidden=false;this.focus();this.fireEvent("show",this)},focus:function(){if(!this.hidden){this.doFocus.defer(50,this)}},doFocus:function(){if(!this.hidden){this.focusEl.focus()}},hide:function(_21){if(this.el&&this.isVisible()){this.fireEvent("beforehide",this);if(this.activeItem){this.activeItem.deactivate();this.activeItem=null}this.el.hide();this.hidden=true;this.fireEvent("hide",this)}if(_21===true&&this.parentMenu){this.parentMenu.hide(true)}},add:function(){var a=arguments,l=a.length,_24;for(var i=0;i<l;i++){var el=a[i];if(el.render){_24=this.addItem(el)}else{if(typeof el=="string"){if(el=="separator"||el=="-"){_24=this.addSeparator()}else{_24=this.addText(el)}}else{if(el.tagName||el.el){_24=this.addElement(el)}else{if(typeof el=="object"){Ext.applyIf(el,this.defaults);_24=this.addMenuItem(el)}}}}}return _24},getEl:function(){if(!this.el){this.render()}return this.el},addSeparator:function(){return this.addItem(new Ext.menu.Separator())},addElement:function(el){return this.addItem(new Ext.menu.BaseItem(el))},addItem:function(_28){this.items.add(_28);if(this.ul){var li=document.createElement("li");li.className="x-menu-list-item";this.ul.dom.appendChild(li);_28.render(li,this);this.delayAutoWidth()}return _28},addMenuItem:function(_2a){if(!(_2a instanceof Ext.menu.Item)){if(typeof _2a.checked=="boolean"){_2a=new Ext.menu.CheckItem(_2a)}else{_2a=new Ext.menu.Item(_2a)}}return this.addItem(_2a)},addText:function(_2b){return this.addItem(new Ext.menu.TextItem(_2b))},insert:function(_2c,_2d){this.items.insert(_2c,_2d);if(this.ul){var li=document.createElement("li");li.className="x-menu-list-item";this.ul.dom.insertBefore(li,this.ul.dom.childNodes[_2c]);_2d.render(li,this);this.delayAutoWidth()}return _2d},remove:function(_2f){this.items.removeKey(_2f.id);_2f.destroy()},removeAll:function(){if(this.items){var f;while(f=this.items.first()){this.remove(f)}}},destroy:function(){this.beforeDestroy();Ext.menu.MenuMgr.unregister(this);if(this.keyNav){this.keyNav.disable()}this.removeAll();if(this.ul){this.ul.removeAllListeners()}if(this.el){this.el.destroy()}},beforeDestroy:Ext.emptyFn});Ext.menu.MenuNav=function(_31){Ext.menu.MenuNav.superclass.constructor.call(this,_31.el);this.scope=this.menu=_31};Ext.extend(Ext.menu.MenuNav,Ext.KeyNav,{doRelay:function(e,h){var k=e.getKey();if(!this.menu.activeItem&&e.isNavKeyPress()&&k!=e.SPACE&&k!=e.RETURN){this.menu.tryActivate(0,1);return false}return h.call(this.scope||this,e,this.menu)},up:function(e,m){if(!m.tryActivate(m.items.indexOf(m.activeItem)-1,-1)){m.tryActivate(m.items.length-1,-1)}},down:function(e,m){if(!m.tryActivate(m.items.indexOf(m.activeItem)+1,1)){m.tryActivate(0,1)}},right:function(e,m){if(m.activeItem){m.activeItem.expandMenu(true)}},left:function(e,m){m.hide();if(m.parentMenu&&m.parentMenu.activeItem){m.parentMenu.activeItem.activate()}},enter:function(e,m){if(m.activeItem){e.stopPropagation();m.activeItem.onClick(e);m.fireEvent("click",this,m.activeItem);return true}}});Ext.menu.MenuMgr=function(){var _1,_2,_3={},_4=false,_5=new Date();function init(){_1={};_2=new Ext.util.MixedCollection();Ext.getDoc().addKeyListener(27,function(){if(_2.length>0){hideAll()}})}function hideAll(){if(_2&&_2.length>0){var c=_2.clone();c.each(function(m){m.hide()})}}function onHide(m){_2.remove(m);if(_2.length<1){Ext.getDoc().un("mousedown",onMouseDown);_4=false}}function onShow(m){var _a=_2.last();_5=new Date();_2.add(m);if(!_4){Ext.getDoc().on("mousedown",onMouseDown);_4=true}if(m.parentMenu){m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"),10)+3);m.parentMenu.activeChild=m}else{if(_a&&_a.isVisible()){m.getEl().setZIndex(parseInt(_a.getEl().getStyle("z-index"),10)+3)}}}function onBeforeHide(m){if(m.activeChild){m.activeChild.hide()}if(m.autoHideTimer){clearTimeout(m.autoHideTimer);delete m.autoHideTimer}}function onBeforeShow(m){var pm=m.parentMenu;if(!pm&&!m.allowOtherMenus){hideAll()}else{if(pm&&pm.activeChild){pm.activeChild.hide()}}}function onMouseDown(e){if(_5.getElapsed()>50&&_2.length>0&&!e.getTarget(".x-menu")){hideAll()}}function onBeforeCheck(mi,_10){if(_10){var g=_3[mi.group];for(var i=0,l=g.length;i<l;i++){if(g[i]!=mi){g[i].setChecked(false)}}}}return{hideAll:function(){hideAll()},register:function(_14){if(!_1){init()
53
+ }_1[_14.id]=_14;_14.on("beforehide",onBeforeHide);_14.on("hide",onHide);_14.on("beforeshow",onBeforeShow);_14.on("show",onShow);var g=_14.group;if(g&&_14.events.checkchange){if(!_3[g]){_3[g]=[]}_3[g].push(_14);_14.on("checkchange",onCheck)}},get:function(_16){if(typeof _16=="string"){if(!_1){return null}return _1[_16]}else{if(_16.events){return _16}else{if(typeof _16.length=="number"){return new Ext.menu.Menu({items:_16})}else{return new Ext.menu.Menu(_16)}}}},unregister:function(_17){delete _1[_17.id];_17.un("beforehide",onBeforeHide);_17.un("hide",onHide);_17.un("beforeshow",onBeforeShow);_17.un("show",onShow);var g=_17.group;if(g&&_17.events.checkchange){_3[g].remove(_17);_17.un("checkchange",onCheck)}},registerCheckable:function(_19){var g=_19.group;if(g){if(!_3[g]){_3[g]=[]}_3[g].push(_19);_19.on("beforecheckchange",onBeforeCheck)}},unregisterCheckable:function(_1b){var g=_1b.group;if(g){_3[g].remove(_1b);_1b.un("beforecheckchange",onBeforeCheck)}},getCheckedItem:function(_1d){var g=_3[_1d];if(g){for(var i=0,l=g.length;i<l;i++){if(g[i].checked){return g[i]}}}return null},setCheckedItem:function(_21,_22){var g=_3[_21];if(g){for(var i=0,l=g.length;i<l;i++){if(g[i].id==_22){g[i].setChecked(true)}}}return null}}}();Ext.menu.BaseItem=function(_1){Ext.menu.BaseItem.superclass.constructor.call(this,_1);this.addEvents("click","activate","deactivate");if(this.handler){this.on("click",this.handler,this.scope)}};Ext.extend(Ext.menu.BaseItem,Ext.Component,{canActivate:false,activeClass:"x-menu-item-active",hideOnClick:true,hideDelay:100,ctype:"Ext.menu.BaseItem",actionMode:"container",render:function(_2,_3){this.parentMenu=_3;Ext.menu.BaseItem.superclass.render.call(this,_2);this.container.menuItemId=this.id},onRender:function(_4,_5){this.el=Ext.get(this.el);if(this.id){this.el.id=this.id}_4.dom.appendChild(this.el.dom)},setHandler:function(_6,_7){if(this.handler){this.un("click",this.handler,this.scope)}this.on("click",this.handler=_6,this.scope=_7)},onClick:function(e){if(!this.disabled&&this.fireEvent("click",this,e)!==false&&this.parentMenu.fireEvent("itemclick",this,e)!==false){this.handleClick(e)}else{e.stopEvent()}},activate:function(){if(this.disabled){return false}var li=this.container;li.addClass(this.activeClass);this.region=li.getRegion().adjust(2,2,-2,-2);this.fireEvent("activate",this);return true},deactivate:function(){this.container.removeClass(this.activeClass);this.fireEvent("deactivate",this)},shouldDeactivate:function(e){return !this.region||!this.region.contains(e.getPoint())},handleClick:function(e){if(this.hideOnClick){this.parentMenu.hide.defer(this.hideDelay,this.parentMenu,[true])}},expandMenu:function(_c){},hideMenu:function(){}});Ext.menu.TextItem=function(_1){if(typeof _1=="string"){_1={text:_1}}Ext.menu.TextItem.superclass.constructor.call(this,_1)};Ext.extend(Ext.menu.TextItem,Ext.menu.BaseItem,{hideOnClick:false,itemCls:"x-menu-text",onRender:function(){var s=document.createElement("span");s.className=this.itemCls;s.innerHTML=this.text;this.el=s;Ext.menu.TextItem.superclass.onRender.apply(this,arguments)}});Ext.menu.Separator=function(_1){Ext.menu.Separator.superclass.constructor.call(this,_1)};Ext.extend(Ext.menu.Separator,Ext.menu.BaseItem,{itemCls:"x-menu-sep",hideOnClick:false,onRender:function(li){var s=document.createElement("span");s.className=this.itemCls;s.innerHTML="&#160;";this.el=s;li.addClass("x-menu-sep-li");Ext.menu.Separator.superclass.onRender.apply(this,arguments)}});Ext.menu.Item=function(_1){Ext.menu.Item.superclass.constructor.call(this,_1);if(this.menu){this.menu=Ext.menu.MenuMgr.get(this.menu)}};Ext.extend(Ext.menu.Item,Ext.menu.BaseItem,{itemCls:"x-menu-item",canActivate:true,showDelay:200,hideDelay:200,ctype:"Ext.menu.Item",onRender:function(_2,_3){var el=document.createElement("a");el.hideFocus=true;el.unselectable="on";el.href=this.href||"#";if(this.hrefTarget){el.target=this.hrefTarget}el.className=this.itemCls+(this.menu?" x-menu-item-arrow":"")+(this.cls?" "+this.cls:"");el.innerHTML=String.format('<img src="{0}" class="x-menu-item-icon {2}" />{1}',this.icon||Ext.BLANK_IMAGE_URL,this.itemText||this.text,this.iconCls||"");this.el=el;Ext.menu.Item.superclass.onRender.call(this,_2,_3)},setText:function(_5){this.text=_5;if(this.rendered){this.el.update(String.format('<img src="{0}" class="x-menu-item-icon {2}">{1}',this.icon||Ext.BLANK_IMAGE_URL,this.text,this.iconCls||""));this.parentMenu.autoWidth()}},setIconClass:function(_6){var _7=this.iconCls;this.iconCls=_6;if(this.rendered){this.el.child("img.x-menu-item-icon").replaceClass(_7,this.iconCls)}},beforeDestroy:function(){if(this.menu){this.menu.destroy()}Ext.menu.Item.superclass.beforeDestroy.call(this)},handleClick:function(e){if(!this.href){e.stopEvent()}Ext.menu.Item.superclass.handleClick.apply(this,arguments)},activate:function(_9){if(Ext.menu.Item.superclass.activate.apply(this,arguments)){this.focus();if(_9){this.expandMenu()}}return true},shouldDeactivate:function(e){if(Ext.menu.Item.superclass.shouldDeactivate.call(this,e)){if(this.menu&&this.menu.isVisible()){return !this.menu.getEl().getRegion().contains(e.getPoint())}return true}return false},deactivate:function(){Ext.menu.Item.superclass.deactivate.apply(this,arguments);this.hideMenu()},expandMenu:function(_b){if(!this.disabled&&this.menu){clearTimeout(this.hideTimer);delete this.hideTimer;if(!this.menu.isVisible()&&!this.showTimer){this.showTimer=this.deferExpand.defer(this.showDelay,this,[_b])}else{if(this.menu.isVisible()&&_b){this.menu.tryActivate(0,1)}}}},deferExpand:function(_c){delete this.showTimer;this.menu.show(this.container,this.parentMenu.subMenuAlign||"tl-tr?",this.parentMenu);if(_c){this.menu.tryActivate(0,1)}},hideMenu:function(){clearTimeout(this.showTimer);delete this.showTimer;if(!this.hideTimer&&this.menu&&this.menu.isVisible()){this.hideTimer=this.deferHide.defer(this.hideDelay,this)}},deferHide:function(){delete this.hideTimer;if(this.menu.over){this.parentMenu.setActiveItem(this,false)}else{this.menu.hide()}}});Ext.menu.CheckItem=function(_1){Ext.menu.CheckItem.superclass.constructor.call(this,_1);this.addEvents("beforecheckchange","checkchange");if(this.checkHandler){this.on("checkchange",this.checkHandler,this.scope)}Ext.menu.MenuMgr.registerCheckable(this)};Ext.extend(Ext.menu.CheckItem,Ext.menu.Item,{itemCls:"x-menu-item x-menu-check-item",groupClass:"x-menu-group-item",checked:false,ctype:"Ext.menu.CheckItem",onRender:function(c){Ext.menu.CheckItem.superclass.onRender.apply(this,arguments);if(this.group){this.el.addClass(this.groupClass)}if(this.checked){this.checked=false;this.setChecked(true,true)}},destroy:function(){Ext.menu.MenuMgr.unregisterCheckable(this);Ext.menu.CheckItem.superclass.destroy.apply(this,arguments)},setChecked:function(_3,_4){if(this.checked!=_3&&this.fireEvent("beforecheckchange",this,_3)!==false){if(this.container){this.container[_3?"addClass":"removeClass"]("x-menu-item-checked")}this.checked=_3;if(_4!==true){this.fireEvent("checkchange",this,_3)}}},handleClick:function(e){if(!this.disabled&&!(this.checked&&this.group)){this.setChecked(!this.checked)}Ext.menu.CheckItem.superclass.handleClick.apply(this,arguments)}});Ext.menu.Adapter=function(_1,_2){Ext.menu.Adapter.superclass.constructor.call(this,_2);this.component=_1};Ext.extend(Ext.menu.Adapter,Ext.menu.BaseItem,{canActivate:true,onRender:function(_3,_4){this.component.render(_3);this.el=this.component.getEl()},activate:function(){if(this.disabled){return false}this.component.focus();this.fireEvent("activate",this);return true},deactivate:function(){this.fireEvent("deactivate",this)},disable:function(){this.component.disable();Ext.menu.Adapter.superclass.disable.call(this)},enable:function(){this.component.enable();Ext.menu.Adapter.superclass.enable.call(this)}});Ext.menu.DateItem=function(_1){Ext.menu.DateItem.superclass.constructor.call(this,new Ext.DatePicker(_1),_1);this.picker=this.component;this.addEvents("select");this.picker.on("render",function(_2){_2.getEl().swallowEvent("click");
54
+ _2.container.addClass("x-menu-date-item")});this.picker.on("select",this.onSelect,this)};Ext.extend(Ext.menu.DateItem,Ext.menu.Adapter,{onSelect:function(_3,_4){this.fireEvent("select",this,_4,_3);Ext.menu.DateItem.superclass.handleClick.call(this)}});Ext.menu.ColorItem=function(_1){Ext.menu.ColorItem.superclass.constructor.call(this,new Ext.ColorPalette(_1),_1);this.palette=this.component;this.relayEvents(this.palette,["select"]);if(this.selectHandler){this.on("select",this.selectHandler,this.scope)}};Ext.extend(Ext.menu.ColorItem,Ext.menu.Adapter);Ext.menu.DateMenu=function(_1){Ext.menu.DateMenu.superclass.constructor.call(this,_1);this.plain=true;var di=new Ext.menu.DateItem(_1);this.add(di);this.picker=di.picker;this.relayEvents(di,["select"]);this.on("beforeshow",function(){if(this.picker){this.picker.hideMonthPicker(true)}},this)};Ext.extend(Ext.menu.DateMenu,Ext.menu.Menu,{cls:"x-date-menu",beforeDestroy:function(){this.picker.destroy()}});Ext.menu.ColorMenu=function(_1){Ext.menu.ColorMenu.superclass.constructor.call(this,_1);this.plain=true;var ci=new Ext.menu.ColorItem(_1);this.add(ci);this.palette=ci.palette;this.relayEvents(ci,["select"])};Ext.extend(Ext.menu.ColorMenu,Ext.menu.Menu,{beforeDestroy:function(){this.palette.destroy()}});Ext.form.Field=Ext.extend(Ext.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"off"},fieldClass:"x-form-field",msgTarget:"qtip",msgFx:"normal",readOnly:false,disabled:false,isFormField:true,hasFocus:false,initComponent:function(){Ext.form.Field.superclass.initComponent.call(this);this.addEvents("focus","blur","specialkey","change","invalid","valid")},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||"")},onRender:function(ct,_2){Ext.form.Field.superclass.onRender.call(this,ct,_2);if(!this.el){var _3=this.getAutoCreate();if(!_3.name){_3.name=this.name||this.id}if(this.inputType){_3.type=this.inputType}this.el=ct.createChild(_3,_2)}var _4=this.el.dom.type;if(_4){if(_4=="password"){_4="text"}this.el.addClass("x-form-"+_4)}if(this.readOnly){this.el.dom.readOnly=true}if(this.tabIndex!==undefined){this.el.dom.setAttribute("tabIndex",this.tabIndex)}this.el.addClass([this.fieldClass,this.cls])},initValue:function(){if(this.value!==undefined){this.setValue(this.value)}else{if(this.el.dom.value.length>0&&this.el.dom.value!=this.emptyText){this.setValue(this.el.dom.value)}}this.originalValue=this.getValue()},isDirty:function(){if(this.disabled){return false}return String(this.getValue())!==String(this.originalValue)},afterRender:function(){Ext.form.Field.superclass.afterRender.call(this);this.initEvents();this.initValue()},fireKey:function(e){if(e.isSpecialKey()){this.fireEvent("specialkey",this,e)}},reset:function(){this.setValue(this.originalValue);this.clearInvalid()},initEvents:function(){this.el.on(Ext.isIE||Ext.isSafari3?"keydown":"keypress",this.fireKey,this);this.el.on("focus",this.onFocus,this);var o=this.inEditor&&Ext.isWindows&&Ext.isGecko?{buffer:10}:null;this.el.on("blur",this.onBlur,this,o)},onFocus:function(){if(this.focusClass){this.el.addClass(this.focusClass)}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},beforeBlur:Ext.emptyFn,onBlur:function(){this.beforeBlur();if(this.focusClass){this.el.removeClass(this.focusClass)}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate()}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent("change",this,v,this.startValue)}this.fireEvent("blur",this)},isValid:function(_8){if(this.disabled){return true}var _9=this.preventMark;this.preventMark=_8===true;var v=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=_9;return v},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true}return false},processValue:function(_b){return _b},validateValue:function(_c){return true},markInvalid:function(_d){if(!this.rendered||this.preventMark){return}this.el.addClass(this.invalidClass);_d=_d||this.invalidText;switch(this.msgTarget){case"qtip":this.el.dom.qtip=_d;this.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}break;case"title":this.el.dom.title=_d;break;case"under":if(!this.errorEl){var _e=this.getErrorCt();if(!_e){this.el.dom.title=_d;break}this.errorEl=_e.createChild({cls:"x-form-invalid-msg"});this.errorEl.setWidth(_e.getWidth(true)-20)}this.errorEl.update(_d);Ext.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;case"side":if(!this.errorIcon){var _e=this.getErrorCt();if(!_e){this.el.dom.title=_d;break}this.errorIcon=_e.createChild({cls:"x-form-invalid-icon"})}this.alignErrorIcon();this.errorIcon.dom.qtip=_d;this.errorIcon.dom.qclass="x-form-invalid-tip";this.errorIcon.show();this.on("resize",this.alignErrorIcon,this);break;default:var t=Ext.getDom(this.msgTarget);t.innerHTML=_d;t.style.display=this.msgDisplay;break}this.fireEvent("invalid",this,_d)},getErrorCt:function(){return this.el.findParent(".x-form-element",5,true)||this.el.findParent(".x-form-field-wrap",5,true)},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,"tl-tr",[2,0])},clearInvalid:function(){if(!this.rendered||this.preventMark){return}this.el.removeClass(this.invalidClass);switch(this.msgTarget){case"qtip":this.el.dom.qtip="";break;case"title":this.el.dom.title="";break;case"under":if(this.errorEl){Ext.form.Field.msgFx[this.msgFx].hide(this.errorEl,this)}break;case"side":if(this.errorIcon){this.errorIcon.dom.qtip="";this.errorIcon.hide();this.un("resize",this.alignErrorIcon,this)}break;default:var t=Ext.getDom(this.msgTarget);t.innerHTML="";t.style.display="none";break}this.fireEvent("valid",this)},getRawValue:function(){var v=this.rendered?this.el.getValue():Ext.value(this.value,"");if(v===this.emptyText){v=""}return v},getValue:function(){if(!this.rendered){return this.value}var v=this.el.getValue();if(v===this.emptyText||v===undefined){v=""}return v},setRawValue:function(v){return this.el.dom.value=(v===null||v===undefined?"":v)},setValue:function(v){this.value=v;if(this.rendered){this.el.dom.value=(v===null||v===undefined?"":v);this.validate()}},adjustSize:function(w,h){var s=Ext.form.Field.superclass.adjustSize.call(this,w,h);s.width=this.adjustWidth(this.el.dom.tagName,s.width);return s},adjustWidth:function(tag,w){tag=tag.toLowerCase();if(typeof w=="number"&&!Ext.isSafari){if(Ext.isIE&&(tag=="input"||tag=="textarea")){if(tag=="input"&&!Ext.isStrict){return this.inEditor?w:w-3}if(tag=="input"&&Ext.isStrict){return w-(Ext.isIE6?4:1)}if(tag=="textarea"&&Ext.isStrict){return w-2}}else{if(Ext.isOpera&&Ext.isStrict){if(tag=="input"){return w+2}if(tag=="textarea"){return w-2}}}}return w}});Ext.form.MessageTargets={qtip:{mark:function(f){this.el.dom.qtip=msg;this.el.dom.qclass="x-form-invalid-tip";if(Ext.QuickTips){Ext.QuickTips.enable()}},clear:function(f){this.el.dom.qtip=""}},title:{mark:function(f){this.el.dom.title=msg},clear:function(f){this.el.dom.title=""}},under:{mark:function(f){if(!this.errorEl){var elp=this.getErrorCt();if(!elp){this.el.dom.title=msg;return}this.errorEl=elp.createChild({cls:"x-form-invalid-msg"});this.errorEl.setWidth(elp.getWidth(true)-20)}this.errorEl.update(msg);Ext.form.Field.msgFx[this.msgFx].show(this.errorEl,this)},clear:function(f){if(this.errorEl){Ext.form.Field.msgFx[this.msgFx].hide(this.errorEl,this)}else{this.el.dom.title=""}}},side:{mark:function(f){if(!this.errorIcon){var elp=this.getErrorCt();if(!elp){this.el.dom.title=msg;return}this.errorIcon=elp.createChild({cls:"x-form-invalid-icon"})}this.alignErrorIcon();this.errorIcon.dom.qtip=msg;this.errorIcon.dom.qclass="x-form-invalid-tip";this.errorIcon.show();this.on("resize",this.alignErrorIcon,this)},clear:function(f){if(this.errorIcon){this.errorIcon.dom.qtip="";
55
+ this.errorIcon.hide();this.un("resize",this.alignErrorIcon,this)}else{this.el.dom.title=""}}},around:{mark:function(f){},clear:function(f){}}};Ext.form.Field.msgFx={normal:{show:function(_26,f){_26.setDisplayed("block")},hide:function(_28,f){_28.setDisplayed(false).update("")}},slide:{show:function(_2a,f){_2a.slideIn("t",{stopFx:true})},hide:function(_2c,f){_2c.slideOut("t",{stopFx:true,useDisplay:true})}},slideRight:{show:function(_2e,f){_2e.fixDisplay();_2e.alignTo(f.el,"tl-tr");_2e.slideIn("l",{stopFx:true})},hide:function(_30,f){_30.slideOut("l",{stopFx:true,useDisplay:true})}}};Ext.reg("field",Ext.form.Field);Ext.form.TextField=Ext.extend(Ext.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,emptyClass:"x-form-empty-field",initComponent:function(){Ext.form.TextField.superclass.initComponent.call(this);this.addEvents("autosize","keydown","keyup","keypress")},initEvents:function(){Ext.form.TextField.superclass.initEvents.call(this);if(this.validationEvent=="keyup"){this.validationTask=new Ext.util.DelayedTask(this.validate,this);this.el.on("keyup",this.filterValidation,this)}else{if(this.validationEvent!==false){this.el.on(this.validationEvent,this.validate,this,{buffer:this.validationDelay})}}if(this.selectOnFocus||this.emptyText){this.on("focus",this.preFocus,this);this.el.on("mousedown",function(){if(!this.hasFocus){this.el.on("mouseup",function(e){e.preventDefault()},this,{single:true})}},this);if(this.emptyText){this.on("blur",this.postBlur,this);this.applyEmptyText()}}if(this.maskRe||(this.vtype&&this.disableKeyFilter!==true&&(this.maskRe=Ext.form.VTypes[this.vtype+"Mask"]))){this.el.on("keypress",this.filterKeys,this)}if(this.grow){this.el.on("keyup",this.onKeyUpBuffered,this,{buffer:50});this.el.on("click",this.autoSize,this)}if(this.enableKeyEvents){this.el.on("keyup",this.onKeyUp,this);this.el.on("keydown",this.onKeyDown,this);this.el.on("keypress",this.onKeyPress,this)}},processValue:function(_2){if(this.stripCharsRe){var _3=_2.replace(this.stripCharsRe,"");if(_3!==_2){this.setRawValue(_3);return _3}}return _2},filterValidation:function(e){if(!e.isNavKeyPress()){this.validationTask.delay(this.validationDelay)}},onDisable:function(){Ext.form.TextField.superclass.onDisable.call(this);if(Ext.isIE){this.el.dom.unselectable="on"}},onEnable:function(){Ext.form.TextField.superclass.onEnable.call(this);if(Ext.isIE){this.el.dom.unselectable=""}},onKeyUpBuffered:function(e){if(!e.isNavKeyPress()){this.autoSize()}},onKeyUp:function(e){this.fireEvent("keyup",this,e)},onKeyDown:function(e){this.fireEvent("keydown",this,e)},onKeyPress:function(e){this.fireEvent("keypress",this,e)},reset:function(){Ext.form.TextField.superclass.reset.call(this);this.applyEmptyText()},applyEmptyText:function(){if(this.rendered&&this.emptyText&&this.getRawValue().length<1&&!this.hasFocus){this.setRawValue(this.emptyText);this.el.addClass(this.emptyClass)}},preFocus:function(){if(this.emptyText){if(this.el.dom.value==this.emptyText){this.setRawValue("")}this.el.removeClass(this.emptyClass)}if(this.selectOnFocus){this.el.dom.select()}},postBlur:function(){this.applyEmptyText()},filterKeys:function(e){if(e.ctrlKey){return}var k=e.getKey();if(Ext.isGecko&&(e.isNavKeyPress()||k==e.BACKSPACE||(k==e.DELETE&&e.button==-1))){return}var c=e.getCharCode(),cc=String.fromCharCode(c);if(!Ext.isGecko&&e.isSpecialKey()&&!cc){return}if(!this.maskRe.test(cc)){e.stopEvent()}},setValue:function(v){if(this.emptyText&&this.el&&v!==undefined&&v!==null&&v!==""){this.el.removeClass(this.emptyClass)}Ext.form.TextField.superclass.setValue.apply(this,arguments);this.applyEmptyText();this.autoSize()},validateValue:function(_e){if(_e.length<1||_e===this.emptyText){if(this.allowBlank){this.clearInvalid();return true}else{this.markInvalid(this.blankText);return false}}if(_e.length<this.minLength){this.markInvalid(String.format(this.minLengthText,this.minLength));return false}if(_e.length>this.maxLength){this.markInvalid(String.format(this.maxLengthText,this.maxLength));return false}if(this.vtype){var vt=Ext.form.VTypes;if(!vt[this.vtype](_e,this)){this.markInvalid(this.vtypeText||vt[this.vtype+"Text"]);return false}}if(typeof this.validator=="function"){var msg=this.validator(_e);if(msg!==true){this.markInvalid(msg);return false}}if(this.regex&&!this.regex.test(_e)){this.markInvalid(this.regexText);return false}return true},selectText:function(_11,end){var v=this.getRawValue();var _14=false;if(v.length>0){_11=_11===undefined?0:_11;end=end===undefined?v.length:end;var d=this.el.dom;if(d.setSelectionRange){d.setSelectionRange(_11,end)}else{if(d.createTextRange){var _16=d.createTextRange();_16.moveStart("character",_11);_16.moveEnd("character",end-v.length);_16.select()}}_14=Ext.isGecko||Ext.isOpera}else{_14=true}if(_14){this.focus()}},autoSize:function(){if(!this.grow||!this.rendered){return}if(!this.metrics){this.metrics=Ext.util.TextMetrics.createInstance(this.el)}var el=this.el;var v=el.dom.value;var d=document.createElement("div");d.appendChild(document.createTextNode(v));v=d.innerHTML;Ext.removeNode(d);d=null;v+="&#160;";var w=Math.min(this.growMax,Math.max(this.metrics.getWidth(v)+10,this.growMin));this.el.setWidth(w);this.fireEvent("autosize",this,w)}});Ext.reg("textfield",Ext.form.TextField);Ext.form.TriggerField=Ext.extend(Ext.form.TextField,{defaultAutoCreate:{tag:"input",type:"text",size:"16",autocomplete:"off"},hideTrigger:false,autoSize:Ext.emptyFn,monitorTab:true,deferHeight:true,mimicing:false,onResize:function(w,h){Ext.form.TriggerField.superclass.onResize.call(this,w,h);if(typeof w=="number"){this.el.setWidth(this.adjustWidth("input",w-this.trigger.getWidth()))}this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())},adjustSize:Ext.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},alignErrorIcon:function(){if(this.wrap){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}},onRender:function(ct,_4){Ext.form.TriggerField.superclass.onRender.call(this,ct,_4);this.wrap=this.el.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild(this.triggerConfig||{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});if(this.hideTrigger){this.trigger.setDisplayed(false)}this.initTrigger();if(!this.width){this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())}},afterRender:function(){Ext.form.TriggerField.superclass.afterRender.call(this);var y;if(Ext.isIE&&!this.hideTrigger&&this.el.getY()!=(y=this.trigger.getY())){this.el.position();this.el.setY(y)}},initTrigger:function(){this.trigger.on("click",this.onTriggerClick,this,{preventDefault:true});this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},onDestroy:function(){if(this.trigger){this.trigger.removeAllListeners();this.trigger.remove()}if(this.wrap){this.wrap.remove()}if(this.mimicing){Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this)}Ext.form.TriggerField.superclass.onDestroy.call(this)},onFocus:function(){Ext.form.TriggerField.superclass.onFocus.call(this);if(!this.mimicing){this.wrap.addClass("x-trigger-wrap-focus");this.mimicing=true;Ext.get(Ext.isIE?document.body:document).on("mousedown",this.mimicBlur,this,{delay:10});if(this.monitorTab){this.el.on("keydown",this.checkTab,this)}}},checkTab:function(e){if(e.getKey()==e.TAB){this.triggerBlur()}},onBlur:function(){},mimicBlur:function(e){if(!this.wrap.contains(e.target)&&this.validateBlur(e)){this.triggerBlur()}},triggerBlur:function(){this.mimicing=false;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);if(this.monitorTab&&this.el){this.el.un("keydown",this.checkTab,this)
56
+ }this.beforeBlur();if(this.wrap){this.wrap.removeClass("x-trigger-wrap-focus")}Ext.form.TriggerField.superclass.onBlur.call(this)},beforeBlur:Ext.emptyFn,validateBlur:function(e){return true},onDisable:function(){Ext.form.TriggerField.superclass.onDisable.call(this);if(this.wrap){this.wrap.addClass(this.disabledClass);this.el.removeClass(this.disabledClass)}},onEnable:function(){Ext.form.TriggerField.superclass.onEnable.call(this);if(this.wrap){this.wrap.removeClass(this.disabledClass)}},onShow:function(){if(this.wrap){this.wrap.dom.style.display="";this.wrap.dom.style.visibility="visible"}},onHide:function(){this.wrap.dom.style.display="none"},onTriggerClick:Ext.emptyFn});Ext.form.TwinTriggerField=Ext.extend(Ext.form.TriggerField,{initComponent:function(){Ext.form.TwinTriggerField.superclass.initComponent.call(this);this.triggerConfig={tag:"span",cls:"x-form-twin-triggers",cn:[{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger1Class},{tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.trigger2Class}]}},getTrigger:function(_9){return this.triggers[_9]},initTrigger:function(){var ts=this.trigger.select(".x-form-trigger",true);this.wrap.setStyle("overflow","hidden");var _b=this;ts.each(function(t,_d,_e){t.hide=function(){var w=_b.wrap.getWidth();this.dom.style.display="none";_b.el.setWidth(w-_b.trigger.getWidth())};t.show=function(){var w=_b.wrap.getWidth();this.dom.style.display="";_b.el.setWidth(w-_b.trigger.getWidth())};var _11="Trigger"+(_e+1);if(this["hide"+_11]){t.dom.style.display="none"}t.on("click",this["on"+_11+"Click"],this,{preventDefault:true});t.addClassOnOver("x-form-trigger-over");t.addClassOnClick("x-form-trigger-click")},this);this.triggers=ts.elements},onTrigger1Click:Ext.emptyFn,onTrigger2Click:Ext.emptyFn});Ext.reg("trigger",Ext.form.TriggerField);Ext.form.TextArea=Ext.extend(Ext.form.TextField,{growMin:60,growMax:1000,growAppend:"&#160;\n&#160;",growPad:0,enterIsSpecial:false,preventScrollbars:false,onRender:function(ct,_2){if(!this.el){this.defaultAutoCreate={tag:"textarea",style:"width:100px;height:60px;",autocomplete:"off"}}Ext.form.TextArea.superclass.onRender.call(this,ct,_2);if(this.grow){this.textSizeEl=Ext.DomHelper.append(document.body,{tag:"pre",cls:"x-form-grow-sizer"});if(this.preventScrollbars){this.el.setStyle("overflow","hidden")}this.el.setHeight(this.growMin)}},onDestroy:function(){if(this.textSizeEl){Ext.removeNode(this.textSizeEl)}Ext.form.TextArea.superclass.onDestroy.call(this)},fireKey:function(e){if(e.isSpecialKey()&&(this.enterIsSpecial||(e.getKey()!=e.ENTER||e.hasModifier()))){this.fireEvent("specialkey",this,e)}},onKeyUp:function(e){if(!e.isNavKeyPress()||e.getKey()==e.ENTER){this.autoSize()}Ext.form.TextArea.superclass.onKeyUp.call(this,e)},autoSize:function(){if(!this.grow||!this.textSizeEl){return}var el=this.el;var v=el.dom.value;var ts=this.textSizeEl;ts.innerHTML="";ts.appendChild(document.createTextNode(v));v=ts.innerHTML;Ext.fly(ts).setWidth(this.el.getWidth());if(v.length<1){v="&#160;&#160;"}else{if(Ext.isIE){v=v.replace(/\n/g,"<p>&#160;</p>")}v+=this.growAppend}ts.innerHTML=v;var h=Math.min(this.growMax,Math.max(ts.offsetHeight,this.growMin)+this.growPad);if(h!=this.lastHeight){this.lastHeight=h;this.el.setHeight(h);this.fireEvent("autosize",this,h)}}});Ext.reg("textarea",Ext.form.TextArea);Ext.form.NumberField=Ext.extend(Ext.form.TextField,{fieldClass:"x-form-field x-form-num-field",allowDecimals:true,decimalSeparator:".",decimalPrecision:2,allowNegative:true,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.MAX_VALUE,minText:"The minimum value for this field is {0}",maxText:"The maximum value for this field is {0}",nanText:"{0} is not a valid number",baseChars:"0123456789",initEvents:function(){Ext.form.NumberField.superclass.initEvents.call(this);var _1=this.baseChars+"";if(this.allowDecimals){_1+=this.decimalSeparator}if(this.allowNegative){_1+="-"}this.stripCharsRe=new RegExp("[^"+_1+"]","gi");var _2=function(e){var k=e.getKey();if(!Ext.isIE&&(e.isSpecialKey()||k==e.BACKSPACE||k==e.DELETE)){return}var c=e.getCharCode();if(_1.indexOf(String.fromCharCode(c))===-1){e.stopEvent()}};this.el.on("keypress",_2,this)},validateValue:function(_6){if(!Ext.form.NumberField.superclass.validateValue.call(this,_6)){return false}if(_6.length<1){return true}_6=String(_6).replace(this.decimalSeparator,".");if(isNaN(_6)){this.markInvalid(String.format(this.nanText,_6));return false}var _7=this.parseValue(_6);if(_7<this.minValue){this.markInvalid(String.format(this.minText,this.minValue));return false}if(_7>this.maxValue){this.markInvalid(String.format(this.maxText,this.maxValue));return false}return true},getValue:function(){return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)))},setValue:function(v){v=typeof v=="number"?v:parseFloat(String(v).replace(this.decimalSeparator,"."));v=isNaN(v)?"":String(v).replace(".",this.decimalSeparator);Ext.form.NumberField.superclass.setValue.call(this,v)},parseValue:function(_9){_9=parseFloat(String(_9).replace(this.decimalSeparator,"."));return isNaN(_9)?"":_9},fixPrecision:function(_a){var _b=isNaN(_a);if(!this.allowDecimals||this.decimalPrecision==-1||_b||!_a){return _b?"":_a}return parseFloat(parseFloat(_a).toFixed(this.decimalPrecision))},beforeBlur:function(){var v=this.parseValue(this.getRawValue());if(v||v===0){this.setValue(this.fixPrecision(v))}}});Ext.reg("numberfield",Ext.form.NumberField);Ext.form.DateField=Ext.extend(Ext.form.TriggerField,{format:"m/d/Y",altFormats:"m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d",disabledDaysText:"Disabled",disabledDatesText:"Disabled",minText:"The date in this field must be equal to or after {0}",maxText:"The date in this field must be equal to or before {0}",invalidText:"{0} is not a valid date - it must be in the format {1}",triggerClass:"x-form-date-trigger",showToday:true,defaultAutoCreate:{tag:"input",type:"text",size:"10",autocomplete:"off"},initComponent:function(){Ext.form.DateField.superclass.initComponent.call(this);this.addEvents("select");if(typeof this.minValue=="string"){this.minValue=this.parseDate(this.minValue)}if(typeof this.maxValue=="string"){this.maxValue=this.parseDate(this.maxValue)}this.disabledDatesRE=null;this.initDisabledDays()},initDisabledDays:function(){if(this.disabledDates){var dd=this.disabledDates;var re="(?:";for(var i=0;i<dd.length;i++){re+=dd[i];if(i!=dd.length-1){re+="|"}}this.disabledDatesRE=new RegExp(re+")")}},setDisabledDates:function(dd){this.disabledDates=dd;this.initDisabledDays();if(this.menu){this.menu.picker.setDisabledDates(this.disabledDatesRE)}},setDisabledDays:function(dd){this.disabledDays=dd;if(this.menu){this.menu.picker.setDisabledDays(dd)}},setMinValue:function(dt){this.minValue=(typeof dt=="string"?this.parseDate(dt):dt);if(this.menu){this.menu.picker.setMinDate(this.minValue)}},setMaxValue:function(dt){this.maxValue=(typeof dt=="string"?this.parseDate(dt):dt);if(this.menu){this.menu.picker.setMaxDate(this.maxValue)}},validateValue:function(_8){_8=this.formatDate(_8);if(!Ext.form.DateField.superclass.validateValue.call(this,_8)){return false}if(_8.length<1){return true}var _9=_8;_8=this.parseDate(_8);if(!_8){this.markInvalid(String.format(this.invalidText,_9,this.format));return false}var _a=_8.getTime();if(this.minValue&&_a<this.minValue.getTime()){this.markInvalid(String.format(this.minText,this.formatDate(this.minValue)));return false}if(this.maxValue&&_a>this.maxValue.getTime()){this.markInvalid(String.format(this.maxText,this.formatDate(this.maxValue)));return false}if(this.disabledDays){var _b=_8.getDay();for(var i=0;i<this.disabledDays.length;i++){if(_b===this.disabledDays[i]){this.markInvalid(this.disabledDaysText);return false}}}var _d=this.formatDate(_8);if(this.disabledDatesRE&&this.disabledDatesRE.test(_d)){this.markInvalid(String.format(this.disabledDatesText,_d));return false}return true},validateBlur:function(){return !this.menu||!this.menu.isVisible()},getValue:function(){return this.parseDate(Ext.form.DateField.superclass.getValue.call(this))||""
57
+ },setValue:function(_e){Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(_e)))},parseDate:function(_f){if(!_f||Ext.isDate(_f)){return _f}var v=Date.parseDate(_f,this.format);if(!v&&this.altFormats){if(!this.altFormatsArray){this.altFormatsArray=this.altFormats.split("|")}for(var i=0,len=this.altFormatsArray.length;i<len&&!v;i++){v=Date.parseDate(_f,this.altFormatsArray[i])}}return v},onDestroy:function(){if(this.menu){this.menu.destroy()}if(this.wrap){this.wrap.remove()}Ext.form.DateField.superclass.onDestroy.call(this)},formatDate:function(_13){return Ext.isDate(_13)?_13.dateFormat(this.format):_13},menuListeners:{select:function(m,d){this.setValue(d);this.fireEvent("select",this,d)},show:function(){this.onFocus()},hide:function(){this.focus.defer(10,this);var ml=this.menuListeners;this.menu.un("select",ml.select,this);this.menu.un("show",ml.show,this);this.menu.un("hide",ml.hide,this)}},onTriggerClick:function(){if(this.disabled){return}if(this.menu==null){this.menu=new Ext.menu.DateMenu()}Ext.apply(this.menu.picker,{minDate:this.minValue,maxDate:this.maxValue,disabledDatesRE:this.disabledDatesRE,disabledDatesText:this.disabledDatesText,disabledDays:this.disabledDays,disabledDaysText:this.disabledDaysText,format:this.format,showToday:this.showToday,minText:String.format(this.minText,this.formatDate(this.minValue)),maxText:String.format(this.maxText,this.formatDate(this.maxValue))});this.menu.on(Ext.apply({},this.menuListeners,{scope:this}));this.menu.picker.setValue(this.getValue()||new Date());this.menu.show(this.el,"tl-bl?")},beforeBlur:function(){var v=this.parseDate(this.getRawValue());if(v){this.setValue(v)}}});Ext.reg("datefield",Ext.form.DateField);Ext.form.ComboBox=Ext.extend(Ext.form.TriggerField,{defaultAutoCreate:{tag:"input",type:"text",size:"24",autocomplete:"off"},listClass:"",selectedClass:"x-combo-selected",triggerClass:"x-form-arrow-trigger",shadow:"sides",listAlign:"tl-bl?",maxHeight:300,minHeight:90,triggerAction:"query",minChars:4,typeAhead:false,queryDelay:500,pageSize:0,selectOnFocus:false,queryParam:"query",loadingText:"Loading...",resizable:false,handleHeight:8,editable:true,allQuery:"",mode:"remote",minListWidth:70,forceSelection:false,typeAheadDelay:250,lazyInit:true,initComponent:function(){Ext.form.ComboBox.superclass.initComponent.call(this);this.addEvents("expand","collapse","beforeselect","select","beforequery");if(this.transform){this.allowDomMove=false;var s=Ext.getDom(this.transform);if(!this.hiddenName){this.hiddenName=s.name}if(!this.store){this.mode="local";var d=[],_3=s.options;for(var i=0,_5=_3.length;i<_5;i++){var o=_3[i];var _7=(Ext.isIE?o.getAttributeNode("value").specified:o.hasAttribute("value"))?o.value:o.text;if(o.selected){this.value=_7}d.push([_7,o.text])}this.store=new Ext.data.SimpleStore({id:0,fields:["value","text"],data:d});this.valueField="value";this.displayField="text"}s.name=Ext.id();if(!this.lazyRender){this.target=true;this.el=Ext.DomHelper.insertBefore(s,this.autoCreate||this.defaultAutoCreate);Ext.removeNode(s);this.render(this.el.parentNode)}else{Ext.removeNode(s)}}else{if(Ext.isArray(this.store)){if(Ext.isArray(this.store[0])){this.store=new Ext.data.SimpleStore({fields:["value","text"],data:this.store});this.valueField="value"}else{this.store=new Ext.data.SimpleStore({fields:["text"],data:this.store,expandData:true});this.valueField="text"}this.displayField="text";this.mode="local"}}this.selectedIndex=-1;if(this.mode=="local"){if(this.initialConfig.queryDelay===undefined){this.queryDelay=10}if(this.initialConfig.minChars===undefined){this.minChars=0}}},onRender:function(ct,_9){Ext.form.ComboBox.superclass.onRender.call(this,ct,_9);if(this.hiddenName){this.hiddenField=this.el.insertSibling({tag:"input",type:"hidden",name:this.hiddenName,id:(this.hiddenId||this.hiddenName)},"before",true);this.el.dom.removeAttribute("name")}if(Ext.isGecko){this.el.dom.setAttribute("autocomplete","off")}if(!this.lazyInit){this.initList()}else{this.on("focus",this.initList,this,{single:true})}if(!this.editable){this.editable=true;this.setEditable(false)}},initValue:function(){Ext.form.ComboBox.superclass.initValue.call(this);if(this.hiddenField){this.hiddenField.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:""}},initList:function(){if(!this.list){var _a="x-combo-list";this.list=new Ext.Layer({shadow:this.shadow,cls:[_a,this.listClass].join(" "),constrain:false});var lw=this.listWidth||Math.max(this.wrap.getWidth(),this.minListWidth);this.list.setWidth(lw);this.list.swallowEvent("mousewheel");this.assetHeight=0;if(this.title){this.header=this.list.createChild({cls:_a+"-hd",html:this.title});this.assetHeight+=this.header.getHeight()}this.innerList=this.list.createChild({cls:_a+"-inner"});this.innerList.on("mouseover",this.onViewOver,this);this.innerList.on("mousemove",this.onViewMove,this);this.innerList.setWidth(lw-this.list.getFrameWidth("lr"));if(this.pageSize){this.footer=this.list.createChild({cls:_a+"-ft"});this.pageTb=new Ext.PagingToolbar({store:this.store,pageSize:this.pageSize,renderTo:this.footer});this.assetHeight+=this.footer.getHeight()}if(!this.tpl){this.tpl='<tpl for="."><div class="'+_a+'-item">{'+this.displayField+"}</div></tpl>"}this.view=new Ext.DataView({applyTo:this.innerList,tpl:this.tpl,singleSelect:true,selectedClass:this.selectedClass,itemSelector:this.itemSelector||"."+_a+"-item"});this.view.on("click",this.onViewClick,this);this.bindStore(this.store,true);if(this.resizable){this.resizer=new Ext.Resizable(this.list,{pinned:true,handles:"se"});this.resizer.on("resize",function(r,w,h){this.maxHeight=h-this.handleHeight-this.list.getFrameWidth("tb")-this.assetHeight;this.listWidth=w;this.innerList.setWidth(w-this.list.getFrameWidth("lr"));this.restrictHeight()},this);this[this.pageSize?"footer":"innerList"].setStyle("margin-bottom",this.handleHeight+"px")}}},getStore:function(){return this.store},bindStore:function(_f,_10){if(this.store&&!_10){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("loadexception",this.collapse,this);if(!_f){this.store=null;if(this.view){this.view.setStore(null)}}}if(_f){this.store=Ext.StoreMgr.lookup(_f);this.store.on("beforeload",this.onBeforeLoad,this);this.store.on("load",this.onLoad,this);this.store.on("loadexception",this.collapse,this);if(this.view){this.view.setStore(_f)}}},initEvents:function(){Ext.form.ComboBox.superclass.initEvents.call(this);this.keyNav=new Ext.KeyNav(this.el,{up:function(e){this.inKeyMode=true;this.selectPrev()},down:function(e){if(!this.isExpanded()){this.onTriggerClick()}else{this.inKeyMode=true;this.selectNext()}},enter:function(e){this.onViewClick();this.delayedCheck=true;this.unsetDelayCheck.defer(10,this)},esc:function(e){this.collapse()},tab:function(e){this.onViewClick(false);return true},scope:this,doRelay:function(foo,bar,_18){if(_18=="down"||this.scope.isExpanded()){return Ext.KeyNav.prototype.doRelay.apply(this,arguments)}return true},forceKeyDown:true});this.queryDelay=Math.max(this.queryDelay||10,this.mode=="local"?10:250);this.dqTask=new Ext.util.DelayedTask(this.initQuery,this);if(this.typeAhead){this.taTask=new Ext.util.DelayedTask(this.onTypeAhead,this)}if(this.editable!==false){this.el.on("keyup",this.onKeyUp,this)}if(this.forceSelection){this.on("blur",this.doForce,this)}},onDestroy:function(){if(this.view){Ext.destroy(this.view)}if(this.list){if(this.innerList){this.innerList.un("mouseover",this.onViewOver,this);this.innerList.un("mousemove",this.onViewMove,this)}this.list.destroy()}if(this.dqTask){this.dqTask.cancel();this.dqTask=null}this.bindStore(null);Ext.form.ComboBox.superclass.onDestroy.call(this)},unsetDelayCheck:function(){delete this.delayedCheck},fireKey:function(e){if(e.isNavKeyPress()&&!this.isExpanded()&&!this.delayedCheck){this.fireEvent("specialkey",this,e)}},onResize:function(w,h){Ext.form.ComboBox.superclass.onResize.apply(this,arguments);if(this.list&&this.listWidth===undefined){var lw=Math.max(w,this.minListWidth);
58
+ this.list.setWidth(lw);this.innerList.setWidth(lw-this.list.getFrameWidth("lr"))}},onEnable:function(){Ext.form.ComboBox.superclass.onEnable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=false}},onDisable:function(){Ext.form.ComboBox.superclass.onDisable.apply(this,arguments);if(this.hiddenField){this.hiddenField.disabled=true}},setEditable:function(_1d){if(_1d==this.editable){return}this.editable=_1d;if(!_1d){this.el.dom.setAttribute("readOnly",true);this.el.on("mousedown",this.onTriggerClick,this);this.el.addClass("x-combo-noedit")}else{this.el.dom.removeAttribute("readOnly");this.el.un("mousedown",this.onTriggerClick,this);this.el.removeClass("x-combo-noedit")}},onBeforeLoad:function(){if(!this.hasFocus){return}this.innerList.update(this.loadingText?'<div class="loading-indicator">'+this.loadingText+"</div>":"");this.restrictHeight();this.selectedIndex=-1},onLoad:function(){if(!this.hasFocus){return}if(this.store.getCount()>0){this.expand();this.restrictHeight();if(this.lastQuery==this.allQuery){if(this.editable){this.el.dom.select()}if(!this.selectByValue(this.value,true)){this.select(0,true)}}else{this.selectNext();if(this.typeAhead&&this.lastKey!=Ext.EventObject.BACKSPACE&&this.lastKey!=Ext.EventObject.DELETE){this.taTask.delay(this.typeAheadDelay)}}}else{this.onEmptyResults()}},onTypeAhead:function(){if(this.store.getCount()>0){var r=this.store.getAt(0);var _1f=r.data[this.displayField];var len=_1f.length;var _21=this.getRawValue().length;if(_21!=len){this.setRawValue(_1f);this.selectText(_21,_1f.length)}}},onSelect:function(_22,_23){if(this.fireEvent("beforeselect",this,_22,_23)!==false){this.setValue(_22.data[this.valueField||this.displayField]);this.collapse();this.fireEvent("select",this,_22,_23)}},getValue:function(){if(this.valueField){return typeof this.value!="undefined"?this.value:""}else{return Ext.form.ComboBox.superclass.getValue.call(this)}},clearValue:function(){if(this.hiddenField){this.hiddenField.value=""}this.setRawValue("");this.lastSelectionText="";this.applyEmptyText();this.value=""},setValue:function(v){var _25=v;if(this.valueField){var r=this.findRecord(this.valueField,v);if(r){_25=r.data[this.displayField]}else{if(this.valueNotFoundText!==undefined){_25=this.valueNotFoundText}}}this.lastSelectionText=_25;if(this.hiddenField){this.hiddenField.value=v}Ext.form.ComboBox.superclass.setValue.call(this,_25);this.value=v},findRecord:function(_27,_28){var _29;if(this.store.getCount()>0){this.store.each(function(r){if(r.data[_27]==_28){_29=r;return false}})}return _29},onViewMove:function(e,t){this.inKeyMode=false},onViewOver:function(e,t){if(this.inKeyMode){return}var _2f=this.view.findItemFromChild(t);if(_2f){var _30=this.view.indexOf(_2f);this.select(_30,false)}},onViewClick:function(_31){var _32=this.view.getSelectedIndexes()[0];var r=this.store.getAt(_32);if(r){this.onSelect(r,_32)}if(_31!==false){this.el.focus()}},restrictHeight:function(){this.innerList.dom.style.height="";var _34=this.innerList.dom;var pad=this.list.getFrameWidth("tb")+(this.resizable?this.handleHeight:0)+this.assetHeight;var h=Math.max(_34.clientHeight,_34.offsetHeight,_34.scrollHeight);var ha=this.getPosition()[1]-Ext.getBody().getScroll().top;var hb=Ext.lib.Dom.getViewHeight()-ha-this.getSize().height;var _39=Math.max(ha,hb,this.minHeight||0)-this.list.shadowOffset-pad-5;h=Math.min(h,_39,this.maxHeight);this.innerList.setHeight(h);this.list.beginUpdate();this.list.setHeight(h+pad);this.list.alignTo(this.wrap,this.listAlign);this.list.endUpdate()},onEmptyResults:function(){this.collapse()},isExpanded:function(){return this.list&&this.list.isVisible()},selectByValue:function(v,_3b){if(v!==undefined&&v!==null){var r=this.findRecord(this.valueField||this.displayField,v);if(r){this.select(this.store.indexOf(r),_3b);return true}}return false},select:function(_3d,_3e){this.selectedIndex=_3d;this.view.select(_3d);if(_3e!==false){var el=this.view.getNode(_3d);if(el){this.innerList.scrollChildIntoView(el,false)}}},selectNext:function(){var ct=this.store.getCount();if(ct>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex<ct-1){this.select(this.selectedIndex+1)}}}},selectPrev:function(){var ct=this.store.getCount();if(ct>0){if(this.selectedIndex==-1){this.select(0)}else{if(this.selectedIndex!=0){this.select(this.selectedIndex-1)}}}},onKeyUp:function(e){if(this.editable!==false&&!e.isSpecialKey()){this.lastKey=e.getKey();this.dqTask.delay(this.queryDelay)}},validateBlur:function(){return !this.list||!this.list.isVisible()},initQuery:function(){this.doQuery(this.getRawValue())},doForce:function(){if(this.el.dom.value.length>0){this.el.dom.value=this.lastSelectionText===undefined?"":this.lastSelectionText;this.applyEmptyText()}},doQuery:function(q,_44){if(q===undefined||q===null){q=""}var qe={query:q,forceAll:_44,combo:this,cancel:false};if(this.fireEvent("beforequery",qe)===false||qe.cancel){return false}q=qe.query;_44=qe.forceAll;if(_44===true||(q.length>=this.minChars)){if(this.lastQuery!==q){this.lastQuery=q;if(this.mode=="local"){this.selectedIndex=-1;if(_44){this.store.clearFilter()}else{this.store.filter(this.displayField,q)}this.onLoad()}else{this.store.baseParams[this.queryParam]=q;this.store.load({params:this.getParams(q)});this.expand()}}else{this.selectedIndex=-1;this.onLoad()}}},getParams:function(q){var p={};if(this.pageSize){p.start=0;p.limit=this.pageSize}return p},collapse:function(){if(!this.isExpanded()){return}this.list.hide();Ext.getDoc().un("mousewheel",this.collapseIf,this);Ext.getDoc().un("mousedown",this.collapseIf,this);this.fireEvent("collapse",this)},collapseIf:function(e){if(!e.within(this.wrap)&&!e.within(this.list)){this.collapse()}},expand:function(){if(this.isExpanded()||!this.hasFocus){return}this.list.alignTo(this.wrap,this.listAlign);this.list.show();this.innerList.setOverflow("auto");Ext.getDoc().on("mousewheel",this.collapseIf,this);Ext.getDoc().on("mousedown",this.collapseIf,this);this.fireEvent("expand",this)},onTriggerClick:function(){if(this.disabled){return}if(this.isExpanded()){this.collapse();this.el.focus()}else{this.onFocus({});if(this.triggerAction=="all"){this.doQuery(this.allQuery,true)}else{this.doQuery(this.getRawValue())}this.el.focus()}}});Ext.reg("combo",Ext.form.ComboBox);Ext.form.Checkbox=Ext.extend(Ext.form.Field,{checkedCls:"x-form-check-checked",focusCls:"x-form-check-focus",overCls:"x-form-check-over",mouseDownCls:"x-form-check-down",tabIndex:0,checked:false,defaultAutoCreate:{tag:"input",type:"checkbox",autocomplete:"off"},baseCls:"x-form-check",initComponent:function(){Ext.form.Checkbox.superclass.initComponent.call(this);this.addEvents("check")},initEvents:function(){Ext.form.Checkbox.superclass.initEvents.call(this);this.initCheckEvents()},initCheckEvents:function(){this.innerWrap.removeAllListeners();this.innerWrap.addClassOnOver(this.overCls);this.innerWrap.addClassOnClick(this.mouseDownCls);this.innerWrap.on("click",this.onClick,this);this.innerWrap.on("keyup",this.onKeyUp,this)},onRender:function(ct,_2){Ext.form.Checkbox.superclass.onRender.call(this,ct,_2);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue}this.el.addClass("x-hidden");this.innerWrap=this.el.wrap({tabIndex:this.tabIndex,cls:this.baseCls+"-wrap-inner"});this.wrap=this.innerWrap.wrap({cls:this.baseCls+"-wrap"});if(this.boxLabel){this.labelEl=this.innerWrap.createChild({tag:"label",htmlFor:this.el.id,cls:"x-form-cb-label",html:this.boxLabel})}this.imageEl=this.innerWrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:this.baseCls},this.el);if(this.checked){this.setValue(true)}else{this.checked=this.el.dom.checked}this.originalValue=this.checked},afterRender:function(){Ext.form.Checkbox.superclass.afterRender.call(this);this.wrap[this.checked?"addClass":"removeClass"](this.checkedCls)},onDestroy:function(){if(this.rendered){Ext.destroy(this.imageEl,this.labelEl,this.innerWrap,this.wrap)}Ext.form.Checkbox.superclass.onDestroy.call(this)},onFocus:function(e){Ext.form.Checkbox.superclass.onFocus.call(this,e);
59
+ this.el.addClass(this.focusCls)},onBlur:function(e){Ext.form.Checkbox.superclass.onBlur.call(this,e);this.el.removeClass(this.focusCls)},onResize:function(){Ext.form.Checkbox.superclass.onResize.apply(this,arguments);if(!this.boxLabel&&!this.fieldLabel){this.el.alignTo(this.wrap,"c-c")}},onKeyUp:function(e){if(e.getKey()==Ext.EventObject.SPACE){this.onClick(e)}},onClick:function(e){if(!this.disabled&&!this.readOnly){this.toggleValue()}e.stopEvent()},onEnable:function(){Ext.form.Checkbox.superclass.onEnable.call(this);this.initCheckEvents()},onDisable:function(){Ext.form.Checkbox.superclass.onDisable.call(this);this.innerWrap.removeAllListeners()},toggleValue:function(){this.setValue(!this.checked)},getResizeEl:function(){if(!this.resizeEl){this.resizeEl=Ext.isSafari?this.wrap:(this.wrap.up(".x-form-element",5)||this.wrap)}return this.resizeEl},getPositionEl:function(){return this.wrap},getActionEl:function(){return this.wrap},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,initValue:Ext.emptyFn,getValue:function(){if(this.rendered){return this.el.dom.checked}return this.checked},setValue:function(v){var _8=this.checked;this.checked=(v===true||v==="true"||v=="1"||String(v).toLowerCase()=="on");if(this.rendered){this.el.dom.checked=this.checked;this.el.dom.defaultChecked=this.checked;this.wrap[this.checked?"addClass":"removeClass"](this.checkedCls)}if(_8!=this.checked){this.fireEvent("check",this,this.checked);if(this.handler){this.handler.call(this.scope||this,this,this.checked)}}}});Ext.reg("checkbox",Ext.form.Checkbox);Ext.form.CheckboxGroup=Ext.extend(Ext.form.Field,{columns:"auto",vertical:false,allowBlank:true,blankText:"You must select at least one item in this group",defaultType:"checkbox",groupCls:"x-form-check-group",onRender:function(ct,_2){if(!this.el){var _3={cls:this.groupCls,layout:"column",border:false,renderTo:ct};var _4={defaultType:this.defaultType,layout:"form",border:false,defaults:{hideLabel:true,anchor:"100%"}};if(this.items[0].items){Ext.apply(_3,{layoutConfig:{columns:this.items.length},defaults:this.defaults,items:this.items});for(var i=0,_6=this.items.length;i<_6;i++){Ext.applyIf(this.items[i],_4)}}else{var _7,_8=[];if(typeof this.columns=="string"){this.columns=this.items.length}if(!Ext.isArray(this.columns)){var cs=[];for(var i=0;i<this.columns;i++){cs.push((100/this.columns)*0.01)}this.columns=cs}_7=this.columns.length;for(var i=0;i<_7;i++){var cc=Ext.apply({items:[]},_4);cc[this.columns[i]<=1?"columnWidth":"width"]=this.columns[i];if(this.defaults){cc.defaults=Ext.apply(cc.defaults||{},this.defaults)}_8.push(cc)}if(this.vertical){var _b=Math.ceil(this.items.length/_7),ri=0;for(var i=0,_6=this.items.length;i<_6;i++){if(i>0&&i%_b==0){ri++}if(this.items[i].fieldLabel){this.items[i].hideLabel=false}_8[ri].items.push(this.items[i])}}else{for(var i=0,_6=this.items.length;i<_6;i++){var ci=i%_7;if(this.items[i].fieldLabel){this.items[i].hideLabel=false}_8[ci].items.push(this.items[i])}}Ext.apply(_3,{layoutConfig:{columns:_7},items:_8})}this.panel=new Ext.Panel(_3);this.el=this.panel.getEl();if(this.forId&&this.itemCls){var l=this.el.up(this.itemCls).child("label",true);if(l){l.setAttribute("htmlFor",this.forId)}}var _f=this.panel.findBy(function(c){return c.isFormField},this);this.items=new Ext.util.MixedCollection();this.items.addAll(_f)}Ext.form.CheckboxGroup.superclass.onRender.call(this,ct,_2)},validateValue:function(_11){if(!this.allowBlank){var _12=true;this.items.each(function(f){if(f.checked){return _12=false}},this);if(_12){this.markInvalid(this.blankText);return false}}return true},onDisable:function(){this.items.each(function(_14){_14.disable()})},onEnable:function(){this.items.each(function(_15){_15.enable()})},onResize:function(w,h){this.panel.setSize(w,h);this.panel.doLayout()},reset:function(){Ext.form.CheckboxGroup.superclass.reset.call(this);this.items.each(function(c){if(c.reset){c.reset()}},this)},initValue:Ext.emptyFn,getValue:Ext.emptyFn,getRawValue:Ext.emptyFn,setValue:Ext.emptyFn,setRawValue:Ext.emptyFn});Ext.reg("checkboxgroup",Ext.form.CheckboxGroup);Ext.form.Radio=Ext.extend(Ext.form.Checkbox,{inputType:"radio",baseCls:"x-form-radio",getGroupValue:function(){var c=this.getParent().child("input[name="+this.el.dom.name+"]:checked",true);return c?c.value:null},getParent:function(){return this.el.up("form")||Ext.getBody()},toggleValue:function(){if(!this.checked){var _2=this.getParent().select("input[name="+this.el.dom.name+"]");_2.each(function(el){if(el.dom.id==this.id){this.setValue(true)}else{Ext.getCmp(el.dom.id).setValue(false)}},this)}},setValue:function(v){if(typeof v=="boolean"){Ext.form.Radio.superclass.setValue.call(this,v)}else{var r=this.getParent().child("input[name="+this.el.dom.name+"][value="+v+"]",true);if(r&&!r.checked){Ext.getCmp(r.id).toggleValue()}}},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("radio",Ext.form.Radio);Ext.form.RadioGroup=Ext.extend(Ext.form.CheckboxGroup,{allowBlank:true,blankText:"You must select one item in this group",defaultType:"radio",groupCls:"x-form-radio-group"});Ext.reg("radiogroup",Ext.form.RadioGroup);Ext.form.Hidden=Ext.extend(Ext.form.Field,{inputType:"hidden",onRender:function(){Ext.form.Hidden.superclass.onRender.apply(this,arguments)},initEvents:function(){this.originalValue=this.getValue()},setSize:Ext.emptyFn,setWidth:Ext.emptyFn,setHeight:Ext.emptyFn,setPosition:Ext.emptyFn,setPagePosition:Ext.emptyFn,markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn});Ext.reg("hidden",Ext.form.Hidden);Ext.form.BasicForm=function(el,_2){Ext.apply(this,_2);this.items=new Ext.util.MixedCollection(false,function(o){return o.id||(o.id=Ext.id())});this.addEvents("beforeaction","actionfailed","actioncomplete");if(el){this.initEl(el)}Ext.form.BasicForm.superclass.constructor.call(this)};Ext.extend(Ext.form.BasicForm,Ext.util.Observable,{timeout:30,activeAction:null,trackResetOnLoad:false,initEl:function(el){this.el=Ext.get(el);this.id=this.el.id||Ext.id();if(!this.standardSubmit){this.el.on("submit",this.onSubmit,this)}this.el.addClass("x-form")},getEl:function(){return this.el},onSubmit:function(e){e.stopEvent()},destroy:function(){this.items.each(function(f){Ext.destroy(f)});if(this.el){this.el.removeAllListeners();this.el.remove()}this.purgeListeners()},isValid:function(){var _7=true;this.items.each(function(f){if(!f.validate()){_7=false}});return _7},isDirty:function(){var _9=false;this.items.each(function(f){if(f.isDirty()){_9=true;return false}});return _9},doAction:function(_b,_c){if(typeof _b=="string"){_b=new Ext.form.Action.ACTION_TYPES[_b](this,_c)}if(this.fireEvent("beforeaction",this,_b)!==false){this.beforeAction(_b);_b.run.defer(100,_b)}return this},submit:function(_d){if(this.standardSubmit){var v=this.isValid();if(v){this.el.dom.submit()}return v}this.doAction("submit",_d);return this},load:function(_f){this.doAction("load",_f);return this},updateRecord:function(_10){_10.beginEdit();var fs=_10.fields;fs.each(function(f){var _13=this.findField(f.name);if(_13){_10.set(f.name,_13.getValue())}},this);_10.endEdit();return this},loadRecord:function(_14){this.setValues(_14.data);return this},beforeAction:function(_15){var o=_15.options;if(o.waitMsg){if(this.waitMsgTarget===true){this.el.mask(o.waitMsg,"x-mask-loading")}else{if(this.waitMsgTarget){this.waitMsgTarget=Ext.get(this.waitMsgTarget);this.waitMsgTarget.mask(o.waitMsg,"x-mask-loading")}else{Ext.MessageBox.wait(o.waitMsg,o.waitTitle||this.waitTitle||"Please Wait...")}}}},afterAction:function(_17,_18){this.activeAction=null;var o=_17.options;if(o.waitMsg){if(this.waitMsgTarget===true){this.el.unmask()}else{if(this.waitMsgTarget){this.waitMsgTarget.unmask()}else{Ext.MessageBox.updateProgress(1);Ext.MessageBox.hide()}}}if(_18){if(o.reset){this.reset()}Ext.callback(o.success,o.scope,[this,_17]);this.fireEvent("actioncomplete",this,_17)}else{Ext.callback(o.failure,o.scope,[this,_17]);this.fireEvent("actionfailed",this,_17)}},findField:function(id){var _1b=this.items.get(id);if(!_1b){this.items.each(function(f){if(f.isFormField&&(f.dataIndex==id||f.id==id||f.getName()==id)){_1b=f;
60
+ return false}})}return _1b||null},markInvalid:function(_1d){if(Ext.isArray(_1d)){for(var i=0,len=_1d.length;i<len;i++){var _20=_1d[i];var f=this.findField(_20.id);if(f){f.markInvalid(_20.msg)}}}else{var _22,id;for(id in _1d){if(typeof _1d[id]!="function"&&(_22=this.findField(id))){_22.markInvalid(_1d[id])}}}return this},setValues:function(_24){if(Ext.isArray(_24)){for(var i=0,len=_24.length;i<len;i++){var v=_24[i];var f=this.findField(v.id);if(f){f.setValue(v.value);if(this.trackResetOnLoad){f.originalValue=f.getValue()}}}}else{var _29,id;for(id in _24){if(typeof _24[id]!="function"&&(_29=this.findField(id))){_29.setValue(_24[id]);if(this.trackResetOnLoad){_29.originalValue=_29.getValue()}}}}return this},getValues:function(_2b){var fs=Ext.lib.Ajax.serializeForm(this.el.dom);if(_2b===true){return fs}return Ext.urlDecode(fs)},clearInvalid:function(){this.items.each(function(f){f.clearInvalid()});return this},reset:function(){this.items.each(function(f){f.reset()});return this},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this},remove:function(_2f){this.items.remove(_2f);return this},render:function(){this.items.each(function(f){if(f.isFormField&&!f.rendered&&document.getElementById(f.id)){f.applyToMarkup(f.id)}});return this},applyToFields:function(o){this.items.each(function(f){Ext.apply(f,o)});return this},applyIfToFields:function(o){this.items.each(function(f){Ext.applyIf(f,o)});return this}});Ext.BasicForm=Ext.form.BasicForm;Ext.FormPanel=Ext.extend(Ext.Panel,{buttonAlign:"center",minButtonWidth:75,labelAlign:"left",monitorValid:false,monitorPoll:200,layout:"form",initComponent:function(){this.form=this.createForm();this.bodyCfg={tag:"form",cls:this.baseCls+"-body",method:this.method||"POST",id:this.formId||Ext.id()};if(this.fileUpload){this.bodyCfg.enctype="multipart/form-data"}Ext.FormPanel.superclass.initComponent.call(this);this.initItems();this.addEvents("clientvalidation");this.relayEvents(this.form,["beforeaction","actionfailed","actioncomplete"])},createForm:function(){delete this.initialConfig.listeners;return new Ext.form.BasicForm(null,this.initialConfig)},initFields:function(){var f=this.form;var _2=this;var fn=function(c){if(c.isFormField){f.add(c)}else{if(c.doLayout&&c!=_2){Ext.applyIf(c,{labelAlign:c.ownerCt.labelAlign,labelWidth:c.ownerCt.labelWidth,itemCls:c.ownerCt.itemCls});if(c.items){c.items.each(fn)}}}};this.items.each(fn)},getLayoutTarget:function(){return this.form.el},getForm:function(){return this.form},onRender:function(ct,_6){this.initFields();Ext.FormPanel.superclass.onRender.call(this,ct,_6);this.form.initEl(this.body)},beforeDestroy:function(){Ext.FormPanel.superclass.beforeDestroy.call(this);this.stopMonitoring();Ext.destroy(this.form)},initEvents:function(){Ext.FormPanel.superclass.initEvents.call(this);this.items.on("remove",this.onRemove,this);this.items.on("add",this.onAdd,this);if(this.monitorValid){this.startMonitoring()}},onAdd:function(ct,c){if(c.isFormField){this.form.add(c)}},onRemove:function(c){if(c.isFormField){Ext.destroy(c.container.up(".x-form-item"));this.form.remove(c)}},startMonitoring:function(){if(!this.bound){this.bound=true;Ext.TaskMgr.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})}},stopMonitoring:function(){this.bound=false},load:function(){this.form.load.apply(this.form,arguments)},onDisable:function(){Ext.FormPanel.superclass.onDisable.call(this);if(this.form){this.form.items.each(function(){this.disable()})}},onEnable:function(){Ext.FormPanel.superclass.onEnable.call(this);if(this.form){this.form.items.each(function(){this.enable()})}},bindHandler:function(){if(!this.bound){return false}var _a=true;this.form.items.each(function(f){if(!f.isValid(true)){_a=false;return false}});if(this.buttons){for(var i=0,_d=this.buttons.length;i<_d;i++){var _e=this.buttons[i];if(_e.formBind===true&&_e.disabled===_a){_e.setDisabled(!_a)}}}this.fireEvent("clientvalidation",this,_a)}});Ext.reg("form",Ext.FormPanel);Ext.form.FormPanel=Ext.FormPanel;Ext.form.FieldSet=Ext.extend(Ext.Panel,{baseCls:"x-fieldset",layout:"form",animCollapse:false,onRender:function(ct,_2){if(!this.el){this.el=document.createElement("fieldset");this.el.id=this.id;if(this.title||this.header||this.checkboxToggle){this.el.appendChild(document.createElement("legend")).className="x-fieldset-header"}}Ext.form.FieldSet.superclass.onRender.call(this,ct,_2);if(this.checkboxToggle){var o=typeof this.checkboxToggle=="object"?this.checkboxToggle:{tag:"input",type:"checkbox",name:this.checkboxName||this.id+"-checkbox"};this.checkbox=this.header.insertFirst(o);this.checkbox.dom.checked=!this.collapsed;this.checkbox.on("click",this.onCheckClick,this)}},onCollapse:function(_4,_5){if(this.checkbox){this.checkbox.dom.checked=false}Ext.form.FieldSet.superclass.onCollapse.call(this,_4,_5)},onExpand:function(_6,_7){if(this.checkbox){this.checkbox.dom.checked=true}Ext.form.FieldSet.superclass.onExpand.call(this,_6,_7)},onCheckClick:function(){this[this.checkbox.dom.checked?"expand":"collapse"]()},beforeDestroy:function(){if(this.checkbox){this.checkbox.un("click",this.onCheckClick,this)}Ext.form.FieldSet.superclass.beforeDestroy.call(this)}});Ext.reg("fieldset",Ext.form.FieldSet);Ext.form.HtmlEditor=Ext.extend(Ext.form.Field,{enableFormat:true,enableFontSize:true,enableColors:true,enableAlignments:true,enableLists:true,enableSourceEdit:true,enableLinks:true,enableFont:true,createLinkText:"Please enter the URL for the link:",defaultLinkValue:"http://",fontFamilies:["Arial","Courier New","Tahoma","Times New Roman","Verdana"],defaultFont:"tahoma",validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Ext.emptyFn,iframePad:3,hideMode:"offsets",defaultAutoCreate:{tag:"textarea",style:"width:500px;height:300px;",autocomplete:"off"},initComponent:function(){this.addEvents("initialize","activate","beforesync","beforepush","sync","push","editmodechange")},createFontOptions:function(){var _1=[],fs=this.fontFamilies,ff,lc;for(var i=0,_6=fs.length;i<_6;i++){ff=fs[i];lc=ff.toLowerCase();_1.push('<option value="',lc,'" style="font-family:',ff,';"',(this.defaultFont==lc?' selected="true">':">"),ff,"</option>")}return _1.join("")},createToolbar:function(_7){var _8=Ext.QuickTips&&Ext.QuickTips.isEnabled();function btn(id,_a,_b){return{itemId:id,cls:"x-btn-icon x-edit-"+id,enableToggle:_a!==false,scope:_7,handler:_b||_7.relayBtnCmd,clickEvent:"mousedown",tooltip:_8?_7.buttonTips[id]||undefined:undefined,tabIndex:-1}}var tb=new Ext.Toolbar({renderTo:this.wrap.dom.firstChild});tb.el.on("click",function(e){e.preventDefault()});if(this.enableFont&&!Ext.isSafari2){this.fontSelect=tb.el.createChild({tag:"select",cls:"x-font-select",html:this.createFontOptions()});this.fontSelect.on("change",function(){var _e=this.fontSelect.dom.value;this.relayCmd("fontname",_e);this.deferFocus()},this);tb.add(this.fontSelect.dom,"-")}if(this.enableFormat){tb.add(btn("bold"),btn("italic"),btn("underline"))}if(this.enableFontSize){tb.add("-",btn("increasefontsize",false,this.adjustFont),btn("decreasefontsize",false,this.adjustFont))}if(this.enableColors){tb.add("-",{itemId:"forecolor",cls:"x-btn-icon x-edit-forecolor",clickEvent:"mousedown",tooltip:_8?_7.buttonTips.forecolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({allowReselect:true,focus:Ext.emptyFn,value:"000000",plain:true,selectHandler:function(cp,_10){this.execCmd("forecolor",Ext.isSafari||Ext.isIE?"#"+_10:_10);this.deferFocus()},scope:this,clickEvent:"mousedown"})},{itemId:"backcolor",cls:"x-btn-icon x-edit-backcolor",clickEvent:"mousedown",tooltip:_8?_7.buttonTips.backcolor||undefined:undefined,tabIndex:-1,menu:new Ext.menu.ColorMenu({focus:Ext.emptyFn,value:"FFFFFF",plain:true,allowReselect:true,selectHandler:function(cp,_12){if(Ext.isGecko){this.execCmd("useCSS",false);this.execCmd("hilitecolor",_12);this.execCmd("useCSS",true);this.deferFocus()}else{this.execCmd(Ext.isOpera?"hilitecolor":"backcolor",Ext.isSafari||Ext.isIE?"#"+_12:_12);
61
+ this.deferFocus()}},scope:this,clickEvent:"mousedown"})})}if(this.enableAlignments){tb.add("-",btn("justifyleft"),btn("justifycenter"),btn("justifyright"))}if(!Ext.isSafari2){if(this.enableLinks){tb.add("-",btn("createlink",false,this.createLink))}if(this.enableLists){tb.add("-",btn("insertorderedlist"),btn("insertunorderedlist"))}if(this.enableSourceEdit){tb.add("-",btn("sourceedit",true,function(btn){this.toggleSourceEdit(btn.pressed)}))}}this.tb=tb},getDocMarkup:function(){return'<html><head><style type="text/css">body{border:0;margin:0;padding:3px;height:98%;cursor:text;}</style></head><body></body></html>'},getEditorBody:function(){return this.doc.body||this.doc.documentElement},getDoc:function(){return Ext.isIE?this.getWin().document:(this.iframe.contentDocument||this.getWin().document)},getWin:function(){return Ext.isIE?this.iframe.contentWindow:window.frames[this.iframe.name]},onRender:function(ct,_15){Ext.form.HtmlEditor.superclass.onRender.call(this,ct,_15);this.el.dom.style.border="0 none";this.el.dom.setAttribute("tabIndex",-1);this.el.addClass("x-hidden");if(Ext.isIE){this.el.applyStyles("margin-top:-1px;margin-bottom:-1px;")}this.wrap=this.el.wrap({cls:"x-html-editor-wrap",cn:{cls:"x-html-editor-tb"}});this.createToolbar(this);this.tb.items.each(function(_16){if(_16.itemId!="sourceedit"){_16.disable()}});var _17=document.createElement("iframe");_17.name=Ext.id();_17.frameBorder="0";_17.src=Ext.isIE?Ext.SSL_SECURE_URL:"javascript:;";this.wrap.dom.appendChild(_17);this.iframe=_17;this.initFrame();if(this.autoMonitorDesignMode!==false){this.monitorTask=Ext.TaskMgr.start({run:this.checkDesignMode,scope:this,interval:100})}if(!this.width){var sz=this.el.getSize();this.setSize(sz.width,this.height||sz.height)}},initFrame:function(){this.doc=this.getDoc();this.win=this.getWin();this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var _19={run:function(){if(this.doc.body||this.doc.readyState=="complete"){Ext.TaskMgr.stop(_19);this.doc.designMode="on";this.initEditor.defer(10,this)}},interval:10,duration:10000,scope:this};Ext.TaskMgr.start(_19)},checkDesignMode:function(){if(this.wrap&&this.wrap.dom.offsetWidth){var doc=this.getDoc();if(!doc){return}if(!doc.editorInitialized||String(doc.designMode).toLowerCase()!="on"){this.initFrame()}}},onResize:function(w,h){Ext.form.HtmlEditor.superclass.onResize.apply(this,arguments);if(this.el&&this.iframe){if(typeof w=="number"){var aw=w-this.wrap.getFrameWidth("lr");this.el.setWidth(this.adjustWidth("textarea",aw));this.iframe.style.width=Math.max(aw,0)+"px"}if(typeof h=="number"){var ah=h-this.wrap.getFrameWidth("tb")-this.tb.el.getHeight();this.el.setHeight(this.adjustWidth("textarea",ah));this.iframe.style.height=Math.max(ah,0)+"px";if(this.doc){this.getEditorBody().style.height=Math.max((ah-(this.iframePad*2)),0)+"px"}}}},toggleSourceEdit:function(_1f){if(_1f===undefined){_1f=!this.sourceEditMode}this.sourceEditMode=_1f===true;var btn=this.tb.items.get("sourceedit");if(btn.pressed!==this.sourceEditMode){btn.toggle(this.sourceEditMode);return}if(this.sourceEditMode){this.tb.items.each(function(_21){if(_21.itemId!="sourceedit"){_21.disable()}});this.syncValue();this.iframe.className="x-hidden";this.el.removeClass("x-hidden");this.el.dom.removeAttribute("tabIndex");this.el.focus()}else{if(this.initialized){this.tb.items.each(function(_22){_22.enable()})}this.pushValue();this.iframe.className="";this.el.addClass("x-hidden");this.el.dom.setAttribute("tabIndex",-1);this.deferFocus()}var _23=this.lastSize;if(_23){delete this.lastSize;this.setSize(_23)}this.fireEvent("editmodechange",this,this.sourceEditMode)},createLink:function(){var url=prompt(this.createLinkText,this.defaultLinkValue);if(url&&url!="http://"){this.relayCmd("createlink",url)}},adjustSize:Ext.BoxComponent.prototype.adjustSize,getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},initEvents:function(){this.originalValue=this.getValue()},markInvalid:Ext.emptyFn,clearInvalid:Ext.emptyFn,setValue:function(v){Ext.form.HtmlEditor.superclass.setValue.call(this,v);this.pushValue()},cleanHtml:function(_26){_26=String(_26);if(_26.length>5){if(Ext.isSafari){_26=_26.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi,"")}}if(_26=="&nbsp;"){_26=""}return _26},syncValue:function(){if(this.initialized){var bd=this.getEditorBody();var _28=bd.innerHTML;if(Ext.isSafari){var bs=bd.getAttribute("style");var m=bs.match(/text-align:(.*?);/i);if(m&&m[1]){_28='<div style="'+m[0]+'">'+_28+"</div>"}}_28=this.cleanHtml(_28);if(this.fireEvent("beforesync",this,_28)!==false){this.el.dom.value=_28;this.fireEvent("sync",this,_28)}}},getValue:function(){this.syncValue();return Ext.form.HtmlEditor.superclass.getValue.call(this)},pushValue:function(){if(this.initialized){var v=this.el.dom.value;if(!this.activated&&v.length<1){v="&nbsp;"}if(this.fireEvent("beforepush",this,v)!==false){this.getEditorBody().innerHTML=v;this.fireEvent("push",this,v)}}},deferFocus:function(){this.focus.defer(10,this)},focus:function(){if(this.win&&!this.sourceEditMode){this.win.focus()}else{this.el.focus()}},initEditor:function(){var _2c=this.getEditorBody();var ss=this.el.getStyles("font-size","font-family","background-image","background-repeat");ss["background-attachment"]="fixed";_2c.bgProperties="fixed";Ext.DomHelper.applyStyles(_2c,ss);if(this.doc){try{Ext.EventManager.removeAll(this.doc)}catch(e){}}this.doc=this.getDoc();Ext.EventManager.on(this.doc,{mousedown:this.onEditorEvent,dblclick:this.onEditorEvent,click:this.onEditorEvent,keyup:this.onEditorEvent,buffer:100,scope:this});if(Ext.isGecko){Ext.EventManager.on(this.doc,"keypress",this.applyCommand,this)}if(Ext.isIE||Ext.isSafari||Ext.isOpera){Ext.EventManager.on(this.doc,"keydown",this.fixKeys,this)}this.initialized=true;this.fireEvent("initialize",this);this.doc.editorInitialized=true;this.pushValue()},onDestroy:function(){if(this.monitorTask){Ext.TaskMgr.stop(this.monitorTask)}if(this.rendered){this.tb.items.each(function(_2e){if(_2e.menu){_2e.menu.removeAll();if(_2e.menu.el){_2e.menu.el.destroy()}}_2e.destroy()});this.wrap.dom.innerHTML="";this.wrap.remove()}},onFirstFocus:function(){this.activated=true;this.tb.items.each(function(_2f){_2f.enable()});if(Ext.isGecko){this.win.focus();var s=this.win.getSelection();if(!s.focusNode||s.focusNode.nodeType!=3){var r=s.getRangeAt(0);r.selectNodeContents(this.getEditorBody());r.collapse(true);this.deferFocus()}try{this.execCmd("useCSS",true);this.execCmd("styleWithCSS",false)}catch(e){}}this.fireEvent("activate",this)},adjustFont:function(btn){var _33=btn.itemId=="increasefontsize"?1:-1;var v=parseInt(this.doc.queryCommandValue("FontSize")||2,10);if(Ext.isSafari3||Ext.isAir){if(v<=10){v=1+_33}else{if(v<=13){v=2+_33}else{if(v<=16){v=3+_33}else{if(v<=18){v=4+_33}else{if(v<=24){v=5+_33}else{v=6+_33}}}}}v=v.constrain(1,6)}else{if(Ext.isSafari){_33*=2}v=Math.max(1,v+_33)+(Ext.isSafari?"px":0)}this.execCmd("FontSize",v)},onEditorEvent:function(e){this.updateToolbar()},updateToolbar:function(){if(!this.activated){this.onFirstFocus();return}var _36=this.tb.items.map,doc=this.doc;if(this.enableFont&&!Ext.isSafari2){var _38=(this.doc.queryCommandValue("FontName")||this.defaultFont).toLowerCase();if(_38!=this.fontSelect.dom.value){this.fontSelect.dom.value=_38}}if(this.enableFormat){_36.bold.toggle(doc.queryCommandState("bold"));_36.italic.toggle(doc.queryCommandState("italic"));_36.underline.toggle(doc.queryCommandState("underline"))}if(this.enableAlignments){_36.justifyleft.toggle(doc.queryCommandState("justifyleft"));_36.justifycenter.toggle(doc.queryCommandState("justifycenter"));_36.justifyright.toggle(doc.queryCommandState("justifyright"))}if(!Ext.isSafari2&&this.enableLists){_36.insertorderedlist.toggle(doc.queryCommandState("insertorderedlist"));_36.insertunorderedlist.toggle(doc.queryCommandState("insertunorderedlist"))}Ext.menu.MenuMgr.hideAll();this.syncValue()},relayBtnCmd:function(btn){this.relayCmd(btn.itemId)},relayCmd:function(cmd,_3b){(function(){this.focus();
62
+ this.execCmd(cmd,_3b);this.updateToolbar()}).defer(10,this)},execCmd:function(cmd,_3d){this.doc.execCommand(cmd,false,_3d===undefined?null:_3d);this.syncValue()},applyCommand:function(e){if(e.ctrlKey){var c=e.getCharCode(),cmd;if(c>0){c=String.fromCharCode(c);switch(c){case"b":cmd="bold";break;case"i":cmd="italic";break;case"u":cmd="underline";break}if(cmd){this.win.focus();this.execCmd(cmd);this.deferFocus();e.preventDefault()}}}},insertAtCursor:function(_41){if(!this.activated){return}if(Ext.isIE){this.win.focus();var r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML(_41);this.syncValue();this.deferFocus()}}else{if(Ext.isGecko||Ext.isOpera){this.win.focus();this.execCmd("InsertHTML",_41);this.deferFocus()}else{if(Ext.isSafari){this.execCmd("InsertText",_41);this.deferFocus()}}}},fixKeys:function(){if(Ext.isIE){return function(e){var k=e.getKey(),r;if(k==e.TAB){e.stopEvent();r=this.doc.selection.createRange();if(r){r.collapse(true);r.pasteHTML("&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}else{if(k==e.ENTER){r=this.doc.selection.createRange();if(r){var _46=r.parentElement();if(!_46||_46.tagName.toLowerCase()!="li"){e.stopEvent();r.pasteHTML("<br />");r.collapse(false);r.select()}}}}}}else{if(Ext.isOpera){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.win.focus();this.execCmd("InsertHTML","&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}}else{if(Ext.isSafari){return function(e){var k=e.getKey();if(k==e.TAB){e.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}}}}}}(),getToolbar:function(){return this.tb},buttonTips:{bold:{title:"Bold (Ctrl+B)",text:"Make the selected text bold.",cls:"x-html-editor-tip"},italic:{title:"Italic (Ctrl+I)",text:"Make the selected text italic.",cls:"x-html-editor-tip"},underline:{title:"Underline (Ctrl+U)",text:"Underline the selected text.",cls:"x-html-editor-tip"},increasefontsize:{title:"Grow Text",text:"Increase the font size.",cls:"x-html-editor-tip"},decreasefontsize:{title:"Shrink Text",text:"Decrease the font size.",cls:"x-html-editor-tip"},backcolor:{title:"Text Highlight Color",text:"Change the background color of the selected text.",cls:"x-html-editor-tip"},forecolor:{title:"Font Color",text:"Change the color of the selected text.",cls:"x-html-editor-tip"},justifyleft:{title:"Align Text Left",text:"Align text to the left.",cls:"x-html-editor-tip"},justifycenter:{title:"Center Text",text:"Center text in the editor.",cls:"x-html-editor-tip"},justifyright:{title:"Align Text Right",text:"Align text to the right.",cls:"x-html-editor-tip"},insertunorderedlist:{title:"Bullet List",text:"Start a bulleted list.",cls:"x-html-editor-tip"},insertorderedlist:{title:"Numbered List",text:"Start a numbered list.",cls:"x-html-editor-tip"},createlink:{title:"Hyperlink",text:"Make the selected text a hyperlink.",cls:"x-html-editor-tip"},sourceedit:{title:"Source Edit",text:"Switch to source editing mode.",cls:"x-html-editor-tip"}}});Ext.reg("htmleditor",Ext.form.HtmlEditor);Ext.form.TimeField=Ext.extend(Ext.form.ComboBox,{minValue:null,maxValue:null,minText:"The time in this field must be equal to or after {0}",maxText:"The time in this field must be equal to or before {0}",invalidText:"{0} is not a valid time",format:"g:i A",altFormats:"g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|ha|gA|h a|g a|g A|gi|hi|gia|hia|g|H",increment:15,mode:"local",triggerAction:"all",typeAhead:false,initDate:"1/1/2008",initComponent:function(){Ext.form.TimeField.superclass.initComponent.call(this);if(typeof this.minValue=="string"){this.minValue=this.parseDate(this.minValue)}if(typeof this.maxValue=="string"){this.maxValue=this.parseDate(this.maxValue)}if(!this.store){var _1=this.parseDate(this.minValue);if(!_1){_1=new Date(this.initDate).clearTime()}var _2=this.parseDate(this.maxValue);if(!_2){_2=new Date(this.initDate).clearTime().add("mi",(24*60)-1)}var _3=[];while(_1<=_2){_3.push([_1.dateFormat(this.format)]);_1=_1.add("mi",this.increment)}this.store=new Ext.data.SimpleStore({fields:["text"],data:_3});this.displayField="text"}},getValue:function(){var v=Ext.form.TimeField.superclass.getValue.call(this);return this.formatDate(this.parseDate(v))||""},setValue:function(_5){Ext.form.TimeField.superclass.setValue.call(this,this.formatDate(this.parseDate(_5)))},validateValue:Ext.form.DateField.prototype.validateValue,parseDate:Ext.form.DateField.prototype.parseDate,formatDate:Ext.form.DateField.prototype.formatDate,beforeBlur:function(){var v=this.parseDate(this.getRawValue());if(v){this.setValue(v.dateFormat(this.format))}}});Ext.reg("timefield",Ext.form.TimeField);Ext.form.Label=Ext.extend(Ext.BoxComponent,{onRender:function(ct,_2){if(!this.el){this.el=document.createElement("label");this.el.id=this.getId();this.el.innerHTML=this.text?Ext.util.Format.htmlEncode(this.text):(this.html||"");if(this.forId){this.el.setAttribute("for",this.forId)}}Ext.form.Label.superclass.onRender.call(this,ct,_2)},setText:function(t,_4){this.text=t;if(this.rendered){this.el.dom.innerHTML=_4!==false?Ext.util.Format.htmlEncode(t):t}return this}});Ext.reg("label",Ext.form.Label);Ext.form.Action=function(_1,_2){this.form=_1;this.options=_2||{}};Ext.form.Action.CLIENT_INVALID="client";Ext.form.Action.SERVER_INVALID="server";Ext.form.Action.CONNECT_FAILURE="connect";Ext.form.Action.LOAD_FAILURE="load";Ext.form.Action.prototype={type:"default",run:function(_3){},success:function(_4){},handleResponse:function(_5){},failure:function(_6){this.response=_6;this.failureType=Ext.form.Action.CONNECT_FAILURE;this.form.afterAction(this,false)},processResponse:function(_7){this.response=_7;if(!_7.responseText){return true}this.result=this.handleResponse(_7);return this.result},getUrl:function(_8){var _9=this.options.url||this.form.url||this.form.el.dom.action;if(_8){var p=this.getParams();if(p){_9+=(_9.indexOf("?")!=-1?"&":"?")+p}}return _9},getMethod:function(){return(this.options.method||this.form.method||this.form.el.dom.method||"POST").toUpperCase()},getParams:function(){var bp=this.form.baseParams;var p=this.options.params;if(p){if(typeof p=="object"){p=Ext.urlEncode(Ext.applyIf(p,bp))}else{if(typeof p=="string"&&bp){p+="&"+Ext.urlEncode(bp)}}}else{if(bp){p=Ext.urlEncode(bp)}}return p},createCallback:function(_d){var _d=_d||{};return{success:this.success,failure:this.failure,scope:this,timeout:(_d.timeout*1000)||(this.form.timeout*1000),upload:this.form.fileUpload?this.success:undefined}}};Ext.form.Action.Submit=function(_e,_f){Ext.form.Action.Submit.superclass.constructor.call(this,_e,_f)};Ext.extend(Ext.form.Action.Submit,Ext.form.Action,{type:"submit",run:function(){var o=this.options;var _11=this.getMethod();var _12=_11=="GET";if(o.clientValidation===false||this.form.isValid()){Ext.Ajax.request(Ext.apply(this.createCallback(o),{form:this.form.el.dom,url:this.getUrl(_12),method:_11,headers:o.headers,params:!_12?this.getParams():null,isUpload:this.form.fileUpload}))}else{if(o.clientValidation!==false){this.failureType=Ext.form.Action.CLIENT_INVALID;this.form.afterAction(this,false)}}},success:function(_13){var _14=this.processResponse(_13);if(_14===true||_14.success){this.form.afterAction(this,true);return}if(_14.errors){this.form.markInvalid(_14.errors);this.failureType=Ext.form.Action.SERVER_INVALID}this.form.afterAction(this,false)},handleResponse:function(_15){if(this.form.errorReader){var rs=this.form.errorReader.read(_15);var _17=[];if(rs.records){for(var i=0,len=rs.records.length;i<len;i++){var r=rs.records[i];_17[i]=r.data}}if(_17.length<1){_17=null}return{success:rs.success,errors:_17}}return Ext.decode(_15.responseText)}});Ext.form.Action.Load=function(_1b,_1c){Ext.form.Action.Load.superclass.constructor.call(this,_1b,_1c);this.reader=this.form.reader};Ext.extend(Ext.form.Action.Load,Ext.form.Action,{type:"load",run:function(){Ext.Ajax.request(Ext.apply(this.createCallback(this.options),{method:this.getMethod(),url:this.getUrl(false),headers:this.options.headers,params:this.getParams()}))},success:function(_1d){var _1e=this.processResponse(_1d);
63
+ if(_1e===true||!_1e.success||!_1e.data){this.failureType=Ext.form.Action.LOAD_FAILURE;this.form.afterAction(this,false);return}this.form.clearInvalid();this.form.setValues(_1e.data);this.form.afterAction(this,true)},handleResponse:function(_1f){if(this.form.reader){var rs=this.form.reader.read(_1f);var _21=rs.records&&rs.records[0]?rs.records[0].data:null;return{success:rs.success,data:_21}}return Ext.decode(_1f.responseText)}});Ext.form.Action.ACTION_TYPES={load:Ext.form.Action.Load,submit:Ext.form.Action.Submit};Ext.form.VTypes=function(){var _1=/^[a-zA-Z_]+$/;var _2=/^[a-zA-Z0-9_]+$/;var _3=/^([\w]+)(\.[\w]+)*@([\w\-]+\.){1,5}([A-Za-z]){2,4}$/;var _4=/(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;return{email:function(v){return _3.test(v)},emailText:'This field should be an e-mail address in the format "user@domain.com"',emailMask:/[a-z0-9_\.\-@]/i,url:function(v){return _4.test(v)},urlText:'This field should be a URL in the format "http://www.domain.com"',alpha:function(v){return _1.test(v)},alphaText:"This field should only contain letters and _",alphaMask:/[a-z_]/i,alphanum:function(v){return _2.test(v)},alphanumText:"This field should only contain letters, numbers and _",alphanumMask:/[a-z0-9_]/i}}();Ext.grid.GridPanel=Ext.extend(Ext.Panel,{ddText:"{0} selected row{1}",minColumnWidth:25,trackMouseOver:true,enableDragDrop:false,enableColumnMove:true,enableColumnHide:true,enableHdMenu:true,stripeRows:false,autoExpandColumn:false,autoExpandMin:50,autoExpandMax:1000,view:null,loadMask:false,deferRowRender:true,rendered:false,viewReady:false,stateEvents:["columnmove","columnresize","sortchange"],initComponent:function(){Ext.grid.GridPanel.superclass.initComponent.call(this);this.autoScroll=false;this.autoWidth=false;if(Ext.isArray(this.columns)){this.colModel=new Ext.grid.ColumnModel(this.columns);delete this.columns}if(this.ds){this.store=this.ds;delete this.ds}if(this.cm){this.colModel=this.cm;delete this.cm}if(this.sm){this.selModel=this.sm;delete this.sm}this.store=Ext.StoreMgr.lookup(this.store);this.addEvents("click","dblclick","contextmenu","mousedown","mouseup","mouseover","mouseout","keypress","keydown","cellmousedown","rowmousedown","headermousedown","cellclick","celldblclick","rowclick","rowdblclick","headerclick","headerdblclick","rowcontextmenu","cellcontextmenu","headercontextmenu","bodyscroll","columnresize","columnmove","sortchange")},onRender:function(ct,_2){Ext.grid.GridPanel.superclass.onRender.apply(this,arguments);var c=this.body;this.el.addClass("x-grid-panel");var _4=this.getView();_4.init(this);c.on("mousedown",this.onMouseDown,this);c.on("click",this.onClick,this);c.on("dblclick",this.onDblClick,this);c.on("contextmenu",this.onContextMenu,this);c.on("keydown",this.onKeyDown,this);this.relayEvents(c,["mousedown","mouseup","mouseover","mouseout","keypress"]);this.getSelectionModel().init(this);this.view.render()},initEvents:function(){Ext.grid.GridPanel.superclass.initEvents.call(this);if(this.loadMask){this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({store:this.store},this.loadMask))}},initStateEvents:function(){Ext.grid.GridPanel.superclass.initStateEvents.call(this);this.colModel.on("hiddenchange",this.saveState,this,{delay:100})},applyState:function(_5){var cm=this.colModel;var cs=_5.columns;if(cs){for(var i=0,_9=cs.length;i<_9;i++){var s=cs[i];var c=cm.getColumnById(s.id);if(c){c.hidden=s.hidden;c.width=s.width;var _c=cm.getIndexById(s.id);if(_c!=i){cm.moveColumn(_c,i)}}}}if(_5.sort){this.store[this.store.remoteSort?"setDefaultSort":"sort"](_5.sort.field,_5.sort.direction)}},getState:function(){var o={columns:[]};for(var i=0,c;c=this.colModel.config[i];i++){o.columns[i]={id:c.id,width:c.width};if(c.hidden){o.columns[i].hidden=true}}var ss=this.store.getSortState();if(ss){o.sort=ss}return o},afterRender:function(){Ext.grid.GridPanel.superclass.afterRender.call(this);this.view.layout();if(this.deferRowRender){this.view.afterRender.defer(10,this.view)}else{this.view.afterRender()}this.viewReady=true},reconfigure:function(_11,_12){if(this.loadMask){this.loadMask.destroy();this.loadMask=new Ext.LoadMask(this.bwrap,Ext.apply({},{store:_11},this.initialConfig.loadMask))}this.view.bind(_11,_12);this.store=_11;this.colModel=_12;if(this.rendered){this.view.refresh(true)}},onKeyDown:function(e){this.fireEvent("keydown",e)},onDestroy:function(){if(this.rendered){if(this.loadMask){this.loadMask.destroy()}var c=this.body;c.removeAllListeners();this.view.destroy();c.update("")}this.colModel.purgeListeners();Ext.grid.GridPanel.superclass.onDestroy.call(this)},processEvent:function(_15,e){this.fireEvent(_15,e);var t=e.getTarget();var v=this.view;var _19=v.findHeaderIndex(t);if(_19!==false){this.fireEvent("header"+_15,this,_19,e)}else{var row=v.findRowIndex(t);var _1b=v.findCellIndex(t);if(row!==false){this.fireEvent("row"+_15,this,row,e);if(_1b!==false){this.fireEvent("cell"+_15,this,row,_1b,e)}}}},onClick:function(e){this.processEvent("click",e)},onMouseDown:function(e){this.processEvent("mousedown",e)},onContextMenu:function(e,t){this.processEvent("contextmenu",e)},onDblClick:function(e){this.processEvent("dblclick",e)},walkCells:function(row,col,_23,fn,_25){var cm=this.colModel,_27=cm.getColumnCount();var ds=this.store,_29=ds.getCount(),_2a=true;if(_23<0){if(col<0){row--;_2a=false}while(row>=0){if(!_2a){col=_27-1}_2a=false;while(col>=0){if(fn.call(_25||this,row,col,cm)===true){return[row,col]}col--}row--}}else{if(col>=_27){row++;_2a=false}while(row<_29){if(!_2a){col=0}_2a=false;while(col<_27){if(fn.call(_25||this,row,col,cm)===true){return[row,col]}col++}row++}}return null},getSelections:function(){return this.selModel.getSelections()},onResize:function(){Ext.grid.GridPanel.superclass.onResize.apply(this,arguments);if(this.viewReady){this.view.layout()}},getGridEl:function(){return this.body},stopEditing:Ext.emptyFn,getSelectionModel:function(){if(!this.selModel){this.selModel=new Ext.grid.RowSelectionModel(this.disableSelection?{selectRow:Ext.emptyFn}:null)}return this.selModel},getStore:function(){return this.store},getColumnModel:function(){return this.colModel},getView:function(){if(!this.view){this.view=new Ext.grid.GridView(this.viewConfig)}return this.view},getDragDropText:function(){var _2b=this.selModel.getCount();return String.format(this.ddText,_2b,_2b==1?"":"s")}});Ext.reg("grid",Ext.grid.GridPanel);Ext.grid.GridView=function(_1){Ext.apply(this,_1);this.addEvents("beforerowremoved","beforerowsinserted","beforerefresh","rowremoved","rowsinserted","rowupdated","refresh");Ext.grid.GridView.superclass.constructor.call(this)};Ext.extend(Ext.grid.GridView,Ext.util.Observable,{deferEmptyText:true,scrollOffset:19,autoFill:false,forceFit:false,sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",columnsText:"Columns",borderWidth:2,tdClass:"x-grid3-cell",hdCls:"x-grid3-hd",cellSelectorDepth:4,rowSelectorDepth:10,cellSelector:"td.x-grid3-cell",rowSelector:"div.x-grid3-row",initTemplates:function(){var ts=this.templates||{};if(!ts.master){ts.master=new Ext.Template('<div class="x-grid3" hidefocus="true">','<div class="x-grid3-viewport">','<div class="x-grid3-header"><div class="x-grid3-header-inner" style="{ostyle}"><div class="x-grid3-header-offset">{header}</div></div><div class="x-clear"></div></div>','<div class="x-grid3-scroller"><div class="x-grid3-body" style="{bstyle}">{body}</div><a href="#" class="x-grid3-focus" tabIndex="-1"></a></div>',"</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>")}if(!ts.header){ts.header=new Ext.Template('<table border="0" cellspacing="0" cellpadding="0" style="{tstyle}">','<thead><tr class="x-grid3-hd-row">{cells}</tr></thead>',"</table>")}if(!ts.hcell){ts.hcell=new Ext.Template('<td class="x-grid3-hd x-grid3-cell x-grid3-td-{id} {css}" style="{style}"><div {tooltip} {attr} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"",'{value}<img class="x-grid3-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" />',"</div></td>")
64
+ }if(!ts.body){ts.body=new Ext.Template("{rows}")}if(!ts.row){ts.row=new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}"><table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody><tr>{cells}</tr>",(this.enableRowBody?'<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>':""),"</tbody></table></div>")}if(!ts.cell){ts.cell=new Ext.Template('<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}" tabIndex="0" {cellAttr}>','<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on" {attr}>{value}</div>',"</td>")}for(var k in ts){var t=ts[k];if(t&&typeof t.compile=="function"&&!t.compiled){t.disableFormats=true;t.compile()}}this.templates=ts;this.colRe=new RegExp("x-grid3-td-([^\\s]+)","")},fly:function(el){if(!this._flyweight){this._flyweight=new Ext.Element.Flyweight(document.body)}this._flyweight.dom=el;return this._flyweight},getEditorParent:function(){return this.scroller.dom},initElements:function(){var E=Ext.Element;var el=this.grid.getGridEl().dom.firstChild;var cs=el.childNodes;this.el=new E(el);this.mainWrap=new E(cs[0]);this.mainHd=new E(this.mainWrap.dom.firstChild);if(this.grid.hideHeaders){this.mainHd.setDisplayed(false)}this.innerHd=this.mainHd.dom.firstChild;this.scroller=new E(this.mainWrap.dom.childNodes[1]);if(this.forceFit){this.scroller.setStyle("overflow-x","hidden")}this.mainBody=new E(this.scroller.dom.firstChild);this.focusEl=new E(this.scroller.dom.childNodes[1]);this.focusEl.swallowEvent("click",true);this.resizeMarker=new E(cs[1]);this.resizeProxy=new E(cs[2])},getRows:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},findCell:function(el){if(!el){return false}return this.fly(el).findParent(this.cellSelector,this.cellSelectorDepth)},findCellIndex:function(el,_b){var _c=this.findCell(el);if(_c&&(!_b||this.fly(_c).hasClass(_b))){return this.getCellIndex(_c)}return false},getCellIndex:function(el){if(el){var m=el.className.match(this.colRe);if(m&&m[1]){return this.cm.getIndexById(m[1])}}return false},findHeaderCell:function(el){var _10=this.findCell(el);return _10&&this.fly(_10).hasClass(this.hdCls)?_10:null},findHeaderIndex:function(el){return this.findCellIndex(el,this.hdCls)},findRow:function(el){if(!el){return false}return this.fly(el).findParent(this.rowSelector,this.rowSelectorDepth)},findRowIndex:function(el){var r=this.findRow(el);return r?r.rowIndex:false},getRow:function(row){return this.getRows()[row]},getCell:function(row,col){return this.getRow(row).getElementsByTagName("td")[col]},getHeaderCell:function(_18){return this.mainHd.dom.getElementsByTagName("td")[_18]},addRowClass:function(row,cls){var r=this.getRow(row);if(r){this.fly(r).addClass(cls)}},removeRowClass:function(row,cls){var r=this.getRow(row);if(r){this.fly(r).removeClass(cls)}},removeRow:function(row){Ext.removeNode(this.getRow(row));this.syncFocusEl(row)},removeRows:function(_20,_21){var bd=this.mainBody.dom;for(var _23=_20;_23<=_21;_23++){Ext.removeNode(bd.childNodes[_20])}this.syncFocusEl(_20)},getScrollState:function(){var sb=this.scroller.dom;return{left:sb.scrollLeft,top:sb.scrollTop}},restoreScroll:function(_25){var sb=this.scroller.dom;sb.scrollLeft=_25.left;sb.scrollTop=_25.top},scrollToTop:function(){this.scroller.dom.scrollTop=0;this.scroller.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var mb=this.scroller.dom;this.grid.fireEvent("bodyscroll",mb.scrollLeft,mb.scrollTop)},syncHeaderScroll:function(){var mb=this.scroller.dom;this.innerHd.scrollLeft=mb.scrollLeft;this.innerHd.scrollLeft=mb.scrollLeft},updateSortIcon:function(col,dir){var sc=this.sortClasses;var hds=this.mainHd.select("td").removeClass(sc);hds.item(col).addClass(sc[dir=="DESC"?1:0])},updateAllColumnWidths:function(){var tw=this.getTotalWidth();var _2e=this.cm.getColumnCount();var ws=[];for(var i=0;i<_2e;i++){ws[i]=this.getColumnWidth(i)}this.innerHd.firstChild.style.width=this.getOffsetWidth();this.innerHd.firstChild.firstChild.style.width=tw;this.mainBody.dom.style.width=tw;for(var i=0;i<_2e;i++){var hd=this.getHeaderCell(i);hd.style.width=ws[i]}var ns=this.getRows(),row,_34;for(var i=0,len=ns.length;i<len;i++){row=ns[i];row.style.width=tw;if(row.firstChild){row.firstChild.style.width=tw;_34=row.firstChild.rows[0];for(var j=0;j<_2e;j++){_34.childNodes[j].style.width=ws[j]}}}this.onAllColumnWidthsUpdated(ws,tw)},updateColumnWidth:function(col,_38){var w=this.getColumnWidth(col);var tw=this.getTotalWidth();this.innerHd.firstChild.style.width=this.getOffsetWidth();this.innerHd.firstChild.firstChild.style.width=tw;this.mainBody.dom.style.width=tw;var hd=this.getHeaderCell(col);hd.style.width=w;var ns=this.getRows(),row;for(var i=0,len=ns.length;i<len;i++){row=ns[i];row.style.width=tw;if(row.firstChild){row.firstChild.style.width=tw;row.firstChild.rows[0].childNodes[col].style.width=w}}this.onColumnWidthUpdated(col,w,tw)},updateColumnHidden:function(col,_41){var tw=this.getTotalWidth();this.innerHd.firstChild.style.width=this.getOffsetWidth();this.innerHd.firstChild.firstChild.style.width=tw;this.mainBody.dom.style.width=tw;var _43=_41?"none":"";var hd=this.getHeaderCell(col);hd.style.display=_43;var ns=this.getRows(),row;for(var i=0,len=ns.length;i<len;i++){row=ns[i];row.style.width=tw;if(row.firstChild){row.firstChild.style.width=tw;row.firstChild.rows[0].childNodes[col].style.display=_43}}this.onColumnHiddenUpdated(col,_41,tw);delete this.lastViewWidth;this.layout()},doRender:function(cs,rs,ds,_4c,_4d,_4e){var ts=this.templates,ct=ts.cell,rt=ts.row,_52=_4d-1;var _53="width:"+this.getTotalWidth()+";";var buf=[],cb,c,p={},rp={tstyle:_53},r;for(var j=0,len=rs.length;j<len;j++){r=rs[j];cb=[];var _5c=(j+_4c);for(var i=0;i<_4d;i++){c=cs[i];p.id=c.id;p.css=i==0?"x-grid3-cell-first ":(i==_52?"x-grid3-cell-last ":"");p.attr=p.cellAttr="";p.value=c.renderer(r.data[c.name],p,r,_5c,i,ds);p.style=c.style;if(p.value==undefined||p.value===""){p.value="&#160;"}if(r.dirty&&typeof r.modified[c.name]!=="undefined"){p.css+=" x-grid3-dirty-cell"}cb[cb.length]=ct.apply(p)}var alt=[];if(_4e&&((_5c+1)%2==0)){alt[0]="x-grid3-row-alt"}if(r.dirty){alt[1]=" x-grid3-dirty-row"}rp.cols=_4d;if(this.getRowClass){alt[2]=this.getRowClass(r,_5c,rp,ds)}rp.alt=alt.join(" ");rp.cells=cb.join("");buf[buf.length]=rt.apply(rp)}return buf.join("")},processRows:function(_5f,_60){if(this.ds.getCount()<1){return}_60=_60||!this.grid.stripeRows;_5f=_5f||0;var _61=this.getRows();var cls=" x-grid3-row-alt ";_61[0].className+=" x-grid3-row-first";_61[_61.length-1].className+=" x-grid3-row-last";for(var i=_5f,len=_61.length;i<len;i++){var row=_61[i];row.rowIndex=i;if(!_60){var _66=((i+1)%2==0);var _67=(" "+row.className+" ").indexOf(cls)!=-1;if(_66==_67){continue}if(_66){row.className+=" x-grid3-row-alt"}else{row.className=row.className.replace("x-grid3-row-alt","")}}}},afterRender:function(){this.mainBody.dom.innerHTML=this.renderRows()||"&nbsp;";this.processRows(0,true);if(this.deferEmptyText!==true){this.applyEmptyText()}},renderUI:function(){var _68=this.renderHeaders();var _69=this.templates.body.apply({rows:"&nbsp;"});var _6a=this.templates.master.apply({body:_69,header:_68,ostyle:"width:"+this.getOffsetWidth()+";",bstyle:"width:"+this.getTotalWidth()+";"});var g=this.grid;g.getGridEl().dom.innerHTML=_6a;this.initElements();Ext.fly(this.innerHd).on("click",this.handleHdDown,this);this.mainHd.on("mouseover",this.handleHdOver,this);this.mainHd.on("mouseout",this.handleHdOut,this);this.mainHd.on("mousemove",this.handleHdMove,this);this.scroller.on("scroll",this.syncScroll,this);if(g.enableColumnResize!==false){this.splitZone=new Ext.grid.GridView.SplitDragZone(g,this.mainHd.dom)}if(g.enableColumnMove){this.columnDrag=new Ext.grid.GridView.ColumnDragZone(g,this.innerHd);this.columnDrop=new Ext.grid.HeaderDropZone(g,this.mainHd.dom)}if(g.enableHdMenu!==false){if(g.enableColumnHide!==false){this.colMenu=new Ext.menu.Menu({id:g.id+"-hcols-menu"});
65
+ this.colMenu.on("beforeshow",this.beforeColMenuShow,this);this.colMenu.on("itemclick",this.handleHdMenuClick,this)}this.hmenu=new Ext.menu.Menu({id:g.id+"-hctx"});this.hmenu.add({id:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{id:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});if(g.enableColumnHide!==false){this.hmenu.add("-",{id:"columns",text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"})}this.hmenu.on("itemclick",this.handleHdMenuClick,this)}if(g.trackMouseOver){this.mainBody.on("mouseover",this.onRowOver,this);this.mainBody.on("mouseout",this.onRowOut,this)}if(g.enableDragDrop||g.enableDrag){this.dragZone=new Ext.grid.GridDragZone(g,{ddGroup:g.ddGroup||"GridDD"})}this.updateHeaderSortState()},layout:function(){if(!this.mainBody){return}var g=this.grid;var c=g.getGridEl();var _6e=c.getSize(true);var vw=_6e.width;if(vw<20||_6e.height<20){return}if(g.autoHeight){this.scroller.dom.style.overflow="visible";if(Ext.isSafari){this.scroller.dom.style.position="static"}}else{this.el.setSize(_6e.width,_6e.height);var _70=this.mainHd.getHeight();var vh=_6e.height-(_70);this.scroller.setSize(vw,vh);if(this.innerHd){this.innerHd.style.width=(vw)+"px"}}if(this.forceFit){if(this.lastViewWidth!=vw){this.fitColumns(false,false);this.lastViewWidth=vw}}else{this.autoExpand();this.syncHeaderScroll()}this.onLayout(vw,vh)},onLayout:function(vw,vh){},onColumnWidthUpdated:function(col,w,tw){},onAllColumnWidthsUpdated:function(ws,tw){},onColumnHiddenUpdated:function(col,_7a,tw){},updateColumnText:function(col,_7d){},afterMove:function(_7e){},init:function(_7f){this.grid=_7f;this.initTemplates();this.initData(_7f.store,_7f.colModel);this.initUI(_7f)},getColumnId:function(_80){return this.cm.getColumnId(_80)},getOffsetWidth:function(){return(this.cm.getTotalWidth()+this.scrollOffset)+"px"},renderHeaders:function(){var cm=this.cm,ts=this.templates;var ct=ts.hcell;var cb=[],sb=[],p={};var len=cm.getColumnCount();var _88=len-1;for(var i=0;i<len;i++){p.id=cm.getColumnId(i);p.value=cm.getColumnHeader(i)||"";p.style=this.getColumnStyle(i,true);p.tooltip=this.getColumnTooltip(i);p.css=i==0?"x-grid3-cell-first ":(i==_88?"x-grid3-cell-last ":"");if(cm.config[i].align=="right"){p.istyle="padding-right:16px"}else{delete p.istyle}cb[cb.length]=ct.apply(p)}return ts.header.apply({cells:cb.join(""),tstyle:"width:"+this.getTotalWidth()+";"})},getColumnTooltip:function(i){var tt=this.cm.getColumnTooltip(i);if(tt){if(Ext.QuickTips.isEnabled()){return'ext:qtip="'+tt+'"'}else{return'title="'+tt+'"'}}return""},beforeUpdate:function(){this.grid.stopEditing(true)},updateHeaders:function(){this.innerHd.firstChild.innerHTML=this.renderHeaders()},focusRow:function(row){this.focusCell(row,0,false)},focusCell:function(row,col,_8f){this.syncFocusEl(this.ensureVisible(row,col,_8f));if(Ext.isGecko){this.focusEl.focus()}else{this.focusEl.focus.defer(1,this.focusEl)}},resolveCell:function(row,col,_92){if(typeof row!="number"){row=row.rowIndex}if(!this.ds){return null}if(row<0||row>=this.ds.getCount()){return null}col=(col!==undefined?col:0);var _93=this.getRow(row),_94;if(!(_92===false&&col===0)){while(this.cm.isHidden(col)){col++}_94=this.getCell(row,col)}return{row:_93,cell:_94}},getResolvedXY:function(_95){if(!_95){return null}var s=this.scroller.dom,c=_95.cell,r=_95.row;return c?Ext.fly(c).getXY():[this.el.getX(),Ext.fly(r).getY()]},syncFocusEl:function(row,col,_9b){var xy=row;if(!Ext.isArray(xy)){row=Math.min(row,Math.max(0,this.getRows().length-1));xy=this.getResolvedXY(this.resolveCell(row,col,_9b))}this.focusEl.setXY(xy||this.scroller.getXY())},ensureVisible:function(row,col,_9f){var _a0=this.resolveCell(row,col,_9f);if(!_a0||!_a0.row){return}var _a1=_a0.row,_a2=_a0.cell;var c=this.scroller.dom;var _a4=0;var p=_a1,_a6=this.el.dom;while(p&&p!=_a6){_a4+=p.offsetTop;p=p.offsetParent}_a4-=this.mainHd.dom.offsetHeight;var _a7=_a4+_a1.offsetHeight;var ch=c.clientHeight;var _a6=parseInt(c.scrollTop,10);var _a9=_a6+ch;if(_a4<_a6){c.scrollTop=_a4}else{if(_a7>_a9){c.scrollTop=_a7-ch}}if(_9f!==false){var _aa=parseInt(_a2.offsetLeft,10);var _ab=_aa+_a2.offsetWidth;var _ac=parseInt(c.scrollLeft,10);var _ad=_ac+c.clientWidth;if(_aa<_ac){c.scrollLeft=_aa}else{if(_ab>_ad){c.scrollLeft=_ab-c.clientWidth}}}return this.getResolvedXY(_a0)},insertRows:function(dm,_af,_b0,_b1){if(!_b1&&_af===0&&_b0>=dm.getCount()-1){this.refresh()}else{if(!_b1){this.fireEvent("beforerowsinserted",this,_af,_b0)}var _b2=this.renderRows(_af,_b0);var _b3=this.getRow(_af);if(_b3){Ext.DomHelper.insertHtml("beforeBegin",_b3,_b2)}else{Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,_b2)}if(!_b1){this.fireEvent("rowsinserted",this,_af,_b0);this.processRows(_af)}}this.syncFocusEl(_af)},deleteRows:function(dm,_b5,_b6){if(dm.getRowCount()<1){this.refresh()}else{this.fireEvent("beforerowsdeleted",this,_b5,_b6);this.removeRows(_b5,_b6);this.processRows(_b5);this.fireEvent("rowsdeleted",this,_b5,_b6)}},getColumnStyle:function(col,_b8){var _b9=!_b8?(this.cm.config[col].css||""):"";_b9+="width:"+this.getColumnWidth(col)+";";if(this.cm.isHidden(col)){_b9+="display:none;"}var _ba=this.cm.config[col].align;if(_ba){_b9+="text-align:"+_ba+";"}return _b9},getColumnWidth:function(col){var w=this.cm.getColumnWidth(col);if(typeof w=="number"){return(Ext.isBorderBox?w:(w-this.borderWidth>0?w-this.borderWidth:0))+"px"}return w},getTotalWidth:function(){return this.cm.getTotalWidth()+"px"},fitColumns:function(_bd,_be,_bf){var cm=this.cm,_c1,_c2,i;var tw=cm.getTotalWidth(false);var aw=this.grid.getGridEl().getWidth(true)-this.scrollOffset;if(aw<20){return}var _c6=aw-tw;if(_c6===0){return false}var vc=cm.getColumnCount(true);var ac=vc-(typeof _bf=="number"?1:0);if(ac===0){ac=1;_bf=undefined}var _c9=cm.getColumnCount();var _ca=[];var _cb=0;var _cc=0;var w;for(i=0;i<_c9;i++){if(!cm.isHidden(i)&&!cm.isFixed(i)&&i!==_bf){w=cm.getColumnWidth(i);_ca.push(i);_cb=i;_ca.push(w);_cc+=w}}var _ce=(aw-cm.getTotalWidth())/_cc;while(_ca.length){w=_ca.pop();i=_ca.pop();cm.setColumnWidth(i,Math.max(this.grid.minColumnWidth,Math.floor(w+w*_ce)),true)}if((tw=cm.getTotalWidth(false))>aw){var _cf=ac!=vc?_bf:_cb;cm.setColumnWidth(_cf,Math.max(1,cm.getColumnWidth(_cf)-(tw-aw)),true)}if(_bd!==true){this.updateAllColumnWidths()}return true},autoExpand:function(_d0){var g=this.grid,cm=this.cm;if(!this.userResized&&g.autoExpandColumn){var tw=cm.getTotalWidth(false);var aw=this.grid.getGridEl().getWidth(true)-this.scrollOffset;if(tw!=aw){var ci=cm.getIndexById(g.autoExpandColumn);var _d6=cm.getColumnWidth(ci);var cw=Math.min(Math.max(((aw-tw)+_d6),g.autoExpandMin),g.autoExpandMax);if(cw!=_d6){cm.setColumnWidth(ci,cw,true);if(_d0!==true){this.updateColumnWidth(ci,cw)}}}}},getColumnData:function(){var cs=[],cm=this.cm,_da=cm.getColumnCount();for(var i=0;i<_da;i++){var _dc=cm.getDataIndex(i);cs[i]={name:(typeof _dc=="undefined"?this.ds.fields.get(i).name:_dc),renderer:cm.getRenderer(i),id:cm.getColumnId(i),style:this.getColumnStyle(i)}}return cs},renderRows:function(_dd,_de){var g=this.grid,cm=g.colModel,ds=g.store,_e2=g.stripeRows;var _e3=cm.getColumnCount();if(ds.getCount()<1){return""}var cs=this.getColumnData();_dd=_dd||0;_de=typeof _de=="undefined"?ds.getCount()-1:_de;var rs=ds.getRange(_dd,_de);return this.doRender(cs,rs,ds,_dd,_e3,_e2)},renderBody:function(){var _e6=this.renderRows()||"&nbsp;";return this.templates.body.apply({rows:_e6})},refreshRow:function(_e7){var ds=this.ds,_e9;if(typeof _e7=="number"){_e9=_e7;_e7=ds.getAt(_e9)}else{_e9=ds.indexOf(_e7)}var cls=[];this.insertRows(ds,_e9,_e9,true);this.getRow(_e9).rowIndex=_e9;this.onRemove(ds,_e7,_e9+1,true);this.fireEvent("rowupdated",this,_e9,_e7)},refresh:function(_eb){this.fireEvent("beforerefresh",this);this.grid.stopEditing(true);var _ec=this.renderBody();this.mainBody.update(_ec);if(_eb===true){this.updateHeaders();this.updateHeaderSortState()}this.processRows(0,true);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},applyEmptyText:function(){if(this.emptyText&&!this.hasRows()){this.mainBody.update('<div class="x-grid-empty">'+this.emptyText+"</div>")
66
+ }},updateHeaderSortState:function(){var _ed=this.ds.getSortState();if(!_ed){return}if(!this.sortState||(this.sortState.field!=_ed.field||this.sortState.direction!=_ed.direction)){this.grid.fireEvent("sortchange",this.grid,_ed)}this.sortState=_ed;var _ee=this.cm.findColumnIndex(_ed.field);if(_ee!=-1){var _ef=_ed.direction;this.updateSortIcon(_ee,_ef)}},destroy:function(){if(this.colMenu){Ext.menu.MenuMgr.unregister(this.colMenu);this.colMenu.destroy();delete this.colMenu}if(this.hmenu){Ext.menu.MenuMgr.unregister(this.hmenu);this.hmenu.destroy();delete this.hmenu}if(this.grid.enableColumnMove){var dds=Ext.dd.DDM.ids["gridHeader"+this.grid.getGridEl().id];if(dds){for(var dd in dds){if(!dds[dd].config.isTarget&&dds[dd].dragElId){var _f2=dds[dd].dragElId;dds[dd].unreg();Ext.get(_f2).remove()}else{if(dds[dd].config.isTarget){dds[dd].proxyTop.remove();dds[dd].proxyBottom.remove();dds[dd].unreg()}}if(Ext.dd.DDM.locationCache[dd]){delete Ext.dd.DDM.locationCache[dd]}}delete Ext.dd.DDM.ids["gridHeader"+this.grid.getGridEl().id]}}if(this.dragZone){this.dragZone.unreg()}Ext.fly(this.innerHd).removeAllListeners();Ext.removeNode(this.innerHd);Ext.destroy(this.resizeMarker,this.resizeProxy,this.focusEl,this.mainBody,this.scroller,this.mainHd,this.mainWrap,this.dragZone,this.splitZone,this.columnDrag,this.columnDrop);this.initData(null,null);Ext.EventManager.removeResizeListener(this.onWindowResize,this);this.purgeListeners()},onDenyColumnHide:function(){},render:function(){if(this.autoFill){var ct=this.grid.ownerCt;if(ct&&ct.getLayout()){ct.on("afterlayout",function(){this.fitColumns(true,true);this.updateHeaders()},this,{single:true})}else{this.fitColumns(true,true)}}else{if(this.forceFit){this.fitColumns(true,false)}else{if(this.grid.autoExpandColumn){this.autoExpand(true)}}}this.renderUI()},initData:function(ds,cm){if(this.ds){this.ds.un("load",this.onLoad,this);this.ds.un("datachanged",this.onDataChange,this);this.ds.un("add",this.onAdd,this);this.ds.un("remove",this.onRemove,this);this.ds.un("update",this.onUpdate,this);this.ds.un("clear",this.onClear,this)}if(ds){ds.on("load",this.onLoad,this);ds.on("datachanged",this.onDataChange,this);ds.on("add",this.onAdd,this);ds.on("remove",this.onRemove,this);ds.on("update",this.onUpdate,this);ds.on("clear",this.onClear,this)}this.ds=ds;if(this.cm){this.cm.un("configchange",this.onColConfigChange,this);this.cm.un("widthchange",this.onColWidthChange,this);this.cm.un("headerchange",this.onHeaderChange,this);this.cm.un("hiddenchange",this.onHiddenChange,this);this.cm.un("columnmoved",this.onColumnMove,this);this.cm.un("columnlockchange",this.onColumnLock,this)}if(cm){delete this.lastViewWidth;cm.on("configchange",this.onColConfigChange,this);cm.on("widthchange",this.onColWidthChange,this);cm.on("headerchange",this.onHeaderChange,this);cm.on("hiddenchange",this.onHiddenChange,this);cm.on("columnmoved",this.onColumnMove,this);cm.on("columnlockchange",this.onColumnLock,this)}this.cm=cm},onDataChange:function(){this.refresh();this.updateHeaderSortState();this.syncFocusEl(0)},onClear:function(){this.refresh();this.syncFocusEl(0)},onUpdate:function(ds,_f7){this.refreshRow(_f7)},onAdd:function(ds,_f9,_fa){this.insertRows(ds,_fa,_fa+(_f9.length-1))},onRemove:function(ds,_fc,_fd,_fe){if(_fe!==true){this.fireEvent("beforerowremoved",this,_fd,_fc)}this.removeRow(_fd);if(_fe!==true){this.processRows(_fd);this.applyEmptyText();this.fireEvent("rowremoved",this,_fd,_fc)}},onLoad:function(){this.scrollToTop()},onColWidthChange:function(cm,col,_101){this.updateColumnWidth(col,_101)},onHeaderChange:function(cm,col,text){this.updateHeaders()},onHiddenChange:function(cm,col,_107){this.updateColumnHidden(col,_107)},onColumnMove:function(cm,_109,_10a){this.indexMap=null;var s=this.getScrollState();this.refresh(true);this.restoreScroll(s);this.afterMove(_10a)},onColConfigChange:function(){delete this.lastViewWidth;this.indexMap=null;this.refresh(true)},initUI:function(grid){grid.on("headerclick",this.onHeaderClick,this)},initEvents:function(){},onHeaderClick:function(g,_10e){if(this.headersDisabled||!this.cm.isSortable(_10e)){return}g.stopEditing(true);g.store.sort(this.cm.getDataIndex(_10e))},onRowOver:function(e,t){var row;if((row=this.findRowIndex(t))!==false){this.addRowClass(row,"x-grid3-row-over")}},onRowOut:function(e,t){var row;if((row=this.findRowIndex(t))!==false&&!e.within(this.getRow(row),true)){this.removeRowClass(row,"x-grid3-row-over")}},handleWheel:function(e){e.stopPropagation()},onRowSelect:function(row){this.addRowClass(row,"x-grid3-row-selected")},onRowDeselect:function(row){this.removeRowClass(row,"x-grid3-row-selected")},onCellSelect:function(row,col){var cell=this.getCell(row,col);if(cell){this.fly(cell).addClass("x-grid3-cell-selected")}},onCellDeselect:function(row,col){var cell=this.getCell(row,col);if(cell){this.fly(cell).removeClass("x-grid3-cell-selected")}},onColumnSplitterMoved:function(i,w){this.userResized=true;var cm=this.grid.colModel;cm.setColumnWidth(i,w,true);if(this.forceFit){this.fitColumns(true,false,i);this.updateAllColumnWidths()}else{this.updateColumnWidth(i,w);this.syncHeaderScroll()}this.grid.fireEvent("columnresize",i,w)},handleHdMenuClick:function(item){var _122=this.hdCtxIndex;var cm=this.cm,ds=this.ds;switch(item.id){case"asc":ds.sort(cm.getDataIndex(_122),"ASC");break;case"desc":ds.sort(cm.getDataIndex(_122),"DESC");break;default:_122=cm.getIndexById(item.id.substr(4));if(_122!=-1){if(item.checked&&cm.getColumnsBy(this.isHideableColumn,this).length<=1){this.onDenyColumnHide();return false}cm.setHidden(_122,item.checked)}}return true},isHideableColumn:function(c){return !c.hidden&&!c.fixed},beforeColMenuShow:function(){var cm=this.cm,_127=cm.getColumnCount();this.colMenu.removeAll();for(var i=0;i<_127;i++){if(cm.config[i].fixed!==true&&cm.config[i].hideable!==false){this.colMenu.add(new Ext.menu.CheckItem({id:"col-"+cm.getColumnId(i),text:cm.getColumnHeader(i),checked:!cm.isHidden(i),hideOnClick:false,disabled:cm.config[i].hideable===false}))}}},handleHdDown:function(e,t){if(Ext.fly(t).hasClass("x-grid3-hd-btn")){e.stopEvent();var hd=this.findHeaderCell(t);Ext.fly(hd).addClass("x-grid3-hd-menu-open");var _12c=this.getCellIndex(hd);this.hdCtxIndex=_12c;var ms=this.hmenu.items,cm=this.cm;ms.get("asc").setDisabled(!cm.isSortable(_12c));ms.get("desc").setDisabled(!cm.isSortable(_12c));this.hmenu.on("hide",function(){Ext.fly(hd).removeClass("x-grid3-hd-menu-open")},this,{single:true});this.hmenu.show(t,"tl-bl?")}},handleHdOver:function(e,t){var hd=this.findHeaderCell(t);if(hd&&!this.headersDisabled){this.activeHd=hd;this.activeHdIndex=this.getCellIndex(hd);var fly=this.fly(hd);this.activeHdRegion=fly.getRegion();if(!this.cm.isMenuDisabled(this.activeHdIndex)){fly.addClass("x-grid3-hd-over");this.activeHdBtn=fly.child(".x-grid3-hd-btn");if(this.activeHdBtn){this.activeHdBtn.dom.style.height=(hd.firstChild.offsetHeight-1)+"px"}}}},handleHdMove:function(e,t){if(this.activeHd&&!this.headersDisabled){var hw=this.splitHandleWidth||5;var r=this.activeHdRegion;var x=e.getPageX();var ss=this.activeHd.style;if(x-r.left<=hw&&this.cm.isResizable(this.activeHdIndex-1)){ss.cursor=Ext.isAir?"move":Ext.isSafari?"e-resize":"col-resize"}else{if(r.right-x<=(!this.activeHdBtn?hw:2)&&this.cm.isResizable(this.activeHdIndex)){ss.cursor=Ext.isAir?"move":Ext.isSafari?"w-resize":"col-resize"}else{ss.cursor=""}}}},handleHdOut:function(e,t){var hd=this.findHeaderCell(t);if(hd&&(!Ext.isIE||!e.within(hd,true))){this.activeHd=null;this.fly(hd).removeClass("x-grid3-hd-over");hd.style.cursor=""}},hasRows:function(){var fc=this.mainBody.dom.firstChild;return fc&&fc.nodeType==1&&fc.className!="x-grid-empty"},bind:function(d,c){this.initData(d,c)}});Ext.grid.GridView.SplitDragZone=function(grid,hd){this.grid=grid;this.view=grid.getView();this.marker=this.view.resizeMarker;this.proxy=this.view.resizeProxy;Ext.grid.GridView.SplitDragZone.superclass.constructor.call(this,hd,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});
67
+ this.scroll=false;this.hw=this.view.splitHandleWidth||5};Ext.extend(Ext.grid.GridView.SplitDragZone,Ext.dd.DDProxy,{b4StartDrag:function(x,y){this.view.headersDisabled=true;var h=this.view.mainWrap.getHeight();this.marker.setHeight(h);this.marker.show();this.marker.alignTo(this.view.getHeaderCell(this.cellIndex),"tl-tl",[-2,0]);this.proxy.setHeight(h);var w=this.cm.getColumnWidth(this.cellIndex);var minw=Math.max(w-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(minw,1000);this.setYConstraint(0,0);this.minX=x-minw;this.maxX=x+1000;this.startPos=x;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,x,y)},handleMouseDown:function(e){var t=this.view.findHeaderCell(e.getTarget());if(t){var xy=this.view.fly(t).getXY(),x=xy[0],y=xy[1];var exy=e.getXY(),ex=exy[0],ey=exy[1];var w=t.offsetWidth,_14f=false;if((ex-x)<=this.hw){_14f=-1}else{if((x+w)-ex<=this.hw){_14f=0}}if(_14f!==false){this.cm=this.grid.colModel;var ci=this.view.getCellIndex(t);if(_14f==-1){if(ci+_14f<0){return}while(this.cm.isHidden(ci+_14f)){--_14f;if(ci+_14f<0){return}}}this.cellIndex=ci+_14f;this.split=t.dom;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.GridView.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}}else{if(this.view.columnDrag){this.view.columnDrag.callHandleMouseDown(e)}}}},endDrag:function(e){this.marker.hide();var v=this.view;var endX=Math.max(this.minX,e.getPageX());var diff=endX-this.startPos;v.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+diff);setTimeout(function(){v.headersDisabled=false},50)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.GroupingView=Ext.extend(Ext.grid.GridView,{hideGroupedColumn:false,showGroupName:true,startCollapsed:false,enableGrouping:true,enableGroupingMenu:true,enableNoGroups:true,emptyGroupText:"(None)",ignoreAdd:false,groupTextTpl:"{text}",gidSeed:1000,initTemplates:function(){Ext.grid.GroupingView.superclass.initTemplates.call(this);this.state={};var sm=this.grid.getSelectionModel();sm.on(sm.selectRow?"beforerowselect":"beforecellselect",this.onBeforeRowSelect,this);if(!this.startGroup){this.startGroup=new Ext.XTemplate('<div id="{groupId}" class="x-grid-group {cls}">','<div id="{groupId}-hd" class="x-grid-group-hd" style="{style}"><div>',this.groupTextTpl,"</div></div>",'<div id="{groupId}-bd" class="x-grid-group-body">')}this.startGroup.compile();this.endGroup="</div></div>"},findGroup:function(el){return Ext.fly(el).up(".x-grid-group",this.mainBody.dom)},getGroups:function(){return this.hasRows()?this.mainBody.dom.childNodes:[]},onAdd:function(){if(this.enableGrouping&&!this.ignoreAdd){var ss=this.getScrollState();this.refresh();this.restoreScroll(ss)}else{if(!this.enableGrouping){Ext.grid.GroupingView.superclass.onAdd.apply(this,arguments)}}},onRemove:function(ds,_5,_6,_7){Ext.grid.GroupingView.superclass.onRemove.apply(this,arguments);var g=document.getElementById(_5._groupId);if(g&&g.childNodes[1].childNodes.length<1){Ext.removeNode(g)}this.applyEmptyText()},refreshRow:function(_9){if(this.ds.getCount()==1){this.refresh()}else{this.isUpdating=true;Ext.grid.GroupingView.superclass.refreshRow.apply(this,arguments);this.isUpdating=false}},beforeMenuShow:function(){var _a=this.getGroupField();var g=this.hmenu.items.get("groupBy");if(g){g.setDisabled(this.cm.config[this.hdCtxIndex].groupable===false)}var s=this.hmenu.items.get("showGroups");if(s){s.setDisabled(!_a&&this.cm.config[this.hdCtxIndex].groupable===false);s.setChecked(!!_a,true)}},renderUI:function(){Ext.grid.GroupingView.superclass.renderUI.call(this);this.mainBody.on("mousedown",this.interceptMouse,this);if(this.enableGroupingMenu&&this.hmenu){this.hmenu.add("-",{id:"groupBy",text:this.groupByText,handler:this.onGroupByClick,scope:this,iconCls:"x-group-by-icon"});if(this.enableNoGroups){this.hmenu.add({id:"showGroups",text:this.showGroupsText,checked:true,checkHandler:this.onShowGroupsClick,scope:this})}this.hmenu.on("beforeshow",this.beforeMenuShow,this)}},onGroupByClick:function(){this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));this.beforeMenuShow()},onShowGroupsClick:function(mi,_e){if(_e){this.onGroupByClick()}else{this.grid.store.clearGrouping()}},toggleGroup:function(_f,_10){this.grid.stopEditing(true);_f=Ext.getDom(_f);var gel=Ext.fly(_f);_10=_10!==undefined?_10:gel.hasClass("x-grid-group-collapsed");this.state[gel.dom.id]=_10;gel[_10?"removeClass":"addClass"]("x-grid-group-collapsed")},toggleAllGroups:function(_12){var _13=this.getGroups();for(var i=0,len=_13.length;i<len;i++){this.toggleGroup(_13[i],_12)}},expandAllGroups:function(){this.toggleAllGroups(true)},collapseAllGroups:function(){this.toggleAllGroups(false)},interceptMouse:function(e){var hd=e.getTarget(".x-grid-group-hd",this.mainBody);if(hd){e.stopEvent();this.toggleGroup(hd.parentNode)}},getGroup:function(v,r,_1a,_1b,_1c,ds){var g=_1a?_1a(v,{},r,_1b,_1c,ds):String(v);if(g===""){g=this.cm.config[_1c].emptyGroupText||this.emptyGroupText}return g},getGroupField:function(){return this.grid.store.getGroupState()},renderRows:function(){var _1f=this.getGroupField();var eg=!!_1f;if(this.hideGroupedColumn){var _21=this.cm.findColumnIndex(_1f);if(!eg&&this.lastGroupField!==undefined){this.mainBody.update("");this.cm.setHidden(this.cm.findColumnIndex(this.lastGroupField),false);delete this.lastGroupField}else{if(eg&&this.lastGroupField===undefined){this.lastGroupField=_1f;this.cm.setHidden(_21,true)}else{if(eg&&this.lastGroupField!==undefined&&_1f!==this.lastGroupField){this.mainBody.update("");var _22=this.cm.findColumnIndex(this.lastGroupField);this.cm.setHidden(_22,false);this.lastGroupField=_1f;this.cm.setHidden(_21,true)}}}}return Ext.grid.GroupingView.superclass.renderRows.apply(this,arguments)},doRender:function(cs,rs,ds,_26,_27,_28){if(rs.length<1){return""}var _29=this.getGroupField();var _2a=this.cm.findColumnIndex(_29);this.enableGrouping=!!_29;if(!this.enableGrouping||this.isUpdating){return Ext.grid.GroupingView.superclass.doRender.apply(this,arguments)}var _2b="width:"+this.getTotalWidth()+";";var _2c=this.grid.getGridEl().id;var cfg=this.cm.config[_2a];var _2e=cfg.groupRenderer||cfg.renderer;var _2f=this.showGroupName?(cfg.groupName||cfg.header)+": ":"";var _30=[],_31,i,len,gid;for(i=0,len=rs.length;i<len;i++){var _35=_26+i;var r=rs[i],_37=r.data[_29],g=this.getGroup(_37,r,_2e,_35,_2a,ds);if(!_31||_31.group!=g){gid=_2c+"-gp-"+_29+"-"+Ext.util.Format.htmlEncode(g);var _39=typeof this.state[gid]!=="undefined"?!this.state[gid]:this.startCollapsed;var _3a=_39?"x-grid-group-collapsed":"";_31={group:g,gvalue:_37,text:_2f+g,groupId:gid,startRow:_35,rs:[r],cls:_3a,style:_2b};_30.push(_31)}else{_31.rs.push(r)}r._groupId=gid}var buf=[];for(i=0,len=_30.length;i<len;i++){var g=_30[i];this.doGroupStart(buf,g,cs,ds,_27);buf[buf.length]=Ext.grid.GroupingView.superclass.doRender.call(this,cs,g.rs,ds,g.startRow,_27,_28);this.doGroupEnd(buf,g,cs,ds,_27)}return buf.join("")},getGroupId:function(_3c){var _3d=this.grid.getGridEl().id;var _3e=this.getGroupField();var _3f=this.cm.findColumnIndex(_3e);var cfg=this.cm.config[_3f];var _41=cfg.groupRenderer||cfg.renderer;var _42=this.getGroup(_3c,{data:{}},_41,0,_3f,this.ds);return _3d+"-gp-"+_3e+"-"+Ext.util.Format.htmlEncode(_3c)},doGroupStart:function(buf,g,cs,ds,_47){buf[buf.length]=this.startGroup.apply(g)},doGroupEnd:function(buf,g,cs,ds,_4c){buf[buf.length]=this.endGroup},getRows:function(){if(!this.enableGrouping){return Ext.grid.GroupingView.superclass.getRows.call(this)}var r=[];var g,gs=this.getGroups();for(var i=0,len=gs.length;i<len;i++){g=gs[i].childNodes[1].childNodes;for(var j=0,_53=g.length;j<_53;j++){r[r.length]=g[j]}}return r},updateGroupWidths:function(){if(!this.enableGrouping||!this.hasRows()){return}var tw=Math.max(this.cm.getTotalWidth(),this.el.dom.offsetWidth-this.scrollOffset)+"px";var gs=this.getGroups();for(var i=0,len=gs.length;i<len;i++){gs[i].firstChild.style.width=tw}},onColumnWidthUpdated:function(col,w,tw){Ext.grid.GroupingView.superclass.onColumnWidthUpdated.call(this,col,w,tw);
68
+ this.updateGroupWidths()},onAllColumnWidthsUpdated:function(ws,tw){Ext.grid.GroupingView.superclass.onAllColumnWidthsUpdated.call(this,ws,tw);this.updateGroupWidths()},onColumnHiddenUpdated:function(col,_5e,tw){Ext.grid.GroupingView.superclass.onColumnHiddenUpdated.call(this,col,_5e,tw);this.updateGroupWidths()},onLayout:function(){this.updateGroupWidths()},onBeforeRowSelect:function(sm,_61){if(!this.enableGrouping){return}var row=this.getRow(_61);if(row&&!row.offsetParent){var g=this.findGroup(row);this.toggleGroup(g,true)}},groupByText:"Group By This Field",showGroupsText:"Show in Groups"});Ext.grid.GroupingView.GROUP_ID=1000;Ext.grid.HeaderDragZone=function(_1,hd,_3){this.grid=_1;this.view=_1.getView();this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDragZone.superclass.constructor.call(this,hd);if(_3){this.setHandleElId(Ext.id(hd));this.setOuterHandleElId(Ext.id(_3))}this.scroll=false};Ext.extend(Ext.grid.HeaderDragZone,Ext.dd.DragZone,{maxDragWidth:120,getDragData:function(e){var t=Ext.lib.Event.getTarget(e);var h=this.view.findHeaderCell(t);if(h){return{ddel:h.firstChild,header:h}}return false},onInitDrag:function(e){this.view.headersDisabled=true;var _8=this.dragData.ddel.cloneNode(true);_8.id=Ext.id();_8.style.width=Math.min(this.dragData.header.offsetWidth,this.maxDragWidth)+"px";this.proxy.update(_8);return true},afterValidDrop:function(){var v=this.view;setTimeout(function(){v.headersDisabled=false},50)},afterInvalidDrop:function(){var v=this.view;setTimeout(function(){v.headersDisabled=false},50)}});Ext.grid.HeaderDropZone=function(_b,hd,_d){this.grid=_b;this.view=_b.getView();this.proxyTop=Ext.DomHelper.append(document.body,{cls:"col-move-top",html:"&#160;"},true);this.proxyBottom=Ext.DomHelper.append(document.body,{cls:"col-move-bottom",html:"&#160;"},true);this.proxyTop.hide=this.proxyBottom.hide=function(){this.setLeftTop(-100,-100);this.setStyle("visibility","hidden")};this.ddGroup="gridHeader"+this.grid.getGridEl().id;Ext.grid.HeaderDropZone.superclass.constructor.call(this,_b.getGridEl().dom)};Ext.extend(Ext.grid.HeaderDropZone,Ext.dd.DropZone,{proxyOffsets:[-4,-9],fly:Ext.Element.fly,getTargetFromEvent:function(e){var t=Ext.lib.Event.getTarget(e);var _10=this.view.findCellIndex(t);if(_10!==false){return this.view.getHeaderCell(_10)}},nextVisible:function(h){var v=this.view,cm=this.grid.colModel;h=h.nextSibling;while(h){if(!cm.isHidden(v.getCellIndex(h))){return h}h=h.nextSibling}return null},prevVisible:function(h){var v=this.view,cm=this.grid.colModel;h=h.prevSibling;while(h){if(!cm.isHidden(v.getCellIndex(h))){return h}h=h.prevSibling}return null},positionIndicator:function(h,n,e){var x=Ext.lib.Event.getPageX(e);var r=Ext.lib.Dom.getRegion(n.firstChild);var px,pt,py=r.top+this.proxyOffsets[1];if((r.right-x)<=(r.right-r.left)/2){px=r.right+this.view.borderWidth;pt="after"}else{px=r.left;pt="before"}var _1f=this.view.getCellIndex(h);var _20=this.view.getCellIndex(n);if(this.grid.colModel.isFixed(_20)){return false}var _21=this.grid.colModel.isLocked(_20);if(pt=="after"){_20++}if(_1f<_20){_20--}if(_1f==_20&&(_21==this.grid.colModel.isLocked(_1f))){return false}px+=this.proxyOffsets[0];this.proxyTop.setLeftTop(px,py);this.proxyTop.show();if(!this.bottomOffset){this.bottomOffset=this.view.mainHd.getHeight()}this.proxyBottom.setLeftTop(px,py+this.proxyTop.dom.offsetHeight+this.bottomOffset);this.proxyBottom.show();return pt},onNodeEnter:function(n,dd,e,_25){if(_25.header!=n){this.positionIndicator(_25.header,n,e)}},onNodeOver:function(n,dd,e,_29){var _2a=false;if(_29.header!=n){_2a=this.positionIndicator(_29.header,n,e)}if(!_2a){this.proxyTop.hide();this.proxyBottom.hide()}return _2a?this.dropAllowed:this.dropNotAllowed},onNodeOut:function(n,dd,e,_2e){this.proxyTop.hide();this.proxyBottom.hide()},onNodeDrop:function(n,dd,e,_32){var h=_32.header;if(h!=n){var cm=this.grid.colModel;var x=Ext.lib.Event.getPageX(e);var r=Ext.lib.Dom.getRegion(n.firstChild);var pt=(r.right-x)<=((r.right-r.left)/2)?"after":"before";var _38=this.view.getCellIndex(h);var _39=this.view.getCellIndex(n);var _3a=cm.isLocked(_39);if(pt=="after"){_39++}if(_38<_39){_39--}if(_38==_39&&(_3a==cm.isLocked(_38))){return false}cm.setLocked(_38,_3a,true);cm.moveColumn(_38,_39);this.grid.fireEvent("columnmove",_38,_39);return true}return false}});Ext.grid.GridView.ColumnDragZone=function(_3b,hd){Ext.grid.GridView.ColumnDragZone.superclass.constructor.call(this,_3b,hd,null);this.proxy.el.addClass("x-grid3-col-dd")};Ext.extend(Ext.grid.GridView.ColumnDragZone,Ext.grid.HeaderDragZone,{handleMouseDown:function(e){},callHandleMouseDown:function(e){Ext.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this,e)}});Ext.grid.SplitDragZone=function(_1,hd,_3){this.grid=_1;this.view=_1.getView();this.proxy=this.view.resizeProxy;Ext.grid.SplitDragZone.superclass.constructor.call(this,hd,"gridSplitters"+this.grid.getGridEl().id,{dragElId:Ext.id(this.proxy.dom),resizeFrame:false});this.setHandleElId(Ext.id(hd));this.setOuterHandleElId(Ext.id(_3));this.scroll=false};Ext.extend(Ext.grid.SplitDragZone,Ext.dd.DDProxy,{fly:Ext.Element.fly,b4StartDrag:function(x,y){this.view.headersDisabled=true;this.proxy.setHeight(this.view.mainWrap.getHeight());var w=this.cm.getColumnWidth(this.cellIndex);var _7=Math.max(w-this.grid.minColumnWidth,0);this.resetConstraints();this.setXConstraint(_7,1000);this.setYConstraint(0,0);this.minX=x-_7;this.maxX=x+1000;this.startPos=x;Ext.dd.DDProxy.prototype.b4StartDrag.call(this,x,y)},handleMouseDown:function(e){ev=Ext.EventObject.setEvent(e);var t=this.fly(ev.getTarget());if(t.hasClass("x-grid-split")){this.cellIndex=this.view.getCellIndex(t.dom);this.split=t.dom;this.cm=this.grid.colModel;if(this.cm.isResizable(this.cellIndex)&&!this.cm.isFixed(this.cellIndex)){Ext.grid.SplitDragZone.superclass.handleMouseDown.apply(this,arguments)}}},endDrag:function(e){this.view.headersDisabled=false;var _b=Math.max(this.minX,Ext.lib.Event.getPageX(e));var _c=_b-this.startPos;this.view.onColumnSplitterMoved(this.cellIndex,this.cm.getColumnWidth(this.cellIndex)+_c)},autoOffset:function(){this.setDelta(0,0)}});Ext.grid.GridDragZone=function(_1,_2){this.view=_1.getView();Ext.grid.GridDragZone.superclass.constructor.call(this,this.view.mainBody.dom,_2);if(this.view.lockedBody){this.setHandleElId(Ext.id(this.view.mainBody.dom));this.setOuterHandleElId(Ext.id(this.view.lockedBody.dom))}this.scroll=false;this.grid=_1;this.ddel=document.createElement("div");this.ddel.className="x-grid-dd-wrap"};Ext.extend(Ext.grid.GridDragZone,Ext.dd.DragZone,{ddGroup:"GridDD",getDragData:function(e){var t=Ext.lib.Event.getTarget(e);var _5=this.view.findRowIndex(t);if(_5!==false){var sm=this.grid.selModel;if(!sm.isSelected(_5)||e.hasModifier()){sm.handleMouseDown(this.grid,_5,e)}return{grid:this.grid,ddel:this.ddel,rowIndex:_5,selections:sm.getSelections()}}return false},onInitDrag:function(e){var _8=this.dragData;this.ddel.innerHTML=this.grid.getDragDropText();this.proxy.update(this.ddel)},afterRepair:function(){this.dragging=false},getRepairXY:function(e,_a){return false},onEndDrag:function(_b,e){},onValidDrop:function(dd,e,id){this.hideProxy()},beforeInvalidDrop:function(e,id){}});Ext.grid.ColumnModel=function(_1){this.defaultWidth=100;this.defaultSortable=false;if(_1.columns){Ext.apply(this,_1);this.setConfig(_1.columns,true)}else{this.setConfig(_1,true)}this.addEvents("widthchange","headerchange","hiddenchange","columnmoved","columnlockchange","configchange");Ext.grid.ColumnModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.ColumnModel,Ext.util.Observable,{getColumnId:function(_2){return this.config[_2].id},setConfig:function(_3,_4){if(!_4){delete this.totalWidth;for(var i=0,_6=this.config.length;i<_6;i++){var c=this.config[i];if(c.editor){c.editor.destroy()}}}this.config=_3;this.lookup={};for(var i=0,_6=_3.length;i<_6;i++){var c=_3[i];if(typeof c.renderer=="string"){c.renderer=Ext.util.Format[c.renderer]}if(typeof c.id=="undefined"){c.id=i}if(c.editor&&c.editor.isFormField){c.editor=new Ext.grid.GridEditor(c.editor)
69
+ }this.lookup[c.id]=c}if(!_4){this.fireEvent("configchange",this)}},getColumnById:function(id){return this.lookup[id]},getIndexById:function(id){for(var i=0,_b=this.config.length;i<_b;i++){if(this.config[i].id==id){return i}}return -1},moveColumn:function(_c,_d){var c=this.config[_c];this.config.splice(_c,1);this.config.splice(_d,0,c);this.dataMap=null;this.fireEvent("columnmoved",this,_c,_d)},isLocked:function(_f){return this.config[_f].locked===true},setLocked:function(_10,_11,_12){if(this.isLocked(_10)==_11){return}this.config[_10].locked=_11;if(!_12){this.fireEvent("columnlockchange",this,_10,_11)}},getTotalLockedWidth:function(){var _13=0;for(var i=0;i<this.config.length;i++){if(this.isLocked(i)&&!this.isHidden(i)){this.totalWidth+=this.getColumnWidth(i)}}return _13},getLockedCount:function(){for(var i=0,len=this.config.length;i<len;i++){if(!this.isLocked(i)){return i}}},getColumnCount:function(_17){if(_17===true){var c=0;for(var i=0,len=this.config.length;i<len;i++){if(!this.isHidden(i)){c++}}return c}return this.config.length},getColumnsBy:function(fn,_1c){var r=[];for(var i=0,len=this.config.length;i<len;i++){var c=this.config[i];if(fn.call(_1c||this,c,i)===true){r[r.length]=c}}return r},isSortable:function(col){if(typeof this.config[col].sortable=="undefined"){return this.defaultSortable}return this.config[col].sortable},isMenuDisabled:function(col){return !!this.config[col].menuDisabled},getRenderer:function(col){if(!this.config[col].renderer){return Ext.grid.ColumnModel.defaultRenderer}return this.config[col].renderer},setRenderer:function(col,fn){this.config[col].renderer=fn},getColumnWidth:function(col){return this.config[col].width||this.defaultWidth},setColumnWidth:function(col,_28,_29){this.config[col].width=_28;this.totalWidth=null;if(!_29){this.fireEvent("widthchange",this,col,_28)}},getTotalWidth:function(_2a){if(!this.totalWidth){this.totalWidth=0;for(var i=0,len=this.config.length;i<len;i++){if(_2a||!this.isHidden(i)){this.totalWidth+=this.getColumnWidth(i)}}}return this.totalWidth},getColumnHeader:function(col){return this.config[col].header},setColumnHeader:function(col,_2f){this.config[col].header=_2f;this.fireEvent("headerchange",this,col,_2f)},getColumnTooltip:function(col){return this.config[col].tooltip},setColumnTooltip:function(col,_32){this.config[col].tooltip=_32},getDataIndex:function(col){return this.config[col].dataIndex},setDataIndex:function(col,_35){this.config[col].dataIndex=_35},findColumnIndex:function(_36){var c=this.config;for(var i=0,len=c.length;i<len;i++){if(c[i].dataIndex==_36){return i}}return -1},isCellEditable:function(_3a,_3b){return(this.config[_3a].editable||(typeof this.config[_3a].editable=="undefined"&&this.config[_3a].editor))?true:false},getCellEditor:function(_3c,_3d){return this.config[_3c].editor},setEditable:function(col,_3f){this.config[col].editable=_3f},isHidden:function(_40){return this.config[_40].hidden},isFixed:function(_41){return this.config[_41].fixed},isResizable:function(_42){return _42>=0&&this.config[_42].resizable!==false&&this.config[_42].fixed!==true},setHidden:function(_43,_44){var c=this.config[_43];if(c.hidden!==_44){c.hidden=_44;this.totalWidth=null;this.fireEvent("hiddenchange",this,_43,_44)}},setEditor:function(col,_47){this.config[col].editor=_47}});Ext.grid.ColumnModel.defaultRenderer=function(_48){if(typeof _48=="string"&&_48.length<1){return"&#160;"}return _48};Ext.grid.DefaultColumnModel=Ext.grid.ColumnModel;Ext.grid.AbstractSelectionModel=function(){this.locked=false;Ext.grid.AbstractSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.AbstractSelectionModel,Ext.util.Observable,{init:function(_1){this.grid=_1;this.initEvents()},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked}});Ext.grid.RowSelectionModel=function(_1){Ext.apply(this,_1);this.selections=new Ext.util.MixedCollection(false,function(o){return o.id});this.last=false;this.lastActive=false;this.addEvents("selectionchange","beforerowselect","rowselect","rowdeselect");Ext.grid.RowSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.RowSelectionModel,Ext.grid.AbstractSelectionModel,{singleSelect:false,initEvents:function(){if(!this.grid.enableDragDrop&&!this.grid.enableDrag){this.grid.on("rowmousedown",this.handleMouseDown,this)}else{this.grid.on("rowclick",function(_3,_4,e){if(e.button===0&&!e.shiftKey&&!e.ctrlKey){this.selectRow(_4,false);_3.view.focusRow(_4)}},this)}this.rowNav=new Ext.KeyNav(this.grid.getGridEl(),{up:function(e){if(!e.shiftKey||this.singleSelect){this.selectPrevious(false)}else{if(this.last!==false&&this.lastActive!==false){var _7=this.last;this.selectRange(this.last,this.lastActive-1);this.grid.getView().focusRow(this.lastActive);if(_7!==false){this.last=_7}}else{this.selectFirstRow()}}},down:function(e){if(!e.shiftKey||this.singleSelect){this.selectNext(false)}else{if(this.last!==false&&this.lastActive!==false){var _9=this.last;this.selectRange(this.last,this.lastActive+1);this.grid.getView().focusRow(this.lastActive);if(_9!==false){this.last=_9}}else{this.selectFirstRow()}}},scope:this});var _a=this.grid.view;_a.on("refresh",this.onRefresh,this);_a.on("rowupdated",this.onRowUpdated,this);_a.on("rowremoved",this.onRemove,this)},onRefresh:function(){var ds=this.grid.store,_c;var s=this.getSelections();this.clearSelections(true);for(var i=0,_f=s.length;i<_f;i++){var r=s[i];if((_c=ds.indexOfId(r.id))!=-1){this.selectRow(_c,true)}}if(s.length!=this.selections.getCount()){this.fireEvent("selectionchange",this)}},onRemove:function(v,_12,r){if(this.selections.remove(r)!==false){this.fireEvent("selectionchange",this)}},onRowUpdated:function(v,_15,r){if(this.isSelected(r)){v.onRowSelect(_15)}},selectRecords:function(_17,_18){if(!_18){this.clearSelections()}var ds=this.grid.store;for(var i=0,len=_17.length;i<len;i++){this.selectRow(ds.indexOf(_17[i]),true)}},getCount:function(){return this.selections.length},selectFirstRow:function(){this.selectRow(0)},selectLastRow:function(_1c){this.selectRow(this.grid.store.getCount()-1,_1c)},selectNext:function(_1d){if(this.hasNext()){this.selectRow(this.last+1,_1d);this.grid.getView().focusRow(this.last);return true}return false},selectPrevious:function(_1e){if(this.hasPrevious()){this.selectRow(this.last-1,_1e);this.grid.getView().focusRow(this.last);return true}return false},hasNext:function(){return this.last!==false&&(this.last+1)<this.grid.store.getCount()},hasPrevious:function(){return !!this.last},getSelections:function(){return[].concat(this.selections.items)},getSelected:function(){return this.selections.itemAt(0)},each:function(fn,_20){var s=this.getSelections();for(var i=0,len=s.length;i<len;i++){if(fn.call(_20||this,s[i],i)===false){return false}}return true},clearSelections:function(_24){if(this.isLocked()){return}if(_24!==true){var ds=this.grid.store;var s=this.selections;s.each(function(r){this.deselectRow(ds.indexOfId(r.id))},this);s.clear()}else{this.selections.clear()}this.last=false},selectAll:function(){if(this.isLocked()){return}this.selections.clear();for(var i=0,len=this.grid.store.getCount();i<len;i++){this.selectRow(i,true)}},hasSelection:function(){return this.selections.length>0},isSelected:function(_2a){var r=typeof _2a=="number"?this.grid.store.getAt(_2a):_2a;return(r&&this.selections.key(r.id)?true:false)},isIdSelected:function(id){return(this.selections.key(id)?true:false)},handleMouseDown:function(g,_2e,e){if(e.button!==0||this.isLocked()){return}var _30=this.grid.getView();if(e.shiftKey&&!this.singleSelect&&this.last!==false){var _31=this.last;this.selectRange(_31,_2e,e.ctrlKey);this.last=_31;_30.focusRow(_2e)}else{var _32=this.isSelected(_2e);if(e.ctrlKey&&_32){this.deselectRow(_2e)}else{if(!_32||this.getCount()>1){this.selectRow(_2e,e.ctrlKey||e.shiftKey);_30.focusRow(_2e)}}}},selectRows:function(_33,_34){if(!_34){this.clearSelections()}for(var i=0,len=_33.length;i<len;i++){this.selectRow(_33[i],true)}},selectRange:function(_37,_38,_39){if(this.isLocked()){return
70
+ }if(!_39){this.clearSelections()}if(_37<=_38){for(var i=_37;i<=_38;i++){this.selectRow(i,true)}}else{for(var i=_37;i>=_38;i--){this.selectRow(i,true)}}},deselectRange:function(_3b,_3c,_3d){if(this.isLocked()){return}for(var i=_3b;i<=_3c;i++){this.deselectRow(i,_3d)}},selectRow:function(_3f,_40,_41){if(this.isLocked()||(_3f<0||_3f>=this.grid.store.getCount())||this.isSelected(_3f)){return}var r=this.grid.store.getAt(_3f);if(r&&this.fireEvent("beforerowselect",this,_3f,_40,r)!==false){if(!_40||this.singleSelect){this.clearSelections()}this.selections.add(r);this.last=this.lastActive=_3f;if(!_41){this.grid.getView().onRowSelect(_3f)}this.fireEvent("rowselect",this,_3f,r);this.fireEvent("selectionchange",this)}},deselectRow:function(_43,_44){if(this.isLocked()){return}if(this.last==_43){this.last=false}if(this.lastActive==_43){this.lastActive=false}var r=this.grid.store.getAt(_43);if(r){this.selections.remove(r);if(!_44){this.grid.getView().onRowDeselect(_43)}this.fireEvent("rowdeselect",this,_43,r);this.fireEvent("selectionchange",this)}},restoreLast:function(){if(this._last){this.last=this._last}},acceptsNav:function(row,col,cm){return !cm.isHidden(col)&&cm.isCellEditable(col,row)},onEditorKey:function(_49,e){var k=e.getKey(),_4c,g=this.grid,ed=g.activeEditor;var _4f=e.shiftKey;if(k==e.TAB){e.stopEvent();ed.completeEdit();if(_4f){_4c=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this)}else{_4c=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this)}}else{if(k==e.ENTER){e.stopEvent();ed.completeEdit();if(this.moveEditorOnEnter!==false){if(_4f){_4c=g.walkCells(ed.row-1,ed.col,-1,this.acceptsNav,this)}else{_4c=g.walkCells(ed.row+1,ed.col,1,this.acceptsNav,this)}}}else{if(k==e.ESC){ed.cancelEdit()}}}if(_4c){g.startEditing(_4c[0],_4c[1])}}});Ext.grid.CellSelectionModel=function(_1){Ext.apply(this,_1);this.selection=null;this.addEvents("beforecellselect","cellselect","selectionchange");Ext.grid.CellSelectionModel.superclass.constructor.call(this)};Ext.extend(Ext.grid.CellSelectionModel,Ext.grid.AbstractSelectionModel,{initEvents:function(){this.grid.on("cellmousedown",this.handleMouseDown,this);this.grid.getGridEl().on(Ext.isIE||Ext.isSafari3?"keydown":"keypress",this.handleKeyDown,this);var _2=this.grid.view;_2.on("refresh",this.onViewChange,this);_2.on("rowupdated",this.onRowUpdated,this);_2.on("beforerowremoved",this.clearSelections,this);_2.on("beforerowsinserted",this.clearSelections,this);if(this.grid.isEditor){this.grid.on("beforeedit",this.beforeEdit,this)}},beforeEdit:function(e){this.select(e.row,e.column,false,true,e.record)},onRowUpdated:function(v,_5,r){if(this.selection&&this.selection.record==r){v.onCellSelect(_5,this.selection.cell[1])}},onViewChange:function(){this.clearSelections(true)},getSelectedCell:function(){return this.selection?this.selection.cell:null},clearSelections:function(_7){var s=this.selection;if(s){if(_7!==true){this.grid.view.onCellDeselect(s.cell[0],s.cell[1])}this.selection=null;this.fireEvent("selectionchange",this,null)}},hasSelection:function(){return this.selection?true:false},handleMouseDown:function(g,_a,_b,e){if(e.button!==0||this.isLocked()){return}this.select(_a,_b)},select:function(_d,_e,_f,_10,r){if(this.fireEvent("beforecellselect",this,_d,_e)!==false){this.clearSelections();r=r||this.grid.store.getAt(_d);this.selection={record:r,cell:[_d,_e]};if(!_f){var v=this.grid.getView();v.onCellSelect(_d,_e);if(_10!==true){v.focusCell(_d,_e)}}this.fireEvent("cellselect",this,_d,_e);this.fireEvent("selectionchange",this,this.selection)}},isSelectable:function(_13,_14,cm){return !cm.isHidden(_14)},handleKeyDown:function(e){if(!e.isNavKeyPress()){return}var g=this.grid,s=this.selection;if(!s){e.stopEvent();var _19=g.walkCells(0,0,1,this.isSelectable,this);if(_19){this.select(_19[0],_19[1])}return}var sm=this;var _1b=function(row,col,_1e){return g.walkCells(row,col,_1e,sm.isSelectable,sm)};var k=e.getKey(),r=s.cell[0],c=s.cell[1];var _22;switch(k){case e.TAB:if(e.shiftKey){_22=_1b(r,c-1,-1)}else{_22=_1b(r,c+1,1)}break;case e.DOWN:_22=_1b(r+1,c,1);break;case e.UP:_22=_1b(r-1,c,-1);break;case e.RIGHT:_22=_1b(r,c+1,1);break;case e.LEFT:_22=_1b(r,c-1,-1);break;case e.ENTER:if(g.isEditor&&!g.editing){g.startEditing(r,c);e.stopEvent();return}break}if(_22){this.select(_22[0],_22[1]);e.stopEvent()}},acceptsNav:function(row,col,cm){return !cm.isHidden(col)&&cm.isCellEditable(col,row)},onEditorKey:function(_26,e){var k=e.getKey(),_29,g=this.grid,ed=g.activeEditor;if(k==e.TAB){if(e.shiftKey){_29=g.walkCells(ed.row,ed.col-1,-1,this.acceptsNav,this)}else{_29=g.walkCells(ed.row,ed.col+1,1,this.acceptsNav,this)}e.stopEvent()}else{if(k==e.ENTER){ed.completeEdit();e.stopEvent()}else{if(k==e.ESC){e.stopEvent();ed.cancelEdit()}}}if(_29){g.startEditing(_29[0],_29[1])}}});Ext.grid.EditorGridPanel=Ext.extend(Ext.grid.GridPanel,{clicksToEdit:2,isEditor:true,detectEdit:false,autoEncode:false,trackMouseOver:false,initComponent:function(){Ext.grid.EditorGridPanel.superclass.initComponent.call(this);if(!this.selModel){this.selModel=new Ext.grid.CellSelectionModel()}this.activeEditor=null;this.addEvents("beforeedit","afteredit","validateedit")},initEvents:function(){Ext.grid.EditorGridPanel.superclass.initEvents.call(this);this.on("bodyscroll",this.stopEditing,this,[true]);this.on("columnresize",this.stopEditing,this,[true]);if(this.clicksToEdit==1){this.on("cellclick",this.onCellDblClick,this)}else{if(this.clicksToEdit=="auto"&&this.view.mainBody){this.view.mainBody.on("mousedown",this.onAutoEditClick,this)}this.on("celldblclick",this.onCellDblClick,this)}},onCellDblClick:function(g,_2,_3){this.startEditing(_2,_3)},onAutoEditClick:function(e,t){if(e.button!==0){return}var _6=this.view.findRowIndex(t);var _7=this.view.findCellIndex(t);if(_6!==false&&_7!==false){this.stopEditing();if(this.selModel.getSelectedCell){var sc=this.selModel.getSelectedCell();if(sc&&sc.cell[0]===_6&&sc.cell[1]===_7){this.startEditing(_6,_7)}}else{if(this.selModel.isSelected(_6)){this.startEditing(_6,_7)}}}},onEditComplete:function(ed,_a,_b){this.editing=false;this.activeEditor=null;ed.un("specialkey",this.selModel.onEditorKey,this.selModel);var r=ed.record;var _d=this.colModel.getDataIndex(ed.col);_a=this.postEditValue(_a,_b,r,_d);if(String(_a)!==String(_b)){var e={grid:this,record:r,field:_d,originalValue:_b,value:_a,row:ed.row,column:ed.col,cancel:false};if(this.fireEvent("validateedit",e)!==false&&!e.cancel){r.set(_d,e.value);delete e.cancel;this.fireEvent("afteredit",e)}}this.view.focusCell(ed.row,ed.col)},startEditing:function(_f,col){this.stopEditing();if(this.colModel.isCellEditable(col,_f)){this.view.ensureVisible(_f,col,true);var r=this.store.getAt(_f);var _12=this.colModel.getDataIndex(col);var e={grid:this,record:r,field:_12,value:r.data[_12],row:_f,column:col,cancel:false};if(this.fireEvent("beforeedit",e)!==false&&!e.cancel){this.editing=true;var ed=this.colModel.getCellEditor(col,_f);if(!ed.rendered){ed.render(this.view.getEditorParent(ed))}(function(){ed.row=_f;ed.col=col;ed.record=r;ed.on("complete",this.onEditComplete,this,{single:true});ed.on("specialkey",this.selModel.onEditorKey,this.selModel);this.activeEditor=ed;var v=this.preEditValue(r,_12);ed.startEdit(this.view.getCell(_f,col).firstChild,v===undefined?"":v)}).defer(50,this)}}},preEditValue:function(r,_17){var _18=r.data[_17];return this.autoEncode&&typeof _18=="string"?Ext.util.Format.htmlDecode(_18):_18},postEditValue:function(_19,_1a,r,_1c){return this.autoEncode&&typeof _19=="string"?Ext.util.Format.htmlEncode(_19):_19},stopEditing:function(_1d){if(this.activeEditor){this.activeEditor[_1d===true?"cancelEdit":"completeEdit"]()}this.activeEditor=null},onDestroy:function(){if(this.rendered){var _1e=this.colModel.config;for(var i=0,len=_1e.length;i<len;i++){var c=_1e[i];Ext.destroy(c.editor)}}Ext.grid.EditorGridPanel.superclass.onDestroy.call(this)}});Ext.reg("editorgrid",Ext.grid.EditorGridPanel);Ext.grid.GridEditor=function(_1,_2){Ext.grid.GridEditor.superclass.constructor.call(this,_1,_2);_1.monitorTab=false
71
+ };Ext.extend(Ext.grid.GridEditor,Ext.Editor,{alignment:"tl-tl",autoSize:"width",hideEl:false,cls:"x-small-editor x-grid-editor",shim:false,shadow:false});Ext.grid.PropertyRecord=Ext.data.Record.create([{name:"name",type:"string"},"value"]);Ext.grid.PropertyStore=function(_1,_2){this.grid=_1;this.store=new Ext.data.Store({recordType:Ext.grid.PropertyRecord});this.store.on("update",this.onUpdate,this);if(_2){this.setSource(_2)}Ext.grid.PropertyStore.superclass.constructor.call(this)};Ext.extend(Ext.grid.PropertyStore,Ext.util.Observable,{setSource:function(o){this.source=o;this.store.removeAll();var _4=[];for(var k in o){if(this.isEditableValue(o[k])){_4.push(new Ext.grid.PropertyRecord({name:k,value:o[k]},k))}}this.store.loadRecords({records:_4},{},true)},onUpdate:function(ds,_7,_8){if(_8==Ext.data.Record.EDIT){var v=_7.data.value;var _a=_7.modified.value;if(this.grid.fireEvent("beforepropertychange",this.source,_7.id,v,_a)!==false){this.source[_7.id]=v;_7.commit();this.grid.fireEvent("propertychange",this.source,_7.id,v,_a)}else{_7.reject()}}},getProperty:function(_b){return this.store.getAt(_b)},isEditableValue:function(_c){if(Ext.isDate(_c)){return true}else{if(typeof _c=="object"||typeof _c=="function"){return false}}return true},setValue:function(_d,_e){this.source[_d]=_e;this.store.getById(_d).set("value",_e)},getSource:function(){return this.source}});Ext.grid.PropertyColumnModel=function(_f,_10){this.grid=_f;var g=Ext.grid;g.PropertyColumnModel.superclass.constructor.call(this,[{header:this.nameText,width:50,sortable:true,dataIndex:"name",id:"name",menuDisabled:true},{header:this.valueText,width:50,resizable:false,dataIndex:"value",id:"value",menuDisabled:true}]);this.store=_10;this.bselect=Ext.DomHelper.append(document.body,{tag:"select",cls:"x-grid-editor x-hide-display",children:[{tag:"option",value:"true",html:"true"},{tag:"option",value:"false",html:"false"}]});var f=Ext.form;var _13=new f.Field({el:this.bselect,bselect:this.bselect,autoShow:true,getValue:function(){return this.bselect.value=="true"}});this.editors={date:new g.GridEditor(new f.DateField({selectOnFocus:true})),string:new g.GridEditor(new f.TextField({selectOnFocus:true})),number:new g.GridEditor(new f.NumberField({selectOnFocus:true,style:"text-align:left;"})),"boolean":new g.GridEditor(_13)};this.renderCellDelegate=this.renderCell.createDelegate(this);this.renderPropDelegate=this.renderProp.createDelegate(this)};Ext.extend(Ext.grid.PropertyColumnModel,Ext.grid.ColumnModel,{nameText:"Name",valueText:"Value",dateFormat:"m/j/Y",renderDate:function(_14){return _14.dateFormat(this.dateFormat)},renderBool:function(_15){return _15?"true":"false"},isCellEditable:function(_16,_17){return _16==1},getRenderer:function(col){return col==1?this.renderCellDelegate:this.renderPropDelegate},renderProp:function(v){return this.getPropertyName(v)},renderCell:function(val){var rv=val;if(Ext.isDate(val)){rv=this.renderDate(val)}else{if(typeof val=="boolean"){rv=this.renderBool(val)}}return Ext.util.Format.htmlEncode(rv)},getPropertyName:function(_1c){var pn=this.grid.propertyNames;return pn&&pn[_1c]?pn[_1c]:_1c},getCellEditor:function(_1e,_1f){var p=this.store.getProperty(_1f);var n=p.data.name,val=p.data.value;if(this.grid.customEditors[n]){return this.grid.customEditors[n]}if(Ext.isDate(val)){return this.editors.date}else{if(typeof val=="number"){return this.editors.number}else{if(typeof val=="boolean"){return this.editors["boolean"]}else{return this.editors.string}}}}});Ext.grid.PropertyGrid=Ext.extend(Ext.grid.EditorGridPanel,{enableColumnMove:false,stripeRows:false,trackMouseOver:false,clicksToEdit:1,enableHdMenu:false,viewConfig:{forceFit:true},initComponent:function(){this.customEditors=this.customEditors||{};this.lastEditRow=null;var _23=new Ext.grid.PropertyStore(this);this.propStore=_23;var cm=new Ext.grid.PropertyColumnModel(this,_23);_23.store.sort("name","ASC");this.addEvents("beforepropertychange","propertychange");this.cm=cm;this.ds=_23.store;Ext.grid.PropertyGrid.superclass.initComponent.call(this);this.selModel.on("beforecellselect",function(sm,_26,_27){if(_27===0){this.startEditing.defer(200,this,[_26,1]);return false}},this)},onRender:function(){Ext.grid.PropertyGrid.superclass.onRender.apply(this,arguments);this.getGridEl().addClass("x-props-grid")},afterRender:function(){Ext.grid.PropertyGrid.superclass.afterRender.apply(this,arguments);if(this.source){this.setSource(this.source)}},setSource:function(_28){this.propStore.setSource(_28)},getSource:function(){return this.propStore.getSource()}});Ext.reg("propertygrid",Ext.grid.PropertyGrid);Ext.grid.RowNumberer=function(_1){Ext.apply(this,_1);if(this.rowspan){this.renderer=this.renderer.createDelegate(this)}};Ext.grid.RowNumberer.prototype={header:"",width:23,sortable:false,fixed:true,menuDisabled:true,dataIndex:"",id:"numberer",rowspan:undefined,renderer:function(v,p,_4,_5){if(this.rowspan){p.cellAttr='rowspan="'+this.rowspan+'"'}return _5+1}};Ext.grid.CheckboxSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,{header:'<div class="x-grid3-hd-checker">&#160;</div>',width:20,sortable:false,menuDisabled:true,fixed:true,dataIndex:"",id:"checker",initEvents:function(){Ext.grid.CheckboxSelectionModel.superclass.initEvents.call(this);this.grid.on("render",function(){var _1=this.grid.getView();_1.mainBody.on("mousedown",this.onMouseDown,this);Ext.fly(_1.innerHd).on("mousedown",this.onHdMouseDown,this)},this)},onMouseDown:function(e,t){if(e.button===0&&t.className=="x-grid3-row-checker"){e.stopEvent();var _4=e.getTarget(".x-grid3-row");if(_4){var _5=_4.rowIndex;if(this.isSelected(_5)){this.deselectRow(_5)}else{this.selectRow(_5,true)}}}},onHdMouseDown:function(e,t){if(t.className=="x-grid3-hd-checker"){e.stopEvent();var hd=Ext.fly(t.parentNode);var _9=hd.hasClass("x-grid3-hd-checker-on");if(_9){hd.removeClass("x-grid3-hd-checker-on");this.clearSelections()}else{hd.addClass("x-grid3-hd-checker-on");this.selectAll()}}},renderer:function(v,p,_c){return'<div class="x-grid3-row-checker">&#160;</div>'}});Ext.LoadMask=function(el,_2){this.el=Ext.get(el);Ext.apply(this,_2);if(this.store){this.store.on("beforeload",this.onBeforeLoad,this);this.store.on("load",this.onLoad,this);this.store.on("loadexception",this.onLoad,this);this.removeMask=Ext.value(this.removeMask,false)}else{var um=this.el.getUpdater();um.showLoadIndicator=false;um.on("beforeupdate",this.onBeforeLoad,this);um.on("update",this.onLoad,this);um.on("failure",this.onLoad,this);this.removeMask=Ext.value(this.removeMask,true)}};Ext.LoadMask.prototype={msg:"Loading...",msgCls:"x-mask-loading",disabled:false,disable:function(){this.disabled=true},enable:function(){this.disabled=false},onLoad:function(){this.el.unmask(this.removeMask)},onBeforeLoad:function(){if(!this.disabled){this.el.mask(this.msg,this.msgCls)}},show:function(){this.onBeforeLoad()},hide:function(){this.onLoad()},destroy:function(){if(this.store){this.store.un("beforeload",this.onBeforeLoad,this);this.store.un("load",this.onLoad,this);this.store.un("loadexception",this.onLoad,this)}else{var um=this.el.getUpdater();um.un("beforeupdate",this.onBeforeLoad,this);um.un("update",this.onLoad,this);um.un("failure",this.onLoad,this)}}};Ext.ProgressBar=Ext.extend(Ext.BoxComponent,{baseCls:"x-progress",animate:false,waitTimer:null,initComponent:function(){Ext.ProgressBar.superclass.initComponent.call(this);this.addEvents("update")},onRender:function(ct,_2){Ext.ProgressBar.superclass.onRender.call(this,ct,_2);var _3=new Ext.Template('<div class="{cls}-wrap">','<div class="{cls}-inner">','<div class="{cls}-bar">','<div class="{cls}-text">',"<div>&#160;</div>","</div>","</div>",'<div class="{cls}-text {cls}-text-back">',"<div>&#160;</div>","</div>","</div>","</div>");if(_2){this.el=_3.insertBefore(_2,{cls:this.baseCls},true)}else{this.el=_3.append(ct,{cls:this.baseCls},true)}if(this.id){this.el.dom.id=this.id}var _4=this.el.dom.firstChild;this.progressBar=Ext.get(_4.firstChild);if(this.textEl){this.textEl=Ext.get(this.textEl);
72
+ delete this.textTopEl}else{this.textTopEl=Ext.get(this.progressBar.dom.firstChild);var _5=Ext.get(_4.childNodes[1]);this.textTopEl.setStyle("z-index",99).addClass("x-hidden");this.textEl=new Ext.CompositeElement([this.textTopEl.dom.firstChild,_5.dom.firstChild]);this.textEl.setWidth(_4.offsetWidth)}this.progressBar.setHeight(_4.offsetHeight)},afterRender:function(){Ext.ProgressBar.superclass.afterRender.call(this);if(this.value){this.updateProgress(this.value,this.text)}else{this.updateText(this.text)}},updateProgress:function(_6,_7,_8){this.value=_6||0;if(_7){this.updateText(_7)}if(this.rendered){var w=Math.floor(_6*this.el.dom.firstChild.offsetWidth);this.progressBar.setWidth(w,_8===true||(_8!==false&&this.animate));if(this.textTopEl){this.textTopEl.removeClass("x-hidden").setWidth(w)}}this.fireEvent("update",this,_6,_7);return this},wait:function(o){if(!this.waitTimer){var _b=this;o=o||{};this.updateText(o.text);this.waitTimer=Ext.TaskMgr.start({run:function(i){var _d=o.increment||10;this.updateProgress(((((i+_d)%_d)+1)*(100/_d))*0.01,null,o.animate)},interval:o.interval||1000,duration:o.duration,onStop:function(){if(o.fn){o.fn.apply(o.scope||this)}this.reset()},scope:_b})}return this},isWaiting:function(){return this.waitTimer!=null},updateText:function(_e){this.text=_e||"&#160;";if(this.rendered){this.textEl.update(this.text)}return this},syncProgressBar:function(){if(this.value){this.updateProgress(this.value,this.text)}return this},setSize:function(w,h){Ext.ProgressBar.superclass.setSize.call(this,w,h);if(this.textTopEl){var _11=this.el.dom.firstChild;this.textEl.setSize(_11.offsetWidth,_11.offsetHeight)}this.syncProgressBar();return this},reset:function(_12){this.updateProgress(0);if(this.textTopEl){this.textTopEl.addClass("x-hidden")}if(this.waitTimer){this.waitTimer.onStop=null;Ext.TaskMgr.stop(this.waitTimer);this.waitTimer=null}if(_12===true){this.hide()}return this}});Ext.reg("progress",Ext.ProgressBar);Ext.Slider=Ext.extend(Ext.BoxComponent,{vertical:false,minValue:0,maxValue:100,keyIncrement:1,increment:0,clickRange:[5,15],clickToChange:true,animate:true,dragging:false,initComponent:function(){if(this.value===undefined){this.value=this.minValue}Ext.Slider.superclass.initComponent.call(this);this.keyIncrement=Math.max(this.increment,this.keyIncrement);this.addEvents("beforechange","change","changecomplete","dragstart","drag","dragend");if(this.vertical){Ext.apply(this,Ext.Slider.Vertical)}},onRender:function(){this.autoEl={cls:"x-slider "+(this.vertical?"x-slider-vert":"x-slider-horz"),cn:{cls:"x-slider-end",cn:{cls:"x-slider-inner",cn:[{cls:"x-slider-thumb"},{tag:"a",cls:"x-slider-focus",href:"#",tabIndex:"-1",hidefocus:"on"}]}}};Ext.Slider.superclass.onRender.apply(this,arguments);this.endEl=this.el.first();this.innerEl=this.endEl.first();this.thumb=this.innerEl.first();this.halfThumb=(this.vertical?this.thumb.getHeight():this.thumb.getWidth())/2;this.focusEl=this.thumb.next();this.initEvents()},initEvents:function(){this.thumb.addClassOnOver("x-slider-thumb-over");this.mon(this.el,"mousedown",this.onMouseDown,this);this.mon(this.el,"keydown",this.onKeyDown,this);this.focusEl.swallowEvent("click",true);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeDragStart.createDelegate(this),onStart:this.onDragStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onDragEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(this.thumb);this.on("beforedestroy",this.tracker.destroy,this.tracker)},onMouseDown:function(e){if(this.disabled){return}if(this.clickToChange&&e.target!=this.thumb.dom){var _2=this.innerEl.translatePoints(e.getXY());this.onClickChange(_2)}this.focus()},onClickChange:function(_3){if(_3.top>this.clickRange[0]&&_3.top<this.clickRange[1]){this.setValue(Math.round(this.reverseValue(_3.left)),undefined,true)}},onKeyDown:function(e){if(this.disabled){e.preventDefault();return}var k=e.getKey();switch(k){case e.UP:case e.RIGHT:e.stopEvent();if(e.ctrlKey){this.setValue(this.maxValue,undefined,true)}else{this.setValue(this.value+this.keyIncrement,undefined,true)}break;case e.DOWN:case e.LEFT:e.stopEvent();if(e.ctrlKey){this.setValue(this.minValue,undefined,true)}else{this.setValue(this.value-this.keyIncrement,undefined,true)}break;default:e.preventDefault()}},doSnap:function(_6){if(!this.increment||this.increment==1||!_6){return _6}var _7=_6,_8=this.increment;var m=_6%_8;if(m>0){if(m>(_8/2)){_7=_6+(_8-m)}else{_7=_6-m}}return _7.constrain(this.minValue,this.maxValue)},afterRender:function(){Ext.Slider.superclass.afterRender.apply(this,arguments);if(this.value!==undefined){var v=this.normalizeValue(this.value);if(v!==this.value){delete this.value;this.setValue(v,false)}else{this.moveThumb(this.translateValue(v),false)}}},getRatio:function(){var w=this.innerEl.getWidth();var v=this.maxValue-this.minValue;return v==0?w:(w/v)},normalizeValue:function(v){if(typeof v!="number"){v=parseInt(v)}v=Math.round(v);v=this.doSnap(v);v=v.constrain(this.minValue,this.maxValue);return v},setValue:function(v,_f,_10){v=this.normalizeValue(v);if(v!==this.value&&this.fireEvent("beforechange",this,v,this.value)!==false){this.value=v;this.moveThumb(this.translateValue(v),_f!==false);this.fireEvent("change",this,v);if(_10){this.fireEvent("changecomplete",this,v)}}},translateValue:function(v){var _12=this.getRatio();return(v*_12)-(this.minValue*_12)-this.halfThumb},reverseValue:function(pos){var _14=this.getRatio();return(pos+this.halfThumb+(this.minValue*_14))/_14},moveThumb:function(v,_16){if(!_16||this.animate===false){this.thumb.setLeft(v)}else{this.thumb.shift({left:v,stopFx:true,duration:0.35})}},focus:function(){this.focusEl.focus(10)},onBeforeDragStart:function(e){return !this.disabled},onDragStart:function(e){this.thumb.addClass("x-slider-thumb-drag");this.dragging=true;this.dragStartValue=this.value;this.fireEvent("dragstart",this,e)},onDrag:function(e){var pos=this.innerEl.translatePoints(this.tracker.getXY());this.setValue(Math.round(this.reverseValue(pos.left)),false);this.fireEvent("drag",this,e)},onDragEnd:function(e){this.thumb.removeClass("x-slider-thumb-drag");this.dragging=false;this.fireEvent("dragend",this,e);if(this.dragStartValue!=this.value){this.fireEvent("changecomplete",this,this.value)}},onDisable:function(){Ext.Slider.superclass.onDisable.call(this);this.thumb.addClass(this.disabledClass);if(Ext.isIE){var xy=this.thumb.getXY();this.thumb.hide();this.innerEl.addClass(this.disabledClass).dom.disabled=true;if(!this.thumbHolder){this.thumbHolder=this.endEl.createChild({cls:"x-slider-thumb "+this.disabledClass})}this.thumbHolder.show().setXY(xy)}},onEnable:function(){Ext.Slider.superclass.onEnable.call(this);this.thumb.removeClass(this.disabledClass);if(Ext.isIE){this.innerEl.removeClass(this.disabledClass).dom.disabled=false;if(this.thumbHolder){this.thumbHolder.hide()}this.thumb.show();this.syncThumb()}},onResize:function(w,h){this.innerEl.setWidth(w-(this.el.getPadding("l")+this.endEl.getPadding("r")));this.syncThumb()},syncThumb:function(){if(this.rendered){this.moveThumb(this.translateValue(this.value))}},getValue:function(){return this.value}});Ext.reg("slider",Ext.Slider);Ext.Slider.Vertical={onResize:function(w,h){this.innerEl.setHeight(h-(this.el.getPadding("t")+this.endEl.getPadding("b")));this.syncThumb()},getRatio:function(){var h=this.innerEl.getHeight();var v=this.maxValue-this.minValue;return h/v},moveThumb:function(v,_24){if(!_24||this.animate===false){this.thumb.setBottom(v)}else{this.thumb.shift({bottom:v,stopFx:true,duration:0.35})}},onDrag:function(e){var pos=this.innerEl.translatePoints(this.tracker.getXY());var _27=this.innerEl.getHeight()-pos.top;this.setValue(this.minValue+Math.round(_27/this.getRatio()),false);this.fireEvent("drag",this,e)},onClickChange:function(_28){if(_28.left>this.clickRange[0]&&_28.left<this.clickRange[1]){var _29=this.innerEl.getHeight()-_28.top;this.setValue(this.minValue+Math.round(_29/this.getRatio()),undefined,true)}}};Ext.StatusBar=Ext.extend(Ext.Toolbar,{cls:"x-statusbar",busyIconCls:"x-status-busy",busyText:"Loading...",autoClear:5000,activeThreadId:0,initComponent:function(){if(this.statusAlign=="right"){this.cls+=" x-status-right"
73
+ }Ext.StatusBar.superclass.initComponent.call(this)},afterRender:function(){Ext.StatusBar.superclass.afterRender.call(this);var _1=this.statusAlign=="right",td=Ext.get(this.nextBlock());if(_1){this.tr.appendChild(td.dom)}else{td.insertBefore(this.tr.firstChild)}this.statusEl=td.createChild({cls:"x-status-text "+(this.iconCls||this.defaultIconCls||""),html:this.text||this.defaultText||""});this.statusEl.unselectable();this.spacerEl=td.insertSibling({tag:"td",style:"width:100%",cn:[{cls:"ytb-spacer"}]},_1?"before":"after")},setStatus:function(o){o=o||{};if(typeof o=="string"){o={text:o}}if(o.text!==undefined){this.setText(o.text)}if(o.iconCls!==undefined){this.setIcon(o.iconCls)}if(o.clear){var c=o.clear,_5=this.autoClear,_6={useDefaults:true,anim:true};if(typeof c=="object"){c=Ext.applyIf(c,_6);if(c.wait){_5=c.wait}}else{if(typeof c=="number"){_5=c;c=_6}else{if(typeof c=="boolean"){c=_6}}}c.threadId=this.activeThreadId;this.clearStatus.defer(_5,this,[c])}return this},clearStatus:function(o){o=o||{};if(o.threadId&&o.threadId!==this.activeThreadId){return this}var _8=o.useDefaults?this.defaultText:"",_9=o.useDefaults?(this.defaultIconCls?this.defaultIconCls:""):"";if(o.anim){this.statusEl.fadeOut({remove:false,useDisplay:true,scope:this,callback:function(){this.setStatus({text:_8,iconCls:_9});this.statusEl.show()}})}else{this.statusEl.hide();this.setStatus({text:_8,iconCls:_9});this.statusEl.show()}return this},setText:function(_a){this.activeThreadId++;this.text=_a||"";if(this.rendered){this.statusEl.update(this.text)}return this},getText:function(){return this.text},setIcon:function(_b){this.activeThreadId++;_b=_b||"";if(this.rendered){if(this.currIconCls){this.statusEl.removeClass(this.currIconCls);this.currIconCls=null}if(_b.length>0){this.statusEl.addClass(_b);this.currIconCls=_b}}else{this.currIconCls=_b}return this},showBusy:function(o){if(typeof o=="string"){o={text:o}}o=Ext.applyIf(o||{},{text:this.busyText,iconCls:this.busyIconCls});return this.setStatus(o)}});Ext.reg("statusbar",Ext.StatusBar);Ext.History=(function(){var _1,_2;var _3=false;var _4;function getHash(){var _5=top.location.href,i=_5.indexOf("#");return i>=0?_5.substr(i+1):null}function doSave(){_2.value=_4}function handleStateChange(_7){_4=_7;Ext.History.fireEvent("change",_7)}function updateIFrame(_8){var _9=['<html><body><div id="state">',_8,"</div></body></html>"].join("");try{var _a=_1.contentWindow.document;_a.open();_a.write(_9);_a.close();return true}catch(e){return false}}function checkIFrame(){if(!_1.contentWindow||!_1.contentWindow.document){setTimeout(checkIFrame,10);return}var _b=_1.contentWindow.document;var _c=_b.getElementById("state");var _d=_c?_c.innerText:null;var _e=getHash();setInterval(function(){_b=_1.contentWindow.document;_c=_b.getElementById("state");var _f=_c?_c.innerText:null;var _10=getHash();if(_f!==_d){_d=_f;handleStateChange(_d);top.location.hash=_d;_e=_d;doSave()}else{if(_10!==_e){_e=_10;updateIFrame(_10)}}},50);_3=true;Ext.History.fireEvent("ready",Ext.History)}function startUp(){_4=_2.value?_2.value:getHash();if(Ext.isIE){checkIFrame()}else{var _11=getHash();setInterval(function(){var _12=getHash();if(_12!==_11){_11=_12;handleStateChange(_11);doSave()}},50);_3=true;Ext.History.fireEvent("ready",Ext.History)}}return{fieldId:"x-history-field",iframeId:"x-history-frame",events:{},init:function(_13,_14){if(_3){Ext.callback(_13,_14,[this]);return}if(!Ext.isReady){Ext.onReady(function(){Ext.History.init(_13,_14)});return}_2=Ext.getDom(Ext.History.fieldId);if(Ext.isIE){_1=Ext.getDom(Ext.History.iframeId)}this.addEvents("ready","change");if(_13){this.on("ready",_13,_14,{single:true})}startUp()},add:function(_15,_16){if(_16!==false){if(this.getToken()==_15){return true}}if(Ext.isIE){return updateIFrame(_15)}else{top.location.hash=_15;return true}},back:function(){history.go(-1)},forward:function(){history.go(1)},getToken:function(){return _3?_4:getHash()}}})();Ext.apply(Ext.History,new Ext.util.Observable());Ext.debug={};(function(){var cp;function createConsole(){var _2=new Ext.debug.ScriptsPanel();var _3=new Ext.debug.LogPanel();var _4=new Ext.debug.DomTree();var _5=new Ext.TabPanel({activeTab:0,border:false,tabPosition:"bottom",items:[{title:"Debug Console",layout:"border",items:[_3,_2]},{title:"DOM Inspector",layout:"border",items:[_4]}]});cp=new Ext.Panel({id:"x-debug-browser",title:"Console",collapsible:true,animCollapse:false,style:"position:absolute;left:0;bottom:0;",height:200,logView:_3,layout:"fit",tools:[{id:"close",handler:function(){cp.destroy();cp=null;Ext.EventManager.removeResizeListener(handleResize)}}],items:_5});cp.render(document.body);cp.resizer=new Ext.Resizable(cp.el,{minHeight:50,handles:"n",pinned:true,transparent:true,resizeElement:function(){var _6=this.proxy.getBox();this.proxy.hide();cp.setHeight(_6.height);return _6}});function handleResize(){cp.setWidth(Ext.getBody().getViewSize().width)}Ext.EventManager.onWindowResize(handleResize);handleResize()}Ext.apply(Ext,{log:function(){if(!cp){createConsole()}cp.logView.log.apply(cp.logView,arguments)},logf:function(_7,_8,_9,_a){Ext.log(String.format.apply(String,arguments))},dump:function(o){if(typeof o=="string"||typeof o=="number"||typeof o=="undefined"||Ext.isDate(o)){Ext.log(o)}else{if(!o){Ext.log("null")}else{if(typeof o!="object"){Ext.log("Unknown return type")}else{if(Ext.isArray(o)){Ext.log("["+o.join(",")+"]")}else{var b=["{\n"];for(var _d in o){var to=typeof o[_d];if(to!="function"&&to!="object"){b.push(String.format(" {0}: {1},\n",_d,o[_d]))}}var s=b.join("");if(s.length>3){s=s.substr(0,s.length-2)}Ext.log(s+"\n}")}}}}},_timers:{},time:function(_10){_10=_10||"def";Ext._timers[_10]=new Date().getTime()},timeEnd:function(_11,_12){var t=new Date().getTime();_11=_11||"def";var v=String.format("{0} ms",t-Ext._timers[_11]);Ext._timers[_11]=new Date().getTime();if(_12!==false){Ext.log("Timer "+(_11=="def"?v:_11+": "+v))}return v}})})();Ext.debug.ScriptsPanel=Ext.extend(Ext.Panel,{id:"x-debug-scripts",region:"east",minWidth:200,split:true,width:350,border:false,layout:"anchor",style:"border-width:0 0 0 1px;",initComponent:function(){this.scriptField=new Ext.form.TextArea({anchor:"100% -26",style:"border-width:0;"});this.trapBox=new Ext.form.Checkbox({id:"console-trap",boxLabel:"Trap Errors",checked:true});this.toolbar=new Ext.Toolbar([{text:"Run",scope:this,handler:this.evalScript},{text:"Clear",scope:this,handler:this.clear},"->",this.trapBox," "," "]);this.items=[this.toolbar,this.scriptField];Ext.debug.ScriptsPanel.superclass.initComponent.call(this)},evalScript:function(){var s=this.scriptField.getValue();if(this.trapBox.getValue()){try{var rt=eval(s);Ext.dump(rt===undefined?"(no return)":rt)}catch(e){Ext.log(e.message||e.descript)}}else{var rt=eval(s);Ext.dump(rt===undefined?"(no return)":rt)}},clear:function(){this.scriptField.setValue("");this.scriptField.focus()}});Ext.debug.LogPanel=Ext.extend(Ext.Panel,{autoScroll:true,region:"center",border:false,style:"border-width:0 1px 0 0",log:function(){var _17=['<div style="padding:5px !important;border-bottom:1px solid #ccc;">',Ext.util.Format.htmlEncode(Array.prototype.join.call(arguments,", ")).replace(/\n/g,"<br />").replace(/\s/g,"&#160;"),"</div>"].join("");this.body.insertHtml("beforeend",_17);this.body.scrollTo("top",100000)},clear:function(){this.body.update("");this.body.dom.scrollTop=0}});Ext.debug.DomTree=Ext.extend(Ext.tree.TreePanel,{enableDD:false,lines:false,rootVisible:false,animate:false,hlColor:"ffff9c",autoScroll:true,region:"center",border:false,initComponent:function(){Ext.debug.DomTree.superclass.initComponent.call(this);var _18=false,_19;var _1a=/^\s*$/;var _1b=Ext.util.Format.htmlEncode;var _1c=Ext.util.Format.ellipsis;var _1d=/\s?([a-z\-]*)\:([^;]*)(?:[;\s\n\r]*)/gi;function findNode(n){if(!n||n.nodeType!=1||n==document.body||n==document){return false}var pn=[n],p=n;while((p=p.parentNode)&&p.nodeType==1&&p.tagName.toUpperCase()!="HTML"){pn.unshift(p)}var cn=_19;for(var i=0,len=pn.length;i<len;i++){cn.expand();
74
+ cn=cn.findChild("htmlNode",pn[i]);if(!cn){return false}}cn.select();var a=cn.ui.anchor;treeEl.dom.scrollTop=Math.max(0,a.offsetTop-10);cn.highlight();return true}function nodeTitle(n){var s=n.tagName;if(n.id){s+="#"+n.id}else{if(n.className){s+="."+n.className}}return s}function onNodeSelect(t,n,_29){return;if(_29&&_29.unframe){_29.unframe()}var _2a={};if(n&&n.htmlNode){if(frameEl.pressed){n.frame()}if(inspecting){return}addStyle.enable();reload.setDisabled(n.leaf);var dom=n.htmlNode;stylePanel.setTitle(nodeTitle(dom));if(_18&&!showAll.pressed){var s=dom.style?dom.style.cssText:"";if(s){var m;while((m=_1d.exec(s))!=null){_2a[m[1].toLowerCase()]=m[2]}}}else{if(_18){var cl=Ext.debug.cssList;var s=dom.style,fly=Ext.fly(dom);if(s){for(var i=0,len=cl.length;i<len;i++){var st=cl[i];var v=s[st]||fly.getStyle(st);if(v!=undefined&&v!==null&&v!==""){_2a[st]=v}}}}else{for(var a in dom){var v=dom[a];if((isNaN(a+10))&&v!=undefined&&v!==null&&v!==""&&!(Ext.isGecko&&a[0]==a[0].toUpperCase())){_2a[a]=v}}}}}else{if(inspecting){return}addStyle.disable();reload.disabled()}stylesGrid.setSource(_2a);stylesGrid.treeNode=n;stylesGrid.view.fitColumns()}this.loader=new Ext.tree.TreeLoader();this.loader.load=function(n,cb){var _37=n.htmlNode==document.body;var cn=n.htmlNode.childNodes;for(var i=0,c;c=cn[i];i++){if(_37&&c.id=="x-debug-browser"){continue}if(c.nodeType==1){n.appendChild(new Ext.debug.HtmlNode(c))}else{if(c.nodeType==3&&!_1a.test(c.nodeValue)){n.appendChild(new Ext.tree.TreeNode({text:"<em>"+_1c(_1b(String(c.nodeValue)),35)+"</em>",cls:"x-tree-noicon"}))}}}cb()};this.root=this.setRootNode(new Ext.tree.TreeNode("Ext"));_19=this.root.appendChild(new Ext.debug.HtmlNode(document.getElementsByTagName("html")[0]))}});Ext.debug.HtmlNode=function(){var _3b=Ext.util.Format.htmlEncode;var _3c=Ext.util.Format.ellipsis;var _3d=/^\s*$/;var _3e=[{n:"id",v:"id"},{n:"className",v:"class"},{n:"name",v:"name"},{n:"type",v:"type"},{n:"src",v:"src"},{n:"href",v:"href"}];function hasChild(n){for(var i=0,c;c=n.childNodes[i];i++){if(c.nodeType==1){return true}}return false}function renderNode(n,_43){var tag=n.tagName.toLowerCase();var s="&lt;"+tag;for(var i=0,len=_3e.length;i<len;i++){var a=_3e[i];var v=n[a.n];if(v&&!_3d.test(v)){s+=" "+a.v+"=&quot;<i>"+_3b(v)+"</i>&quot;"}}var _4a=n.style?n.style.cssText:"";if(_4a){s+=" style=&quot;<i>"+_3b(_4a.toLowerCase())+"</i>&quot;"}if(_43&&n.childNodes.length>0){s+="&gt;<em>"+_3c(_3b(String(n.innerHTML)),35)+"</em>&lt;/"+tag+"&gt;"}else{if(_43){s+=" /&gt;"}else{s+="&gt;"}}return s}var _4b=function(n){var _4d=!hasChild(n);this.htmlNode=n;this.tagName=n.tagName.toLowerCase();var _4e={text:renderNode(n,_4d),leaf:_4d,cls:"x-tree-noicon"};_4b.superclass.constructor.call(this,_4e);this.attributes.htmlNode=n;if(!_4d){this.on("expand",this.onExpand,this);this.on("collapse",this.onCollapse,this)}};Ext.extend(_4b,Ext.tree.AsyncTreeNode,{cls:"x-tree-noicon",preventHScroll:true,refresh:function(_4f){var _50=!hasChild(this.htmlNode);this.setText(renderNode(this.htmlNode,_50));if(_4f){Ext.fly(this.ui.textNode).highlight()}},onExpand:function(){if(!this.closeNode&&this.parentNode){this.closeNode=this.parentNode.insertBefore(new Ext.tree.TreeNode({text:"&lt;/"+this.tagName+"&gt;",cls:"x-tree-noicon"}),this.nextSibling)}else{if(this.closeNode){this.closeNode.ui.show()}}},onCollapse:function(){if(this.closeNode){this.closeNode.ui.hide()}},render:function(_51){_4b.superclass.render.call(this,_51)},highlightNode:function(){},highlight:function(){},frame:function(){this.htmlNode.style.border="1px solid #0000ff"},unframe:function(){this.htmlNode.style.border=""}});return _4b}();
75
+ Ext.util.Format.eurMoney=function(v){v=(Math.round((v-0)*100))/100;v=(v==Math.floor(v))?v+".00":((v*10==Math.floor(v*10))?v+"0":v);return"€"+v};Ext.util.Format.boolRenderer=function(v,p,record){p.css+=" x-grid3-check-col-td";return'<div class="x-grid3-check-col'+(v?"-on":"")+" x-grid3-cc-"+this.id+'">&#160;</div>'};var treeDropConfig={getDropPoint:function(e,n,dd){var tn=n.node;if(tn.isRoot){return tn.allowChildren!==false?"append":false}var dragEl=n.ddel;var t=Ext.lib.Dom.getY(dragEl),b=t+dragEl.offsetHeight;var y=Ext.lib.Event.getPageY(e);var noAppend=tn.allowChildren===false;if(this.appendOnly||tn.parentNode.allowChildren===false){return noAppend?false:"append"}var noBelow=false;if(!this.allowParentInsert){noBelow=tn.hasChildNodes()&&tn.isExpanded()}var q=(b-t)/(noAppend?2:3);if(y>=t&&y<(t+q)){return"above"}else{if(!noBelow&&(noAppend||y>=b-q&&y<=b)){return"below"}else{return"append"}}},completeDrop:function(de){var ns=de.dropNode,p=de.point,t=de.target;if(!Ext.isArray(ns)){ns=[ns]}var n;for(var i=0,len=ns.length;i<len;i++){n=ns[i];if(p=="above"){t.parentNode.insertBefore(n,t)}else{if(p=="below"){t.parentNode.insertBefore(n,t.nextSibling)}else{t.leaf=false;t.appendChild(n)}}}n.ui.focus();if(this.tree.hlDrop){n.ui.highlight()}t.ui.endDrop();this.tree.fireEvent("nodedrop",de)}};Ext.lib.Event.getTarget=function(e){var ee=e.browserEvent||e;return ee.target?Event.element(ee):null};Ext.grid.CheckColumn=function(config){Ext.apply(this,config);if(!this.id){this.id=Ext.id()}this.renderer=this.renderer.createDelegate(this)};Ext.grid.CheckColumn.prototype={init:function(grid){this.grid=grid;this.grid.on("render",function(){var view=this.grid.getView();view.mainBody.on("mousedown",this.onMouseDown,this)},this)},onMouseDown:function(e,t){if(t.className&&t.className.indexOf("x-grid3-cc-"+this.id)!=-1){e.stopEvent();var index=this.grid.getView().findRowIndex(t);var record=this.grid.store.getAt(index);var editEvent={grid:this.grid,record:this.grid.store.getAt(index),field:this.dataIndex,value:!record.data[this.dataIndex],originalValue:record.data[this.dataIndex],row:index,column:this.grid.getColumnModel().findColumnIndex(this.dataIndex)};record.set(this.dataIndex,editEvent.value);this.grid.getSelectionModel().selectRow(index);this.grid.fireEvent("afteredit",editEvent)}},renderer:function(v,p,record){p.css+=" x-grid3-check-col-td";return'<div class="x-grid3-check-col'+(v?"-on":"")+" x-grid3-cc-"+this.id+'">&#160;</div>'}};Ext.form.DateTimeField=Ext.extend(Ext.form.Field,{defaultAutoCreate:{tag:"input",type:"hidden"},timeWidth:100,dateWidth:100,dtSeparator:" ",hiddenFormat:"Y-m-d H:i:s",otherToNow:true,dateFormat:"d/m/y",timeFormat:"H:i",allowBlank:false,hideTime:false,initComponent:function(){Ext.form.DateTimeField.superclass.initComponent.call(this);var dateConfig=Ext.apply({},{id:this.id+"-date",format:this.dateFormat||Ext.form.DateField.prototype.format,width:this.dateWidth,allowBlank:this.allowBlank,selectOnFocus:this.selectOnFocus,listeners:{blur:{scope:this,fn:this.onBlur},focus:{scope:this,fn:this.onFocus}}},this.dateConfig);this.df=new Ext.form.DateField(dateConfig);this.df.ownerCt=this;delete (this.dateFormat);var timeConfig=Ext.apply({},{id:this.id+"-time",format:this.timeFormat||Ext.form.TimeField.prototype.format,allowBlank:this.allowBlank,width:this.timeWidth,selectOnFocus:this.selectOnFocus,listeners:{blur:{scope:this,fn:this.onBlur},focus:{scope:this,fn:this.onFocus}}},this.timeConfig);this.tf=new Ext.form.TimeField(timeConfig);this.tf.ownerCt=this;delete (this.timeFormat);this.relayEvents(this.df,["focus","specialkey","invalid","valid"]);this.relayEvents(this.tf,["focus","specialkey","invalid","valid"])},onRender:function(ct,position){if(this.isRendered){return}Ext.form.DateTimeField.superclass.onRender.call(this,ct,position);var t;var timeStyle=this.hideTime?"display:none":"";t=Ext.DomHelper.append(ct,{tag:"table",style:"border-collapse:collapse",children:[{tag:"tr",children:[{tag:"td",style:"padding-right:17px",cls:"datetime-date"},{tag:"td",cls:"datetime-time",style:timeStyle}]}]},true);this.tableEl=t;this.wrap=t.wrap();this.wrap.on("mousedown",this.onMouseDown,this,{delay:10});this.df.render(t.child("td.datetime-date"));this.tf.render(t.child("td.datetime-time"));this.df.wrap.setStyle({width:this.dateWidth});this.tf.wrap.setStyle({width:this.timeWidth});if(Ext.isIE&&Ext.isStrict){t.select("input").applyStyles({top:0})}this.on("specialkey",this.onSpecialKey,this);this.df.el.swallowEvent(["keydown","keypress"]);this.tf.el.swallowEvent(["keydown","keypress"]);if("side"===this.msgTarget){var elp=this.el.findParent(".x-form-element",10,true);this.errorIcon=elp.createChild({cls:"x-form-invalid-icon"});this.df.errorIcon=this.errorIcon;this.tf.errorIcon=this.errorIcon}if(!this.el.dom.name){this.el.dom.name=this.hiddenName||this.name||this.id}this.df.el.dom.removeAttribute("name");this.tf.el.dom.removeAttribute("name");this.isRendered=true;if(this.el.dom.value){this.setValue(this.el.dom.value)}else{this.setValue(new Date());this.updateHidden()}},adjustSize:Ext.BoxComponent.prototype.adjustSize,alignErrorIcon:function(){this.errorIcon.alignTo(this.tableEl,"tl-tr",[2,0])},initDateValue:function(){this.dateValue=this.otherToNow?new Date():new Date(1970,0,1,0,0,0)},clearInvalid:function(){this.df.clearInvalid();this.tf.clearInvalid()},beforeDestroy:function(){if(this.isRendered){this.wrap.removeAllListeners();this.wrap.remove();this.tableEl.remove();this.df.destroy();this.tf.destroy()}},disable:function(){if(this.isRendered){this.df.disabled=this.disabled;this.df.onDisable();this.tf.onDisable()}this.disabled=true;this.df.disabled=true;this.tf.disabled=true;this.fireEvent("disable",this);return this},enable:function(){if(this.rendered){this.df.onEnable();this.tf.onEnable()}this.disabled=false;this.df.disabled=false;this.tf.disabled=false;this.fireEvent("enable",this);return this},focus:function(){this.df.focus()},getPositionEl:function(){return this.wrap},getResizeEl:function(){return this.wrap},getValue:function(){return this.dateValue?new Date(this.dateValue):""},isValid:function(){return this.df.isValid()&&this.tf.isValid()},isVisible:function(){return this.df.rendered&&this.df.getActionEl().isVisible()},onBlur:function(f){if(this.wrapClick){f.focus();this.wrapClick=false}this.updateDate();this.updateTime();this.updateHidden();(function(){if(!this.df.hasFocus&&!this.tf.hasFocus){var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent("change",this,v,this.startValue)}this.hasFocus=false;this.fireEvent("blur",this)}}).defer(100,this)},onFocus:function(){if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this)}},onMouseDown:function(e){if(!this.disabled){this.wrapClick="td"===e.target.nodeName.toLowerCase()}},onSpecialKey:function(t,e){var key=e.getKey();if(key===e.TAB){if(t===this.df&&!e.shiftKey){e.stopEvent();this.tf.focus()}if(t===this.tf&&e.shiftKey){e.stopEvent();this.df.focus()}}if(key===e.ENTER){this.updateValue()}},setDate:function(date){this.df.setValue(date)},setTime:function(date){this.tf.setValue(date)},setSize:function(w,h){if(!w){return}if("below"===this.timePosition){this.df.setSize(w,h);this.tf.setSize(w,h);if(Ext.isIE){this.df.el.up("td").setWidth(w);this.tf.el.up("td").setWidth(w)}}else{this.df.setSize(w-this.timeWidth-4,h);this.tf.setSize(this.timeWidth,h);if(Ext.isIE){this.df.el.up("td").setWidth(w-this.timeWidth-4);this.tf.el.up("td").setWidth(this.timeWidth)}}},setValue:function(val){if(!val&&true===this.emptyToNow){this.setValue(new Date());return}else{if(!val){this.setDate("");this.setTime("");this.updateValue();return}}if("number"===typeof val){val=new Date(val)}val=val?val:new Date(1970,0,1,0,0,0);var da,time;if(val instanceof Date){this.setDate(val);this.setTime(val);this.dateValue=new Date(val)}else{da=val.split(this.dtSeparator);this.setDate(da[0]);if(da[1]){if(da[2]){da[1]+=da[2]}var hh=da[1].split(":");this.setTime(hh[0]+":"+hh[1])}}},setVisible:function(visible){if(visible){this.df.show();
76
+ this.tf.show()}else{this.df.hide();this.tf.hide()}return this},show:function(){return this.setVisible(true)},hide:function(){return this.setVisible(false)},updateDate:function(){var d=this.df.getValue();if(d){if(!(this.dateValue instanceof Date)){this.initDateValue();if(!this.tf.getValue()){this.setTime(this.dateValue)}}this.dateValue.setMonth(0);this.dateValue.setFullYear(d.getFullYear());this.dateValue.setMonth(d.getMonth());this.dateValue.setDate(d.getDate())}else{this.dateValue="";this.setTime("")}},updateTime:function(){var t=this.tf.getValue();if(t&&!(t instanceof Date)){t=Date.parseDate(t,this.tf.format)}if(t&&!this.df.getValue()){this.initDateValue();this.setDate(this.dateValue)}if(this.dateValue instanceof Date){if(t){this.dateValue.setHours(t.getHours());this.dateValue.setMinutes(t.getMinutes());this.dateValue.setSeconds(t.getSeconds())}else{this.dateValue.setHours(0);this.dateValue.setMinutes(0);this.dateValue.setSeconds(0)}}},updateHidden:function(){if(this.isRendered){var value=this.dateValue instanceof Date?this.dateValue.format(this.hiddenFormat):"";this.el.dom.value=value}},updateValue:function(){this.updateDate();this.updateTime();this.updateHidden();return},validate:function(){return this.df.validate()&&this.tf.validate()},renderer:function(field){var format=field.editor.dateFormat||Ext.form.DateTime.prototype.dateFormat;format+=" "+(field.editor.timeFormat||Ext.form.DateTime.prototype.timeFormat);var renderer=function(val){var retval=Ext.util.Format.date(val,format);return retval};return renderer}});Ext.reg("datetimefield",Ext.form.DateTimeField);Ext.grid.Search=function(config){Ext.apply(this,config);Ext.grid.Search.superclass.constructor.call(this)};Ext.extend(Ext.grid.Search,Ext.util.Observable,{autoFocus:true,searchText:"Search",searchTipText:"Insert a word or press Search",selectAllText:"Select All",position:"top",iconCls:"check",checkIndexes:"all",disableIndexes:[],dateFormat:undefined,showSelectAll:true,menuStyle:"checkbox",minCharsTipText:"Insert at least {0} characters",mode:"remote",width:200,xtype:"gridsearch",paramNames:{fields:"fields",query:"query"},shortcutKey:"r",shortcutModifier:"alt",align:"right",minLength:3,init:function(grid){this.grid=grid;if("string"===typeof this.toolbarContainer){this.toolbarContainer=Ext.getCmp(this.toolbarContainer)}grid.onRender=grid.onRender.createSequence(this.onRender,this);grid.reconfigure=grid.reconfigure.createSequence(this.reconfigure,this)},onRender:function(){var panel=this.toolbarContainer||this.grid;var tb="bottom"===this.position?panel.bottomToolbar:panel.topToolbar;this.menu=new Ext.menu.Menu();if("right"===this.align){tb.addFill()}else{if(0<tb.items.getCount()){tb.addSeparator()}}tb.add({text:this.searchText,menu:this.menu});this.field=new Ext.form.TwinTriggerField({width:this.width,selectOnFocus:undefined===this.selectOnFocus?true:this.selectOnFocus,trigger1Class:"x-form-clear-trigger",trigger2Class:this.minChars?"x-hidden":"x-form-search-trigger",onTrigger1Click:this.minChars?Ext.emptyFn:this.onTriggerClear.createDelegate(this),onTrigger2Click:this.onTriggerSearch.createDelegate(this),minLength:this.minLength});this.field.on("render",function(){this.field.el.dom.qtip=this.minChars?String.format(this.minCharsTipText,this.minChars):this.searchTipText;if(this.minChars){this.field.el.on({scope:this,buffer:300,keyup:this.onKeyUp})}var map=new Ext.KeyMap(this.field.el,[{key:Ext.EventObject.ENTER,scope:this,fn:this.onTriggerSearch},{key:Ext.EventObject.ESC,scope:this,fn:this.onTriggerClear}]);map.stopEvent=true},this,{single:true});tb.add(this.field);this.reconfigure();if(this.shortcutKey&&this.shortcutModifier){var shortcutEl=this.grid.getEl();var shortcutCfg=[{key:this.shortcutKey,scope:this,stopEvent:true,fn:function(){this.field.focus()}}];shortcutCfg[0][this.shortcutModifier]=true;this.keymap=new Ext.KeyMap(shortcutEl,shortcutCfg)}if(true===this.autoFocus){this.grid.store.on({scope:this,load:function(){this.field.focus()}})}},onKeyUp:function(){var length=this.field.getValue().toString().length;if(0===length||this.minChars<=length){this.onTriggerSearch()}},onTriggerClear:function(){if(this.field.getValue()){this.field.setValue("");this.field.focus();this.onTriggerSearch()}},onTriggerSearch:function(){if(!this.field.isValid()){return}var val=this.field.getValue();var store=this.grid.store;if("local"===this.mode){store.clearFilter();if(val){store.filterBy(function(r){var retval=false;this.menu.items.each(function(item){if(!item.checked||retval){return}var rv=r.get(item.dataIndex);rv=rv instanceof Date?rv.format(this.dateFormat||r.fields.get(item.dataIndex).dateFormat):rv;var re=new RegExp(val,"gi");retval=re.test(rv)},this);if(retval){return true}return retval},this)}else{}}else{if(store.lastOptions&&store.lastOptions.params){store.lastOptions.params[store.paramNames.start]=0}var fields=[];this.menu.items.each(function(item){if(item.checked&&item.dataIndex){fields.push(item.dataIndex)}});delete (store.baseParams[this.paramNames.fields]);delete (store.baseParams[this.paramNames.query]);if(store.lastOptions&&store.lastOptions.params){delete (store.lastOptions.params[this.paramNames.fields]);delete (store.lastOptions.params[this.paramNames.query])}if(fields.length){store.baseParams[this.paramNames.fields]=fields.compact().join();store.baseParams[this.paramNames.query]=val}store.reload()}},setDisabled:function(){this.field.setDisabled.apply(this.field,arguments)},enable:function(){this.setDisabled(false)},disable:function(){this.setDisabled(true)},reconfigure:function(){var menu=this.menu;menu.removeAll();if(this.showSelectAll&&"radio"!==this.menuStyle){menu.add(new Ext.menu.CheckItem({text:this.selectAllText,checked:!(this.checkIndexes instanceof Array),hideOnClick:false,handler:function(item){var checked=!item.checked;item.parentMenu.items.each(function(i){if(item!==i&&i.setChecked&&!i.disabled){i.setChecked(checked)}})}}),"-")}var cm=this.grid.colModel;var group=undefined;if("radio"===this.menuStyle){group="g"+(new Date).getTime()}Ext.each(cm.config,function(config){var disable=false;if(config.header&&config.dataIndex&&config.sortable){Ext.each(this.disableIndexes,function(item){disable=disable?disable:item===config.dataIndex});if(!disable){menu.add(new Ext.menu.CheckItem({text:config.header,hideOnClick:false,group:group,checked:"all"===this.checkIndexes,dataIndex:config.dataIndex}))}}},this);if(this.checkIndexes instanceof Array){Ext.each(this.checkIndexes,function(di){var item=menu.items.find(function(itm){return itm.dataIndex===di});if(item){item.setChecked(true,true)}},this)}if(this.readonlyIndexes instanceof Array){Ext.each(this.readonlyIndexes,function(di){var item=menu.items.find(function(itm){return itm.dataIndex===di});if(item){item.disable()}},this)}}});
@@ -0,0 +1,12 @@
1
+ var Prototype={Version:"1.6.0.3",Browser:{IE:!!(window.attachEvent&&navigator.userAgent.indexOf("Opera")===-1),Opera:navigator.userAgent.indexOf("Opera")>-1,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")===-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div")["__proto__"]&&document.createElement("div")["__proto__"]!==document.createElement("form")["__proto__"]},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(x){return x}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class={create:function(){var parent=null,properties=$A(arguments);if(Object.isFunction(properties[0])){parent=properties.shift()}function klass(){this.initialize.apply(this,arguments)}Object.extend(klass,Class.Methods);klass.superclass=parent;klass.subclasses=[];if(parent){var subclass=function(){};subclass.prototype=parent.prototype;klass.prototype=new subclass;parent.subclasses.push(klass)}for(var i=0;i<properties.length;i++){klass.addMethods(properties[i])}if(!klass.prototype.initialize){klass.prototype.initialize=Prototype.emptyFunction}klass.prototype.constructor=klass;return klass}};Class.Methods={addMethods:function(source){var ancestor=this.superclass&&this.superclass.prototype;var properties=Object.keys(source);if(!Object.keys({toString:true}).length){properties.push("toString","valueOf")}for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&Object.isFunction(value)&&value.argumentNames().first()=="$super"){var method=value;value=(function(m){return function(){return ancestor[m].apply(this,arguments)}})(property).wrap(method);value.valueOf=method.valueOf.bind(method);value.toString=method.toString.bind(method)}this.prototype[property]=value}return this}};var Abstract={};Object.extend=function(destination,source){for(var property in source){destination[property]=source[property]}return destination};Object.extend(Object,{inspect:function(object){try{if(Object.isUndefined(object)){return"undefined"}if(object===null){return"null"}return object.inspect?object.inspect():String(object)}catch(e){if(e instanceof RangeError){return"..."}throw e}},toJSON:function(object){var type=typeof object;switch(type){case"undefined":case"function":case"unknown":return;case"boolean":return object.toString()}if(object===null){return"null"}if(object.toJSON){return object.toJSON()}if(Object.isElement(object)){return}var results=[];for(var property in object){var value=Object.toJSON(object[property]);if(!Object.isUndefined(value)){results.push(property.toJSON()+": "+value)}}return"{"+results.join(", ")+"}"},toQueryString:function(object){return $H(object).toQueryString()},toHTML:function(object){return object&&object.toHTML?object.toHTML():String.interpret(object)},keys:function(object){var keys=[];for(var property in object){keys.push(property)}return keys},values:function(object){var values=[];for(var property in object){values.push(object[property])}return values},clone:function(object){return Object.extend({},object)},isElement:function(object){return !!(object&&object.nodeType==1)},isArray:function(object){return object!=null&&typeof object=="object"&&"splice" in object&&"join" in object},isHash:function(object){return object instanceof Hash},isFunction:function(object){return typeof object=="function"},isString:function(object){return typeof object=="string"},isNumber:function(object){return typeof object=="number"},isUndefined:function(object){return typeof object=="undefined"}});Object.extend(Function.prototype,{argumentNames:function(){var names=this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1].replace(/\s+/g,"").split(",");return names.length==1&&!names[0]?[]:names},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)))}},bindAsEventListener:function(){var __method=this,args=$A(arguments),object=args.shift();return function(event){return __method.apply(object,[event||window.event].concat(args))}},curry:function(){if(!arguments.length){return this}var __method=this,args=$A(arguments);return function(){return __method.apply(this,args.concat($A(arguments)))}},delay:function(){var __method=this,args=$A(arguments),timeout=args.shift()*1000;return window.setTimeout(function(){return __method.apply(__method,args)},timeout)},defer:function(){var args=[0.01].concat($A(arguments));return this.delay.apply(this,args)},wrap:function(wrapper){var __method=this;return function(){return wrapper.apply(this,[__method.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized){return this._methodized}var __method=this;return this._methodized=function(){return __method.apply(null,[this].concat($A(arguments)))}}});Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};var Try={these:function(){var returnValue;for(var i=0,length=arguments.length;i<length;i++){var lambda=arguments[i];try{returnValue=lambda();break}catch(e){}}return returnValue}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(str){return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(callback,frequency){this.callback=callback;this.frequency=frequency;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute()}finally{this.currentlyExecuting=false}}}});Object.extend(String,{interpret:function(value){return value==null?"":String(value)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(pattern,replacement){var result="",source=this,match;replacement=arguments.callee.prepareReplacement(replacement);while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result},sub:function(pattern,replacement,count){replacement=this.gsub.prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})},scan:function(pattern,iterator){this.gsub(pattern,iterator);return String(this)},truncate:function(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var matchAll=new RegExp(Prototype.ScriptFragment,"img");var matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var self=arguments.callee;
2
+ self.text.data=this;return self.div.innerHTML},unescapeHTML:function(){var div=new Element("div");div.innerHTML=this.stripTags();return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(memo,node){return memo+node.nodeValue}):div.childNodes[0].nodeValue):""},toQueryParams:function(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(count){return count<1?"":new Array(count+1).join(this)},camelize:function(){var parts=this.split("-"),len=parts.length;if(len==1){return parts[0]}var camelized=this.charAt(0)=="-"?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1)}return camelized},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(useDoubleQuotes){var escapedString=this.gsub(/[\x00-\x1f\\]/,function(match){var character=String.specialChar[match[0]];return character?character:"\\u00"+match[0].charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(filter){return this.sub(filter||Prototype.JSONFilter,"#{1}")},isJSON:function(){var str=this;if(str.blank()){return false}str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(pattern){return this.indexOf(pattern)>-1},startsWith:function(pattern){return this.indexOf(pattern)===0},endsWith:function(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(object,pattern){return new Template(this,pattern).evaluate(object)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.stripTags().replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}})}String.prototype.gsub.prepareReplacement=function(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);return function(match){return template.evaluate(match)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text);var Template=Class.create({initialize:function(template,pattern){this.template=template.toString();this.pattern=pattern||Template.Pattern},evaluate:function(object){if(Object.isFunction(object.toTemplateReplacements)){object=object.toTemplateReplacements()}return this.template.gsub(this.pattern,function(match){if(object==null){return""}var before=match[1]||"";if(before=="\\"){return match[2]}var ctx=object,expr=match[3];var pattern=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;match=pattern.exec(expr);if(match==null){return before}while(match!=null){var comp=match[1].startsWith("[")?match[2].gsub("\\\\]","]"):match[1];ctx=ctx[comp];if(null==ctx||""==match[3]){break}expr=expr.substring("["==match[3]?match[1].length:match[0].length);match=pattern.exec(expr)}return before+String.interpret(ctx)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(iterator,context){var index=0;try{this._each(function(value){iterator.call(context,value,index++)})}catch(e){if(e!=$break){throw e}}return this},eachSlice:function(number,iterator,context){var index=-number,slices=[],array=this.toArray();if(number<1){return array}while((index+=number)<array.length){slices.push(array.slice(index,index+number))}return slices.collect(iterator,context)},all:function(iterator,context){iterator=iterator||Prototype.K;var result=true;this.each(function(value,index){result=result&&!!iterator.call(context,value,index);if(!result){throw $break}});return result},any:function(iterator,context){iterator=iterator||Prototype.K;var result=false;this.each(function(value,index){if(result=!!iterator.call(context,value,index)){throw $break}});return result},collect:function(iterator,context){iterator=iterator||Prototype.K;var results=[];this.each(function(value,index){results.push(iterator.call(context,value,index))});return results},detect:function(iterator,context){var result;this.each(function(value,index){if(iterator.call(context,value,index)){result=value;throw $break}});return result},findAll:function(iterator,context){var results=[];this.each(function(value,index){if(iterator.call(context,value,index)){results.push(value)}});return results},grep:function(filter,iterator,context){iterator=iterator||Prototype.K;var results=[];if(Object.isString(filter)){filter=new RegExp(filter)}this.each(function(value,index){if(filter.match(value)){results.push(iterator.call(context,value,index))}});return results},include:function(object){if(Object.isFunction(this.indexOf)){if(this.indexOf(object)!=-1){return true}}var found=false;this.each(function(value){if(value==object){found=true;throw $break}});return found},inGroupsOf:function(number,fillWith){fillWith=Object.isUndefined(fillWith)?null:fillWith;return this.eachSlice(number,function(slice){while(slice.length<number){slice.push(fillWith)}return slice})},inject:function(memo,iterator,context){this.each(function(value,index){memo=iterator.call(context,memo,value,index)});return memo},invoke:function(method){var args=$A(arguments).slice(1);return this.map(function(value){return value[method].apply(value,args)})},max:function(iterator,context){iterator=iterator||Prototype.K;var result;this.each(function(value,index){value=iterator.call(context,value,index);if(result==null||value>=result){result=value}});return result},min:function(iterator,context){iterator=iterator||Prototype.K;var result;this.each(function(value,index){value=iterator.call(context,value,index);if(result==null||value<result){result=value}});return result},partition:function(iterator,context){iterator=iterator||Prototype.K;var trues=[],falses=[];this.each(function(value,index){(iterator.call(context,value,index)?trues:falses).push(value)});return[trues,falses]},pluck:function(property){var results=[];this.each(function(value){results.push(value[property])});return results},reject:function(iterator,context){var results=[];this.each(function(value,index){if(!iterator.call(context,value,index)){results.push(value)}});return results},sortBy:function(iterator,context){return this.map(function(value,index){return{value:value,criteria:iterator.call(context,value,index)}}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var iterator=Prototype.K,args=$A(arguments);if(Object.isFunction(args.last())){iterator=args.pop()}var collections=[this].concat(args).map($A);return this.map(function(value,index){return iterator(collections.pluck(index))
3
+ })},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(iterable){if(!iterable){return[]}if(iterable.toArray){return iterable.toArray()}var length=iterable.length||0,results=new Array(length);while(length--){results[length]=iterable[length]}return results}if(Prototype.Browser.WebKit){$A=function(iterable){if(!iterable){return[]}if(!(typeof iterable==="function"&&typeof iterable.length==="number"&&typeof iterable.item==="function")&&iterable.toArray){return iterable.toArray()}var length=iterable.length||0,results=new Array(length);while(length--){results[length]=iterable[length]}return results}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(iterator){for(var i=0,length=this.length;i<length;i++){iterator(this[i])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(value){return value!=null})},flatten:function(){return this.inject([],function(array,value){return array.concat(Object.isArray(value)?value.flatten():[value])})},without:function(){var values=$A(arguments);return this.select(function(value){return !values.include(value)})},reverse:function(inline){return(inline!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(sorted){return this.inject([],function(array,value,index){if(0==index||(sorted?array.last()!=value:!array.include(value))){array.push(value)}return array})},intersect:function(array){return this.uniq().findAll(function(item){return array.detect(function(value){return item===value})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"},toJSON:function(){var results=[];this.each(function(object){var value=Object.toJSON(object);if(!Object.isUndefined(value)){results.push(value)}});return"["+results.join(", ")+"]"}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(item,i){i||(i=0);var length=this.length;if(i<0){i=length+i}for(;i<length;i++){if(this[i]===item){return i}}return -1}}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(item,i){i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;var n=this.slice(0,i).reverse().indexOf(item);return(n<0)?n:i-n-1}}Array.prototype.toArray=Array.prototype.clone;function $w(string){if(!Object.isString(string)){return[]}string=string.strip();return string?string.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var array=[];for(var i=0,length=this.length;i<length;i++){array.push(this[i])}for(var i=0,length=arguments.length;i<length;i++){if(Object.isArray(arguments[i])){for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++){array.push(arguments[i][j])}}else{array.push(arguments[i])}}return array}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(iterator,context){$R(0,this,true).each(iterator,context);return this},toPaddedString:function(length,radix){var string=this.toString(radix||10);return"0".times(length-string.length)+string},toJSON:function(){return isFinite(this)?this.toString():"null"}});$w("abs round ceil floor").each(function(method){Number.prototype[method]=Math[method].methodize()});function $H(object){return new Hash(object)}var Hash=Class.create(Enumerable,(function(){function toQueryPair(key,value){if(Object.isUndefined(value)){return key}return key+"="+encodeURIComponent(String.interpret(value))}return{initialize:function(object){this._object=Object.isHash(object)?object.toObject():Object.clone(object)},_each:function(iterator){for(var key in this._object){var value=this._object[key],pair=[key,value];pair.key=key;pair.value=value;iterator(pair)}},set:function(key,value){return this._object[key]=value},get:function(key){if(this._object[key]!==Object.prototype[key]){return this._object[key]}},unset:function(key){var value=this._object[key];delete this._object[key];return value},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(value){var match=this.detect(function(pair){return pair.value===value});return match&&match.key},merge:function(object){return this.clone().update(object)},update:function(object){return new Hash(object).inject(this,function(result,pair){result.set(pair.key,pair.value);return result})},toQueryString:function(){return this.inject([],function(results,pair){var key=encodeURIComponent(pair.key),values=pair.value;if(values&&typeof values=="object"){if(Object.isArray(values)){return results.concat(values.map(toQueryPair.curry(key)))}}else{results.push(toQueryPair(key,values))}return results}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(pair){return pair.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive},_each:function(iterator){var value=this.start;while(this.include(value)){iterator(value);value=value.succ()}},include:function(value){if(value<this.start){return false}if(this.exclusive){return value<this.end}return value<=this.end}});var $R=function(start,end,exclusive){return new ObjectRange(start,end,exclusive)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(iterator){this.responders._each(iterator)},register:function(responder){if(!this.include(responder)){this.responders.push(responder)}},unregister:function(responder){this.responders=this.responders.without(responder)},dispatch:function(callback,request,transport,json){this.each(function(responder){if(Object.isFunction(responder[callback])){try{responder[callback].apply(responder,[request,transport,json])}catch(e){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(options){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,options||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,url,options){$super(options);this.transport=Ajax.getTransport();this.request(url)},request:function(url){this.url=url;this.method=this.options.method;var params=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){params._method=this.method;this.method="post"}this.parameters=params;if(params=Object.toQueryString(params)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+params}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){params+="&_="
4
+ }}}try{var response=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(response)}Ajax.Responders.dispatch("onCreate",this,response);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||params):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(e){this.dispatchException(e)}},onStateChange:function(){var readyState=this.transport.readyState;if(readyState>1&&!((readyState==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var headers={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){headers["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){headers.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var extras=this.options.requestHeaders;if(Object.isFunction(extras.push)){for(var i=0,length=extras.length;i<length;i+=2){headers[extras[i]]=extras[i+1]}}else{$H(extras).each(function(pair){headers[pair.key]=pair.value})}}for(var name in headers){this.transport.setRequestHeader(name,headers[name])}},success:function(){var status=this.getStatus();return !status||(status>=200&&status<300)},getStatus:function(){try{return this.transport.status||0}catch(e){return 0}},respondToReadyState:function(readyState){var state=Ajax.Request.Events[readyState],response=new Ajax.Response(this);if(state=="Complete"){try{this._complete=true;(this.options["on"+response.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(response,response.headerJSON)}catch(e){this.dispatchException(e)}var contentType=response.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&contentType&&contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+state]||Prototype.emptyFunction)(response,response.headerJSON);Ajax.Responders.dispatch("on"+state,this,response,response.headerJSON)}catch(e){this.dispatchException(e)}if(state=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var m=this.url.match(/^\s*https?:\/\/[^\/]*/);return !m||(m[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(name){try{return this.transport.getResponseHeader(name)||null}catch(e){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(exception){(this.options.onException||Prototype.emptyFunction)(this,exception);Ajax.Responders.dispatch("onException",this,exception)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(request){this.request=request;var transport=this.transport=request.transport,readyState=this.readyState=transport.readyState;if((readyState>2&&!Prototype.Browser.IE)||readyState==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(transport.responseText);this.headerJSON=this._getHeaderJSON()}if(readyState==4){var xml=transport.responseXML;this.responseXML=Object.isUndefined(xml)?null:xml;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(e){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(e){return null}},getResponseHeader:function(name){return this.transport.getResponseHeader(name)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var json=this.getHeader("X-JSON");if(!json){return null}json=decodeURIComponent(escape(json));try{return json.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(e){this.request.dispatchException(e)}},_getResponseJSON:function(){var options=this.request.options;if(!options.evalJSON||(options.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(options.sanitizeJSON||!this.request.isSameOrigin())}catch(e){this.request.dispatchException(e)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,container,url,options){this.container={success:(container.success||container),failure:(container.failure||(container.success?null:container))};options=Object.clone(options);var onComplete=options.onComplete;options.onComplete=(function(response,json){this.updateContent(response.responseText);if(Object.isFunction(onComplete)){onComplete(response,json)}}).bind(this);$super(url,options)},updateContent:function(responseText){var receiver=this.container[this.success()?"success":"failure"],options=this.options;if(!options.evalScripts){responseText=responseText.stripScripts()}if(receiver=$(receiver)){if(options.insertion){if(Object.isString(options.insertion)){var insertion={};insertion[options.insertion]=responseText;receiver.insert(insertion)}else{options.insertion(receiver,responseText)}}else{receiver.update(responseText)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,container,url,options){$super(options);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=container;this.url=url;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(response){if(this.options.decay){this.decay=(response.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=response.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(element){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++){elements.push($(arguments[i]))}return elements}if(Object.isString(element)){element=document.getElementById(element)}return Element.extend(element)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(expression,parentElement){var results=[];var query=document.evaluate(expression,$(parentElement)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,length=query.snapshotLength;i<length;i++){results.push(Element.extend(query.snapshotItem(i)))}return results}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(){var element=this.Element;this.Element=function(tagName,attributes){attributes=attributes||{};tagName=tagName.toLowerCase();var cache=Element.cache;if(Prototype.Browser.IE&&attributes.name){tagName="<"+tagName+' name="'+attributes.name+'">';delete attributes.name;return Element.writeAttribute(document.createElement(tagName),attributes)}if(!cache[tagName]){cache[tagName]=Element.extend(document.createElement(tagName))
5
+ }return Element.writeAttribute(cache[tagName].cloneNode(false),attributes)};Object.extend(this.Element,element||{});if(element){this.Element.prototype=element.prototype}}).call(window);Element.cache={};Element.Methods={visible:function(element){return $(element).style.display!="none"},toggle:function(element){element=$(element);Element[Element.visible(element)?"hide":"show"](element);return element},hide:function(element){element=$(element);element.style.display="none";return element},show:function(element){element=$(element);element.style.display="";return element},remove:function(element){element=$(element);element.parentNode.removeChild(element);return element},update:function(element,content){element=$(element);if(content&&content.toElement){content=content.toElement()}if(Object.isElement(content)){return element.update().insert(content)}content=Object.toHTML(content);element.innerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element},replace:function(element,content){element=$(element);if(content&&content.toElement){content=content.toElement()}else{if(!Object.isElement(content)){content=Object.toHTML(content);var range=element.ownerDocument.createRange();range.selectNode(element);content.evalScripts.bind(content).defer();content=range.createContextualFragment(content.stripScripts())}}element.parentNode.replaceChild(content,element);return element},insert:function(element,insertions){element=$(element);if(Object.isString(insertions)||Object.isNumber(insertions)||Object.isElement(insertions)||(insertions&&(insertions.toElement||insertions.toHTML))){insertions={bottom:insertions}}var content,insert,tagName,childNodes;for(var position in insertions){content=insertions[position];position=position.toLowerCase();insert=Element._insertionTranslations[position];if(content&&content.toElement){content=content.toElement()}if(Object.isElement(content)){insert(element,content);continue}content=Object.toHTML(content);tagName=((position=="before"||position=="after")?element.parentNode:element).tagName.toUpperCase();childNodes=Element._getContentFromAnonymousElement(tagName,content.stripScripts());if(position=="top"||position=="after"){childNodes.reverse()}childNodes.each(insert.curry(element));content.evalScripts.bind(content).defer()}return element},wrap:function(element,wrapper,attributes){element=$(element);if(Object.isElement(wrapper)){$(wrapper).writeAttribute(attributes||{})}else{if(Object.isString(wrapper)){wrapper=new Element(wrapper,attributes)}else{wrapper=new Element("div",wrapper)}}if(element.parentNode){element.parentNode.replaceChild(wrapper,element)}wrapper.appendChild(element);return wrapper},inspect:function(element){element=$(element);var result="<"+element.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(pair){var property=pair.first(),attribute=pair.last();var value=(element[property]||"").toString();if(value){result+=" "+attribute+"="+value.inspect(true)}});return result+">"},recursivelyCollect:function(element,property){element=$(element);var elements=[];while(element=element[property]){if(element.nodeType==1){elements.push(Element.extend(element))}}return elements},ancestors:function(element){return $(element).recursivelyCollect("parentNode")},descendants:function(element){return $(element).select("*")},firstDescendant:function(element){element=$(element).firstChild;while(element&&element.nodeType!=1){element=element.nextSibling}return $(element)},immediateDescendants:function(element){if(!(element=$(element).firstChild)){return[]}while(element&&element.nodeType!=1){element=element.nextSibling}if(element){return[element].concat($(element).nextSiblings())}return[]},previousSiblings:function(element){return $(element).recursivelyCollect("previousSibling")},nextSiblings:function(element){return $(element).recursivelyCollect("nextSibling")},siblings:function(element){element=$(element);return element.previousSiblings().reverse().concat(element.nextSiblings())},match:function(element,selector){if(Object.isString(selector)){selector=new Selector(selector)}return selector.match($(element))},up:function(element,expression,index){element=$(element);if(arguments.length==1){return $(element.parentNode)}var ancestors=element.ancestors();return Object.isNumber(expression)?ancestors[expression]:Selector.findElement(ancestors,expression,index)},down:function(element,expression,index){element=$(element);if(arguments.length==1){return element.firstDescendant()}return Object.isNumber(expression)?element.descendants()[expression]:Element.select(element,expression)[index||0]},previous:function(element,expression,index){element=$(element);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(element))}var previousSiblings=element.previousSiblings();return Object.isNumber(expression)?previousSiblings[expression]:Selector.findElement(previousSiblings,expression,index)},next:function(element,expression,index){element=$(element);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(element))}var nextSiblings=element.nextSiblings();return Object.isNumber(expression)?nextSiblings[expression]:Selector.findElement(nextSiblings,expression,index)},select:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element,args)},adjacent:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element.parentNode,args).without(element)},identify:function(element){element=$(element);var id=element.readAttribute("id"),self=arguments.callee;if(id){return id}do{id="anonymous_element_"+self.counter++}while($(id));element.writeAttribute("id",id);return id},readAttribute:function(element,name){element=$(element);if(Prototype.Browser.IE){var t=Element._attributeTranslations.read;if(t.values[name]){return t.values[name](element,name)}if(t.names[name]){name=t.names[name]}if(name.include(":")){return(!element.attributes||!element.attributes[name])?null:element.attributes[name].value}}return element.getAttribute(name)},writeAttribute:function(element,name,value){element=$(element);var attributes={},t=Element._attributeTranslations.write;if(typeof name=="object"){attributes=name}else{attributes[name]=Object.isUndefined(value)?true:value}for(var attr in attributes){name=t.names[attr]||attr;value=attributes[attr];if(t.values[attr]){name=t.values[attr](element,value)}if(value===false||value===null){element.removeAttribute(name)}else{if(value===true){element.setAttribute(name,name)}else{element.setAttribute(name,value)}}}return element},getHeight:function(element){return $(element).getDimensions().height},getWidth:function(element){return $(element).getDimensions().width},classNames:function(element){return new Element.ClassNames(element)},hasClassName:function(element,className){if(!(element=$(element))){return}var elementClassName=element.className;return(elementClassName.length>0&&(elementClassName==className||new RegExp("(^|\\s)"+className+"(\\s|$)").test(elementClassName)))},addClassName:function(element,className){if(!(element=$(element))){return}if(!element.hasClassName(className)){element.className+=(element.className?" ":"")+className}return element},removeClassName:function(element,className){if(!(element=$(element))){return}element.className=element.className.replace(new RegExp("(^|\\s+)"+className+"(\\s+|$)")," ").strip();return element},toggleClassName:function(element,className){if(!(element=$(element))){return}return element[element.hasClassName(className)?"removeClassName":"addClassName"](className)},cleanWhitespace:function(element){element=$(element);var node=element.firstChild;while(node){var nextNode=node.nextSibling;if(node.nodeType==3&&!/\S/.test(node.nodeValue)){element.removeChild(node)}node=nextNode}return element},empty:function(element){return $(element).innerHTML.blank()},descendantOf:function(element,ancestor){element=$(element),ancestor=$(ancestor);if(element.compareDocumentPosition){return(element.compareDocumentPosition(ancestor)&8)===8
6
+ }if(ancestor.contains){return ancestor.contains(element)&&ancestor!==element}while(element=element.parentNode){if(element==ancestor){return true}}return false},scrollTo:function(element){element=$(element);var pos=element.cumulativeOffset();window.scrollTo(pos[0],pos[1]);return element},getStyle:function(element,style){element=$(element);style=style=="float"?"cssFloat":style.camelize();var value=element.style[style];if(!value||value=="auto"){var css=document.defaultView.getComputedStyle(element,null);value=css?css[style]:null}if(style=="opacity"){return value?parseFloat(value):1}return value=="auto"?null:value},getOpacity:function(element){return $(element).getStyle("opacity")},setStyle:function(element,styles){element=$(element);var elementStyle=element.style,match;if(Object.isString(styles)){element.style.cssText+=";"+styles;return styles.include("opacity")?element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]):element}for(var property in styles){if(property=="opacity"){element.setOpacity(styles[property])}else{elementStyle[(property=="float"||property=="cssFloat")?(Object.isUndefined(elementStyle.styleFloat)?"cssFloat":"styleFloat"):property]=styles[property]}}return element},setOpacity:function(element,value){element=$(element);element.style.opacity=(value==1||value==="")?"":(value<0.00001)?0:value;return element},getDimensions:function(element){element=$(element);var display=element.getStyle("display");if(display!="none"&&display!=null){return{width:element.offsetWidth,height:element.offsetHeight}}var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;var originalDisplay=els.display;els.visibility="hidden";els.position="absolute";els.display="block";var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display=originalDisplay;els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight}},makePositioned:function(element){element=$(element);var pos=Element.getStyle(element,"position");if(pos=="static"||!pos){element._madePositioned=true;element.style.position="relative";if(Prototype.Browser.Opera){element.style.top=0;element.style.left=0}}return element},undoPositioned:function(element){element=$(element);if(element._madePositioned){element._madePositioned=undefined;element.style.position=element.style.top=element.style.left=element.style.bottom=element.style.right=""}return element},makeClipping:function(element){element=$(element);if(element._overflow){return element}element._overflow=Element.getStyle(element,"overflow")||"auto";if(element._overflow!=="hidden"){element.style.overflow="hidden"}return element},undoClipping:function(element){element=$(element);if(!element._overflow){return element}element.style.overflow=element._overflow=="auto"?"":element._overflow;element._overflow=null;return element},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent}while(element);return Element._returnOffset(valueL,valueT)},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;if(element){if(element.tagName.toUpperCase()=="BODY"){break}var p=Element.getStyle(element,"position");if(p!=="static"){break}}}while(element);return Element._returnOffset(valueL,valueT)},absolutize:function(element){element=$(element);if(element.getStyle("position")=="absolute"){return element}var offsets=element.positionedOffset();var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left-parseFloat(element.style.left||0);element._originalTop=top-parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position="absolute";element.style.top=top+"px";element.style.left=left+"px";element.style.width=width+"px";element.style.height=height+"px";return element},relativize:function(element){element=$(element);if(element.getStyle("position")=="relative"){return element}element.style.position="relative";var top=parseFloat(element.style.top||0)-(element._originalTop||0);var left=parseFloat(element.style.left||0)-(element._originalLeft||0);element.style.top=top+"px";element.style.left=left+"px";element.style.height=element._originalHeight;element.style.width=element._originalWidth;return element},cumulativeScrollOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode}while(element);return Element._returnOffset(valueL,valueT)},getOffsetParent:function(element){if(element.offsetParent){return $(element.offsetParent)}if(element==document.body){return $(element)}while((element=element.parentNode)&&element!=document.body){if(Element.getStyle(element,"position")!="static"){return $(element)}}return $(document.body)},viewportOffset:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body&&Element.getStyle(element,"position")=="absolute"){break}}while(element=element.offsetParent);element=forElement;do{if(!Prototype.Browser.Opera||(element.tagName&&(element.tagName.toUpperCase()=="BODY"))){valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0}}while(element=element.parentNode);return Element._returnOffset(valueL,valueT)},clonePosition:function(element,source){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});source=$(source);var p=source.viewportOffset();element=$(element);var delta=[0,0];var parent=null;if(Element.getStyle(element,"position")=="absolute"){parent=element.getOffsetParent();delta=parent.viewportOffset()}if(parent==document.body){delta[0]-=document.body.offsetLeft;delta[1]-=document.body.offsetTop}if(options.setLeft){element.style.left=(p[0]-delta[0]+options.offsetLeft)+"px"}if(options.setTop){element.style.top=(p[1]-delta[1]+options.offsetTop)+"px"}if(options.setWidth){element.style.width=source.offsetWidth+"px"}if(options.setHeight){element.style.height=source.offsetHeight+"px"}return element}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(proceed,element,style){switch(style){case"left":case"top":case"right":case"bottom":if(proceed(element,"position")==="static"){return null}case"height":case"width":if(!Element.visible(element)){return null}var dim=parseInt(proceed(element,style),10);if(dim!==element["offset"+style.capitalize()]){return dim+"px"}var properties;if(style==="height"){properties=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{properties=["border-left-width","padding-left","padding-right","border-right-width"]}return properties.inject(dim,function(memo,property){var val=proceed(element,property);return val===null?memo:memo-parseInt(val,10)})+"px";default:return proceed(element,style)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(proceed,element,attribute){if(attribute==="title"){return element.title}return proceed(element,attribute)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(proceed,element){element=$(element);try{element.offsetParent}catch(e){return $(document.body)}var position=element.getStyle("position");if(position!=="static"){return proceed(element)}element.setStyle({position:"relative"});var value=proceed(element);element.setStyle({position:position});return value});$w("positionedOffset viewportOffset").each(function(method){Element.Methods[method]=Element.Methods[method].wrap(function(proceed,element){element=$(element);
7
+ try{element.offsetParent}catch(e){return Element._returnOffset(0,0)}var position=element.getStyle("position");if(position!=="static"){return proceed(element)}var offsetParent=element.getOffsetParent();if(offsetParent&&offsetParent.getStyle("position")==="fixed"){offsetParent.setStyle({zoom:1})}element.setStyle({position:"relative"});var value=proceed(element);element.setStyle({position:position});return value})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(proceed,element){try{element.offsetParent}catch(e){return Element._returnOffset(0,0)}return proceed(element)});Element.Methods.getStyle=function(element,style){element=$(element);style=(style=="float"||style=="cssFloat")?"styleFloat":style.camelize();var value=element.style[style];if(!value&&element.currentStyle){value=element.currentStyle[style]}if(style=="opacity"){if(value=(element.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(value[1]){return parseFloat(value[1])/100}}return 1}if(value=="auto"){if((style=="width"||style=="height")&&(element.getStyle("display")!="none")){return element["offset"+style.capitalize()]+"px"}return null}return value};Element.Methods.setOpacity=function(element,value){function stripAlpha(filter){return filter.replace(/alpha\([^\)]*\)/gi,"")}element=$(element);var currentStyle=element.currentStyle;if((currentStyle&&!currentStyle.hasLayout)||(!currentStyle&&element.style.zoom=="normal")){element.style.zoom=1}var filter=element.getStyle("filter"),style=element.style;if(value==1||value===""){(filter=stripAlpha(filter))?style.filter=filter:style.removeAttribute("filter");return element}else{if(value<0.00001){value=0}}style.filter=stripAlpha(filter)+"alpha(opacity="+(value*100)+")";return element};Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(element,attribute){return element.getAttribute(attribute,2)},_getAttrNode:function(element,attribute){var node=element.getAttributeNode(attribute);return node?node.value:""},_getEv:function(element,attribute){attribute=element.getAttribute(attribute);return attribute?attribute.toString().slice(23,-2):null},_flag:function(element,attribute){return $(element).hasAttribute(attribute)?attribute:null},style:function(element){return element.style.cssText.toLowerCase()},title:function(element){return element.title}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(element,value){element.checked=!!value},style:function(element,value){element.style.cssText=value?value:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(attr){Element._attributeTranslations.write.names[attr.toLowerCase()]=attr;Element._attributeTranslations.has[attr.toLowerCase()]=attr});(function(v){Object.extend(v,{href:v._getAttr,src:v._getAttr,type:v._getAttr,action:v._getAttrNode,disabled:v._flag,checked:v._flag,readonly:v._flag,multiple:v._flag,onload:v._getEv,onunload:v._getEv,onclick:v._getEv,ondblclick:v._getEv,onmousedown:v._getEv,onmouseup:v._getEv,onmouseover:v._getEv,onmousemove:v._getEv,onmouseout:v._getEv,onfocus:v._getEv,onblur:v._getEv,onkeypress:v._getEv,onkeydown:v._getEv,onkeyup:v._getEv,onsubmit:v._getEv,onreset:v._getEv,onselect:v._getEv,onchange:v._getEv})})(Element._attributeTranslations.read.values)}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1)?0.999999:(value==="")?"":(value<0.00001)?0:value;return element}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1||value==="")?"":(value<0.00001)?0:value;if(value==1){if(element.tagName.toUpperCase()=="IMG"&&element.width){element.width++;element.width--}else{try{var n=document.createTextNode(" ");element.appendChild(n);element.removeChild(n)}catch(e){}}}return element};Element.Methods.cumulativeOffset=function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body){if(Element.getStyle(element,"position")=="absolute"){break}}element=element.offsetParent}while(element);return Element._returnOffset(valueL,valueT)}}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(element,content){element=$(element);if(content&&content.toElement){content=content.toElement()}if(Object.isElement(content)){return element.update().insert(content)}content=Object.toHTML(content);var tagName=element.tagName.toUpperCase();if(tagName in Element._insertionTranslations.tags){$A(element.childNodes).each(function(node){element.removeChild(node)});Element._getContentFromAnonymousElement(tagName,content.stripScripts()).each(function(node){element.appendChild(node)})}else{element.innerHTML=content.stripScripts()}content.evalScripts.bind(content).defer();return element}}if("outerHTML" in document.createElement("div")){Element.Methods.replace=function(element,content){element=$(element);if(content&&content.toElement){content=content.toElement()}if(Object.isElement(content)){element.parentNode.replaceChild(content,element);return element}content=Object.toHTML(content);var parent=element.parentNode,tagName=parent.tagName.toUpperCase();if(Element._insertionTranslations.tags[tagName]){var nextSibling=element.next();var fragments=Element._getContentFromAnonymousElement(tagName,content.stripScripts());parent.removeChild(element);if(nextSibling){fragments.each(function(node){parent.insertBefore(node,nextSibling)})}else{fragments.each(function(node){parent.appendChild(node)})}}else{element.outerHTML=content.stripScripts()}content.evalScripts.bind(content).defer();return element}}Element._returnOffset=function(l,t){var result=[l,t];result.left=l;result.top=t;return result};Element._getContentFromAnonymousElement=function(tagName,html){var div=new Element("div"),t=Element._insertionTranslations.tags[tagName];if(t){div.innerHTML=t[0]+html+t[1];t[2].times(function(){div=div.firstChild})}else{div.innerHTML=html}return $A(div.childNodes)};Element._insertionTranslations={before:function(element,node){element.parentNode.insertBefore(node,element)},top:function(element,node){element.insertBefore(node,element.firstChild)},bottom:function(element,node){element.appendChild(node)},after:function(element,node){element.parentNode.insertBefore(node,element.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(element,attribute){attribute=Element._attributeTranslations.has[attribute]||attribute;var node=$(element).getAttributeNode(attribute);return !!(node&&node.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div")["__proto__"]){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div")["__proto__"];Prototype.BrowserFeatures.ElementExtensions=true}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K}var Methods={},ByTag=Element.Methods.ByTag;var extend=Object.extend(function(element){if(!element||element._extendedByPrototype||element.nodeType!=1||element==window){return element}var methods=Object.clone(Methods),tagName=element.tagName.toUpperCase(),property,value;if(ByTag[tagName]){Object.extend(methods,ByTag[tagName])}for(property in methods){value=methods[property];
8
+ if(Object.isFunction(value)&&!(property in element)){element[property]=value.methodize()}}element._extendedByPrototype=Prototype.emptyFunction;return element},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(Methods,Element.Methods);Object.extend(Methods,Element.Methods.Simulated)}}});extend.refresh();return extend})();Element.hasAttribute=function(element,attribute){if(element.hasAttribute){return element.hasAttribute(attribute)}return Element.Methods.Simulated.hasAttribute(element,attribute)};Element.addMethods=function(methods){var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;if(!methods){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var tagName=methods;methods=arguments[1]}if(!tagName){Object.extend(Element.Methods,methods||{})}else{if(Object.isArray(tagName)){tagName.each(extend)}else{extend(tagName)}}function extend(tagName){tagName=tagName.toUpperCase();if(!Element.Methods.ByTag[tagName]){Element.Methods.ByTag[tagName]={}}Object.extend(Element.Methods.ByTag[tagName],methods)}function copy(methods,destination,onlyIfAbsent){onlyIfAbsent=onlyIfAbsent||false;for(var property in methods){var value=methods[property];if(!Object.isFunction(value)){continue}if(!onlyIfAbsent||!(property in destination)){destination[property]=value.methodize()}}}function findDOMClass(tagName){var klass;var trans={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(trans[tagName]){klass="HTML"+trans[tagName]+"Element"}if(window[klass]){return window[klass]}klass="HTML"+tagName+"Element";if(window[klass]){return window[klass]}klass="HTML"+tagName.capitalize()+"Element";if(window[klass]){return window[klass]}window[klass]={};window[klass].prototype=document.createElement(tagName)["__proto__"];return window[klass]}if(F.ElementExtensions){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true)}if(F.SpecificElementExtensions){for(var tag in Element.Methods.ByTag){var klass=findDOMClass(tag);if(Object.isUndefined(klass)){continue}copy(T[tag],klass.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){var dimensions={},B=Prototype.Browser;$w("width height").each(function(d){var D=d.capitalize();if(B.WebKit&&!document.evaluate){dimensions[d]=self["inner"+D]}else{if(B.Opera&&parseFloat(window.opera.version())<9.5){dimensions[d]=document.body["client"+D]}else{dimensions[d]=document.documentElement["client"+D]}}});return dimensions},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};var Selector=Class.create({initialize:function(expression){this.expression=expression.strip();if(this.shouldUseSelectorsAPI()){this.mode="selectorsAPI"}else{if(this.shouldUseXPath()){this.mode="xpath";this.compileXPathMatcher()}else{this.mode="normal";this.compileMatcher()}}},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false}var e=this.expression;if(Prototype.Browser.WebKit&&(e.include("-of-type")||e.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(e)){return false}return true},shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(!Selector._div){Selector._div=new Element("div")}try{Selector._div.querySelector(this.expression)}catch(e){return false}return true},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var e=this.expression,ps=Selector.patterns,x=Selector.xpath,le,m;if(Selector._cache[e]){this.xpath=Selector._cache[e];return}this.matcher=[".//*"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){if(m=e.match(ps[i])){this.matcher.push(Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m));e=e.replace(m[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(root){root=root||document;var e=this.expression,results;switch(this.mode){case"selectorsAPI":if(root!==document){var oldId=root.id,id=$(root).identify();e="#"+id+" "+e}results=$A(root.querySelectorAll(e)).map(Element.extend);root.id=oldId;return results;case"xpath":return document._getElementsByXPath(this.xpath,root);default:return this.matcher(root)}},match:function(element){this.tokens=[];var e=this.expression,ps=Selector.patterns,as=Selector.assertions;var le,p,m;while(e&&le!==e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){if(as[i]){this.tokens.push([i,Object.clone(m)]);e=e.replace(m[0],"")}else{return this.findElements(document).include(element)}}}}var match=true,name,matches;for(var i=0,token;token=this.tokens[i];i++){name=token[0],matches=token[1];if(!Selector.assertions[name](element,matches)){match=false;break}}return match},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(m){if(m[1]=="*"){return""}return"[local-name()='"+m[1].toLowerCase()+"' or local-name()='"+m[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(m){m[1]=m[1].toLowerCase();return new Template("[@#{1}]").evaluate(m)},attr:function(m){m[1]=m[1].toLowerCase();m[3]=m[5]||m[6];return new Template(Selector.xpath.operators[m[2]]).evaluate(m)},pseudo:function(m){var h=Selector.xpath.pseudos[m[1]];if(!h){return""}if(Object.isFunction(h)){return h(m)}return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0)]",checked:"[@checked]",disabled:"[(@disabled) and (@type!='hidden')]",enabled:"[not(@disabled) and (@type!='hidden')]",not:function(m){var e=m[6],p=Selector.patterns,x=Selector.xpath,le,v;var exclusion=[];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in p){if(m=e.match(p[i])){v=Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m);exclusion.push("("+v.substring(1,v.length-1)+")");
9
+ e=e.replace(m[0],"");break}}}return"[not("+exclusion.join(" and ")+")]"},"nth-child":function(m){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m)},"nth-last-child":function(m){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m)},"nth-of-type":function(m){return Selector.xpath.pseudos.nth("position() ",m)},"nth-last-of-type":function(m){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m)},"first-of-type":function(m){m[6]="1";return Selector.xpath.pseudos["nth-of-type"](m)},"last-of-type":function(m){m[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](m)},"only-of-type":function(m){var p=Selector.xpath.pseudos;return p["first-of-type"](m)+p["last-of-type"](m)},nth:function(fragment,m){var mm,formula=m[6],predicate;if(formula=="even"){formula="2n+0"}if(formula=="odd"){formula="2n+1"}if(mm=formula.match(/^(\d+)$/)){return"["+fragment+"= "+mm[1]+"]"}if(mm=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(mm[1]=="-"){mm[1]=-1}var a=mm[1]?Number(mm[1]):1;var b=mm[2]?Number(mm[2]):0;predicate="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(predicate).evaluate({fragment:fragment,a:a,b:b})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c); c = false;',className:'n = h.className(n, r, "#{1}", c); c = false;',id:'n = h.id(n, r, "#{1}", c); c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(m){m[3]=(m[5]||m[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m)},pseudo:function(m){if(m[6]){m[6]=m[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[((?:[\w]+:)?[\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(element,matches){return matches[1].toUpperCase()==element.tagName.toUpperCase()},className:function(element,matches){return Element.hasClassName(element,matches[1])},id:function(element,matches){return element.id===matches[1]},attrPresence:function(element,matches){return Element.hasAttribute(element,matches[1])},attr:function(element,matches){var nodeValue=Element.readAttribute(element,matches[1]);return nodeValue&&Selector.operators[matches[2]](nodeValue,matches[5]||matches[6])}},handlers:{concat:function(a,b){for(var i=0,node;node=b[i];i++){a.push(node)}return a},mark:function(nodes){var _true=Prototype.emptyFunction;for(var i=0,node;node=nodes[i];i++){node._countedByPrototype=_true}return nodes},unmark:function(nodes){for(var i=0,node;node=nodes[i];i++){node._countedByPrototype=undefined}return nodes},index:function(parentNode,reverse,ofType){parentNode._countedByPrototype=Prototype.emptyFunction;if(reverse){for(var nodes=parentNode.childNodes,i=nodes.length-1,j=1;i>=0;i--){var node=nodes[i];if(node.nodeType==1&&(!ofType||node._countedByPrototype)){node.nodeIndex=j++}}}else{for(var i=0,j=1,nodes=parentNode.childNodes;node=nodes[i];i++){if(node.nodeType==1&&(!ofType||node._countedByPrototype)){node.nodeIndex=j++}}}},unique:function(nodes){if(nodes.length==0){return nodes}var results=[],n;for(var i=0,l=nodes.length;i<l;i++){if(!(n=nodes[i])._countedByPrototype){n._countedByPrototype=Prototype.emptyFunction;results.push(Element.extend(n))}}return Selector.handlers.unmark(results)},descendant:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){h.concat(results,node.getElementsByTagName("*"))}return results},child:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){for(var j=0,child;child=node.childNodes[j];j++){if(child.nodeType==1&&child.tagName!="!"){results.push(child)}}}return results},adjacent:function(nodes){for(var i=0,results=[],node;node=nodes[i];i++){var next=this.nextElementSibling(node);if(next){results.push(next)}}return results},laterSibling:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){h.concat(results,Element.nextSiblings(node))}return results},nextElementSibling:function(node){while(node=node.nextSibling){if(node.nodeType==1){return node}}return null},previousElementSibling:function(node){while(node=node.previousSibling){if(node.nodeType==1){return node}}return null},tagName:function(nodes,root,tagName,combinator){var uTagName=tagName.toUpperCase();var results=[],h=Selector.handlers;if(nodes){if(combinator){if(combinator=="descendant"){for(var i=0,node;node=nodes[i];i++){h.concat(results,node.getElementsByTagName(tagName))}return results}else{nodes=this[combinator](nodes)}if(tagName=="*"){return nodes}}for(var i=0,node;node=nodes[i];i++){if(node.tagName.toUpperCase()===uTagName){results.push(node)}}return results}else{return root.getElementsByTagName(tagName)}},id:function(nodes,root,id,combinator){var targetNode=$(id),h=Selector.handlers;if(!targetNode){return[]}if(!nodes&&root==document){return[targetNode]}if(nodes){if(combinator){if(combinator=="child"){for(var i=0,node;node=nodes[i];i++){if(targetNode.parentNode==node){return[targetNode]}}}else{if(combinator=="descendant"){for(var i=0,node;node=nodes[i];i++){if(Element.descendantOf(targetNode,node)){return[targetNode]}}}else{if(combinator=="adjacent"){for(var i=0,node;node=nodes[i];i++){if(Selector.handlers.previousElementSibling(targetNode)==node){return[targetNode]}}}else{nodes=h[combinator](nodes)}}}}for(var i=0,node;node=nodes[i];i++){if(node==targetNode){return[targetNode]}}return[]}return(targetNode&&Element.descendantOf(targetNode,root))?[targetNode]:[]},className:function(nodes,root,className,combinator){if(nodes&&combinator){nodes=this[combinator](nodes)}return Selector.handlers.byClassName(nodes,root,className)},byClassName:function(nodes,root,className){if(!nodes){nodes=Selector.handlers.descendant([root])}var needle=" "+className+" ";for(var i=0,results=[],node,nodeClassName;node=nodes[i];i++){nodeClassName=node.className;if(nodeClassName.length==0){continue}if(nodeClassName==className||(" "+nodeClassName+" ").include(needle)){results.push(node)}}return results},attrPresence:function(nodes,root,attr,combinator){if(!nodes){nodes=root.getElementsByTagName("*")}if(nodes&&combinator){nodes=this[combinator](nodes)}var results=[];for(var i=0,node;node=nodes[i];i++){if(Element.hasAttribute(node,attr)){results.push(node)}}return results},attr:function(nodes,root,attr,value,operator,combinator){if(!nodes){nodes=root.getElementsByTagName("*")}if(nodes&&combinator){nodes=this[combinator](nodes)}var handler=Selector.operators[operator],results=[];for(var i=0,node;node=nodes[i];i++){var nodeValue=Element.readAttribute(node,attr);if(nodeValue===null){continue}if(handler(nodeValue,value)){results.push(node)}}return results},pseudo:function(nodes,name,value,root,combinator){if(nodes&&combinator){nodes=this[combinator](nodes)}if(!nodes){nodes=root.getElementsByTagName("*")}return Selector.pseudos[name](nodes,value,root)}},pseudos:{"first-child":function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.previousElementSibling(node)){continue}results.push(node)}return results},"last-child":function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.nextElementSibling(node)){continue}results.push(node)}return results},"only-child":function(nodes,value,root){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){if(!h.previousElementSibling(node)&&!h.nextElementSibling(node)){results.push(node)}}return results},"nth-child":function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root)
10
+ },"nth-last-child":function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true)},"nth-of-type":function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,false,true)},"nth-last-of-type":function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true,true)},"first-of-type":function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,false,true)},"last-of-type":function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,true,true)},"only-of-type":function(nodes,formula,root){var p=Selector.pseudos;return p["last-of-type"](p["first-of-type"](nodes,formula,root),formula,root)},getIndices:function(a,b,total){if(a==0){return b>0?[b]:[]}return $R(1,total).inject([],function(memo,i){if(0==(i-b)%a&&(i-b)/a>=0){memo.push(i)}return memo})},nth:function(nodes,formula,root,reverse,ofType){if(nodes.length==0){return[]}if(formula=="even"){formula="2n+0"}if(formula=="odd"){formula="2n+1"}var h=Selector.handlers,results=[],indexed=[],m;h.mark(nodes);for(var i=0,node;node=nodes[i];i++){if(!node.parentNode._countedByPrototype){h.index(node.parentNode,reverse,ofType);indexed.push(node.parentNode)}}if(formula.match(/^\d+$/)){formula=Number(formula);for(var i=0,node;node=nodes[i];i++){if(node.nodeIndex==formula){results.push(node)}}}else{if(m=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]=="-"){m[1]=-1}var a=m[1]?Number(m[1]):1;var b=m[2]?Number(m[2]):0;var indices=Selector.pseudos.getIndices(a,b,nodes.length);for(var i=0,node,l=indices.length;node=nodes[i];i++){for(var j=0;j<l;j++){if(node.nodeIndex==indices[j]){results.push(node)}}}}}h.unmark(nodes);h.unmark(indexed);return results},empty:function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(node.tagName=="!"||node.firstChild){continue}results.push(node)}return results},not:function(nodes,selector,root){var h=Selector.handlers,selectorType,m;var exclusions=new Selector(selector).findElements(root);h.mark(exclusions);for(var i=0,results=[],node;node=nodes[i];i++){if(!node._countedByPrototype){results.push(node)}}h.unmark(exclusions);return results},enabled:function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(!node.disabled&&(!node.type||node.type!=="hidden")){results.push(node)}}return results},disabled:function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(node.disabled){results.push(node)}}return results},checked:function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(node.checked){results.push(node)}}return results}},operators:{"=":function(nv,v){return nv==v},"!=":function(nv,v){return nv!=v},"^=":function(nv,v){return nv==v||nv&&nv.startsWith(v)},"$=":function(nv,v){return nv==v||nv&&nv.endsWith(v)},"*=":function(nv,v){return nv==v||nv&&nv.include(v)},"$=":function(nv,v){return nv.endsWith(v)},"*=":function(nv,v){return nv.include(v)},"~=":function(nv,v){return(" "+nv+" ").include(" "+v+" ")},"|=":function(nv,v){return("-"+(nv||"").toUpperCase()+"-").include("-"+(v||"").toUpperCase()+"-")}},split:function(expression){var expressions=[];expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){expressions.push(m[1].strip())});return expressions},matchElements:function(elements,expression){var matches=$$(expression),h=Selector.handlers;h.mark(matches);for(var i=0,results=[],element;element=elements[i];i++){if(element._countedByPrototype){results.push(element)}}h.unmark(matches);return results},findElement:function(elements,expression,index){if(Object.isNumber(expression)){index=expression;expression=false}return Selector.matchElements(elements,expression||"*")[index||0]},findChildElements:function(element,expressions){expressions=Selector.split(expressions.join(","));var results=[],h=Selector.handlers;for(var i=0,l=expressions.length,selector;i<l;i++){selector=new Selector(expressions[i].strip());h.concat(results,selector.findElements(element))}return(l>1)?h.unique(results):results}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(a,b){for(var i=0,node;node=b[i];i++){if(node.tagName!=="!"){a.push(node)}}return a},unmark:function(nodes){for(var i=0,node;node=nodes[i];i++){node.removeAttribute("_countedByPrototype")}return nodes}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(form){$(form).reset();return form},serializeElements:function(elements,options){if(typeof options!="object"){options={hash:!!options}}else{if(Object.isUndefined(options.hash)){options.hash=true}}var key,value,submitted=false,submit=options.submit;var data=elements.inject({},function(result,element){if(!element.disabled&&element.name){key=element.name;value=$(element).getValue();if(value!=null&&element.type!="file"&&(element.type!="submit"||(!submitted&&submit!==false&&(!submit||key==submit)&&(submitted=true)))){if(key in result){if(!Object.isArray(result[key])){result[key]=[result[key]]}result[key].push(value)}else{result[key]=value}}}return result});return options.hash?data:Object.toQueryString(data)}};Form.Methods={serialize:function(form,options){return Form.serializeElements(Form.getElements(form),options)},getElements:function(form){return $A($(form).getElementsByTagName("*")).inject([],function(elements,child){if(Form.Element.Serializers[child.tagName.toLowerCase()]){elements.push(Element.extend(child))}return elements})},getInputs:function(form,typeName,name){form=$(form);var inputs=form.getElementsByTagName("input");if(!typeName&&!name){return $A(inputs).map(Element.extend)}for(var i=0,matchingInputs=[],length=inputs.length;i<length;i++){var input=inputs[i];if((typeName&&input.type!=typeName)||(name&&input.name!=name)){continue}matchingInputs.push(Element.extend(input))}return matchingInputs},disable:function(form){form=$(form);Form.getElements(form).invoke("disable");return form},enable:function(form){form=$(form);Form.getElements(form).invoke("enable");return form},findFirstElement:function(form){var elements=$(form).getElements().findAll(function(element){return"hidden"!=element.type&&!element.disabled});var firstByIndex=elements.findAll(function(element){return element.hasAttribute("tabIndex")&&element.tabIndex>=0}).sortBy(function(element){return element.tabIndex}).first();return firstByIndex?firstByIndex:elements.find(function(element){return["input","select","textarea"].include(element.tagName.toLowerCase())})},focusFirstElement:function(form){form=$(form);form.findFirstElement().activate();return form},request:function(form,options){form=$(form),options=Object.clone(options||{});var params=options.parameters,action=form.readAttribute("action")||"";if(action.blank()){action=window.location.href}options.parameters=form.serialize(true);if(params){if(Object.isString(params)){params=params.toQueryParams()}Object.extend(options.parameters,params)}if(form.hasAttribute("method")&&!options.method){options.method=form.method}return new Ajax.Request(action,options)}};Form.Element={focus:function(element){$(element).focus();return element},select:function(element){$(element).select();return element}};Form.Element.Methods={serialize:function(element){element=$(element);if(!element.disabled&&element.name){var value=element.getValue();if(value!=undefined){var pair={};pair[element.name]=value;return Object.toQueryString(pair)}}return""},getValue:function(element){element=$(element);var method=element.tagName.toLowerCase();return Form.Element.Serializers[method](element)},setValue:function(element,value){element=$(element);var method=element.tagName.toLowerCase();Form.Element.Serializers[method](element,value);return element},clear:function(element){$(element).value="";return element},present:function(element){return $(element).value!=""},activate:function(element){element=$(element);try{element.focus();if(element.select&&(element.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(element.type))){element.select()}}catch(e){}return element},disable:function(element){element=$(element);
11
+ element.disabled=true;return element},enable:function(element){element=$(element);element.disabled=false;return element}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(element,value){switch(element.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(element,value);default:return Form.Element.Serializers.textarea(element,value)}},inputSelector:function(element,value){if(Object.isUndefined(value)){return element.checked?element.value:null}else{element.checked=!!value}},textarea:function(element,value){if(Object.isUndefined(value)){return element.value}else{element.value=value}},select:function(element,value){if(Object.isUndefined(value)){return this[element.type=="select-one"?"selectOne":"selectMany"](element)}else{var opt,currentValue,single=!Object.isArray(value);for(var i=0,length=element.length;i<length;i++){opt=element.options[i];currentValue=this.optionValue(opt);if(single){if(currentValue==value){opt.selected=true;return}}else{opt.selected=value.include(currentValue)}}}},selectOne:function(element){var index=element.selectedIndex;return index>=0?this.optionValue(element.options[index]):null},selectMany:function(element){var values,length=element.length;if(!length){return null}for(var i=0,values=[];i<length;i++){var opt=element.options[i];if(opt.selected){values.push(this.optionValue(opt))}}return values},optionValue:function(opt){return Element.extend(opt).hasAttribute("value")?opt.value:opt.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,element,frequency,callback){$super(callback,frequency);this.element=$(element);this.lastValue=this.getValue()},execute:function(){var value=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(value)?this.lastValue!=value:String(this.lastValue)!=String(value)){this.callback(this.element,value);this.lastValue=value}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(element,callback){this.element=$(element);this.callback=callback;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(element){if(element.type){switch(element.type.toLowerCase()){case"checkbox":case"radio":Event.observe(element,"click",this.onElementEvent.bind(this));break;default:Event.observe(element,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event={}}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(event){var element;switch(event.type){case"mouseover":element=event.fromElement;break;case"mouseout":element=event.toElement;break;default:return null}return Element.extend(element)}});Event.Methods=(function(){var isButton;if(Prototype.Browser.IE){var buttonMap={0:1,1:4,2:2};isButton=function(event,code){return event.button==buttonMap[code]}}else{if(Prototype.Browser.WebKit){isButton=function(event,code){switch(code){case 0:return event.which==1&&!event.metaKey;case 1:return event.which==1&&event.metaKey;default:return false}}}else{isButton=function(event,code){return event.which?(event.which===code+1):(event.button===code)}}}return{isLeftClick:function(event){return isButton(event,0)},isMiddleClick:function(event){return isButton(event,1)},isRightClick:function(event){return isButton(event,2)},element:function(event){event=Event.extend(event);var node=event.target,type=event.type,currentTarget=event.currentTarget;if(currentTarget&&currentTarget.tagName){if(type==="load"||type==="error"||(type==="click"&&currentTarget.tagName.toLowerCase()==="input"&&currentTarget.type==="radio")){node=currentTarget}}if(node.nodeType==Node.TEXT_NODE){node=node.parentNode}return Element.extend(node)},findElement:function(event,expression){var element=Event.element(event);if(!expression){return element}var elements=[element].concat(element.ancestors());return Selector.findElement(elements,expression,0)},pointer:function(event){var docElement=document.documentElement,body=document.body||{scrollLeft:0,scrollTop:0};return{x:event.pageX||(event.clientX+(docElement.scrollLeft||body.scrollLeft)-(docElement.clientLeft||0)),y:event.pageY||(event.clientY+(docElement.scrollTop||body.scrollTop)-(docElement.clientTop||0))}},pointerX:function(event){return Event.pointer(event).x},pointerY:function(event){return Event.pointer(event).y},stop:function(event){Event.extend(event);event.preventDefault();event.stopPropagation();event.stopped=true}}})();Event.extend=(function(){var methods=Object.keys(Event.Methods).inject({},function(m,name){m[name]=Event.Methods[name].methodize();return m});if(Prototype.Browser.IE){Object.extend(methods,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(event){if(!event){return false}if(event._extendedByPrototype){return event}event._extendedByPrototype=Prototype.emptyFunction;var pointer=Event.pointer(event);Object.extend(event,{target:event.srcElement,relatedTarget:Event.relatedTarget(event),pageX:pointer.x,pageY:pointer.y});return Object.extend(event,methods)}}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents")["__proto__"];Object.extend(Event.prototype,methods);return Prototype.K}})();Object.extend(Event,(function(){var cache=Event.cache;function getEventID(element){if(element._prototypeEventID){return element._prototypeEventID[0]}arguments.callee.id=arguments.callee.id||1;return element._prototypeEventID=[++arguments.callee.id]}function getDOMEventName(eventName){if(eventName&&eventName.include(":")){return"dataavailable"}return eventName}function getCacheForID(id){return cache[id]=cache[id]||{}}function getWrappersForEventName(id,eventName){var c=getCacheForID(id);return c[eventName]=c[eventName]||[]}function createWrapper(element,eventName,handler){var id=getEventID(element);var c=getWrappersForEventName(id,eventName);if(c.pluck("handler").include(handler)){return false}var wrapper=function(event){if(!Event||!Event.extend||(event.eventName&&event.eventName!=eventName)){return false}Event.extend(event);handler.call(element,event)};wrapper.handler=handler;c.push(wrapper);return wrapper}function findWrapper(id,eventName,handler){var c=getWrappersForEventName(id,eventName);return c.find(function(wrapper){return wrapper.handler==handler})}function destroyWrapper(id,eventName,handler){var c=getCacheForID(id);if(!c[eventName]){return false}c[eventName]=c[eventName].without(findWrapper(id,eventName,handler))}function destroyCache(){for(var id in cache){for(var eventName in cache[id]){cache[id][eventName]=null}}}if(window.attachEvent){window.attachEvent("onunload",destroyCache)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}return{observe:function(element,eventName,handler){element=$(element);var name=getDOMEventName(eventName);var wrapper=createWrapper(element,eventName,handler);if(!wrapper){return element}if(element.addEventListener){element.addEventListener(name,wrapper,false)}else{element.attachEvent("on"+name,wrapper)
12
+ }return element},stopObserving:function(element,eventName,handler){element=$(element);var id=getEventID(element),name=getDOMEventName(eventName);if(!handler&&eventName){getWrappersForEventName(id,eventName).each(function(wrapper){element.stopObserving(eventName,wrapper.handler)});return element}else{if(!eventName){Object.keys(getCacheForID(id)).each(function(eventName){element.stopObserving(eventName)});return element}}var wrapper=findWrapper(id,eventName,handler);if(!wrapper){return element}if(element.removeEventListener){element.removeEventListener(name,wrapper,false)}else{element.detachEvent("on"+name,wrapper)}destroyWrapper(id,eventName,handler);return element},fire:function(element,eventName,memo){element=$(element);if(element==document&&document.createEvent&&!element.dispatchEvent){element=document.documentElement}var event;if(document.createEvent){event=document.createEvent("HTMLEvents");event.initEvent("dataavailable",true,true)}else{event=document.createEventObject();event.eventType="ondataavailable"}event.eventName=eventName;event.memo=memo||{};if(document.createEvent){element.dispatchEvent(event)}else{element.fireEvent(event.eventType,event)}return Event.extend(event)}}})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var timer;function fireContentLoadedEvent(){if(document.loaded){return}if(timer){window.clearInterval(timer)}document.fire("dom:loaded");document.loaded=true}if(document.addEventListener){if(Prototype.Browser.WebKit){timer=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){fireContentLoadedEvent()}},0);Event.observe(window,"load",fireContentLoadedEvent)}else{document.addEventListener("DOMContentLoaded",fireContentLoadedEvent,false)}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;fireContentLoadedEvent()}}}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(element,content){return Element.insert(element,{before:content})},Top:function(element,content){return Element.insert(element,{top:content})},Bottom:function(element,content){return Element.insert(element,{bottom:content})},After:function(element,content){return Element.insert(element,{after:content})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(element,x,y){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(element,x,y)}this.xcomp=x;this.ycomp=y;this.offset=Element.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1]+element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+element.offsetWidth)},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=Element.cumulativeScrollOffset(element);this.xcomp=x+offsetcache[0]-this.deltaX;this.ycomp=y+offsetcache[1]-this.deltaY;this.offset=Element.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+element.offsetWidth)},overlap:function(mode,element){if(!mode){return 0}if(mode=="vertical"){return((this.offset[1]+element.offsetHeight)-this.ycomp)/element.offsetHeight}if(mode=="horizontal"){return((this.offset[0]+element.offsetWidth)-this.xcomp)/element.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(element){Position.prepare();return Element.absolutize(element)},relativize:function(element){Position.prepare();return Element.relativize(element)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(source,target,options){options=options||{};return Element.clonePosition(target,source,options)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(instanceMethods){function iter(name){return name.blank()?null:"[contains(concat(' ', @class, ' '), ' "+name+" ')]"}instanceMethods.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(element,className){className=className.toString().strip();var cond=/\s/.test(className)?$w(className).map(iter).join(""):iter(className);return cond?document._getElementsByXPath(".//*"+cond,element):[]}:function(element,className){className=className.toString().strip();var elements=[],classNames=(/\s/.test(className)?$w(className):null);if(!classNames&&!className){return elements}var nodes=$(element).getElementsByTagName("*");className=" "+className+" ";for(var i=0,child,cn;child=nodes[i];i++){if(child.className&&(cn=" "+child.className+" ")&&(cn.include(className)||(classNames&&classNames.all(function(name){return !name.toString().blank()&&cn.include(" "+name+" ")})))){elements.push(Element.extend(child))}}return elements};return function(className,parentElement){return $(parentElement||document.body).getElementsByClassName(className)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element)},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0})._each(iterator)},set:function(className){this.element.className=className},add:function(classNameToAdd){if(this.include(classNameToAdd)){return}this.set($A(this).concat(classNameToAdd).join(" "))},remove:function(classNameToRemove){if(!this.include(classNameToRemove)){return}this.set($A(this).without(classNameToRemove).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();
@@ -0,0 +1,12 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title="#{AppConfig.project} v.#{Lipsiadmin::VERSION::STRING}"
5
+ =stylesheet_link_tag "standard", "login"
6
+ %body
7
+ #wrapper
8
+ #login-box
9
+ #content
10
+ =yield
11
+ #copyright
12
+ Copyright &copy; 2009 LipsiaSoft s.r.l. All rights reserved
@@ -0,0 +1,7 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title="#{AppConfig.project} v.#{Lipsiadmin::VERSION::STRING}"
5
+ =stylesheet_link_tag "standard", "login"
6
+ %body
7
+ #wrapper
@@ -0,0 +1,20 @@
1
+ class CreateAccounts < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :accounts, :force => true do |t|
4
+ t.string :name, :surname, :email, :salt, :crypted_password, :role, :modules
5
+ t.timestamps
6
+ end
7
+
8
+ # I'll create the first account
9
+ Account.create({:email => "info@lipsiasoft.com",
10
+ :name => "Davide",
11
+ :surname => "D'Agostino",
12
+ :password => "admin",
13
+ :password_confirmation => "admin",
14
+ :role => "administrator" })
15
+ end
16
+
17
+ def self.down
18
+ drop_table "accounts"
19
+ end
20
+ end
@@ -0,0 +1,116 @@
1
+ require 'digest/sha1'
2
+ class Account < ActiveRecord::Base
3
+ # Virtual attribute for the unencrypted password
4
+ attr_accessor :password
5
+
6
+ serialize :modules
7
+
8
+ validates_presence_of :name, :surname, :email
9
+ validates_presence_of :password, :if => :password_required?
10
+ validates_presence_of :password_confirmation, :if => :password_required?
11
+ validates_length_of :password, :within => 4..40, :if => :password_required?
12
+ validates_confirmation_of :password, :if => :password_required?
13
+ validates_length_of :email, :within => 3..100
14
+ validates_uniqueness_of :email, :case_sensitive => false
15
+ validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
16
+ before_save :encrypt_password
17
+
18
+ def after_create
19
+ Notifier.deliver_registration(self)
20
+ end
21
+
22
+ def full_name
23
+ "#{name} #{surname}".strip
24
+ end
25
+
26
+ def modules
27
+ read_attribute(:modules) || []
28
+ end
29
+
30
+ def modules=(perms)
31
+ perms = perms.collect {|p| p.to_sym unless p.blank? }.compact if perms
32
+ write_attribute(:modules, perms)
33
+ end
34
+
35
+ # Activates the user in the database.
36
+ def activate
37
+ @activated = true
38
+ self.activated_at = Time.now.utc
39
+ self.activation_code = nil
40
+ end
41
+
42
+ # Authenticates a user by their email and unencrypted password. Returns the user or nil.
43
+ def self.authenticate(email, password)
44
+ u = find :first, :conditions => ['email = ?', email] # need to get the salt
45
+ u && u.authenticated?(password) ? u : nil
46
+ end
47
+
48
+ # Encrypts some data with the salt.
49
+ def self.encrypt(password, salt)
50
+ enc = OpenSSL::Cipher::Cipher.new('DES-EDE3-CBC')
51
+ enc.encrypt(salt)
52
+ data = enc.update(password)
53
+ Base64.encode64(data << enc.final)
54
+ rescue
55
+ nil
56
+ end
57
+
58
+ def password_clean
59
+ unless @password
60
+ enc = OpenSSL::Cipher::Cipher.new('DES-EDE3-CBC')
61
+ enc.decrypt(salt)
62
+ text = enc.update(Base64.decode64(crypted_password))
63
+ @password = (text << enc.final)
64
+ end
65
+ @password
66
+ rescue
67
+ nil
68
+ end
69
+
70
+ def active?
71
+ # If you want you can integrate you custom activation/blocking system
72
+ true
73
+ end
74
+
75
+ # Encrypts the password with the user salt
76
+ def encrypt(password)
77
+ self.class.encrypt(password, salt)
78
+ end
79
+
80
+ def authenticated?(password)
81
+ crypted_password == encrypt(password)
82
+ end
83
+
84
+
85
+ def maps
86
+ if modules && modules.split(",").size > 0
87
+ maps = AccountAccess.find_by_project_modules(modules.split(","))
88
+ return maps unless maps.blank?
89
+ end
90
+
91
+ if !role.blank?
92
+ maps = AccountAccess.find_by_role(role)
93
+ return maps unless maps.blank?
94
+ end
95
+ end
96
+
97
+ # Generate Methods takes from AccessControl rules
98
+ # Example:
99
+ #
100
+ # def administrator?
101
+ # role == "administrator"
102
+ # end
103
+ AccountAccess.roles.each { |r| define_method("#{r.to_s.downcase.gsub(" ","_").to_sym}?") { role.to_s.downcase.gsub(" ","_").to_sym == r.to_s.downcase.gsub(" ","_").to_sym } }
104
+
105
+ protected
106
+ # before filter
107
+ def encrypt_password
108
+ return if password.blank?
109
+ self.salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{email}--") if new_record?
110
+ self.crypted_password = encrypt(password)
111
+ end
112
+
113
+ def password_required?
114
+ crypted_password.blank? || !password.blank?
115
+ end
116
+ end