spontaneous 0.1.0.alpha1 → 0.2.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (413) hide show
  1. data/Gemfile +40 -35
  2. data/LICENSE +20 -0
  3. data/Rakefile +39 -42
  4. data/Readme.markdown +155 -0
  5. data/application/css/definitions.scss +3 -0
  6. data/application/css/editing.scss +9 -4
  7. data/application/css/min/565d4c25e82148acb01c45c8d675b37a08676d77.css +1 -0
  8. data/application/css/min/84dbe894ea96eafd321c30823d630817bfc4b03b.css +1 -0
  9. data/application/css/min/d1b54ff4847c613618267ca1c15658e2aee0a4e5.css +1 -0
  10. data/application/css/v2.scss +144 -50
  11. data/application/js/add_alias_dialogue.js +18 -8
  12. data/application/js/ajax.js +1 -1
  13. data/application/js/authentication.js +8 -1
  14. data/application/js/box.js +37 -7
  15. data/application/js/box_container.js +1 -1
  16. data/application/js/compatibility.js +7 -0
  17. data/application/js/content.js +7 -0
  18. data/application/js/content_area.js +4 -0
  19. data/application/js/edit_panel.js +44 -18
  20. data/application/js/editing.js +12 -0
  21. data/application/js/event_source.js +17 -0
  22. data/application/js/extensions.js +2 -0
  23. data/application/js/field_types/file_field.js +2 -1
  24. data/application/js/field_types/image_field.js +35 -48
  25. data/application/js/field_types/long_string_field.js +12 -0
  26. data/application/js/field_types/markdown_field.js +2 -5
  27. data/application/js/field_types/string_field.js +5 -1
  28. data/application/js/field_types/webvideo_field.js +15 -0
  29. data/application/js/init.js +1 -0
  30. data/application/js/location.js +30 -19
  31. data/application/js/login.js +1 -2
  32. data/application/js/min/2a0c2962537a3181fedfff5c92596ba6d3122dc9.js +3 -0
  33. data/application/js/min/4cf1c493d3379ecba5287758c61238034c0893f9.js +2 -0
  34. data/application/js/min/78ac6b99d96750bb6b9f9aad4cb9cd91cd03f391.js +3 -0
  35. data/application/js/min/c8efb9b9f7c3f6613fcebc6be60f605b6570a382.js +90 -0
  36. data/application/js/page.js +1 -0
  37. data/application/js/page_entry.js +6 -40
  38. data/application/js/preview.js +2 -3
  39. data/application/js/top_bar.js +76 -31
  40. data/application/js/upload.js +5 -2
  41. data/application/js/upload_manager.js +2 -81
  42. data/application/js/vendor/jquery-1.7.1.min.js +4 -0
  43. data/application/js/vendor/jquery-ui-1.8.16.custom.min.js +791 -0
  44. data/application/js/views.js +3 -3
  45. data/application/js/views/box_view.js +164 -83
  46. data/application/js/views/page_piece_view.js +2 -2
  47. data/application/js/views/page_view.js +46 -15
  48. data/application/js/views/piece_view.js +29 -8
  49. data/application/static/diagonal-texture.png +0 -0
  50. data/application/static/item-buttons-highlight.png +0 -0
  51. data/application/static/plus-box.png +0 -0
  52. data/application/static/plus_alt.svg +8 -0
  53. data/application/static/slot-up-arrow.png +0 -0
  54. data/application/views/{index.erubis → index.erb} +9 -5
  55. data/application/views/{login.erubis → login.erb} +14 -10
  56. data/application/views/schema_modification_error.html.erb +18 -6
  57. data/application/views/{unsupported.erubis → unsupported.erb} +0 -0
  58. data/bin/spot +15 -2
  59. data/db/migrations/20100610142136_init.rb +2 -2
  60. data/db/migrations/20101130104334_timestamps.rb +2 -2
  61. data/db/migrations/20110209152710_users_and_groups.rb +11 -11
  62. data/db/migrations/20120106171423_visibility_path.rb +19 -0
  63. data/db/migrations/20120107124541_owner_id.rb +19 -0
  64. data/docs/recipe-interface-screenshot.png +0 -0
  65. data/lib/cutaneous.rb +11 -10
  66. data/lib/cutaneous/context_helper.rb +119 -14
  67. data/lib/cutaneous/preview_context.rb +4 -3
  68. data/lib/cutaneous/preview_renderer.rb +1 -6
  69. data/lib/cutaneous/publish_context.rb +1 -0
  70. data/lib/cutaneous/{first_pass_renderer.rb → publish_renderer.rb} +2 -6
  71. data/lib/cutaneous/publish_template.rb +62 -0
  72. data/lib/cutaneous/publish_token_parser.rb +8 -0
  73. data/lib/cutaneous/renderer.rb +4 -2
  74. data/lib/cutaneous/request_context.rb +1 -0
  75. data/lib/cutaneous/{second_pass_renderer.rb → request_renderer.rb} +2 -5
  76. data/lib/cutaneous/request_template.rb +11 -0
  77. data/lib/cutaneous/request_token_parser.rb +9 -0
  78. data/lib/cutaneous/token_parser.rb +125 -0
  79. data/lib/sequel/plugins/content_table_inheritance.rb +19 -12
  80. data/lib/sequel/plugins/scoped_table_name.rb +45 -0
  81. data/lib/spontaneous.rb +123 -126
  82. data/lib/spontaneous/box.rb +127 -47
  83. data/lib/spontaneous/box_style.rb +39 -22
  84. data/lib/spontaneous/change.rb +2 -2
  85. data/lib/spontaneous/cli.rb +1 -0
  86. data/lib/spontaneous/cli/base.rb +12 -4
  87. data/lib/spontaneous/cli/console.rb +72 -0
  88. data/lib/spontaneous/cli/server.rb +36 -12
  89. data/lib/spontaneous/cli/site.rb +175 -1
  90. data/lib/spontaneous/collections/box_set.rb +19 -1
  91. data/lib/spontaneous/collections/entry_set.rb +70 -22
  92. data/lib/spontaneous/collections/field_set.rb +3 -3
  93. data/lib/spontaneous/collections/prototype_set.rb +28 -0
  94. data/lib/spontaneous/config.rb +14 -5
  95. data/lib/spontaneous/content.rb +23 -24
  96. data/lib/spontaneous/errors.rb +20 -4
  97. data/lib/spontaneous/extensions/array.rb +2 -2
  98. data/lib/spontaneous/extensions/json.rb +1 -1
  99. data/lib/spontaneous/extensions/nil.rb +13 -0
  100. data/lib/spontaneous/facet.rb +61 -7
  101. data/lib/spontaneous/field_types.rb +1 -3
  102. data/lib/spontaneous/field_types/date_field.rb +1 -0
  103. data/lib/spontaneous/field_types/field.rb +32 -15
  104. data/lib/spontaneous/field_types/image_field.rb +138 -69
  105. data/lib/spontaneous/field_types/location_field.rb +59 -0
  106. data/lib/spontaneous/field_types/long_string_field.rb +13 -0
  107. data/lib/spontaneous/field_types/markdown_field.rb +2 -1
  108. data/lib/spontaneous/field_types/string_field.rb +2 -2
  109. data/lib/spontaneous/field_types/webvideo_field.rb +255 -0
  110. data/lib/spontaneous/generators/page/inline.html.cut +1 -1
  111. data/lib/spontaneous/generators/page/page.html.cut.tt +5 -4
  112. data/lib/spontaneous/generators/page/page.rb.tt +1 -5
  113. data/lib/spontaneous/generators/site.rb +1 -0
  114. data/lib/spontaneous/generators/site/.gitignore +2 -0
  115. data/lib/spontaneous/generators/site/Gemfile.tt +3 -5
  116. data/lib/spontaneous/generators/site/config/environment.rb.tt +1 -0
  117. data/lib/spontaneous/generators/site/config/environments/development.rb.tt +3 -1
  118. data/lib/spontaneous/generators/site/config/environments/production.rb.tt +3 -1
  119. data/lib/spontaneous/generators/site/config/indexes.rb.tt +23 -0
  120. data/lib/spontaneous/generators/site/public/css/{site.css → site.scss} +0 -0
  121. data/lib/spontaneous/generators/site/schema/box.rb.tt +5 -0
  122. data/lib/spontaneous/generators/site/templates/layouts/standard.html.cut.tt +11 -5
  123. data/lib/spontaneous/image_size.rb +0 -1
  124. data/lib/spontaneous/loader.rb +335 -218
  125. data/lib/spontaneous/logger.rb +7 -2
  126. data/lib/spontaneous/media.rb +64 -59
  127. data/lib/spontaneous/media/file.rb +74 -0
  128. data/lib/spontaneous/page.rb +47 -18
  129. data/lib/spontaneous/page_piece.rb +29 -27
  130. data/lib/spontaneous/paths.rb +0 -1
  131. data/lib/spontaneous/permissions.rb +3 -21
  132. data/lib/spontaneous/permissions/user.rb +5 -1
  133. data/lib/spontaneous/permissions/user_level.rb +6 -7
  134. data/lib/spontaneous/piece.rb +12 -7
  135. data/lib/spontaneous/plugins/aliases.rb +76 -31
  136. data/lib/spontaneous/plugins/allowed_types.rb +36 -37
  137. data/lib/spontaneous/plugins/application/facets.rb +7 -10
  138. data/lib/spontaneous/plugins/application/features.rb +17 -0
  139. data/lib/spontaneous/plugins/application/paths.rb +25 -31
  140. data/lib/spontaneous/plugins/application/render.rb +1 -5
  141. data/lib/spontaneous/plugins/application/serialisation.rb +2 -0
  142. data/lib/spontaneous/plugins/application/state.rb +6 -9
  143. data/lib/spontaneous/plugins/boxes.rb +65 -40
  144. data/lib/spontaneous/plugins/controllers.rb +22 -22
  145. data/lib/spontaneous/plugins/entries.rb +149 -150
  146. data/lib/spontaneous/plugins/entry.rb +50 -35
  147. data/lib/spontaneous/plugins/field/editor_class.rb +13 -0
  148. data/lib/spontaneous/plugins/fields.rb +41 -33
  149. data/lib/spontaneous/plugins/instance_code.rb +9 -9
  150. data/lib/spontaneous/plugins/layouts.rb +31 -35
  151. data/lib/spontaneous/plugins/media.rb +31 -32
  152. data/lib/spontaneous/plugins/page/formats.rb +56 -31
  153. data/lib/spontaneous/plugins/page/request.rb +15 -9
  154. data/lib/spontaneous/plugins/page_search.rb +30 -31
  155. data/lib/spontaneous/plugins/page_tree.rb +59 -12
  156. data/lib/spontaneous/plugins/paths.rb +84 -79
  157. data/lib/spontaneous/plugins/permissions.rb +26 -28
  158. data/lib/spontaneous/plugins/prototypes.rb +42 -37
  159. data/lib/spontaneous/plugins/publishing.rb +50 -94
  160. data/lib/spontaneous/plugins/render.rb +8 -16
  161. data/lib/spontaneous/plugins/schema_hierarchy.rb +20 -21
  162. data/lib/spontaneous/plugins/schema_id.rb +33 -25
  163. data/lib/spontaneous/plugins/schema_title.rb +3 -4
  164. data/lib/spontaneous/plugins/serialisation.rb +32 -35
  165. data/lib/spontaneous/plugins/site/features.rb +32 -0
  166. data/lib/spontaneous/plugins/site/instance.rb +3 -2
  167. data/lib/spontaneous/plugins/site/level.rb +18 -0
  168. data/lib/spontaneous/plugins/site/map.rb +2 -1
  169. data/lib/spontaneous/plugins/site/publishing.rb +56 -59
  170. data/lib/spontaneous/plugins/site/revisions.rb +24 -19
  171. data/lib/spontaneous/plugins/site/schema.rb +33 -0
  172. data/lib/spontaneous/plugins/site/search.rb +43 -0
  173. data/lib/spontaneous/plugins/site/selectors.rb +35 -30
  174. data/lib/spontaneous/plugins/site/storage.rb +63 -0
  175. data/lib/spontaneous/plugins/site_map.rb +23 -25
  176. data/lib/spontaneous/plugins/styles.rb +35 -43
  177. data/lib/spontaneous/plugins/supertype.rb +3 -1
  178. data/lib/spontaneous/plugins/visibility.rb +90 -83
  179. data/lib/spontaneous/prototypes/box_prototype.rb +55 -25
  180. data/lib/spontaneous/prototypes/field_prototype.rb +66 -19
  181. data/lib/spontaneous/prototypes/style_prototype.rb +2 -2
  182. data/lib/spontaneous/publishing.rb +1 -1
  183. data/lib/spontaneous/publishing/immediate.rb +128 -49
  184. data/lib/spontaneous/publishing/simultaneous.rb +70 -0
  185. data/lib/spontaneous/rack.rb +38 -26
  186. data/lib/spontaneous/rack/around_back.rb +3 -23
  187. data/lib/spontaneous/rack/around_preview.rb +3 -8
  188. data/lib/spontaneous/rack/assets.rb +7 -6
  189. data/lib/spontaneous/rack/authentication.rb +21 -0
  190. data/lib/spontaneous/rack/back.rb +310 -331
  191. data/lib/spontaneous/rack/cacheable_file.rb +27 -0
  192. data/lib/spontaneous/rack/cookie_authentication.rb +38 -0
  193. data/lib/spontaneous/rack/css.rb +43 -0
  194. data/lib/spontaneous/rack/event_source.rb +31 -0
  195. data/lib/spontaneous/rack/front.rb +30 -8
  196. data/lib/spontaneous/rack/helpers.rb +31 -0
  197. data/lib/spontaneous/rack/media.rb +22 -21
  198. data/lib/spontaneous/rack/public.rb +2 -1
  199. data/lib/spontaneous/rack/query_authentication.rb +35 -0
  200. data/lib/spontaneous/rack/reloader.rb +6 -3
  201. data/lib/spontaneous/rack/user_helpers.rb +28 -0
  202. data/lib/spontaneous/render.rb +64 -23
  203. data/lib/spontaneous/render/context_base.rb +143 -0
  204. data/lib/spontaneous/render/format.rb +24 -19
  205. data/lib/spontaneous/render/helpers.rb +14 -0
  206. data/lib/spontaneous/render/helpers/html_helper.rb +69 -0
  207. data/lib/spontaneous/render/helpers/script_helper.rb +17 -0
  208. data/lib/spontaneous/render/helpers/stylesheet_helper.rb +16 -0
  209. data/lib/spontaneous/render/preview_context.rb +8 -0
  210. data/lib/spontaneous/render/preview_renderer.rb +6 -0
  211. data/lib/spontaneous/render/publish_context.rb +22 -0
  212. data/lib/spontaneous/render/published_renderer.rb +12 -13
  213. data/lib/spontaneous/render/publishing_renderer.rb +3 -0
  214. data/lib/spontaneous/render/render_cache.rb +26 -0
  215. data/lib/spontaneous/render/renderer.rb +5 -1
  216. data/lib/spontaneous/render/request_context.rb +8 -0
  217. data/lib/spontaneous/schema.rb +56 -24
  218. data/lib/spontaneous/schema/schema_modification.rb +2 -2
  219. data/lib/spontaneous/schema/uid.rb +22 -106
  220. data/lib/spontaneous/schema/uid_map.rb +120 -0
  221. data/lib/spontaneous/search.rb +11 -0
  222. data/lib/spontaneous/search/compound_indexer.rb +26 -0
  223. data/lib/spontaneous/search/database.rb +72 -0
  224. data/lib/spontaneous/search/field.rb +95 -0
  225. data/lib/spontaneous/search/index.rb +184 -0
  226. data/lib/spontaneous/search/results.rb +34 -0
  227. data/lib/spontaneous/server.rb +5 -1
  228. data/lib/spontaneous/site.rb +56 -16
  229. data/lib/spontaneous/storage.rb +22 -0
  230. data/lib/spontaneous/storage/backend.rb +10 -0
  231. data/lib/spontaneous/storage/cloud.rb +104 -0
  232. data/lib/spontaneous/storage/local.rb +52 -0
  233. data/lib/spontaneous/style.rb +27 -9
  234. data/lib/spontaneous/version.rb +1 -1
  235. data/spontaneous.gemspec +719 -0
  236. data/test/disabled/test_slots.rb +1 -1
  237. data/test/experimental/test_cutaneous.rb +309 -0
  238. data/test/experimental/test_features.rb +129 -0
  239. data/test/fixtures/application/views/{index.erubis → index.erb} +0 -0
  240. data/test/fixtures/back/public/css/sass_include.scss +5 -0
  241. data/test/fixtures/back/public/css/sass_template.scss +4 -0
  242. data/test/fixtures/example_application/templates/client_project.html.cut +4 -4
  243. data/test/fixtures/example_application/templates/client_project/images.html.cut +1 -1
  244. data/test/fixtures/example_application/templates/client_projects.html.cut +2 -2
  245. data/test/fixtures/example_application/templates/inline_image.html.cut +1 -1
  246. data/test/fixtures/example_application/templates/layouts/home.html.cut +7 -7
  247. data/test/fixtures/example_application/templates/layouts/info.html.cut +1 -1
  248. data/test/fixtures/example_application/templates/layouts/project.html.cut +4 -4
  249. data/test/fixtures/example_application/templates/layouts/projects.html.cut +2 -2
  250. data/test/fixtures/example_application/templates/project.html.cut +2 -2
  251. data/test/fixtures/example_application/templates/project/inline.html.cut +3 -3
  252. data/test/fixtures/example_application/templates/project_image.html.cut +1 -1
  253. data/test/fixtures/example_application/templates/text.html.cut +1 -1
  254. data/test/fixtures/fields/youtube_api_response.xml +102 -0
  255. data/test/fixtures/layouts/layouts/custom4.html.cut +0 -0
  256. data/test/fixtures/plugins/schema_plugin/public/css/plugin.css +1 -0
  257. data/test/fixtures/plugins/schema_plugin/public/js/plugin.js +1 -0
  258. data/test/fixtures/plugins/schema_plugin/public/static.html +1 -0
  259. data/test/fixtures/plugins/schema_plugin/public/subdir/image.gif +1 -0
  260. data/test/fixtures/plugins/schema_plugin/public/subdir/include1.scss +3 -0
  261. data/test/fixtures/plugins/schema_plugin/public/subdir/sass.scss +4 -0
  262. data/test/fixtures/plugins/schema_plugin/public/subdir/sass/include2.scss +4 -0
  263. data/test/fixtures/public/templates/layouts/default.html.cut +1 -1
  264. data/test/fixtures/public/templates/layouts/default.pdf.cut +1 -1
  265. data/test/fixtures/public/templates/layouts/default.rss.cut +1 -1
  266. data/test/fixtures/public/templates/layouts/dynamic.html.cut +1 -1
  267. data/test/fixtures/schema_modification/config/database.yml +0 -0
  268. data/test/fixtures/schema_modification/config/environment.rb +2 -0
  269. data/test/fixtures/schema_modification/schema/box.rb +1 -0
  270. data/test/fixtures/schema_modification/schema/custom_box.rb +1 -0
  271. data/test/fixtures/schema_modification/schema/page.rb +6 -0
  272. data/test/fixtures/schema_modification/schema/piece.rb +1 -0
  273. data/test/fixtures/search/config/database.yml +1 -0
  274. data/test/fixtures/search/config/indexes.rb +4 -0
  275. data/test/fixtures/serialisation/root_hash.yaml.erb +16 -20
  276. data/test/fixtures/storage/cloud/environment.rb +12 -0
  277. data/test/fixtures/storage/default/environment.rb +1 -0
  278. data/test/fixtures/templates/aliases/layouts/c_alias.html.cut +1 -1
  279. data/test/fixtures/templates/content/include.html.cut +1 -1
  280. data/test/fixtures/templates/content/include_dir.html.cut +1 -1
  281. data/test/fixtures/templates/content/included.epub.cut +1 -1
  282. data/test/fixtures/templates/content/included.html.cut +1 -1
  283. data/test/fixtures/templates/content/partial/included.html.cut +1 -1
  284. data/test/fixtures/templates/content/preprocess.html.cut +1 -1
  285. data/test/fixtures/templates/content/second.html.cut +1 -1
  286. data/test/fixtures/templates/content/template.epub.cut +1 -1
  287. data/test/fixtures/templates/content/template.html.cut +1 -1
  288. data/test/fixtures/templates/default_style_class.html.cut +1 -1
  289. data/test/fixtures/templates/engine/braces.html.cut +6 -0
  290. data/test/fixtures/templates/engine/multiline.html.cut +5 -0
  291. data/test/fixtures/templates/extended/grandparent.html.cut +7 -7
  292. data/test/fixtures/templates/extended/main.html.cut +5 -5
  293. data/test/fixtures/templates/extended/parent.html.cut +10 -8
  294. data/test/fixtures/templates/extended/partial.html.cut +1 -0
  295. data/test/fixtures/templates/extended/partial_with_locals.html.cut +1 -0
  296. data/test/fixtures/templates/extended/with_includes.html.cut +9 -0
  297. data/test/fixtures/templates/extended/with_includes_and_locals.html.cut +9 -0
  298. data/test/fixtures/templates/layouts/entries.html.cut +7 -7
  299. data/test/fixtures/templates/layouts/page_style.html.cut +1 -1
  300. data/test/fixtures/templates/layouts/params.html.cut +1 -1
  301. data/test/fixtures/templates/layouts/preview_render.html.cut +2 -2
  302. data/test/fixtures/templates/layouts/standard_page.html.cut +1 -1
  303. data/test/fixtures/templates/layouts/subdir_style.html.cut +1 -1
  304. data/test/fixtures/templates/layouts/template_params.html.cut +1 -1
  305. data/test/fixtures/templates/layouts/variables.html.cut +7 -0
  306. data/test/fixtures/templates/page_class/inline_style.html.cut +1 -1
  307. data/test/fixtures/templates/preview_render/variables.html.cut +1 -0
  308. data/test/fixtures/templates/publishing/templates/layouts/dynamic.html.cut +1 -0
  309. data/test/fixtures/templates/publishing/templates/layouts/dynamic.rtf.cut +1 -0
  310. data/test/fixtures/templates/publishing/templates/layouts/static.html.cut +1 -0
  311. data/test/fixtures/templates/template_class/anonymous_style.html.cut +2 -2
  312. data/test/fixtures/templates/template_class/complex_template.html.cut +4 -4
  313. data/test/fixtures/templates/template_class/complex_template.pdf.cut +4 -4
  314. data/test/fixtures/templates/template_class/default_template_style.html.cut +2 -2
  315. data/test/fixtures/templates/template_class/images_with_template.html.cut +3 -3
  316. data/test/fixtures/templates/template_class/slots_template.html.cut +3 -3
  317. data/test/fixtures/templates/template_class/slots_template.pdf.cut +3 -3
  318. data/test/fixtures/templates/template_class/this_template.epub.cut +1 -1
  319. data/test/fixtures/templates/template_class/this_template.html.cut +1 -1
  320. data/test/fixtures/templates/template_class/this_template.pdf.cut +1 -1
  321. data/test/fixtures/templates/with_default_style_class.html.cut +1 -1
  322. data/test/functional/test_application.rb +19 -15
  323. data/test/functional/test_back.rb +130 -98
  324. data/test/functional/test_front.rb +72 -28
  325. data/test/javascript/test_dom.rb +1 -1
  326. data/test/javascript/test_markdown.rb +1 -1
  327. data/test/slow/test_publishing.rb +94 -75
  328. data/test/slow/test_visibility.rb +47 -14
  329. data/test/test_helper.rb +30 -3
  330. data/test/ui/test_page_editing.rb +1 -1
  331. data/test/unit/test_alias.rb +200 -16
  332. data/test/unit/test_authentication.rb +26 -28
  333. data/test/unit/test_boxes.rb +146 -75
  334. data/test/unit/test_config.rb +42 -20
  335. data/test/unit/test_content.rb +156 -37
  336. data/test/unit/test_content_inheritance.rb +4 -2
  337. data/test/unit/test_extensions.rb +7 -1
  338. data/test/unit/test_fields.rb +558 -290
  339. data/test/{experimental → unit}/test_formats.rb +42 -3
  340. data/test/unit/test_generators.rb +3 -2
  341. data/test/unit/test_helpers.rb +54 -0
  342. data/test/unit/test_image_size.rb +1 -1
  343. data/test/unit/test_images.rb +51 -40
  344. data/test/unit/test_layouts.rb +21 -4
  345. data/test/unit/test_logger.rb +1 -1
  346. data/test/unit/test_media.rb +165 -7
  347. data/test/unit/test_page.rb +158 -27
  348. data/test/unit/test_permissions.rb +170 -187
  349. data/test/unit/test_piece.rb +27 -9
  350. data/test/unit/test_plugins.rb +153 -0
  351. data/test/unit/test_prototype_set.rb +60 -2
  352. data/test/unit/test_prototypes.rb +81 -20
  353. data/test/unit/test_render.rb +97 -9
  354. data/test/unit/test_schema.rb +167 -120
  355. data/test/unit/test_search.rb +588 -0
  356. data/test/unit/test_serialisation.rb +26 -10
  357. data/test/unit/test_site.rb +42 -25
  358. data/test/unit/test_storage.rb +88 -0
  359. data/test/unit/test_structure.rb +11 -5
  360. data/test/unit/test_styles.rb +64 -3
  361. data/test/unit/test_table_scoping.rb +76 -0
  362. data/test/unit/test_templates.rb +69 -31
  363. data/test/unit/test_type_hierarchy.rb +9 -1
  364. metadata +274 -208
  365. data/Gemfile.lock +0 -146
  366. data/application/css/min/54ee0ed3c7fac7632bd5c020d69e9a2503e0c88c.css +0 -1
  367. data/application/css/min/c256adc144e2bdd0b0539356b04eb62db01e1dc3.css +0 -1
  368. data/application/js/edit_dialogue.js +0 -137
  369. data/application/js/min/492a209de8ee955fa9c729a765377495001e11b1.js +0 -17
  370. data/application/js/min/80f684d77c940887a1d4a63e3a96102e993baa98.js +0 -88
  371. data/application/js/min/c7140ec9475e5bf868b901e0621338d7d162358b.js +0 -3
  372. data/application/js/min/f07f2bd6630ee31e1c2288ec223383d8f0658ba6.js +0 -2
  373. data/application/js/vendor/.DS_Store +0 -0
  374. data/application/js/vendor/JS.Class-2.1.5/src/command.js +0 -93
  375. data/application/js/vendor/JS.Class-2.1.5/src/comparable.js +0 -37
  376. data/application/js/vendor/JS.Class-2.1.5/src/constant_scope.js +0 -48
  377. data/application/js/vendor/JS.Class-2.1.5/src/core.js +0 -1060
  378. data/application/js/vendor/JS.Class-2.1.5/src/decorator.js +0 -50
  379. data/application/js/vendor/JS.Class-2.1.5/src/enumerable.js +0 -505
  380. data/application/js/vendor/JS.Class-2.1.5/src/forwardable.js +0 -22
  381. data/application/js/vendor/JS.Class-2.1.5/src/hash.js +0 -334
  382. data/application/js/vendor/JS.Class-2.1.5/src/linked_list.js +0 -114
  383. data/application/js/vendor/JS.Class-2.1.5/src/loader.js +0 -553
  384. data/application/js/vendor/JS.Class-2.1.5/src/method_chain.js +0 -172
  385. data/application/js/vendor/JS.Class-2.1.5/src/observable.js +0 -55
  386. data/application/js/vendor/JS.Class-2.1.5/src/package.js +0 -472
  387. data/application/js/vendor/JS.Class-2.1.5/src/proxy.js +0 -58
  388. data/application/js/vendor/JS.Class-2.1.5/src/ruby.js +0 -44
  389. data/application/js/vendor/JS.Class-2.1.5/src/set.js +0 -332
  390. data/application/js/vendor/JS.Class-2.1.5/src/stack_trace.js +0 -151
  391. data/application/js/vendor/JS.Class-2.1.5/src/state.js +0 -95
  392. data/application/js/vendor/JS.Class-2.1.5/src/stdlib.js +0 -2612
  393. data/application/js/vendor/jquery-1.4.2.min.js +0 -154
  394. data/application/js/vendor/jquery-1.4.3.min.js +0 -166
  395. data/application/js/vendor/jquery-1.5.1.min.js +0 -16
  396. data/application/js/vendor/jquery-1.5.1rc1.min.js +0 -24
  397. data/application/js/vendor/jquery-ui-1.8.6.custom.min.js +0 -265
  398. data/application/js/vendor/jquery-ui-1.8.custom.min.js +0 -106
  399. data/application/js/vendor/jquery.hotkeys-0.7.9.js +0 -248
  400. data/application/js/vendor/jquery.hotkeys-0.7.9.min.js +0 -19
  401. data/application/js/vendor/jsdiff.js +0 -169
  402. data/lib/cutaneous/first_pass_parser.rb +0 -23
  403. data/lib/cutaneous/parser_core.rb +0 -18
  404. data/lib/cutaneous/second_pass_parser.rb +0 -23
  405. data/lib/sequel/plugins/yajl_serialization.rb +0 -154
  406. data/lib/spontaneous/plugins.rb +0 -20
  407. data/lib/spontaneous/proxy_object.rb +0 -12
  408. data/lib/spontaneous/publishing/fire_and_forget.rb +0 -57
  409. data/lib/spontaneous/render/context.rb +0 -100
  410. data/spontaneous.gemspec.tmpl +0 -66
  411. data/test/experimental/test_plugins.rb +0 -64
  412. data/test/fixtures/templates/publishing/layouts/dynamic.html.cut +0 -1
  413. data/test/fixtures/templates/publishing/layouts/static.html.cut +0 -1
data/Gemfile.lock DELETED
@@ -1,146 +0,0 @@
1
- GIT
2
- remote: https://github.com/dasch/shoulda.git
3
- revision: 16984cacbbff26413f83f19ca2f5c7aa1326cd27
4
- branch: minitest
5
- specs:
6
- shoulda (2.11.3)
7
-
8
- PATH
9
- remote: /Users/garry/Dropbox/Development/spontaneous3/locat
10
- specs:
11
- locat (0.1.1)
12
- ansi
13
- grit
14
-
15
- GEM
16
- remote: http://rubygems.org/
17
- specs:
18
- activesupport (3.0.7)
19
- ansi (1.3.0)
20
- base58 (0.1.0)
21
- columnize (0.3.2)
22
- configuration (1.2.0)
23
- daemons (1.1.3)
24
- diff-lcs (1.1.2)
25
- envjs (0.3.7)
26
- johnson (>= 2.0.0.pre3)
27
- erubis (2.7.0)
28
- eventmachine (0.12.10)
29
- fire_and_forget (0.3.3)
30
- git (1.2.5)
31
- grit (2.4.1)
32
- diff-lcs (~> 1.1)
33
- mime-types (~> 1.15)
34
- harmony (0.5.6)
35
- envjs (= 0.3.7)
36
- johnson (= 2.0.0.pre3)
37
- home_run (1.0.2)
38
- hwia (1.0.2)
39
- jeweler (1.6.0)
40
- bundler (~> 1.0.0)
41
- git (>= 1.2.5)
42
- rake
43
- jnunemaker-matchy (0.4.0)
44
- johnson (2.0.0.pre3)
45
- stackdeck (~> 0.2)
46
- kramdown (0.13.3)
47
- launchy (0.4.0)
48
- configuration (>= 0.0.5)
49
- rake (>= 0.8.1)
50
- leftright (0.9.1)
51
- less (1.2.21)
52
- mutter (>= 0.4.2)
53
- treetop (>= 1.4.2)
54
- linecache (0.43)
55
- mime-types (1.16)
56
- mini_magick (3.3)
57
- subexec (~> 0.1.0)
58
- minitest (2.1.0)
59
- mocha (0.9.12)
60
- multipart-post (1.1.3)
61
- mutter (0.5.3)
62
- mysql2 (0.3.2)
63
- polyglot (0.3.1)
64
- rack (1.3.0.beta2)
65
- rack-test (0.6.0)
66
- rack (>= 1.0)
67
- rake (0.8.7)
68
- reek (1.2.8)
69
- ruby2ruby (~> 1.2)
70
- ruby_parser (~> 2.0)
71
- sexp_processor (~> 3.0)
72
- ruby-debug (0.10.4)
73
- columnize (>= 0.1)
74
- ruby-debug-base (~> 0.10.4.0)
75
- ruby-debug-base (0.10.4)
76
- linecache (>= 0.3)
77
- ruby2ruby (1.2.5)
78
- ruby_parser (~> 2.0)
79
- sexp_processor (~> 3.0)
80
- ruby_parser (2.0.6)
81
- sexp_processor (~> 3.0)
82
- sass (3.1.4)
83
- selenium-client (1.2.18)
84
- sequel (3.24.1)
85
- sexp_processor (3.0.5)
86
- shine (0.6)
87
- multipart-post (>= 1.0)
88
- sinatra (1.1.4)
89
- rack (~> 1.1)
90
- tilt (< 2.0, >= 1.2.2)
91
- stackdeck (0.2.0)
92
- stringex (1.2.1)
93
- subexec (0.1.0)
94
- tenjin (0.6.1)
95
- thin (1.2.11)
96
- daemons (>= 1.0.9)
97
- eventmachine (>= 0.12.6)
98
- rack (>= 1.0.0)
99
- thor (0.14.6)
100
- tilt (1.3.1)
101
- timecop (0.3.5)
102
- treetop (1.4.9)
103
- polyglot (>= 0.3.1)
104
- yajl-ruby (0.8.2)
105
-
106
- PLATFORMS
107
- ruby
108
-
109
- DEPENDENCIES
110
- activesupport (~> 3.0.4)
111
- base58 (~> 0.1.0)
112
- erubis (~> 2.6)
113
- fire_and_forget (~> 0.3.2)
114
- harmony (~> 0.5)
115
- home_run (~> 1.0.0)
116
- hwia (~> 1.0.2)
117
- jeweler (~> 1.5)
118
- jnunemaker-matchy (~> 0.4)
119
- johnson (= 2.0.0.pre3)
120
- kramdown (~> 0.13.3)
121
- launchy (~> 0.4.0)
122
- leftright (~> 0.9)
123
- less (~> 1.2)
124
- locat!
125
- mini_magick (~> 3.3)
126
- minitest (~> 2.1.0)
127
- mocha (~> 0.9)
128
- mysql2 (~> 0.2)
129
- rack (~> 1.3.beta)
130
- rack-test (~> 0.5)
131
- rake (~> 0.8.7)
132
- reek
133
- ruby-debug
134
- sass (~> 3.1.4)
135
- selenium-client (~> 1.2.18)
136
- sequel (~> 3.20)
137
- shine (~> 0.6)
138
- shoulda!
139
- sinatra (~> 1.1.2)
140
- stackdeck (~> 0.2)
141
- stringex (~> 1.1)
142
- tenjin (~> 0.6.1)
143
- thin (~> 1.2)
144
- thor (~> 0.14.6)
145
- timecop (~> 0.3)
146
- yajl-ruby (~> 0.7)
@@ -1 +0,0 @@
1
- .shadow{-webkit-box-shadow:0px 3px 30px #cccccc;-moz-box-shadow:0px 3px 30px #cccccc}.clearfix:after,#outer #login form .inputs .submit:after{content:".";display:block;height:0;clear:both;visibility:hidden}.box-flexible{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1}.no-select,.interface,.button,#outer #login form .inputs label span,#outer #login form .inputs button{-moz-user-select:none;-webkit-user-select:none}.interface,.button,#outer #login form .inputs label span,#outer #login form .inputs button{font-family:"HelveticaNeue", "Helvetica Neue", "FrutigerLTStd-Roman", "Frutiger LT Std";-webkit-font-smoothing:antialiased;text-transform:uppercase;font-size:10px;font-weight:bold}.button{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;text-align:center;height:17px;padding-top:2px;font-weight:bold;display:inline-block;text-decoration:none;background-color:#10b2fe;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#29bafe), to(#01a6f3));background-image:-moz-linear-gradient(top, #29bafe, #01a6f3);color:white !important}.button:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}.button:hover{background-color:#ff6c03 !important;color:white !important}.button .key-combo{opacity:0.5;margin-left:4px}.button.cancel{background-color:#6b6b6b;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#787878), to(#5e5e5e));background-image:-moz-linear-gradient(top, #787878, #5e5e5e)}.button.cancel:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}.controls-gradient{background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#404040), to(#222));background-image:-moz-linear-gradient(top, #404040, #222)}body,h1,h2,h3,h4,h5,h6,dd,dt,ul,ol,li{margin:0;padding:0;font-weight:normal;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}body{margin-bottom:300px;background-color:white;font-family:"HelveticaNeue", "Helvetica Neue", "FrutigerLTStd-Light", "Frutiger LT Std 45 Light"}ul,ol{list-style-type:none}a{text-decoration:none}#outer{width:400px;margin:0 auto;top:100px;position:relative}#outer h1{margin:0;padding:0;padding-left:8px;font-weight:100;font-family:"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", "FrutigerLTStd-Light", "Frutiger LT Std";-webkit-font-smoothing:antialiased;font-size:24px;line-height:28px;color:#666}#outer #login{position:relative}#outer #login #splash{display:none;width:100px;height:108px;background:url(/@spontaneous/static/spot.svg) 0 0 no-repeat;-moz-background-size:100% 100%;-o-background-size:100% 100%;-webkit-background-size:100% 100%;background-size:100% 100%;position:absolute;left:-108px;top:-5px}#outer #login form{-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;background-color:#eee;border:solid 3px #fafafa;font-family:"HelveticaNeue", "Helvetica Neue", "FrutigerLTStd-Light", "Frutiger LT Std 45 Light"}#outer #login form p{position:relative;margin-top:0;margin-bottom:4px}#outer #login form p.error{-webkit-font-smoothing:antialiased;-webkit-border-top-right-radius:8px;-moz-border-radius-topright:8px;border-top-right-radius:8px;-webkit-border-top-left-radius:8px;-moz-border-radius-topleft:8px;border-top-left-radius:8px;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(red), to(#f00000));background-image:-moz-linear-gradient(top, red, #f00000);padding:8px;color:#fff}#outer #login form .inputs{padding:8px}#outer #login form .inputs input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:none;font-size:14px;font-weight:bold;padding:4px;width:376px;font-family:"HelveticaNeue", "Helvetica Neue", "FrutigerLTStd-Light", "Frutiger LT Std 45 Light";outline-color:#10b2fe}#outer #login form .inputs label{position:relative}#outer #login form .inputs label span{position:absolute;left:8px;top:4px;color:#666}#outer #login form .inputs label span.faded{opacity:0.5}#outer #login form .inputs .submit{margin-bottom:0}#outer #login form .inputs button{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;text-align:center;height:17px;padding-top:2px;font-weight:bold;display:inline-block;text-decoration:none;background-color:#10b2fe;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#29bafe), to(#01a6f3));background-image:-moz-linear-gradient(top, #29bafe, #01a6f3);color:white !important;border:none;float:right;width:96px}#outer #login form .inputs button:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}
@@ -1 +0,0 @@
1
- .shadow,#page-slots.slots .slot-entries .entry-wrap .dialogue,#page-slots.slots .slot-entries .entry-wrap.ui-sortable-helper .entry-contents,#dialogue-wrap #dialogue-outer,#editing,#status-bar,.pop-over,.editing-panel .field-group.image .field .value img{-webkit-box-shadow:0px 3px 30px #cccccc;-moz-box-shadow:0px 3px 30px #cccccc}.clearfix:after,#top:after,.fields-preview:after,.fields-preview-text li:after,.fields-preview-image:after,#page-slots.slots .slot-tabs:after,#page-slots.slots .slot-entries .entry-wrap:after,#page-slots.slots .slot-entries .entry-wrap .entry-inner:after,#page-slots.slots .slot-entries .entry-wrap .slots .slot-tabs:after,#editing:after,.editing-panel .editing-fields:after,#editing #content-panel .tabs:after,#editing #content-panel #content-wrapper .facet-allowed .type-list:after{content:".";display:block;height:0;clear:both;visibility:hidden}.box-flexible,.pop-over > header > h3,.pop-over #popover-delete a,.editing-panel .field-group.image{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1}.no-select,.interface,.button,.preview-label,.fields-preview-text .name,.fields-preview-image li .name,#top #navigation li select,#top #switch-mode,#top #open-publish,#page-content #page-info .path,#page-content #page-info .path h3,#page-content #page-info .path h3.developer a,#page-content #page-info .buttons .status,#page-slots.slots .slot-tabs li,#page-slots.slots .slot-addable a,#page-slots.slots .slot-entries .entry-wrap .title-bar,#page-slots.slots .slot-entries .entry-wrap .dialogue .buttons a,#page-slots.slots .slot-entries .entry-wrap .slots .slot-tabs li,#page-slots.slots .slot-entries .entry-wrap .slots .slot-addable,#page-slots.slots .slot-entries .entry-wrap .slots .slot-addable a,#create-home-dialogue .instructions,#publishing-dialogue .change-list .actions,#publishing-dialogue .change-set .add span,#editing .field-group .name,.pop-over > header > h3,.pop-over .button.close,.pop-over .button.cancel,.pop-over .pop-insert-link label,.pop-over .link-page-browser .page-list .page,.pop-over .link-page-browser .page-ancestors ul li,.pop-over #popover-delete a.ok,.pop-over #popover-delete a.cancel,.editing-panel .editing-toolbar .buttons .save,.editing-panel .editing-toolbar .buttons .cancel,.editing-panel .field-group .name,.editing-panel .field-group.image .field .value .info,.field .markdown-editor .md-toolbar a,#conflicted-fields-dialogue .instructions,#conflicted-fields-dialogue .labels .diff,#add-alias-dialogue .instructions,.fields-preview-image li .value img{-moz-user-select:none;-webkit-user-select:none}.interface,.button,.preview-label,.fields-preview-text .name,.fields-preview-image li .name,#top #navigation li select,#top #switch-mode,#top #open-publish,#page-content #page-info .path,#page-content #page-info .path h3,#page-content #page-info .path h3.developer a,#page-content #page-info .buttons .status,#page-slots.slots .slot-tabs li,#page-slots.slots .slot-addable a,#page-slots.slots .slot-entries .entry-wrap .title-bar,#page-slots.slots .slot-entries .entry-wrap .dialogue .buttons a,#page-slots.slots .slot-entries .entry-wrap .slots .slot-tabs li,#page-slots.slots .slot-entries .entry-wrap .slots .slot-addable,#page-slots.slots .slot-entries .entry-wrap .slots .slot-addable a,#create-home-dialogue .instructions,#publishing-dialogue .change-list .actions,#publishing-dialogue .change-set .add span,#editing .field-group .name,.pop-over > header > h3,.pop-over .button.close,.pop-over .button.cancel,.pop-over .pop-insert-link label,.pop-over .link-page-browser .page-list .page,.pop-over .link-page-browser .page-ancestors ul li,.pop-over #popover-delete a.ok,.pop-over #popover-delete a.cancel,.editing-panel .editing-toolbar .buttons .save,.editing-panel .editing-toolbar .buttons .cancel,.editing-panel .field-group .name,.editing-panel .field-group.image .field .value .info,.field .markdown-editor .md-toolbar a,#conflicted-fields-dialogue .instructions,#conflicted-fields-dialogue .labels .diff,#add-alias-dialogue .instructions{font-family:"HelveticaNeue", "Helvetica Neue", "FrutigerLTStd-Roman", "Frutiger LT Std";-webkit-font-smoothing:antialiased;text-transform:uppercase;font-size:10px;font-weight:bold}.button{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;text-align:center;height:17px;padding-top:2px;font-weight:bold;display:inline-block;text-decoration:none;background-color:#10b2fe;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#29bafe), to(#01a6f3));background-image:-moz-linear-gradient(top, #29bafe, #01a6f3);color:white !important}.button:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}.button:hover{background-color:#ff6c03 !important;color:white !important}.button .key-combo{opacity:0.5;margin-left:4px}.button.cancel{background-color:#6b6b6b;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#787878), to(#5e5e5e));background-image:-moz-linear-gradient(top, #787878, #5e5e5e)}.button.cancel:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}.controls-gradient,#top,#dialogue-wrap #dialogue-outer #dialogue-title,#status-bar,.pop-over > header{background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#404040), to(#222));background-image:-moz-linear-gradient(top, #404040, #222)}body,h1,h2,h3,h4,h5,h6,dd,dt,ul,ol,li{margin:0;padding:0;font-weight:normal;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}body{margin-bottom:300px;background-color:white;font-family:"HelveticaNeue", "Helvetica Neue", "FrutigerLTStd-Light", "Frutiger LT Std 45 Light"}ul,ol{list-style-type:none}a{text-decoration:none}.preview-label,.fields-preview-text .name,.fields-preview-image li .name{color:#333333}.preview-value,.fields-preview-text .value{font-size:11px;font-family:"HelveticaNeue", "Helvetica Neue", "FrutigerLTStd-Light", "Frutiger LT Std 45 Light";line-height:13px;color:#666666;font-weight:normal}.container-padding,#top,#page-content #page-info,#page-content #page-fields .fields-preview,#page-slots.slots .fields-preview.depth-box,#page-slots.slots .slot-addable,#status-bar{padding-left:64px;padding-right:64px}img.missing{width:100%;height:50px;background:url("/@spontaneous/static/missing.png") 50% 50% no-repeat;border:none}.clear{clear:both}#top{display:-webkit-box;display:-moz-box;display:box;box-align:center;-webkit-box-align:center;-moz-box-align:center;position:fixed;height:31px;top:0;right:0;left:0}#top #navigation{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;font-size:11px;font-weight:bold;color:#999999;width:100%}#top #navigation li{padding-left:10px;padding-right:15px;background:url("/@spontaneous/static/location-arrow.png") right 0 no-repeat;float:left;display:block;font-weight:bold}#top #navigation li select{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;text-transform:none;font-size:11px;-webkit-appearance:none;cursor:pointer;display:block;background:url("/@spontaneous/static/select-arrow.png") 95% 50% no-repeat;border:none;outline:none;position:relative;padding-top:0px;padding-right:25px;height:31px;color:#888888;font-weight:bold;width:100%}#top #navigation li select.unselected{color:#555555;font-weight:normal;font-style:italic;max-width:80px}#top #navigation li a{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;color:#888888;height:31px;padding-top:9px;display:block;background:url("/@spontaneous/static/select-arrow.png") right 50% no-repeat;padding-right:20px}#top #navigation li a:hover,#top #navigation li select:hover{color:white}#top #navigation li.root a{background-image:none}#top #navigation li:first-child{background-image:url("/@spontaneous/static/spontaneous.png"),url("/@spontaneous/static/location-arrow.png");background-position:0 70%, right 0;background-repeat:no-repeat;padding-right:12px}#top #navigation li:first-child a{padding-right:28px}#top #switch-mode,#top #open-publish{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;text-align:center;height:17px;padding-top:2px;font-weight:bold;display:inline-block;text-decoration:none;background-color:#10b2fe;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#29bafe), to(#01a6f3));background-image:-moz-linear-gradient(top, #29bafe, #01a6f3);color:white !important;display:-webkit-box;display:-moz-box;display:box;box-orient:vertical;-webkit-box-orient:vertical;-moz-box-orient:vertical;box-align:center;-webkit-box-align:center;-moz-box-align:center;margin:0;width:64px}#top #switch-mode:hover,#top #open-publish:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}#top #open-publish{position:relative;margin-right:8px}#top #open-publish #publish-progress{position:absolute;left:4px;top:1px}#top #open-publish.progress{padding-left:20px;padding-right:20px;width:124px;background-color:#666;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#737373), to(#595959));background-image:-moz-linear-gradient(top, #737373, #595959);color:#999999}#top #open-publish.progress:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}#content{position:fixed;overflow:auto;top:31px;right:0;bottom:0px;left:0}#content #data_pane,#content #preview_pane{border:none;display:block;position:absolute;left:0;right:0;top:0;bottom:0;width:100%;height:100%}#page-content #page-info{background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#3a3a3a), to(#222));background-image:-moz-linear-gradient(top, #3a3a3a, #222);height:54px;padding-top:10px;position:relative}#page-content #page-info h1,#page-content #page-info h3{position:relative}#page-content #page-info h1{font-family:"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", "FrutigerLTStd-Light", "Frutiger LT Std";font-weight:100;color:white;font-size:24px;line-height:21px}#page-content #page-info h1 span{color:#888888}#page-content #page-info .path,#page-content #page-info .path h3,#page-content #page-info .path h3.developer a{cursor:pointer;color:#c1c1c1;font-size:11px;line-height:12px;text-transform:none}#page-content #page-info .path .uid,#page-content #page-info .path .developer{margin-left:32px;opacity:0.5}#page-content #page-info .path .uid.missing,#page-content #page-info .path .developer.missing{opacity:0.5}#page-content #page-info > .path{display:-webkit-box;display:-moz-box;display:box;position:absolute;bottom:12px}#page-content #page-info .path .edit{display:-webkit-box;display:-moz-box;display:box;box-orient:horizontal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;box-align:center;-webkit-box-align:center;-moz-box-align:center}#page-content #page-info .path .edit .input-error{display:block;position:relative;top:0;vertical-align:top;margin-left:8px}#page-content #page-info .path .edit .input-error input[type="text"],#page-content #page-info .path .edit .input-error span{height:16px;padding:4px}#page-content #page-info .path .edit .input-error input[type="text"]{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;font-weight:bold;width:400px;border:none;outline:none;vertical-align:top}#page-content #page-info .path .edit .input-error span{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;padding-left:8px;padding-right:8px;background-color:red;position:absolute;right:-1px;top:0;color:white}#page-content #page-info .path .edit input[type="text"].error{color:red}#page-content #page-info .path .edit .input-error.uid-input input[type="text"]{padding-left:1.05em;width:200px}#page-content #page-info .path .edit .button{display:block;margin-left:8px;padding-left:32px;padding-right:32px}#page-content #page-info .path .edit .button.cancel{padding-left:10px;padding-right:10px}#page-content #page-info .path .edit span,#page-content #page-info .path .edit a.path{display:block;position:relative}#page-content #page-info .path .edit a.path{color:#c1c1c1;margin-right:1px}#page-content #page-info .path .edit a.path:hover{color:white}#page-content #page-info .path .edit span{color:#bbbbbb;margin-right:1px}#page-content #page-info .path .edit .hash{color:#666;position:absolute;left:4px;font-weight:bold;padding-top:5px}#page-content #page-info .path h3:hover{color:white}#page-content #page-info .buttons{position:absolute;right:64px;top:16px}#page-content #page-info .buttons .button.publish{width:120px;height:32px;padding-top:8px;background-color:#666666;font-size:12px;position:relative}#page-content #page-info .buttons .button.publish:hover{background-color:#ff6c03}#page-content #page-info .buttons .status{vertical-align:top;display:inline-block;text-transform:none;font-weight:normal;margin:0;padding:0;color:#666666;font-size:10px;line-height:11px;position:relative;top:5px;margin-right:8px}#page-content #page-info .buttons .status strong{display:block;text-transform:uppercase}#page-content #page-fields .fields-preview{padding-top:8px;padding-bottom:8px;position:relative}#page-content #page-fields .fields-preview .overlay{position:absolute;left:0;right:0;top:0;bottom:0;border-style:solid;border-width:2px;border-color:transparent}#page-content #page-fields .fields-preview.hover .overlay{border-color:#10b2fe}.fields-preview{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background-color:#fff;cursor:pointer}.fields-preview .value p{margin:0 0 8px 0;padding:0}.fields-preview .value p:last-child{margin-bottom:0}.fields-preview .fields-preview-text{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.fields-preview-text{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:580px;float:left;padding-right:100px;margin-right:16px}.fields-preview-text.empty{display:none}.fields-preview-text li{border-bottom:solid 1px #cccccc;padding-top:3px;padding-bottom:3px;display:block;line-height:13px;font-size:11px;font-family:"HelveticaNeue", "Helvetica Neue", "FrutigerLTStd-Light", "Frutiger LT Std 45 Light";float:left;width:100%;position:relative;padding-left:100px}.fields-preview-text li .name,.fields-preview-text li .value{float:left}.fields-preview-text li:last-child{border-bottom:none}.fields-preview-text .name{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100px;right:100px;margin-left:-100px;padding-right:8px}.fields-preview-text .value a{color:#ff6c03}.fields-preview-text .value h1,.fields-preview-text .value h2{font-size:1.2em;font-weight:bold;margin-bottom:1em}.fields-preview-text .value h2{font-size:1em}.fields-preview-text .value ul,.fields-preview-text .value ol{display:block;padding-left:1.4em;margin-bottom:8px}.fields-preview-text .value ul li,.fields-preview-text .value ol li{display:list-item;list-style-position:outside;border:none;margin:0;padding:0;float:none}.fields-preview-text .value ul{list-style-type:disc !important}.fields-preview-text .value ol{list-style-type:decimal !important}.fields-preview-image{float:left;width:300px}.fields-preview-image.empty{display:none}.fields-preview-image li{float:left;display:block;margin-right:4px;margin-bottom:4px;position:relative}.fields-preview-image li .name{opacity:0.7;color:black;padding-left:4px;padding-top:2px;background-color:#efefef;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;left:0;right:0;bottom:0;top:auto;height:16px;z-index:4}.fields-preview-image li .value{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;background-color:#efefef;max-height:90px;min-height:45px;min-width:90px;cursor:pointer;text-align:center;position:relative}.fields-preview-image li .value .waiting{position:absolute;display:block;left:0;right:0;text-align:center;top:30%;height:16px;z-index:3}.fields-preview-image li .value .image-drop{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;z-index:100;position:absolute;top:0;right:0;bottom:0;left:0;text-align:center}.fields-preview-image li .value .image-drop .drop-upload-outer{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:solid 1px white;position:absolute;margin:4px;height:6px;left:0;right:0;bottom:50%;padding:0 1px}.fields-preview-image li .value .image-drop .drop-upload-outer .drop-upload-inner{position:relative;margin-right:2px;top:1px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;background-color:white;height:4px}.fields-preview-image li .value .image-drop.drop-active{border:solid 2px #10b2fe;cursor:copy}.fields-preview-image li .value .image-drop.drop-invalid{cursor:no-drop}.fields-preview-image li .value .image-drop.uploading{background-color:rgba(0,0,0,0.5)}.fields-preview-image li .value img{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;position:relative;max-height:90px}#page-slots.slots .slot-tabs{height:32px;vertical-align:top;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#666), to(#4d4d4d));background-image:-moz-linear-gradient(top, #666, #4d4d4d)}#page-slots.slots .slot-tabs li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:11px;color:#dddddd;display:block;float:left;height:100%;padding-left:16px;width:160px;padding-top:9px;cursor:pointer;border-left:solid 1px transparent;border-right:solid 1px #494949;position:relative}#page-slots.slots .slot-tabs li .down{display:none}#page-slots.slots .slot-tabs li:hover,#page-slots.slots .slot-tabs li.active{background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff7d14), to(#ff6c03));background-image:-moz-linear-gradient(top, #ff7d14, #ff6c03);background-color:#ff6c03;color:white;border-right-color:#ff6c03}#page-slots.slots .slot-tabs li:hover .down,#page-slots.slots .slot-tabs li.active .down{position:absolute;display:block;left:0;right:0;bottom:-7px;height:7px;background:url("/@spontaneous/static/orange-down-arrow.png") 50% 0 no-repeat;z-index:1}#page-slots.slots .slot-tabs li:first-child{padding-left:64px;width:224px}#page-slots.slots .slot-tabs li:first-child.active .down{padding-left:64px}#page-slots.slots .slot-tabs li.active + li:hover{border-left-color:#ea5700}#page-slots.slots .fields-preview.depth-box{background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#eee), to(#ddd));background-image:-moz-linear-gradient(top, #eee, #ddd);display:-webkit-box;display:-moz-box;display:box;position:relative;padding-top:12px;padding-bottom:5px}#page-slots.slots .fields-preview.depth-box .overlay{position:absolute;left:0;right:0;top:0;bottom:0;border-style:solid;border-width:2px;border-color:transparent}#page-slots.slots .fields-preview.depth-box.hover .overlay{border-color:#10b2fe}#page-slots.slots .fields-preview.depth-box .value{color:#555555}#page-slots.slots .fields-preview.depth-box .fields-preview-text{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;width:60%}#page-slots.slots .fields-preview.depth-box .fields-preview-image{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;width:40%}#page-slots.slots .slot-addable{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ddd), to(#eee));background-image:-moz-linear-gradient(top, #ddd, #eee);border-top:solid 1px #cccccc;height:40px;padding-top:10px;position:relative}#page-slots.slots .slot-addable a{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;text-align:center;height:17px;padding-top:2px;font-weight:bold;display:inline-block;text-decoration:none;background-color:#10b2fe;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#29bafe), to(#01a6f3));background-image:-moz-linear-gradient(top, #29bafe, #01a6f3);color:white !important;padding-right:16px;padding-left:16px}#page-slots.slots .slot-addable a:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}#page-slots.slots .slot-addable a + a{margin-left:8px}#page-slots.slots .slot-addable .alias{font-style:italic}#page-slots.slots .slot-addable .down{position:absolute;display:block;left:0;right:0;bottom:-18px;height:18px;background:url("/@spontaneous/static/slot-down-arrow.png") 50% 0 no-repeat}#page-slots.slots .slot-addable.drop-active{outline:solid 2px #10b2fe}#page-slots.slots .slot-entries{padding-top:32px}#page-slots.slots .slot-entries .fields-preview{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;padding:4px;background:none;background-color:white}#page-slots.slots .slot-entries .entry-wrap{position:relative;margin-left:64px;margin-right:64px}#page-slots.slots .slot-entries .entry-wrap .entry-contents{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;background-color:gray;padding:1px;padding-top:20px}#page-slots.slots .slot-entries .entry-wrap .entry-spacer{height:32px}#page-slots.slots .slot-entries .entry-wrap .entry-inner{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;background-color:gray;position:relative}#page-slots.slots .slot-entries .entry-wrap .title-bar{background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#919191), to(gray));background-image:-moz-linear-gradient(top, #919191, gray);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;color:rgba(255,255,255,0.4);padding-top:4px;padding-left:6px;text-transform:none;font-weight:normal;cursor:ns-resize;position:absolute;left:0;right:0;top:0;height:16px}#page-slots.slots .slot-entries .entry-wrap .title-bar .actions{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;background-color:rgba(0,0,0,0.2);position:absolute;top:0;right:4px}#page-slots.slots .slot-entries .entry-wrap .title-bar .actions a{background:url("/@spontaneous/static/item-buttons.png") 0 0 no-repeat;display:inline-block;width:15px;height:15px;position:relative;top:4px;cursor:pointer;padding:0 10px}#page-slots.slots .slot-entries .entry-wrap .title-bar .actions .delete{background-position:-54px 0}#page-slots.slots .slot-entries .entry-wrap .title-bar .actions .delete:hover{background-position:-54px -20px}#page-slots.slots .slot-entries .entry-wrap .title-bar .actions .visibility{background-position:-25px 0}#page-slots.slots .slot-entries .entry-wrap .title-bar .actions .visibility:hover{background-position:-25px -20px}#page-slots.slots .slot-entries .entry-wrap .dialogue{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;position:absolute;top:20px;left:4px;right:4px;background-color:rgba(0,0,0,0.9);z-index:30;padding:32px;color:white}#page-slots.slots .slot-entries .entry-wrap .dialogue .buttons a{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;text-align:center;height:17px;padding-top:2px;font-weight:bold;display:inline-block;text-decoration:none;background-color:#ccc;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#d9d9d9), to(#bfbfbf));background-image:-moz-linear-gradient(top, #d9d9d9, #bfbfbf);color:white !important;padding-left:16px;padding-right:16px}#page-slots.slots .slot-entries .entry-wrap .dialogue .buttons a:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}#page-slots.slots .slot-entries .entry-wrap .dialogue .buttons a + a{margin-left:8px}#page-slots.slots .slot-entries .entry-wrap .dialogue .buttons a.default{background-color:#10b2fe}#page-slots.slots .slot-entries .entry-wrap .white-bg,#page-slots.slots .slot-entries .entry-wrap .grey-bg{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;left:0px;right:40%;top:0;bottom:0px;margin:0;background-color:white;z-index:1}#page-slots.slots .slot-entries .entry-wrap .white-bg{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;border-width:2px;border-color:transparent;border-style:solid}#page-slots.slots .slot-entries .entry-wrap .white-bg.active{border-color:#10b2fe}#page-slots.slots .slot-entries .entry-wrap .grey-bg{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;left:auto;width:40%;right:0;background-color:#6b6b6b;margin-left:0}#page-slots.slots .slot-entries .entry-wrap .entry{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;z-index:2;float:left}#page-slots.slots .slot-entries .entry-wrap .entry .fields-preview{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;padding:4px;background:none;border-color:white}#page-slots.slots .slot-entries .entry-wrap .entry .fields-preview-text{width:100%;position:relative;margin-bottom:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#page-slots.slots .slot-entries .entry-wrap .entry .fields-preview-text li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#page-slots.slots .slot-entries .entry-wrap .slots{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;padding-left:0;float:left;width:40%;z-index:2;left:1px}#page-slots.slots .slot-entries .entry-wrap .slots .slot-tabs{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:24px;display:block;margin-right:1px;width:100%;background:none}#page-slots.slots .slot-entries .entry-wrap .slots .slot-tabs li{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;width:25%;height:100%;display:block;padding-left:8px;padding-top:6px;cursor:pointer;border-right:solid 1px #565656;background-color:#6b6b6b;color:#f2f2f2}#page-slots.slots .slot-entries .entry-wrap .slots .slot-tabs li:nth-child(4){float:right;position:relative;border-right:none}#page-slots.slots .slot-entries .entry-wrap .slots .slot-tabs li.active:hover,#page-slots.slots .slot-entries .entry-wrap .slots .slot-tabs li.active{background:#565656 none;border-right:solid 1px #565656;color:white}#page-slots.slots .slot-entries .entry-wrap .slots .slot-tabs li:hover{background-color:#ff6c03;border-right-color:#ff6c03}#page-slots.slots .slot-entries .entry-wrap .slots .slot-tabs li:hover + li:nth-child(4){border-left-color:#ff6c03}#page-slots.slots .slot-entries .entry-wrap .slots .slot-tabs li .down{display:none}#page-slots.slots .slot-entries .entry-wrap .slots .slot-addable{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:none;background:none;background-color:#565656;height:33px;padding:8px 8px 0 8px}#page-slots.slots .slot-entries .entry-wrap .slots .slot-addable a{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;text-align:center;height:17px;padding-top:2px;font-weight:bold;display:inline-block;text-decoration:none;background-color:#6b6b6b;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#787878), to(#5e5e5e));background-image:-moz-linear-gradient(top, #787878, #5e5e5e);color:white !important;padding-left:8px;padding-right:8px}#page-slots.slots .slot-entries .entry-wrap .slots .slot-addable a:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}#page-slots.slots .slot-entries .entry-wrap .slots .slot-addable a + a{margin-left:8px}#page-slots.slots .slot-entries .entry-wrap .slots .slot-addable .alias{font-style:italic}#page-slots.slots .slot-entries .entry-wrap .slots .slot-addable .down{display:none}#page-slots.slots .slot-entries .entry-wrap .slots .slot-entries{padding-top:8px}#page-slots.slots .slot-entries .entry-wrap .slots .entry-wrap.depth-2{margin-left:8px;margin-right:8px;margin-bottom:8px}#page-slots.slots .slot-entries .entry-wrap .slots .entry-wrap.depth-2 .white-bg{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;width:auto;right:0}#page-slots.slots .slot-entries .entry-wrap .slots .entry-wrap.depth-2 .grey-bg{display:none}#page-slots.slots .slot-entries .entry-wrap .slots .entry-wrap.depth-2 .entry-spacer{height:8px}#page-slots.slots .slot-entries .entry-wrap .slots .entry-wrap.depth-2 .entry{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;width:100%}#page-slots.slots .slot-entries .entry-wrap .slots .entry-wrap.depth-2 .entry .fields-preview{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;padding:4px;background:none;width:100%;display:block}#page-slots.slots .slot-entries .entry-wrap .slots .entry-wrap.depth-2 .entry .fields-preview .fields-preview-text{width:100%;margin-bottom:0}#page-slots.slots .slot-entries .entry-wrap .slots .entry-wrap.depth-2 .entry .fields-preview .fields-preview-image{float:none;width:100%;margin-left:0;margin-top:4px;padding-top:4px}#page-slots.slots .slot-entries .entry-wrap .slots .entry-wrap.depth-2 .entry .fields-preview .fields-preview-text.empty + .fields-preview-image{margin-top:0}#page-slots.slots .slot-entries .entry-wrap .slots .entry-wrap.depth-2 .entry + .entry{margin-top:8px}#page-slots.slots .slot-entries .entry-wrap .alias-target{padding:4px;background-color:#444;color:white;font-size:14px;font-style:italic}#page-slots.slots .slot-entries .entry-wrap .alias-target .icon-wrap,#page-slots.slots .slot-entries .entry-wrap .alias-target a{display:inline-block;vertical-align:top;cursor:pointer}#page-slots.slots .slot-entries .entry-wrap .alias-target .icon-wrap{margin-right:8px}#page-slots.slots .slot-entries .entry-wrap.no-boxes .white-bg{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;right:0}#page-slots.slots .slot-entries .entry-wrap.no-boxes .grey-bg{display:none}#page-slots.slots .slot-entries .entry-wrap.no-boxes .entry{width:100%}#page-slots.slots .slot-entries .entry-wrap.no-boxes .entry .fields-preview{display:-webkit-box;display:-moz-box;display:box}#page-slots.slots .slot-entries .entry-wrap.no-boxes .entry .fields-preview .fields-preview-text{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;width:60%;padding-right:0}#page-slots.slots .slot-entries .entry-wrap.no-boxes .entry .fields-preview .fields-preview-image{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;width:40%}#page-slots.slots .slot-entries .entry-wrap.hidden{opacity:0.4 !important}#page-slots.slots .slot-entries .entry-wrap.page .white-bg{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;right:0}#page-slots.slots .slot-entries .entry-wrap.page .page-title{background-color:#444;padding:4px}#page-slots.slots .slot-entries .entry-wrap.page .page-title a{cursor:pointer;font-family:"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", "FrutigerLTStd-Light", "Frutiger LT Std";font-weight:100;color:#fff;font-size:16px;line-height:normal}#page-slots.slots .slot-entries .entry-wrap.page .page-title a:hover{color:#ff6c03}#page-slots.slots .slot-entries .entry-wrap.boxes.depth-1 .entry{width:60%}#page-slots.slots .slot-entries .entry-wrap.boxes.depth-1 .entry .fields-preview.depth-1 .fields-preview-text{margin-right:-110px;padding-right:110px}#page-slots.slots .slot-entries .entry-wrap.boxes.depth-1 .entry .fields-preview.depth-1 .fields-preview-image{width:94px;float:right}#page-slots.slots .slot-entries .entry-wrap.boxes.depth-1 .entry .fields-preview.depth-1 .fields-preview-image img{max-width:94px}#page-slots.slots .slot-entries .entry-wrap.boxes.depth-1 .entry .fields-preview.depth-1 .fields-preview-image li{margin-right:0}#page-slots.slots .slot-entries .entry-wrap.boxes.depth-1 .entry .fields-preview.depth-1 .fields-preview-image li:last-child{margin-bottom:0}#dialogue-overlay{position:fixed;left:0;right:0;top:0;bottom:0;background-color:rgba(255,255,255,0.9);z-index:1000}#dialogue-wrap{position:fixed;left:0;right:0;bottom:0;top:0;overflow:auto;z-index:1001}#dialogue-wrap #dialogue-outer{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;display:-webkit-box;display:-moz-box;display:box;box-orient:vertical;-webkit-box-orient:vertical;-moz-box-orient:vertical;background-color:#222;position:relative;top:50px;margin:0 auto;margin-bottom:50px}#dialogue-wrap #dialogue-outer #dialogue-title{font-weight:100;font-family:"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", "FrutigerLTStd-Light", "Frutiger LT Std";-webkit-font-smoothing:antialiased;-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;height:26px;color:#fff;padding:0 8px 0 10px;padding-top:6px}#dialogue-wrap #dialogue-outer #dialogue-body{overflow:auto;margin:0 2px;background-color:#fff}#dialogue-wrap #dialogue-outer #dialogue-control-wrap #dialogue-controls{position:relative}#dialogue-wrap #dialogue-outer #dialogue-control-wrap #dialogue-controls .dialogue-actions{display:-webkit-box;display:-moz-box;display:box}#dialogue-wrap #dialogue-outer #dialogue-control-wrap #dialogue-controls .dialogue-actions .spacer{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1}#dialogue-wrap #dialogue-outer #dialogue-control-wrap #dialogue-controls .dialogue-actions .button{display:block;width:128px;margin:8px 0}#dialogue-wrap #dialogue-outer #dialogue-control-wrap #dialogue-controls .dialogue-actions .button + .button{margin-left:8px}#dialogue-wrap #dialogue-outer #dialogue-control-wrap #dialogue-controls .dialogue-actions .button:last-child{margin-right:8px}#dialogue-wrap #dialogue-outer #dialogue-control-wrap #dialogue-controls .dialogue-actions .cancel{background-color:#6b6b6b;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#787878), to(#5e5e5e));background-image:-moz-linear-gradient(top, #787878, #5e5e5e)}#dialogue-wrap #dialogue-outer #dialogue-control-wrap #dialogue-controls .dialogue-actions .cancel:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}#dialogue-wrap #dialogue-outer #dialogue-control-wrap #dialogue-controls .dialogue-actions .save{background-color:#10b2fe;float:right}#dialogue-wrap #dialogue-outer #dialogue-control-wrap #dialogue-controls .dialogue-actions .disabled,#dialogue-wrap #dialogue-outer #dialogue-control-wrap #dialogue-controls .dialogue-actions .disabled:hover{background-color:#333333 !important;color:#6b6b6b !important}.dialogue-wrapper,#editing{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;background-color:#cccccc;width:980px}#create-home-dialogue .instructions{margin:0;background-color:#f2f2f2;color:#666;padding:4px 8px;margin-bottom:8px}#create-home-dialogue .instructions .button{padding-left:2px;padding-right:2px}#create-home-dialogue .type{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;display:-webkit-box;display:-moz-box;display:box;cursor:pointer;padding:4px 8px;background-color:#fbfbfb;border:solid 1px #f2f2f2;margin:8px;margin-top:0}#create-home-dialogue .type:hover{background-color:#666;color:#fff}#create-home-dialogue .type.selected{background-color:#10b2fe;color:#fff}#publishing-dialogue{min-height:200px;max-height:90%;position:relative;display:-webkit-box;display:-moz-box;display:box;box-orient:horizontal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal}#publishing-dialogue .change-list{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;width:50%}#publishing-dialogue .change-list#changes{border-right:solid 2px #000}#publishing-dialogue .change-list .actions{display:-webkit-box;display:-moz-box;display:box;box-orient:horizontal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;box-align:center;-webkit-box-align:center;-moz-box-align:center;color:#666;background-color:#f2f2f2;padding:4px 8px}#publishing-dialogue .change-list .actions div{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1}#publishing-dialogue .change-list .actions .button{padding-left:8px;padding-right:8px}#publishing-dialogue .change-list .change-sets{overflow:auto}#publishing-dialogue .change-list .change-sets .instructions{font-family:"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", "FrutigerLTStd-Light", "Frutiger LT Std";color:#999;text-align:center;position:relative;padding-top:50px}#publishing-dialogue .publish-up-to-date{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;position:absolute;left:0;right:0;top:0;bottom:0;margin:60px 200px 60px 200px;text-align:center;background-color:#333;opacity:0.95;font-family:"HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", "FrutigerLTStd-Light", "Frutiger LT Std";font-size:24px;padding-top:24px;color:#fff}#publishing-dialogue .change-set{cursor:pointer;padding:8px 8px 0 8px}#publishing-dialogue .change-set .inner{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;display:-webkit-box;display:-moz-box;display:box;border:solid 3px transparent;background-color:#fbfbfb;border:solid 1px #f2f2f2}#publishing-dialogue .change-set .pages{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1}#publishing-dialogue .change-set .pages .title{padding:4px 8px;color:#333}#publishing-dialogue .change-set .pages .title + .title{border-top:solid 1px #f2f2f2}#publishing-dialogue .change-set .pages .url{font-size:10px;color:#666}#publishing-dialogue .change-set .add{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;display:-webkit-box;display:-moz-box;display:box;box-pack:center;-webkit-box-pack:center;-moz-box-pack:center;box-align:center;-webkit-box-align:center;-moz-box-align:center;width:64px;background-color:#f2f2f2;position:relative;color:#999}#publishing-dialogue .change-set .add span{font-size:40px;position:relative;top:-5px}#publishing-dialogue .change-set .add:hover{background-color:#10b2fe;color:#fff}#publishing-dialogue .change-set .titles a{display:block;margin-bottom:2px}#publishing-dialogue .change-set .titles a span{font-size:11px;margin-left:1em}#publishing-dialogue .change-set:hover{border-color:#10b2fe}#editing{z-index:1001}#editing .button{background-color:#42ab06}#editing .field-group-bg{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;position:absolute;margin:8px;top:0px;bottom:0px}#editing .field-group-bg.text{left:0;right:343px}#editing .field-group-bg.image{left:629px;right:0}#editing input[type="submit"]{visibility:hidden;position:absolute;width:0;height:0}#editing .field-group{position:relative;z-index:1010;float:left;padding:8px}#editing .field-group .field + .field{margin-top:8px}#editing .field-group .name{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background-color:#d1d1d1;display:block;height:24px;padding-left:8px;padding-top:6px}#editing .field-group .value{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;border:solid 2px transparent;padding:6px;background-color:white}#editing .field-group .value textarea,#editing .field-group .value input[type="text"]{font-family:"Lucida Grande";font-size:11px;line-height:14px;outline:none}#editing .field-group .value input[type="file"]{visibility:hidden;position:absolute;width:0;height:0}#editing .field-group .value textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:none;width:100%;padding-right:64px}#editing .field-group .value input[type="text"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%;border:none;display:block;font-weight:bold}#editing .field-group .field.focus .name{background-color:#42ab06;color:white}#editing .field-group .field.focus .value{border-color:#42ab06}#editing .field-group.image{width:327px}#editing .field-group.image .field .value{position:relative;min-height:70px}#editing .field-group.image .field .value img{max-width:50%}#editing .field-group.image .field .value img.empty{width:50%;height:100px}#editing .field-group.image .field .value .actions{margin:8px;margin-left:0;position:absolute;top:0;right:0;bottom:0;width:109px}#editing .field-group.image .field .value .actions .button{display:block}#editing .field-group.image .field .value .actions .button.clear{color:#5b5b5b;background-color:#d1d1d1;position:absolute;bottom:0;width:100%}#editing .field-group.image .field .value .landscape img{max-width:100%;max-height:50%}#editing .field-group.image .field .value .landscape .actions{width:auto;display:block;margin:8px 0 0 0;position:relative}#editing .field-group.image .field .value .landscape .actions .button{display:inline-block;width:109px}#editing .field-group.image .field .value .landscape .actions .button.clear{position:static}#editing .field-group.image .field .value .landscape .actions .button.change{position:absolute;right:0}#status-bar{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:fixed;height:32px;bottom:0;left:0;right:0;background-color:#cccccc;z-index:100000}#status-bar #progress-container{position:relative;top:12px;font-size:10px;color:#888888}#status-bar #progress-container #progress-bars{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;position:relative;width:50%;height:8px;border:solid 1px #151515}#status-bar #progress-container #progress-bars .bar,#status-bar #progress-container #progress-bars #editing #url-panel,#editing #status-bar #progress-container #progress-bars #url-panel,#status-bar #progress-container #progress-bars #editing #content-panel .tabs .tab,#editing #content-panel .tabs #status-bar #progress-container #progress-bars .tab,#status-bar #progress-container #progress-bars #editing #content-panel #content-wrapper .field-wrap .field.edit .name,#editing #content-panel #content-wrapper .field-wrap .field.edit #status-bar #progress-container #progress-bars .name,#status-bar #progress-container #progress-bars #editing #content-panel #content-wrapper .field-wrap .field.edit .value input.input,#editing #content-panel #content-wrapper .field-wrap .field.edit .value #status-bar #progress-container #progress-bars input.input,#status-bar #progress-container #progress-bars #editing #content-panel #content-wrapper .page-entry-link h3,#editing #content-panel #content-wrapper .page-entry-link #status-bar #progress-container #progress-bars h3{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;height:8px;padding:0;background-color:black;position:absolute;top:0;left:0;opacity:0.7}#status-bar #progress-container #progress-bars #progress-individual{opacity:0.3}#status-bar #progress-container #progress-bars #progress-total{background-color:#fff}#status-bar #progress-container #progress-name{position:absolute;right:16px;top:-1px;text-align:right}#status-bar #progress-container #progress-stats{position:absolute;left:50%;top:-1px;margin-left:10px}#script-load-splash{background:url("/@spontaneous/static/splash.png") 0 0 no-repeat;width:318px;height:43px;position:relative;margin:0 auto;top:150px}#script-load-splash #script-load-progress{-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;position:relative;left:-31px;top:64px;border:solid 1px #ddd;padding:1px;width:380px;height:4px}#script-load-splash #script-load-progress div{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;background-color:#ddd;height:4px}#script-load-splash #script-load-progress.synchronous{border:none;color:#ddd;top:44px;left:47px}#script-load-splash.loaded{background-position:0 -80px}.icon-wrap{overflow:hidden;position:relative}.icon-wrap img{position:relative}.pop-over{display:inline-block;background-color:#222;margin:0px;-webkit-padding-start:0;-moz-padding-start:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;position:absolute;opacity:0px;z-index:1000000}.pop-over > div{margin:0px 8px 8px 8px !important;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.pop-over > header{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;position:relative;padding:8px 8px 8px 8px}.pop-over > header > h3{text-transform:none;margin:0px;margin-bottom:0;color:white;font-size:14px;line-height:22px;display:block;text-align:center;font-weight:normal}.pop-over header .button{min-width:50px}.pop-over .po-button.back{position:relative;padding-left:5px;margin-left:8px}.pop-over .back.black > .pointer{background-image:-webkit-gradient(linear, left top, right bottom, from(#7d828c), color-stop(0.5, #303749), color-stop(0.5, #121a2e), to(#121a2e));border-left:solid 1px rgba(79,79,79,0.75);border:solid 1px rgba(79,79,79,0.75);-webkit-border-radius:6px 0 6px 0;-moz-border-radius:6px 0 6px 0;border-radius:6px 0 6px 0;height:19px;width:19px;display:inline-block;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);-webkit-mask-image:-webkit-gradient(linear, left bottom, right top, from(#000), color-stop(0.5, #000), color-stop(0.5, transparent), to(transparent));position:absolute;left:-7px;top:1px;-webkit-background-clip:content;-moz-background-clip:content;background-clip:content}.pop-over .back:hover .pointer,.pop-over .back.hover .pointer{background-image:-webkit-gradient(linear, left top, right bottom, from(#4286f5), color-stop(0.5, #4286f5), color-stop(0.5, #194fdb), to(#194fdb))}.pop-over .button{min-width:100px}.pop-over .button.close,.pop-over .button.cancel{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;text-align:center;height:17px;padding-top:2px;font-weight:bold;display:inline-block;text-decoration:none;background-color:#404040;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#4d4d4d), to(#333));background-image:-moz-linear-gradient(top, #4d4d4d, #333);color:white !important;min-width:50px}.pop-over .button.close:hover,.pop-over .button.cancel:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}.pop-over .po-button.forward{position:relative;padding-right:5px;margin-right:8px}.pop-over .forward.black > .pointer{background-image:-webkit-gradient(linear, left top, right bottom, from(#7d828c), color-stop(0.5, #303749), color-stop(0.5, #121a2e), to(#121a2e));border-left:solid 1px rgba(79,79,79,0.75);border:solid 1px rgba(79,79,79,0.75);border-top-left-radius:6px;border-bottom-right-radius:6px;height:19px;width:19px;display:inline-block;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);-webkit-mask-image:-webkit-gradient(linear, right top, left bottom, from(#000), color-stop(0.5, #000), color-stop(0.5, transparent), to(transparent));position:absolute;right:-7px;top:1px;-webkit-background-clip:content;-moz-background-clip:content;background-clip:content}.pop-over .forward:hover > .pointer,.pop-over .forward.hover > .pointer{background-image:-webkit-gradient(linear, left top, right bottom, from(#4286f5), color-stop(0.5, #4286f5), color-stop(0.5, #194fdb), to(#194fdb))}.pop-over header{display:-webkit-box;display:-moz-box;display:box;box-orient:horizontal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;box-align:stretch;-webkit-box-align:stretch;-moz-box-align:stretch}.pop-over .menuHandle{position:absolute;top:-14px;left:8px;height:30px !important;width:30px;border:solid 2px #4f4f4f;border-bottom:none;border-right:none;background-color:#404040 !important;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);-webkit-transform:rotate(45deg);-webkit-mask-image:-webkit-gradient(linear, left top, right bottom, from(#000), color-stop(0.5, #000), color-stop(0.5, transparent), to(transparent))}.pop-over .hide{-webkit-transform:translate3d(-1000px, 0px);-moz-transform:translate3d(-1000px, 0px);transform:translate3d(-1000px, 0px)}.pop-over .show{-webkit-transform:translate3d(0px, 0px);-moz-transform:translate3d(0px, 0px);transform:translate3d(0px, 0px)}.pop-over .fade-in{-webkit-transition:opacity 0.25s ease-in-out;-moz-transition:opacity 0.25s ease-in-out;transition:opacity 0.25s ease-in-out;opacity:1}.pop-over .fade-out{-webkit-transition:opacity 0.25s ease-in-out;-moz-transition:opacity 0.25s ease-in-out;transition:opacity 0.25s ease-in-out;opacity:0}.pop-over ul.dropdown-menu-basic,.pop-over .dropdown-menu-basic li{margin:0px;padding:0px;list-style:none}.pop-over .dropdown-menu-basic li{border-bottom:1px solid #666666;font-size:18px !important;line-height:36px;padding:0px 8px}.pop-over .dropdown-menu-basic li:hover,.pop-over .dropdown-menu-basic li.hover{background-image:-webkit-gradient(linear, left top, left bottom, from(#4286f5), to(#194fdb));color:white}.pop-over .dropdown-menu-basic li:first-of-type{-webkit-border-top-right-radius:5px;-moz-border-radius-topright:5px;border-top-right-radius:5px;-webkit-border-top-left-radius:5px;-moz-border-radius-topleft:5px;border-top-left-radius:5px}.pop-over .dropdown-menu-basic li:last-of-type{-webkit-border-bottom-right-radius:5px;-moz-border-radius-bottomright:5px;border-bottom-right-radius:5px;-webkit-border-bottom-left-radius:5px;-moz-border-radius-bottomleft:5px;border-bottom-left-radius:5px}.pop-over .buttons{display:-webkit-box;display:-moz-box;display:box;box-orient:horizontal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;box-pack:justify;-webkit-box-pack:justify;-moz-box-pack:justify}.pop-over .buttons a{display:block}.pop-over .pop-insert-link p{margin-top:0;margin-bottom:8px}.pop-over .pop-insert-link label{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;display:block;background-color:#404040;color:#fff;padding:0}.pop-over .pop-insert-link label span{display:block;padding:4px 0 4px 4px}.pop-over .pop-insert-link input,.pop-over .pop-insert-link textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;border:none;display:block;outline:none;width:100%;padding:4px;margin:0}.pop-over .link-page-browser{margin-bottom:8px}.pop-over .link-page-browser label{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.pop-over .link-page-browser .page-list{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;background-color:#fff;padding:8px 0}.pop-over .link-page-browser .page-list .page{cursor:pointer;color:#333;text-transform:none;padding:4px 4px;padding-right:80px;position:relative;font-size:11px;border-bottom:solid 1px #eee}.pop-over .link-page-browser .page-list .page:last-child{border-bottom:none}.pop-over .link-page-browser .page-list .page:hover{background-color:#999;color:#fff}.pop-over .link-page-browser .page-list .page.active{background-color:#10b2fe;color:white}.pop-over .link-page-browser .page-list .page.active span:hover{background-color:#01a6f3}.pop-over .link-page-browser .page-list .page span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;display:block;position:absolute;right:0;top:0;bottom:0;font-size:16px;line-height:13px;font-weight:normal;width:80px;margin:2px;background:url("/@spontaneous/static/page-browser-next.png") right 1px no-repeat}.pop-over .link-page-browser .page-list .page span:hover{background-position:right -39px;background-color:#8d8d8d}.pop-over .link-page-browser .page-list .page span:active{background-color:#10b2fe}.pop-over .link-page-browser .page-ancestors{background-color:#4d4d4d}.pop-over .link-page-browser .page-ancestors ul{display:-webkit-box;display:-moz-box;display:box;box-orient:horizontal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;margin:0;padding:0;padding:4px}.pop-over .link-page-browser .page-ancestors ul li{font-size:10px;text-transform:none;cursor:pointer}.pop-over .link-page-browser .page-ancestors ul li,.pop-over .link-page-browser .page-ancestors ul li a{color:#ccc}.pop-over .link-page-browser .page-ancestors ul li span{display:inline-block;color:#777;margin:0 2px;padding:0}.pop-over .link-page-browser .page-ancestors ul li:hover a{color:#fff}.pop-over .link-page-browser .page-ancestors ul li:active a{color:#10b2fe}.pop-over #popover-delete{display:-webkit-box;display:-moz-box;display:box;box-orient:horizontal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;box-pack:justify;-webkit-box-pack:justify;-moz-box-pack:justify}.pop-over #popover-delete a.ok{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;text-align:center;height:17px;padding-top:2px;font-weight:bold;display:inline-block;text-decoration:none;background-color:#10b2fe;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#29bafe), to(#01a6f3));background-image:-moz-linear-gradient(top, #29bafe, #01a6f3);color:white !important;display:block}.pop-over #popover-delete a.ok:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}.pop-over #popover-delete a.cancel{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;text-align:center;height:17px;padding-top:2px;font-weight:bold;display:inline-block;text-decoration:none;background-color:#404040;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#4d4d4d), to(#333));background-image:-moz-linear-gradient(top, #4d4d4d, #333);color:white !important;display:block}.pop-over #popover-delete a.cancel:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}.pop-over #popover-delete a{max-width:100px}.editing-panel{z-index:1001;background:url(/@spontaneous/static/editing-texture-1.png) repeat}.editing-panel .editing-fields{display:-webkit-box;display:-moz-box;display:box;box-align:horizontal;-webkit-box-align:horizontal;-moz-box-align:horizontal;padding:8px}.editing-panel .editing-toolbar{background-color:rgba(0,0,0,0.3);padding:4px 16px}.editing-panel .editing-toolbar .indent{position:absolute;top:0;right:0;left:0;height:6px}.editing-panel .editing-toolbar.bottom .indent{top:auto;bottom:0}.editing-panel .editing-toolbar .buttons{display:-webkit-box;display:-moz-box;display:box;box-orient:horizontal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;box-pack:justify;-webkit-box-pack:justify;-moz-box-pack:justify;width:621px}.editing-panel .editing-toolbar .buttons .save,.editing-panel .editing-toolbar .buttons .cancel{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;text-align:center;height:17px;padding-top:2px;font-weight:bold;display:inline-block;text-decoration:none;background-color:#10b2fe;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#29bafe), to(#01a6f3));background-image:-moz-linear-gradient(top, #29bafe, #01a6f3);color:white !important}.editing-panel .editing-toolbar .buttons .save:hover,.editing-panel .editing-toolbar .buttons .cancel:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}.editing-panel .editing-toolbar .buttons .cancel{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;cursor:pointer;text-align:center;height:17px;padding-top:2px;font-weight:bold;display:inline-block;text-decoration:none;background-color:#444;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#515151), to(#373737));background-image:-moz-linear-gradient(top, #515151, #373737);color:white !important}.editing-panel .editing-toolbar .buttons .cancel:hover{background-color:#ff6c03 !important;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff6c03), to(#e96100));background-image:-moz-linear-gradient(top, #ff6c03, #e96100);color:white !important}.editing-panel .editing-toolbar .buttons .save,.editing-panel .editing-toolbar .buttons .cancel{display:block;width:128px}.editing-panel .editing-toolbar.bottom .buttons{padding-top:0}.editing-panel .field-group-bg{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;position:absolute;margin:8px;top:0px;bottom:0px}.editing-panel .field-group-bg.text{left:0;right:343px}.editing-panel .field-group-bg.image{left:629px;right:0}.editing-panel input[type="submit"]{visibility:hidden;position:absolute;width:0;height:0}.editing-panel .field-group{position:relative;z-index:1010;float:left;padding:8px}.editing-panel .field-group .field + .field{margin-top:8px}.editing-panel .field-group .name{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background-color:rgba(0,0,0,0.2);color:#fff;display:block;height:16px;padding-left:8px;padding-top:2px}.editing-panel .field-group .name .comment{font-weight:normal;text-transform:none;margin-left:8px}.editing-panel .field-group .value{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;border:solid 2px transparent;padding:6px;background-color:white;opacity:0.8}.editing-panel .field-group .value textarea,.editing-panel .field-group .value input[type="text"]{font-family:"Lucida Grande";font-size:11px;line-height:14px;outline:none}.editing-panel .field-group .value input[type="file"]{visibility:hidden;position:absolute;width:0;height:0}.editing-panel .field-group .value textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border:none;width:100%;padding-right:64px;resize:vertical}.editing-panel .field-group .value input[type="text"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%;border:none;display:block;font-weight:bold}.editing-panel .field-group .field.focus .name{background-color:rgba(0,0,0,0.6);color:white}.editing-panel .field-group .field.focus .name .comment{color:white}.editing-panel .field-group .field.focus .value{border-color:#fff;background-color:#fff;opacity:1}.editing-panel .field-group.text{width:621px}.editing-panel.depth-2 .editing-fields{padding:0;box-orient:vertical;-webkit-box-orient:vertical;-moz-box-orient:vertical}.editing-panel.depth-2 .editing-toolbar{padding-left:8px;padding-right:8px}.editing-panel.depth-2 .editing-toolbar .buttons{width:100%}.editing-panel.depth-2 .field-group.text{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.editing-panel.depth-2 .field-group.image{padding:8px}.editing-panel .field-group.image{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;padding:8px 0}.editing-panel .field-group.image .field{display:inline-block;vertical-align:top;min-width:100px;margin-right:8px;margin-bottom:8px;margin-top:0;margin-left:0}.editing-panel .field-group.image .field .name{background-color:rgba(0,0,0,0.6)}.editing-panel .field-group.image .field .value{opacity:1}.editing-panel .field-group.image .field .value{position:relative;min-height:70px;text-align:center}.editing-panel .field-group.image .field .value img{max-width:200px;cursor:pointer}.editing-panel .field-group.image .field .value img:hover{outline:solid 1px #10b2fe}.editing-panel .field-group.image .field .value img.empty{width:50%;height:100px}.editing-panel .field-group.image .field .value .image-drop{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;z-index:2;position:absolute;top:0;right:0;bottom:0;left:0}.editing-panel .field-group.image .field .value .image-drop.drop-active,.editing-panel .field-group.image .field .value .image-drop:hover{border:solid 1px #10b2fe}.editing-panel .field-group.image .field .value .actions{margin:0px;margin-left:0;position:absolute;top:0;right:0;width:60px}.editing-panel .field-group.image .field .value .actions .button{display:block}.editing-panel .field-group.image .field .value .actions .button.clear{color:#5b5b5b;background-color:#d1d1d1;width:100%}.editing-panel .field-group.image .field .value .info{position:absolute;left:0;right:0;bottom:0;padding:8px;opacity:0.7;color:black;padding-left:4px;padding-top:2px;background-color:#efefef;text-transform:none;display:-webkit-box;display:-moz-box;display:box;box-orient:vertical;-webkit-box-orient:vertical;-moz-box-orient:vertical}.editing-panel .field-group.image .field .value .info .filename{word-wrap:break-word}.editing-panel .field-group.image .field .value .info .sizes{padding-top:4px;display:-webkit-box;display:-moz-box;display:box;box-orient:horizontal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;box-pack:justify;-webkit-box-pack:justify;-moz-box-pack:justify}.editing-panel .field-group.image .field .value .landscape img{max-width:200px}.editing-panel .field-group.image .field .value .landscape .actions{width:auto;display:block;margin:8px 0 0 0;position:relative}.editing-panel .field-group.image .field .value .landscape .actions .button{display:inline-block;width:109px}.editing-panel .field-group.image .field .value .landscape .actions .button.clear{position:static}.editing-panel .field-group.image .field .value .landscape .actions .button.change{position:absolute;right:0}.clearfix:after,#top:after,.fields-preview:after,.fields-preview-text li:after,.fields-preview-image:after,#page-slots.slots .slot-tabs:after,#page-slots.slots .slot-entries .entry-wrap:after,#page-slots.slots .slot-entries .entry-wrap .entry-inner:after,#page-slots.slots .slot-entries .entry-wrap .slots .slot-tabs:after,#editing:after,.editing-panel .editing-fields:after,#editing #content-panel .tabs:after,#editing #content-panel #content-wrapper .facet-allowed .type-list:after{content:".";display:block;height:0;clear:both;visibility:hidden}.bar,#editing #url-panel,#editing #content-panel .tabs .tab,#editing #content-panel #content-wrapper .field-wrap .field.edit .name,#editing #content-panel #content-wrapper .field-wrap .field.edit .value input.input,#editing #content-panel #content-wrapper .page-entry-link h3{height:23px;padding-top:11px}.border-box,#editing #content-panel #content-wrapper .field-wrap .field.edit .value input.input{-webkit-box-sizing:border-box;-mox-box-sizing:border-box;box-sizing:border-box}#editing{position:absolute;top:0;left:0;right:0;bottom:0}#editing #url-panel{background-color:#e0e0e0;padding-left:10px;position:absolute;top:0;left:0;right:0}#editing #function-panel{position:absolute;top:34px;left:0;right:0;height:34px}#editing #content-panel{position:absolute;top:85px;left:0;right:0;bottom:0;overflow:auto;padding:0 10px;padding-bottom:100px}#editing #content-panel .tabs{-webkit-border-top-right-radius:5px;-moz-border-radius-topright:5px;border-top-right-radius:5px;-webkit-border-top-left-radius:5px;-moz-border-radius-topleft:5px;border-top-left-radius:5px;background-color:#d7d7d7;list-style:none;height:34px}#editing #content-panel .tabs .tab:first-child{-webkit-border-top-left-radius:5px;-moz-border-radius-topleft:5px;border-top-left-radius:5px}#editing #content-panel .tabs .tab{display:block;float:left;padding-left:10px;min-width:130px;border-right:solid 1px #c5c5c5;cursor:pointer}#editing #content-panel .tabs .tab:hover{background-color:#10b2fe}#editing #content-panel .tabs .tab.active{background-color:#c5c5c5;font-weight:bold}#editing #content-panel #content-wrapper{border-top:solid 1px #cecece;background-color:#e0e0e0}#editing #content-panel #content-wrapper .field-wrap .edit,#editing #content-panel #content-wrapper .field-wrap .preview{padding:10px;background-color:#cecece}#editing #content-panel #content-wrapper .field-wrap .field{-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;width:100%}#editing #content-panel #content-wrapper .field-wrap .field .name,#editing #content-panel #content-wrapper .field-wrap .field .value{display:table-cell}#editing #content-panel #content-wrapper .field-wrap .field .name{-webkit-border-top-left-radius:5px;-moz-border-radius-topleft:5px;border-top-left-radius:5px;-webkit-border-bottom:5px;-moz-border-radius-bottomleft:5px;border-bottom-left-radius:5px;vertical-align:top;font-weight:bold;width:150px;padding-right:10px;text-align:right}#editing #content-panel #content-wrapper .field-wrap .field .value{-webkit-border-top-right-radius:5px;-moz-border-radius-topright:5px;border-top-right-radius:5px;-webkit-border-bottom:5px;-moz-border-radius-bottomright:5px;border-bottom-right-radius:5px;padding-left:10px}#editing #content-panel #content-wrapper .field-wrap .field.edit .name{background-color:#aaa}#editing #content-panel #content-wrapper .field-wrap .field.edit .name.active{background-color:#10b2fe;color:#fff}#editing #content-panel #content-wrapper .field-wrap .field.edit .value{padding-top:0;padding-bottom:0;padding-right:0;padding-left:0px;position:relative}#editing #content-panel #content-wrapper .field-wrap .field.edit .value input.input{-webkit-border-top-right-radius:5px;-moz-border-radius-topright:5px;border-top-right-radius:5px;-webkit-border-bottom:5px;-moz-border-radius-bottomright:5px;border-bottom-right-radius:5px;display:block;position:relative;left:0;width:100%;height:34px;border:solid 2px #10b2fe;outline:none;padding-left:10px;vertical-align:top}#editing #content-panel #content-wrapper .field-wrap .field.edit .value input.input:focus{border-color:#10b2fe}#editing #content-panel #content-wrapper .field-wrap .field + .field{margin-top:10px}#editing #content-panel #content-wrapper .facet-contents-wrap .facet-contents-wrap .facet-drag-bar{display:none}#editing #content-panel #content-wrapper .facet-contents-wrap .editing .facet-contents-wrap .facet-drag-bar{display:block}#editing #content-panel #content-wrapper .facet.depth-1 .facet-contents-wrap{background-color:#d7d7d7}#editing #content-panel #content-wrapper .facet.depth-2{background-color:#e0e0e0}#editing #content-panel #content-wrapper .facet.depth-2 .field-wrap .preview{background-color:#fff}#editing #content-panel #content-wrapper .facet.depth-2 .field-wrap .edit{background-color:#e0e0e0}#editing #content-panel #content-wrapper .facet.depth-2 .facet-contents-wrap{background-color:#e0e0e0}#editing #content-panel #content-wrapper .facet.depth-1 > .facet-bottom-bar{-webkit-border-bottom-right-radius:5px;-moz-border-radius-bottomright:5px;border-bottom-right-radius:5px;-webkit-border-bottom-left-radius:5px;-moz-border-radius-bottomleft:5px;border-bottom-left-radius:5px;background-color:#e0e0e0}#editing #content-panel #content-wrapper .facet-allowed{background-color:#cecece;padding:0}#editing #content-panel #content-wrapper .facet-allowed .type-list{-webkit-border-top-right-radius:5px;-moz-border-radius-topright:5px;border-top-right-radius:5px;-webkit-border-top-left-radius:5px;-moz-border-radius-topleft:5px;border-top-left-radius:5px;padding-left:10px;padding-right:10px;padding-bottom:6px}#editing #content-panel #content-wrapper .facet-allowed .type-list a{-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;display:block;float:left;min-width:95px;padding:7px 6px 0 6px;height:21px;background-color:#d7d7d7;margin-top:6px}#editing #content-panel #content-wrapper .facet-allowed .type-list a:hover{background-color:#10b2fe;color:#fff}#editing #content-panel #content-wrapper .facet-allowed .type-list a + a{margin-left:6px}#editing #content-panel #content-wrapper .page-entry-link h3{-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;background-color:#e0e0e0;margin-bottom:10px;font-size:150%;padding-left:10px}#editing #content-panel #content-wrapper .page-entry-link h3 a{font-weight:normal}#editing #content-panel #content-wrapper .facet-contents-wrap{padding:10px}#editing #content-panel #content-wrapper .facet-contents-wrap .facet-drag-bar{-webkit-border-top-right-radius:5px;-moz-border-radius-topright:5px;border-top-right-radius:5px;-webkit-border-top-left-radius:5px;-moz-border-radius-topleft:5px;border-top-left-radius:5px;height:24px;background-color:#c5c5c5}#editing #content-panel #content-wrapper .facet-contents-wrap .facet{margin-top:20px}#editing #content-panel #content-wrapper .facet-contents-wrap .page .field-wrap{padding-bottom:10px}#editing #content-panel #content-wrapper .depth-2 .facet-contents-wrap{background-color:#cecece}#editing #content-panel #content-wrapper .facet-bottom-bar{-webkit-border-bottom-right-radius:5px;-moz-border-radius-bottomright:5px;border-bottom-right-radius:5px;-webkit-border-bottom-left-radius:5px;-moz-border-radius-bottomleft:5px;border-bottom-left-radius:5px;height:10px;background-color:#d7d7d7}#page-fields .editing-panel .editing-fields,#page-fields .editing-panel .editing-toolbar,.box-fields .editing-panel .editing-fields,.box-fields .editing-panel .editing-toolbar{padding-left:64px;padding-right:64px}#page-fields .editing-panel .field-group.text,.box-fields .editing-panel .field-group.text{padding-left:0}.box-fields .editing-panel .editing-toolbar.bottom .indent{opacity:0.2}.field .markdown-editor .md-toolbar{display:-webkit-box;display:-moz-box;display:box;box-orient:horizontal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;background-color:rgba(0,0,0,0.2)}.field .markdown-editor .md-toolbar a{color:#999;display:block;border:solid 1px transparent;padding:2px 6px;cursor:pointer}.field .markdown-editor .md-toolbar a.active{background-color:#ccc}.field .markdown-editor .md-toolbar a:hover{background-color:#999}.field .markdown-editor .md-toolbar a + a{margin-left:10px}.field.focus .markdown-editor .md-toolbar{background-color:rgba(0,0,0,0.6)}.field.focus .markdown-editor .md-toolbar a{color:#333}#conflicted-fields-dialogue .instructions{text-transform:none;margin:0;background-color:#f2f2f2;color:#666;padding:8px}#conflicted-fields-dialogue .differences{display:-webkit-box;display:-moz-box;display:box}#conflicted-fields-dialogue .diff{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:11px;width:50%;padding:8px 8px;border:solid 2px #f2f2f2;cursor:pointer}#conflicted-fields-dialogue .diff.selected{border-color:#10b2fe}#conflicted-fields-dialogue .diff ins{background-color:#deffdd;text-decoration:none}#conflicted-fields-dialogue .diff del{background-color:#fedddd;text-decoration:line-through}#conflicted-fields-dialogue .diff .para{color:#ccc}#conflicted-fields-dialogue .labels .diff{border:none;background-color:#fbfbfb;padding-top:5px;padding-bottom:5px}#conflicted-fields-dialogue .image-field-conflict.changes .diff{display:-webkit-box;display:-moz-box;display:box;box-orient:horizontal;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;box-pack:center;-webkit-box-pack:center;-moz-box-pack:center;box-align:center;-webkit-box-align:center;-moz-box-align:center}#conflicted-fields-dialogue .image-field-conflict.changes .diff img{max-height:500px;max-width:100%;display:block}#add-alias-dialogue .instructions{margin:0;background-color:#f2f2f2;color:#666;padding:4px 8px}#add-alias-dialogue .type{-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;display:-webkit-box;display:-moz-box;display:box;cursor:pointer;padding:4px 8px;background-color:#fbfbfb;border:solid 1px #f2f2f2;margin:8px;margin-bottom:0}#add-alias-dialogue .type:hover{background-color:#666;color:#fff}#add-alias-dialogue .type.selected{background-color:#10b2fe;color:#fff}a.developer.source{color:rgba(255,255,255,0.6)}a.developer.source:hover{color:#fff}
@@ -1,137 +0,0 @@
1
- // console.log('Loading EditDialogue...')
2
-
3
- Spontaneous.EditDialogue = (function($, S) {
4
- var dom = S.Dom, Dialogue = Spontaneous.Dialogue;
5
-
6
- var EditDialogue = new JS.Class(Dialogue, {
7
- initialize: function(content) {
8
- this.content = content;
9
- },
10
- buttons: function() {
11
- var save_label = "Save (" + ((window.navigator.platform.indexOf("Mac") === 0) ? "Cmd" : "Ctrl") + "+s)", btns = {};
12
- btns[save_label] = this.save.bind(this);
13
- return btns;
14
- },
15
- id: function() {
16
- return this.content.id();
17
- },
18
- uid: function() {
19
- return this.content.uid() + '!editing';
20
- },
21
- save: function() {
22
- var values = this.form.serializeArray();
23
- var field_data = new FormData();
24
- var size = 0;
25
- $.each(values, function(i, v) {
26
- field_data.append(v.name, v.value);
27
- size += (v.name.length + v.value.length);
28
- });
29
- $('> *', this.form).animate({'opacity': 0.3}, 400, function() {
30
- Spontaneous.UploadManager.form(this, field_data, size);
31
- $.each(this.content.file_fields(), function() {
32
- this.save();
33
- });
34
- }.bind(this));
35
- return false;
36
- },
37
-
38
- upload_progress: function(position, total) {
39
- console.log('EditDialogue.upload_progress', position, total)
40
- },
41
- upload_complete: function(response) {
42
- var fields = response.fields;
43
- for (var i = 0, ii = fields.length; i < ii; i++) {
44
- var values = fields[i], field = this.content.field(values.name);
45
- field.update(values);
46
- }
47
- this.close();
48
- },
49
- cleanup: function() {
50
- S.Popover.close();
51
-
52
- var fields = this.content.field_list();
53
- for (var i = 0, ii = fields.length; i < ii; i++) {
54
- var field = fields[i];
55
- field.close_edit();
56
- }
57
- $(':input', this.form).add(document).unbind('keydown.savedialog');
58
- },
59
- body: function() {
60
- var editing = dom.form('#editing', {'enctype':'multipart/form-data', 'method':'post'});
61
- var outer = dom.div();
62
- outer.append(dom.div('.field-group-bg.text'));
63
- outer.append(dom.div('.field-group-bg.image'));
64
- var text_field_wrap = dom.div('.field-group.text');
65
- var image_field_wrap = dom.div('.field-group.image');
66
- var text_fields = this.content.text_fields();
67
- var submit = dom.input({'type':'submit'});
68
-
69
- for (var i = 0, ii = text_fields.length; i < ii; i++) {
70
- var field = text_fields[i];
71
- text_field_wrap.append(this.field_edit(field));
72
- }
73
- outer.append(text_field_wrap);
74
- var image_fields = this.content.image_fields();
75
-
76
- for (var i = 0, ii = image_fields.length; i < ii; i++) {
77
- var field = image_fields[i];
78
- image_field_wrap.append(this.field_edit(field));
79
- }
80
- outer.append(image_field_wrap);
81
- outer.append(submit);
82
- editing.append(outer);
83
- __dialogue = this;
84
- // activate the highlighting
85
- $('input, textarea', editing).focus(function() {
86
- __dialogue.field_focus(this);
87
- }).blur(function() {
88
- // $(this).parents('.field').first().removeClass('focus');
89
- });
90
- editing.submit(this.save.bind(this));
91
- this.form = editing;
92
- $(':input', this.form).add(document).bind('keydown.savedialog', function(event) {
93
- var s_key = 83;
94
- if ((event.ctrlKey || event.metaKey) && event.keyCode === s_key) {
95
- this.save();
96
- return false;
97
- }
98
- }.bind(this));
99
- return this.form;
100
- },
101
- field_focus: function(input) {
102
- var text_fields = this.content.text_fields(), active_field = false;
103
- for (var i = 0, ii = text_fields.length; i < ii; i++) {
104
- var field = text_fields[i];
105
- if (field.input()[0] === input) {
106
- active_field = field;
107
- break;
108
- }
109
- }
110
- if (active_field === this.active_field) { return; }
111
- if (this.active_field) {
112
- this.active_field.on_blur();
113
- }
114
- if (active_field) {
115
- this.active_field = active_field;
116
- this.active_field.on_focus();
117
- }
118
- },
119
- field_edit: function(field) {
120
- var d = dom.div('.field');
121
- d.append(dom.label('.name', {'for':field.css_id()}).html(field.label()));
122
- var toolbar = field.toolbar();
123
- if (toolbar) {
124
- d.append(dom.div('.toolbar').html(toolbar));
125
- }
126
- var edit = field.edit();
127
- d.append(dom.div('.value').html(edit));
128
- var footer = field.footer();
129
- if (footer) {
130
- d.append(dom.div('.footer').html(footer));
131
- }
132
- return d;
133
- }
134
- });
135
- return EditDialogue;
136
- })(jQuery, Spontaneous);
137
-
@@ -1,17 +0,0 @@
1
- /*
2
- * jQuery JavaScript Library v1.6.2
3
- * http://jquery.com/
4
- *
5
- * Copyright 2011, John Resig
6
- * Dual licensed under the MIT or GPL Version 2 licenses.
7
- * http://jquery.org/license
8
- *
9
- * Includes Sizzle.js
10
- * http://sizzlejs.com/
11
- * Copyright 2011, The Dojo Foundation
12
- * Released under the MIT, BSD, and GPL Licenses.
13
- *
14
- * Date: Thu Jun 30 14:16:56 2011 -0400
15
- */
16
- (function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement){ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),ci.close()}d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1){for(h in a.converters){typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h])}}l=k,k=d[g];if(k==="*"){k=l}else{if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}}return c}function bZ(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g){i in d&&(c[g[i]]=d[i])}while(f[0]==="*"){f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"))}if(h){for(i in e){if(e[i]&&e[i].test(h)){f.unshift(i);break}}}if(f[0] in d){j=f[0]}else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bY(a,b,c,d){if(f.isArray(b)){f.each(b,function(b,e){c||bC.test(a)?d(a,e):bY(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)})}else{if(!c&&b!=null&&typeof b=="object"){for(var e in b){bY(a+"["+e+"]",b[e],c,d)}}else{d(a,b)}}}function bX(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bR,l;for(;i<j&&(k||!l);i++){l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bX(a,c,d,e,l,g)))}(k||!l)&&!g["*"]&&(l=bX(a,c,d,e,"*",g));return l}function bW(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bN),e=0,g=d.length,h,i,j;for(;e<g;e++){h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}}function bA(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bv:bw;if(d>0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null){d=a.style[b]||0}d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName" in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio"){a.defaultChecked=a.checked}}function bj(a){return"getElementsByTagName" in a?a.getElementsByTagName("*"):"querySelectorAll" in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object"){b.outerHTML=a.outerHTML}else{if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option"){b.selected=a.defaultSelected}else{if(c==="input"||c==="textarea"){b.defaultValue=a.defaultValue}}}else{a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)}}b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g){for(var i=0,j=g[h].length;i<j;i++){f.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}}}function bg(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function W(a,b,c){b=b||0;if(f.isFunction(b)){return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c})}if(b.nodeType){return f.grep(a,function(a,d){return a===b===c})}if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(R.test(b)){return f.filter(b,d,!c)}b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function V(a){return !a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;i<s.length;i++){g=s[i],g.origType.replace(x,"")===a.type?q.push(g.selector):s.splice(i--,1)}e=f(a.target).closest(q,a.currentTarget);for(j=0,k=e.length;j<k;j++){m=e[j];for(i=0;i<s.length;i++){g=s[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,d=null;if(g.preType==="mouseenter"||g.preType==="mouseleave"){a.type=g.preType,d=f(a.relatedTarget).closest(g.selector)[0],d&&f.contains(h,d)&&(d=h)}(!d||d!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){e=p[j];if(c&&e.level>c){break}a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped()){break}}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return !0}function D(){return !1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a){if(b!=="toJSON"){return !1}}return !0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else{d=b}}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a){return this}if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2]){return f.find(a)}this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return !d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a)){return f.ready(a)}a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++){if((a=arguments[j])!=null){for(c in a){d=i[c],f=a[c];if(i===f){continue}l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}}}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body){return setTimeout(e.ready,1)}e.isReady=!0;if(a!==!0&&--e.readyWait>0){return}A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete"){return setTimeout(e.ready,1)}if(c.addEventListener){c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1)}else{if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval" in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a)){return !1}if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf")){return !1}var c;for(c in a){}return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a){return !1}return !0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b){return null}b=e.trim(b);if(a.JSON&&a.JSON.parse){return a.JSON.parse(b)}if(o.test(b.replace(p,"@").replace(q,"]").replace(r,""))){return(new Function("return "+b))()}e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a){if(c.apply(a[f],d)===!1){break}}}else{for(;g<h;){if(c.apply(a[g++],d)===!1){break}}}}else{if(i){for(f in a){if(c.call(a[f],f,a[f])===!1){break}}}else{for(;g<h;){if(c.call(a[g],g,a[g++])===!1){break}}}}return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b){if(H){return H.call(b,a)}for(var c=0,d=b.length;c<d;c++){if(b[c]===a){return c}}return -1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number"){for(var f=c.length;e<f;e++){a[d++]=c[e]}}else{while(c[e]!==b){a[d++]=c[e++]}}a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++){e=!!b(a[f],f),c!==e&&d.push(a[f])}return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k){for(;i<j;i++){f=c(a[i],i,d),f!=null&&(h[h.length]=f)}}else{for(g in a){f=c(a[g],g,d),f!=null&&(h[h.length]=f)}}return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a)){return b}var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c){e.access(a,j,c[j],f,g,d)}return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++){g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h)}return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g="done fail isResolved isRejected promise then always pipe".split(" "),h=[].slice;f.extend({_Deferred:function(){var a=[],b,c,d,e={done:function(){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++){i=c[g],j=f.type(i),j==="array"?e.done.apply(e,i):j==="function"&&a.push(i)}k&&e.resolveWith(k[0],k[1])}return this},resolveWith:function(e,f){if(!d&&!b&&!c){f=f||[],c=1;try{while(a[0]){a.shift().apply(e,f)}}finally{b=[e,f],c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return !!c||!!b},cancel:function(){d=1,a=[];return this}};return e},Deferred:function(a){var b=f._Deferred(),c=f._Deferred(),d;f.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[c,"reject"]},function(a,c){var e=c[0],g=c[1],h;f.isFunction(e)?b[a](function(){h=e.apply(this,arguments),h&&f.isFunction(h.promise)?h.promise().then(d.resolve,d.reject):d[g](h)}):b[a](d[g])})}).promise()},promise:function(a){if(a==null){if(d){return d}d=a={}}var c=g.length;while(c--){a[g[c]]=b[g[c]]}return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c<d;c++){b[c]&&f.isFunction(b[c].promise)?b[c].promise().then(i(c),g.reject):--e}e||g.resolveWith(g,b)}else{g!==a&&g.resolveWith(g,d?[a]:[])}return g.promise()}}),f.support=function(){var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;a.setAttribute("className","t"),a.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e){return{}}g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1000,top:-1000});for(t in p){o.style[t]=p[t]}o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom" in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent){for(t in {submit:1,change:1,focusin:1}){s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u}}o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return !!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b){return}l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function"){e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c)}i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c]){return i[g]&&i[g].events}return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i]){return}if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j)){return}}}if(d){delete h[i][e];if(!l(h[i])){return}}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b){return b!==!0&&a.getAttribute("classid")===b}}return !0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h<i;h++){g=e[h].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),k(this[0],g,d[g]))}}}return d}if(typeof a=="object"){return this.each(function(){f.data(this,a)})}var j=a.split(".");j[1]=j[1]?"."+j[1]:"";if(c===b){d=this.triggerHandler("getData"+j[1]+"!",[j[0]]),d===b&&this.length&&(d=f.data(this[0],a),d=k(this[0],a,d));return d===b&&j[1]?this.data(j[0]):d}return this.each(function(){var b=f(this),d=[j[0],c];b.triggerHandler("setData"+j[1]+"!",d),f.data(this,a,c),b.triggerHandler("changeData"+j[1]+"!",d)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,c){a&&(c=(c||"fx")+"mark",f.data(a,c,(f.data(a,c,b,!0)||0)+1,!0))},_unmark:function(a,c,d){a!==!0&&(d=c,c=a,a=!1);if(c){d=d||"fx";var e=d+"mark",g=a?0:(f.data(c,e,b,!0)||1)-1;g?f.data(c,e,g,!0):(f.removeData(c,e,!0),m(c,d,"mark"))}},queue:function(a,c,d){if(a){c=(c||"fx")+"queue";var e=f.data(a,c,b,!0);d&&(!e||f.isArray(d)?e=f.data(a,c,f.makeArray(d),!0):e.push(d));return e||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e;d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),d.call(a,function(){f.dequeue(a,b)})),c.length||(f.removeData(a,b+"queue",!0),m(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b){return f.queue(this[0],a)}return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){f.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--){if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f._Deferred(),!0)){h++,l.done(m)}}m();return d.promise()}});var n=/[\n\t\r]/g,o=/\s+/,p=/\r/g,q=/^(?:button|input)$/i,r=/^(?:button|input|object|select|textarea)$/i,s=/^a(?:rea)?$/i,t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,u=/\:|^on/,v,w;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a)){return this.each(function(b){f(this).addClass(a.call(this,b,this.className))})}if(a&&typeof a=="string"){b=a.split(o);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1){if(!e.className&&b.length===1){e.className=a}else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++){~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ")}e.className=f.trim(g)}}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a)){return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))})}if(a&&typeof a=="string"||a===b){c=(a||"").split(o);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className){if(a){h=(" "+g.className+" ").replace(n," ");for(i=0,j=c.length;i<j;i++){h=h.replace(" "+c[i]+" "," ")}g.className=f.trim(h)}else{g.className=""}}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a)){return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)})}return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(o);while(e=j[g++]){i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}}else{if(c==="undefined"||c==="boolean"){this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""}}})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++){if((" "+this[c].className+" ").replace(n," ").indexOf(b)>-1){return !0}}return !1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get" in c&&(d=c.get(e,"value"))!==b){return d}d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set" in c)||c.set(this,h,"value")===b){this.value=h}}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return !b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0){return null}for(var h=g?c:0,i=g?c+1:e.length;h<i;h++){var j=e[h];if(j.selected&&(f.support.optDisabled?!j.disabled:j.getAttribute("disabled")===null)&&(!j.parentNode.disabled||!f.nodeName(j.parentNode,"optgroup"))){b=f(j).val();if(g){return b}d.push(b)}}if(g&&!d.length&&e.length){return f(e[c]).val()}return d},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2){return b}if(e&&c in f.attrFn){return f(a)[c](d)}if(!("getAttribute" in a)){return f.prop(a,c,d)}var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set" in i&&j&&(h=i.set(a,d,c))!==b){return h}a.setAttribute(c,""+d);return d}if(i&&"get" in i&&j&&(h=i.get(a,c))!==null){return h}h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b) in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode){f.error("type property can't be changed")}else{if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button")){return v.get(a,b)}return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button")){return v.set(a,b,c)}a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2){return b}var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set" in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get" in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b)){return a.checked=f.inArray(f(a).val(),b)>=0}}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1){d=D}else{if(!d){return}}var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i){return}var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1){a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t){return}c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t){f.event.remove(a,h+c)}return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p){continue}if(!d){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace)){f.event.remove(a,r,q.handler,j),p.splice(j--,1)}}continue}o=f.event.special[h]||{};for(j=e||0;j<p.length;j++){q=p[j];if(d.guid===q.guid){if(l||n.test(q.namespace)){e==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q)}if(e!=null){break}}}if(p.length===0||e!=null&&p.length===1){(!o.teardown||o.teardown.call(a,m)===!1)&&f.removeEvent(a,h,s.handle),g=null,delete t[h]}}if(f.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,f.isEmptyObject(s)&&f.removeData(a,b,!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e){c.preventDefault(),c.stopPropagation()}if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8){return}c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h<i;h++){var j=d[h];if(e||c.namespace_re.test(j.namespace)){c.handler=j.handler,c.data=j.data,c.handleObj=j;var k=j.handler.apply(this,g);k!==b&&(c.result=k,k===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped()){break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[f.expando]){return a}var d=a;a=f.Event(d);for(var e=this.props.length,g;e;){g=this.props[--e],a[g]=d[g]}a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=a.target.ownerDocument||c,i=h.documentElement,j=h.body;a.pageX=a.clientX+(i&&i.scrollLeft||j&&j.scrollLeft||0)-(i&&i.clientLeft||j&&j.clientLeft||0),a.pageY=a.clientY+(i&&i.scrollTop||j&&j.scrollTop||0)-(i&&i.clientTop||j&&j.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:100000000,proxy:f.proxy,special:{ready:{setup:f.bindReady,teardown:f.noop},live:{add:function(a){f.event.add(this,N(a.origType,a.selector),f.extend({},a,{handler:M,guid:a.handler.guid}))},remove:function(a){f.event.remove(this,N(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!this.preventDefault){return new f.Event(a,b)}a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?E:D):this.type=a,b&&f.extend(this,b),this.timeStamp=f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=E;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=E;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=E,this.stopPropagation()},isDefaultPrevented:D,isPropagationStopped:D,isImmediatePropagationStopped:D};var F=function(a){var b=a.relatedTarget,c=!1,d=a.type;a.type=a.data,b!==this&&(b&&(c=f.contains(this,b)),c||(f.event.handle.apply(this,arguments),a.type=d))},G=function(a){a.type=a.data,f.event.handle.apply(this,arguments)};f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={setup:function(c){f.event.add(this,b,c&&c.selector?G:F,a)},teardown:function(a){f.event.remove(this,b,a&&a.selector?G:F)}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(a,b){if(!f.nodeName(this,"form")){f.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&f(b).closest("form").length&&K("submit",this,arguments)}),f.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&f(b).closest("form").length&&a.keyCode===13&&K("submit",this,arguments)})}else{return !1}},teardown:function(a){f.event.remove(this,".specialSubmit")}});if(!f.support.changeBubbles){var H,I=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e){return}if(e!=null||g){c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file"){return !1}for(var c in H){f.event.add(this,c+".specialChange",H[c])}return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a){this[c](h,d,a[h],e)}return this}if(arguments.length===2||d===!1){e=d,d=b}c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one"){this.one(a,d,e)}else{for(var i=0,j=this.length;i<j;i++){f.event.add(this[i],a,g,d)}}return this}}),f.fn.extend({unbind:function(a,b){if(typeof a=="object"&&!a.preventDefault){for(var c in a){this.unbind(c,a[c])}}else{for(var d=0,e=this.length;d<e;d++){f.event.remove(this[d],a,b)}}return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){return f.event.trigger(a,b,this[0],!0)}},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f.data(this,"lastToggle"+a.guid)||0)%d;f.data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length){b[d++].guid=c}return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var L={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};f.each(["live","die"],function(a,c){f.fn[c]=function(a,d,e,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:f(this.context);if(typeof a=="object"&&!a.preventDefault){for(var o in a){n[c](o,d,a[o],m)}return this}if(c==="die"&&!a&&g&&g.charAt(0)==="."){n.unbind(g);return this}if(d===!1||f.isFunction(d)){e=d||D,d=b}a=(a||"").split(" ");while((h=a[i++])!=null){j=x.exec(h),k="",j&&(k=j[0],h=h.replace(x,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,L[h]?(a.push(L[h]+k),h=h+k):h=(L[h]||h)+k;if(c==="live"){for(var p=0,q=n.length;p<q;p++){f.event.add(n[p],"live."+N(h,m),{data:d,selector:m,handler:e,origType:h,origHandler:e,preType:l})}}else{n.unbind("live."+N(h,m),e)}}return this}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!="string"){if(i===b){j=!0;break}}else{if(k.filter(b,[i]).length>0){j=i;break}}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9){return[]}if(!b||typeof b!="string"){return f}var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b)){if(x.length===2&&l.relative[x[0]]){j=v(x[0]+x[1],d)}else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length){b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}}}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length){r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}}else{n=x=[]}}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]"){if(!u){f.push.apply(f,n)}else{if(d&&d.nodeType===1){for(t=0;n[t]!=null;t++){n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t])}}else{for(t=0;n[t]!=null;t++){n[t]&&n[t].nodeType===1&&f.push(j[t])}}}}else{p(n,f)}o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g){for(var b=1;b<a.length;b++){a[b]===a[b-1]&&a.splice(b--,1)}}}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a){return[]}for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter){if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\"){continue}j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(!f){g=o=!0}else{if(f===!0){continue}}}if(f){for(var s=0;(p=j[s])!=null;s++){if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}}}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g){return[]}break}}}if(a===h){if(g==null){k.error(a)}else{break}}h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++){if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++){c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b)}d&&k.filter(b,a,!0)}},"":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("parentNode",b,f,a,e,c)},"~":function(a,b,c){var e,f=d++,g=u;typeof b=="string"&&!j.test(b)&&(b=b.toLowerCase(),e=b,g=t),g("previousSibling",b,f,a,e,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++){d[e].getAttribute("name")===a[1]&&c.push(d[e])}return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined"){return b.getElementsByTagName(a[1])}}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f){return a}for(var g=0,h;(h=b[g])!=null;g++){h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1))}return !1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else{a[2]&&k.error(a[0])}a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not"){if((a.exec(b[3])||"").length>1||/^\w/.test(b[3])){b[3]=k(b[3],null,null,c)}else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return !1}}else{if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0])){return !0}}return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return !!a.firstChild},empty:function(a){return !a.firstChild},has:function(a,b,c){return !!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f){return f(a,c,b,d)}if(e==="contains"){return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0}if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++){if(g[h]===a){return !1}}return !0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling){if(d.nodeType===1){return !1}}if(c==="first"){return !0}d=a;case"last":while(d=d.nextSibling){if(d.nodeType===1){return !1}}return !0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0){return !0}var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling){d.nodeType===1&&(d.nodeIndex=++i)}h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f){return f(a,c,b,d)}}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match){l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n))}var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]"){Array.prototype.push.apply(d,a)}else{if(typeof a.length=="number"){for(var f=a.length;c<f;c++){d.push(a[c])}}else{for(;a[c];c++){d.push(a[c])}}}return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition){return a.compareDocumentPosition?-1:1}return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){if(a===b){g=!0;return 0}if(a.sourceIndex&&b.sourceIndex){return a.sourceIndex-b.sourceIndex}var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(h===i){return s(a,b)}if(!h){return -1}if(!i){return 1}while(j){e.unshift(j),j=j.parentNode}j=i;while(j){f.unshift(j),j=j.parentNode}c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++){if(e[k]!==f[k]){return s(e[k],f[k])}}return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b){return c}var d=a.nextSibling;while(d){if(d===b){return -1}d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++){c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes))}return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++){c[e].nodeType===1&&d.push(c[e])}c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1]){return p(e.getElementsByTagName(b),f)}if(h[2]&&l.find.CLASS&&e.getElementsByClassName){return p(e.getElementsByClassName(h[2]),f)}}if(e.nodeType===9){if(b==="body"&&e.body){return p([e.body],f)}if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode){return p([],f)}if(i.id===h[3]){return p([i],f)}}try{return p(e.querySelectorAll(b),f)}catch(j){}}else{if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q){return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}}catch(s){}finally{n||m.removeAttribute("id")}}}}return a(b,e,f,g)};for(var e in a){k[e]=a[e]}b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a)){try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11){return f}}}catch(g){}}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1){return}l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c){return b.getElementsByClassName(a[1])}},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return !!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return !1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a)){e+=c[0],a=a.replace(l.match.PSEUDO,"")}a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++){k(a,f[g],d)}return k.filter(e,d)};f.find=k,f.expr=k.selectors,f.expr[":"]=f.expr.filters,f.unique=k.uniqueSort,f.text=k.getText,f.isXMLDoc=k.isXML,f.contains=k.contains}();var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string"){return f(a).filter(function(){for(c=0,d=b.length;c<d;c++){if(f.contains(b[c],this)){return !0}}})}var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0){for(h=g;h<e.length;h++){for(i=0;i<g;i++){if(e[i]===e[h]){e.splice(h--,1);break}}}}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++){if(f.contains(this,b[a])){return !0}}})},not:function(a){return this.pushStack(W(this,a,!1),"not",a)},filter:function(a){return this.pushStack(W(this,a,!0),"filter",a)},is:function(a){return !!a&&(typeof a=="string"?f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d<e;d++){i=a[d],j[i]||(j[i]=T.test(i)?f(i,b||this.context):i)}while(g&&g.ownerDocument&&g!==b){for(i in j){h=j[i],(h.jquery?h.index(g)>-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k})}g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(l?l.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11){break}}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string"){return f.inArray(this[0],a?f(a):this.parent().children())}return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d))){g.nodeType===1&&e.push(g),g=g[c]}return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c]){if(a.nodeType===1&&++e===b){break}}return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling){a.nodeType===1&&a!==b&&c.push(a)}return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/<tbody/i,ba=/<|&#?\w+;/,bb=/<(?:script|object|embed|option|style)/i,bc=/checked\s*(?:[^=]|=\s*.checked.)/i,bd=/\/(java|ecma)script/i,be=/^\s*<!(?:\[CDATA\[|\-\-)/,bf={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a)){return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))})}if(typeof a!="object"&&a!==b){return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))}return f.text(this)},wrapAll:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapAll(a.call(this,b))})}if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1){a=a.firstChild}return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapInner(a.call(this,b))})}return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)})}if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)})}if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++){if(!a||f.filter(a,[d]).length){!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d)}}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild){b.removeChild(b.firstChild)}}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b){return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null}if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++){this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}}catch(e){this.empty().append(a)}}else{f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a)}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a)){return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))})}typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bc.test(j)){return this.each(function(){f(this).domManip(a,c,d,!0)})}if(f.isFunction(j)){return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)})}if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++){d.call(c?bg(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}}k.length&&f.each(k,bm)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i;b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof a[0]=="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!bb.test(a[0])&&(f.support.checkClone||!bc.test(a[0]))&&(g=!0,h=f.fragments[a[0]],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[a[0]]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h){bi(e[h],g[h])}}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h){bh(e[h],g[h])}}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k){continue}if(typeof k=="string"){if(!ba.test(k)){k=b.createTextNode(k)}else{k=k.replace(Z,"<$1></$2>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--){o=o.lastChild}if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i){f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}}var r;if(!f.support.appendChecked){if(k[0]&&typeof(r=k.length)=="number"){for(i=0;i<r;i++){bl(k[i])}}else{bl(k)}}k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return !a.type||bd.test(a.type)};for(j=0;h[j];j++){if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript")){e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j])}else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.expando,g=f.event.special,h=f.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&f.noData[j.nodeName.toLowerCase()]){continue}c=j[f.expando];if(c){b=d[c]&&d[c][e];if(b&&b.events){for(var k in b.events){g[k]?f.event.remove(j,k):f.removeEvent(j,k,b.handle)}b.handle&&(b.handle.elem=null)}h?delete j[f.expando]:j.removeAttribute&&j.removeAttribute(f.expando),delete d[c]}}}});var bn=/alpha\([^)]*\)/i,bo=/opacity=([^)]*)/,bp=/([A-Z]|^ms)/g,bq=/^-?\d+(?:px)?$/i,br=/^-?\d/,bs=/^[+\-]=/,bt=/[^+\-\.\de]+/g,bu={position:"absolute",visibility:"hidden",display:"block"},bv=["Left","Right"],bw=["Top","Bottom"],bx,by,bz;f.fn.css=function(a,c){if(arguments.length===2&&c===b){return this}return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bx(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get" in k&&(g=k.get(a,!1,e))!==b){return g}return j[c]}h=typeof d;if(h==="number"&&isNaN(d)||d==null){return}h==="string"&&bs.test(d)&&(d=+d.replace(bt,"")+parseFloat(f.css(a,c)),h="number"),h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set" in k)||(d=k.set(a,d))!==b){try{j[c]=d}catch(l){}}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get" in g&&(e=g.get(a,!0,d))!==b){return e}if(bx){return bx(a,c)}},swap:function(a,b,c){var d={};for(var e in b){d[e]=a.style[e],a.style[e]=b[e]}c.call(a);for(e in b){a.style[e]=d[e]}}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0){return bA(a,b,d)}f.swap(a,bu,function(){e=bA(a,b,d)});return e}},set:function(a,b){if(!bq.test(b)){return b}b=parseFloat(b);if(b>=0){return b+"px"}}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView)){return b}if(g=e.getComputedStyle(a,null)){d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c))}return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return !f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ){return bQ.apply(this,arguments)}if(!this.length){return this}var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in {context:1,url:1}){c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c])}return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified")){f.lastModified[k]=x}if(y=v.getResponseHeader("Etag")){f.etag[k]=y}}if(a===304){c="notmodified",o=!0}else{try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}}else{u=c;if(!c||a){c="error",a<0&&(a=0)}}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n)){o[c[1].toLowerCase()]=c[2]}}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2){for(b in a){j[b]=[j[b],a[b]]}}else{b=a[v.status],v.then(b,b)}}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2){return !1}t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers){v.setRequestHeader(u,d.headers[u])}if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return !1}for(u in {success:1,error:1,complete:1}){v[u](d[u])}p=bX(bS,d,c,v);if(!p){w(-1,"No Transport")}else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a)){f.each(a,function(){e(this.name,this.value)})}else{for(var g in a){bY(g,a[g],c,e)}}return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState)){d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")}},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd){cd[a](0,1)}}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return !this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials" in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields){for(j in c.xhrFields){h[j]=c.xhrFields[j]}}c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e){h.setRequestHeader(j,e[j])}}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e){h.readyState!==4&&h.abort()}else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0){return this.animate(cr("show",3),a,b,c)}for(var g=0,h=this.length;g<h;g++){d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cs(d.nodeName)))}for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none"){d.style.display=f._data(d,"olddisplay")||""}}}return this},hide:function(a,b,c){if(a||a===0){return this.animate(cr("hide",3),a,b,c)}for(var d=0,e=this.length;d<e;d++){if(this[d].style){var g=f.css(this[d],"display");g!=="none"&&!f._data(this[d],"olddisplay")&&f._data(this[d],"olddisplay",g)}}for(d=0;d<e;d++){this[d].style&&(this[d].style.display="none")}return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cr("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=f.speed(b,c,d);if(f.isEmptyObject(a)){return this.each(e.complete,[!1])}a=f.extend({},a);return this[e.queue===!1?"each":"queue"](function(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d){return b.complete.call(this)}c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(f.support.inlineBlockNeedsLayout?(j=cs(this.nodeName),j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a){k=new f.fx(this,b,i),h=a[i],cj.test(h)?k[h==="toggle"?d?"show":"hide":h]():(l=ck.exec(h),m=k.cur(),l?(n=parseFloat(l[2]),o=l[3]||(f.cssNumber[i]?"":"px"),o!=="px"&&(f.style(this,i,(n||1)+o),m=(n||1)/k.cur()*m,f.style(this,i,m+o)),l[1]&&(n=(l[1]==="-="?-1:1)*n+m),k.custom(m,n,o)):k.custom(m,h,""))}return !0})},stop:function(a,b){a&&this.queue([]),this.each(function(){var a=f.timers,c=a.length;b||f._unmark(!0,this);while(c--){a[c].elem===this&&(b&&a[c](!0),a.splice(c,1))}}),b||this.dequeue();return this}}),f.each({slideDown:cr("show",1),slideUp:cr("hide",1),slideToggle:cr("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default,d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue!==!1?f.dequeue(this):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+0.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function h(a){return d.step(a)}var d=this,e=f.fx,g;this.startTime=cn||cp(),this.start=a,this.end=b,this.unit=c||this.unit||(f.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,h.elem=this.elem,h()&&f.timers.push(h)&&!cl&&(co?(cl=!0,g=function(){cl&&(co(g),e.tick())},co(g)):cl=setInterval(e.tick,e.interval))},show:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=cn||cp(),c=!0,d=this.elem,e=this.options,g,h;if(a||b>=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties){e.animatedProperties[g]!==!0&&(c=!1)}if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show){for(var i in e.animatedProperties){f.style(d,i,e.orig[i])}}e.complete.call(d)}return !1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return !0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b<a.length;++b){a[b]()||a.splice(b--,1)}a.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cl),cl=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var ct=/^t(?:able|d|h)$/i,cu=/^(?:body|html)$/i;"getBoundingClientRect" in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a){return this.each(function(b){f.offset.setOffset(this,a,b)})}if(!b||!b.ownerDocument){return null}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b)}try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b)){return c?{top:c.top,left:c.left}:{top:0,left:0}}var h=e.body,i=cv(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a){return this.each(function(b){f.offset.setOffset(this,a,b)})}if(!b||!b.ownerDocument){return null}if(b===b.ownerDocument.body){return f.offset.bodyOffset(b)}f.offset.initialize();var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.offset.supportsFixedPosition&&k.position==="fixed"){break}c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.offset.doesNotAddBorder&&(!f.offset.doesAddBorderForTableAndCells||!ct.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static"){l+=i.offsetTop,m+=i.offsetLeft}f.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={initialize:function(){var a=c.body,b=c.createElement("div"),d,e,g,h,i=parseFloat(f.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using" in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0]){return null}var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static"){a=a.offsetParent}return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e){return null}g=cv(e);return g?"pageXOffset" in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e){return a==null?null:this}if(f.isFunction(a)){return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))})}if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9){return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c])}if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
17
- // YUI compression via shine.magnetised.info
@@ -1,88 +0,0 @@
1
- /*
2
- * jQuery UI 1.8.9
3
- *
4
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
- * Dual licensed under the MIT or GPL Version 2 licenses.
6
- * http://jquery.org/license
7
- *
8
- * http://docs.jquery.com/UI
9
- */
10
- (function(d,b){function a(c){return !d(c).parents().andSelf().filter(function(){return d.curCSS(this,"visibility")==="hidden"||d.expr.filters.hidden(this)}).length}d.ui=d.ui||{};if(!d.ui.version){d.extend(d.ui,{version:"1.8.9",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});d.fn.extend({_focus:d.fn.focus,focus:function(e,c){return typeof e==="number"?this.each(function(){var f=this;setTimeout(function(){d(f).focus();c&&c.call(f)},e)}):this._focus.apply(this,arguments)},scrollParent:function(){var c;c=d.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(d.curCSS(this,"position",1))&&/(auto|scroll)/.test(d.curCSS(this,"overflow",1)+d.curCSS(this,"overflow-y",1)+d.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(d.curCSS(this,"overflow",1)+d.curCSS(this,"overflow-y",1)+d.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!c.length?d(document):c},zIndex:function(e){if(e!==b){return this.css("zIndex",e)}if(this.length){e=d(this[0]);for(var c;e.length&&e[0]!==document;){c=e.css("position");if(c==="absolute"||c==="relative"||c==="fixed"){c=parseInt(e.css("zIndex"),10);if(!isNaN(c)&&c!==0){return c}}e=e.parent()}}return 0},disableSelection:function(){return this.bind((d.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(c){c.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});d.each(["Width","Height"],function(f,c){function l(n,i,h,e){d.each(k,function(){i-=parseFloat(d.curCSS(n,"padding"+this,true))||0;if(h){i-=parseFloat(d.curCSS(n,"border"+this+"Width",true))||0}if(e){i-=parseFloat(d.curCSS(n,"margin"+this,true))||0}});return i}var k=c==="Width"?["Left","Right"]:["Top","Bottom"],j=c.toLowerCase(),g={innerWidth:d.fn.innerWidth,innerHeight:d.fn.innerHeight,outerWidth:d.fn.outerWidth,outerHeight:d.fn.outerHeight};d.fn["inner"+c]=function(e){if(e===b){return g["inner"+c].call(this)}return this.each(function(){d(this).css(j,l(this,e)+"px")})};d.fn["outer"+c]=function(h,e){if(typeof h!=="number"){return g["outer"+c].call(this,h)}return this.each(function(){d(this).css(j,l(this,h,true,e)+"px")})}});d.extend(d.expr[":"],{data:function(e,c,f){return !!d.data(e,f[3])},focusable:function(e){var c=e.nodeName.toLowerCase(),f=d.attr(e,"tabindex");if("area"===c){c=e.parentNode;f=c.name;if(!e.href||!f||c.nodeName.toLowerCase()!=="map"){return false}e=d("img[usemap=#"+f+"]")[0];return !!e&&a(e)}return(/input|select|textarea|button|object/.test(c)?!e.disabled:"a"==c?e.href||!isNaN(f):!isNaN(f))&&a(e)},tabbable:function(e){var c=d.attr(e,"tabindex");return(isNaN(c)||c>=0)&&d(e).is(":focusable")}});d(function(){var e=document.body,c=e.appendChild(c=document.createElement("div"));d.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});d.support.minHeight=c.offsetHeight===100;d.support.selectstart="onselectstart" in c;e.removeChild(c).style.display="none"});d.extend(d.ui,{plugin:{add:function(f,c,h){f=d.ui[f].prototype;for(var g in h){f.plugins[g]=f.plugins[g]||[];f.plugins[g].push([c,h[g]])}},call:function(f,c,h){if((c=f.plugins[c])&&f.element[0].parentNode){for(var g=0;g<c.length;g++){f.options[c[g][0]]&&c[g][1].apply(f.element,h)}}}},contains:function(e,c){return document.compareDocumentPosition?e.compareDocumentPosition(c)&16:e!==c&&e.contains(c)},hasScroll:function(e,c){if(d(e).css("overflow")==="hidden"){return false}c=c&&c==="left"?"scrollLeft":"scrollTop";var f=false;if(e[c]>0){return true}e[c]=1;f=e[c]>0;e[c]=0;return f},isOverAxis:function(e,c,f){return e>c&&e<c+f},isOver:function(f,c,l,k,j,g){return d.ui.isOverAxis(f,l,j)&&d.ui.isOverAxis(c,k,g)}})}})(jQuery);
11
- /*
12
- * jQuery UI Widget 1.8.9
13
- *
14
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
15
- * Dual licensed under the MIT or GPL Version 2 licenses.
16
- * http://jquery.org/license
17
- *
18
- * http://docs.jquery.com/UI/Widget
19
- */
20
- (function(a,e){if(a.cleanData){var d=a.cleanData;a.cleanData=function(b){for(var g=0,f;(f=b[g])!=null;g++){a(f).triggerHandler("remove")}d(b)}}else{var c=a.fn.remove;a.fn.remove=function(b,f){return this.each(function(){if(!f){if(!b||a.filter(b,[this]).length){a("*",this).add([this]).each(function(){a(this).triggerHandler("remove")})}}return c.call(a(this),b,f)})}}a.widget=function(b,j,i){var h=b.split(".")[0],g;b=b.split(".")[1];g=h+"-"+b;if(!i){i=j;j=a.Widget}a.expr[":"][g]=function(f){return !!a.data(f,b)};a[h]=a[h]||{};a[h][b]=function(f,k){arguments.length&&this._createWidget(f,k)};j=new j;j.options=a.extend(true,{},j.options);a[h][b].prototype=a.extend(true,j,{namespace:h,widgetName:b,widgetEventPrefix:a[h][b].prototype.widgetEventPrefix||b,widgetBaseClass:g},i);a.widget.bridge(b,a[h][b])};a.widget.bridge=function(b,f){a.fn[b]=function(k){var j=typeof k==="string",i=Array.prototype.slice.call(arguments,1),g=this;k=!j&&i.length?a.extend.apply(null,[true,k].concat(i)):k;if(j&&k.charAt(0)==="_"){return g}j?this.each(function(){var l=a.data(this,b),h=l&&a.isFunction(l[k])?l[k].apply(l,i):l;if(h!==l&&h!==e){g=h;return false}}):this.each(function(){var h=a.data(this,b);h?h.option(k||{})._init():a.data(this,b,new f(k,this))});return g}};a.Widget=function(b,f){arguments.length&&this._createWidget(b,f)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(b,g){a.data(g,this.widgetName,this);this.element=a(g);this.options=a.extend(true,{},this.options,this._getCreateOptions(),b);var f=this;this.element.bind("remove."+this.widgetName,function(){f.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(b,g){var f=b;if(arguments.length===0){return a.extend({},this.options)}if(typeof b==="string"){if(g===e){return this.options[b]}f={};f[b]=g}this._setOptions(f);return this},_setOptions:function(b){var f=this;a.each(b,function(h,g){f._setOption(h,g)});return this},_setOption:function(b,f){this.options[b]=f;if(b==="disabled"){this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f)}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,j,i){var h=this.options[b];j=a.Event(j);j.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();i=i||{};if(j.originalEvent){b=a.event.props.length;for(var g;b;){g=a.event.props[--b];j[g]=j.originalEvent[g]}}this.element.trigger(j,i);return !(a.isFunction(h)&&h.call(this.element[0],j,i)===false||j.isDefaultPrevented())}}})(jQuery);
21
- /*
22
- * jQuery UI Mouse 1.8.9
23
- *
24
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
25
- * Dual licensed under the MIT or GPL Version 2 licenses.
26
- * http://jquery.org/license
27
- *
28
- * http://docs.jquery.com/UI/Mouse
29
- *
30
- * Depends:
31
- * jquery.ui.widget.js
32
- */
33
- (function(a){a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(c){return b._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(d){d.originalEvent=d.originalEvent||{};if(!d.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(d);this._mouseDownEvent=d;var c=this,h=d.which==1,g=typeof this.options.cancel=="string"?a(d.target).parents().add(d.target).filter(this.options.cancel).length:false;if(!h||g||!this._mouseCapture(d)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d)){this._mouseStarted=this._mouseStart(d)!==false;if(!this._mouseStarted){d.preventDefault();return true}}this._mouseMoveDelegate=function(b){return c._mouseMove(b)};this._mouseUpDelegate=function(b){return c._mouseUp(b)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);d.preventDefault();return d.originalEvent.mouseHandled=true}},_mouseMove:function(b){if(a.browser.msie&&!(document.documentMode>=9)&&!b.button){return this._mouseUp(b)}if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==false)?this._mouseDrag(b):this._mouseUp(b)}return !this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",true);this._mouseStop(b)}return false},_mouseDistanceMet:function(b){return Math.max(Math.abs(this._mouseDownEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);(function(f){f.ui=f.ui||{};var e=/left|center|right/,d=/top|center|bottom/,b=f.fn.position,a=f.fn.offset;f.fn.position=function(c){if(!c||!c.of){return b.apply(this,arguments)}c=f.extend({},c);var i=f(c.of),q=i[0],o=(c.collision||"flip").split(" "),p=c.offset?c.offset.split(" "):[0,0],n,l,m;if(q.nodeType===9){n=i.width();l=i.height();m={top:0,left:0}}else{if(q.setTimeout){n=i.width();l=i.height();m={top:i.scrollTop(),left:i.scrollLeft()}}else{if(q.preventDefault){c.at="left top";n=l=0;m={top:c.of.pageY,left:c.of.pageX}}else{n=i.outerWidth();l=i.outerHeight();m=i.offset()}}}f.each(["my","at"],function(){var g=(c[this]||"").split(" ");if(g.length===1){g=e.test(g[0])?g.concat(["center"]):d.test(g[0])?["center"].concat(g):["center","center"]}g[0]=e.test(g[0])?g[0]:"center";g[1]=d.test(g[1])?g[1]:"center";c[this]=g});if(o.length===1){o[1]=o[0]}p[0]=parseInt(p[0],10)||0;if(p.length===1){p[1]=p[0]}p[1]=parseInt(p[1],10)||0;if(c.at[0]==="right"){m.left+=n}else{if(c.at[0]==="center"){m.left+=n/2}}if(c.at[1]==="bottom"){m.top+=l}else{if(c.at[1]==="center"){m.top+=l/2}}m.left+=p[0];m.top+=p[1];return this.each(function(){var u=f(this),s=u.outerWidth(),k=u.outerHeight(),j=parseInt(f.curCSS(this,"marginLeft",true))||0,h=parseInt(f.curCSS(this,"marginTop",true))||0,y=s+j+(parseInt(f.curCSS(this,"marginRight",true))||0),x=k+h+(parseInt(f.curCSS(this,"marginBottom",true))||0),t=f.extend({},m),g;if(c.my[0]==="right"){t.left-=s}else{if(c.my[0]==="center"){t.left-=s/2}}if(c.my[1]==="bottom"){t.top-=k}else{if(c.my[1]==="center"){t.top-=k/2}}t.left=Math.round(t.left);t.top=Math.round(t.top);g={left:t.left-j,top:t.top-h};f.each(["left","top"],function(v,r){f.ui.position[o[v]]&&f.ui.position[o[v]][r](t,{targetWidth:n,targetHeight:l,elemWidth:s,elemHeight:k,collisionPosition:g,collisionWidth:y,collisionHeight:x,offset:p,my:c.my,at:c.at})});f.fn.bgiframe&&u.bgiframe();u.offset(f.extend(t,{using:c.using}))})};f.ui.position={fit:{left:function(c,g){var h=f(window);h=g.collisionPosition.left+g.collisionWidth-h.width()-h.scrollLeft();c.left=h>0?c.left-h:Math.max(c.left-g.collisionPosition.left,c.left)},top:function(c,g){var h=f(window);h=g.collisionPosition.top+g.collisionHeight-h.height()-h.scrollTop();c.top=h>0?c.top-h:Math.max(c.top-g.collisionPosition.top,c.top)}},flip:{left:function(c,i){if(i.at[0]!=="center"){var m=f(window);m=i.collisionPosition.left+i.collisionWidth-m.width()-m.scrollLeft();var k=i.my[0]==="left"?-i.elemWidth:i.my[0]==="right"?i.elemWidth:0,l=i.at[0]==="left"?i.targetWidth:-i.targetWidth,j=-2*i.offset[0];c.left+=i.collisionPosition.left<0?k+l+j:m>0?k+l+j:0}},top:function(c,i){if(i.at[1]!=="center"){var m=f(window);m=i.collisionPosition.top+i.collisionHeight-m.height()-m.scrollTop();var k=i.my[1]==="top"?-i.elemHeight:i.my[1]==="bottom"?i.elemHeight:0,l=i.at[1]==="top"?i.targetHeight:-i.targetHeight,j=-2*i.offset[1];c.top+=i.collisionPosition.top<0?k+l+j:m>0?k+l+j:0}}}};if(!f.offset.setOffset){f.offset.setOffset=function(c,i){if(/static/.test(f.curCSS(c,"position"))){c.style.position="relative"}var m=f(c),k=m.offset(),l=parseInt(f.curCSS(c,"top",true),10)||0,j=parseInt(f.curCSS(c,"left",true),10)||0;k={top:i.top-k.top+l,left:i.left-k.left+j};"using" in i?i.using.call(c,k):m.css(k)};f.fn.offset=function(c){var g=this[0];if(!g||!g.ownerDocument){return null}if(c){return this.each(function(){f.offset.setOffset(this,c)})}return a.call(this)}}})(jQuery);(function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))){this.element[0].style.position="relative"}this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(d){var c=this.options;if(this.helper||c.disabled||a(d.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(d);if(!this.handle){return false}return true},_mouseStart:function(d){var c=this.options;this.helper=this._createHelper(d);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);c.containment&&this._setContainment();if(this._trigger("start",d)===false){this._clear();return false}this._cacheHelperProportions();a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,d);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(d,true);return true},_mouseDrag:function(d,c){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute");if(!c){c=this._uiHash();if(this._trigger("drag",d,c)===false){this._mouseUp({});return false}this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}a.ui.ddmanager&&a.ui.ddmanager.drag(this,d);return false},_mouseStop:function(e){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,e)}if(this.dropped){d=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original"){return false}if(this.options.revert=="invalid"&&!d||this.options.revert=="valid"&&d||this.options.revert===true||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d)){var f=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",e)!==false&&f._clear()})}else{this._trigger("stop",e)!==false&&this._clear()}return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(d){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==d.target){c=true}});return c},_createHelper:function(d){var c=this.options;d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[d])):c.helper=="clone"?this.element.clone():this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo);d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){if(typeof b=="string"){b=b.split(" ")}if(a.isArray(b)){b={left:+b[0],top:+b[1]||0}}if("left" in b){this.offset.click.left=b.left+this.margins.left}if("right" in b){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if("top" in b){this.offset.click.top=b.top+this.margins.top}if("bottom" in b){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[(e.containment=="document"?0:a(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(e.containment=="document"?0:a(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(e.containment=="document"?0:a(window).scrollLeft())+a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e.containment=="document"?0:a(window).scrollTop())+(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!/^(document|window|parent)$/.test(e.containment)&&e.containment.constructor!=Array){var d=a(e.containment)[0];if(d){e=a(e.containment).offset();var f=a(d).css("overflow")!="hidden";this.containment=[e.left+(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0)-this.margins.top,e.left+(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(e,d){if(!d){d=this.position}e=e=="absolute"?1:-1;var h=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(h[0].tagName);return{top:d.top+this.offset.relative.top*e+this.offset.parent.top*e-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:h.scrollTop())*e),left:d.left+this.offset.relative.left*e+this.offset.parent.left*e-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:h.scrollLeft())*e)}},_generatePosition:function(h){var d=this.options,l=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,j=/(html|body)/i.test(l[0].tagName),k=h.pageX,i=h.pageY;if(this.originalPosition){if(this.containment){if(h.pageX-this.offset.click.left<this.containment[0]){k=this.containment[0]+this.offset.click.left}if(h.pageY-this.offset.click.top<this.containment[1]){i=this.containment[1]+this.offset.click.top}if(h.pageX-this.offset.click.left>this.containment[2]){k=this.containment[2]+this.offset.click.left}if(h.pageY-this.offset.click.top>this.containment[3]){i=this.containment[3]+this.offset.click.top}}if(d.grid){i=this.originalPageY+Math.round((i-this.originalPageY)/d.grid[1])*d.grid[1];i=this.containment?!(i-this.offset.click.top<this.containment[1]||i-this.offset.click.top>this.containment[3])?i:!(i-this.offset.click.top<this.containment[1])?i-d.grid[1]:i+d.grid[1]:i;k=this.originalPageX+Math.round((k-this.originalPageX)/d.grid[0])*d.grid[0];k=this.containment?!(k-this.offset.click.left<this.containment[0]||k-this.offset.click.left>this.containment[2])?k:!(k-this.offset.click.left<this.containment[0])?k-d.grid[0]:k+d.grid[0]:k}}return{top:i-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():j?0:l.scrollTop()),left:k-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():j?0:l.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(e,d,f){f=f||this._uiHash();a.ui.plugin.call(this,e,[d,f]);if(e=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.Widget.prototype._trigger.call(this,e,d,f)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});a.extend(a.ui.draggable,{version:"1.8.9"});a.ui.plugin.add("draggable","connectToSortable",{start:function(g,d){var j=a(this).data("draggable"),h=j.options,i=a.extend({},d,{item:j.element});j.sortables=[];a(h.connectToSortable).each(function(){var b=a.data(this,"sortable");if(b&&!b.options.disabled){j.sortables.push({instance:b,shouldRevert:b.options.revert});b._refreshItems();b._trigger("activate",g,i)}})},stop:function(e,d){var h=a(this).data("draggable"),g=a.extend({},d,{item:h.element});a.each(h.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;h.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(e);this.instance.options.helper=this.instance.options._helper;h.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",e,g)}})},drag:function(e,d){var h=a(this).data("draggable"),g=this;a.each(h.sortables,function(){this.instance.positionAbs=h.positionAbs;this.instance.helperProportions=h.helperProportions;this.instance.offset.click=h.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(g).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return d.helper[0]};e.target=this.instance.currentItem[0];this.instance._mouseCapture(e,true);this.instance._mouseStart(e,true,true);this.instance.offset.click.top=h.offset.click.top;this.instance.offset.click.left=h.offset.click.left;this.instance.offset.parent.left-=h.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=h.offset.parent.top-this.instance.offset.parent.top;h._trigger("toSortable",e);h.dropped=this.instance.element;h.currentItem=h.element;this.instance.fromOutside=h}this.instance.currentItem&&this.instance._mouseDrag(e)}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",e,this.instance._uiHash(this.instance));this.instance._mouseStop(e,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();h._trigger("fromSortable",e);h.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(){var d=a("body"),c=a(this).data("draggable").options;if(d.css("cursor")){c._cursor=d.css("cursor")}d.css("cursor",c.cursor)},stop:function(){var b=a(this).data("draggable").options;b._cursor&&a("body").css("cursor",b._cursor)}});a.ui.plugin.add("draggable","iframeFix",{start:function(){var b=a(this).data("draggable").options;a(b.iframeFix===true?"iframe":b.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(d,c){d=a(c.helper);c=a(this).data("draggable").options;if(d.css("opacity")){c._opacity=d.css("opacity")}d.css("opacity",c.opacity)},stop:function(d,c){d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}});a.ui.plugin.add("draggable","scroll",{start:function(){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(e){var d=a(this).data("draggable"),h=d.options,g=false;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!h.axis||h.axis!="x"){if(d.overflowOffset.top+d.scrollParent[0].offsetHeight-e.pageY<h.scrollSensitivity){d.scrollParent[0].scrollTop=g=d.scrollParent[0].scrollTop+h.scrollSpeed}else{if(e.pageY-d.overflowOffset.top<h.scrollSensitivity){d.scrollParent[0].scrollTop=g=d.scrollParent[0].scrollTop-h.scrollSpeed}}}if(!h.axis||h.axis!="y"){if(d.overflowOffset.left+d.scrollParent[0].offsetWidth-e.pageX<h.scrollSensitivity){d.scrollParent[0].scrollLeft=g=d.scrollParent[0].scrollLeft+h.scrollSpeed}else{if(e.pageX-d.overflowOffset.left<h.scrollSensitivity){d.scrollParent[0].scrollLeft=g=d.scrollParent[0].scrollLeft-h.scrollSpeed}}}}else{if(!h.axis||h.axis!="x"){if(e.pageY-a(document).scrollTop()<h.scrollSensitivity){g=a(document).scrollTop(a(document).scrollTop()-h.scrollSpeed)}else{if(a(window).height()-(e.pageY-a(document).scrollTop())<h.scrollSensitivity){g=a(document).scrollTop(a(document).scrollTop()+h.scrollSpeed)}}}if(!h.axis||h.axis!="y"){if(e.pageX-a(document).scrollLeft()<h.scrollSensitivity){g=a(document).scrollLeft(a(document).scrollLeft()-h.scrollSpeed)}else{if(a(window).width()-(e.pageX-a(document).scrollLeft())<h.scrollSensitivity){g=a(document).scrollLeft(a(document).scrollLeft()+h.scrollSpeed)}}}}g!==false&&a.ui.ddmanager&&!h.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,e)}});a.ui.plugin.add("draggable","snap",{start:function(){var d=a(this).data("draggable"),c=d.options;d.snapElements=[];a(c.snap.constructor!=String?c.snap.items||":data(draggable)":c.snap).each(function(){var e=a(this),b=e.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:b.top,left:b.left})})},drag:function(L,K){for(var J=a(this).data("draggable"),H=J.options,I=H.snapTolerance,G=K.offset.left,z=G+J.helperProportions.width,A=K.offset.top,y=A+J.helperProportions.height,F=J.snapElements.length-1;F>=0;F--){var E=J.snapElements[F].left,C=E+J.snapElements[F].width,D=J.snapElements[F].top,B=D+J.snapElements[F].height;if(E-I<G&&G<C+I&&D-I<A&&A<B+I||E-I<G&&G<C+I&&D-I<y&&y<B+I||E-I<z&&z<C+I&&D-I<A&&A<B+I||E-I<z&&z<C+I&&D-I<y&&y<B+I){if(H.snapMode!="inner"){var x=Math.abs(D-y)<=I,w=Math.abs(B-A)<=I,v=Math.abs(E-z)<=I,u=Math.abs(C-G)<=I;if(x){K.position.top=J._convertPositionTo("relative",{top:D-J.helperProportions.height,left:0}).top-J.margins.top}if(w){K.position.top=J._convertPositionTo("relative",{top:B,left:0}).top-J.margins.top}if(v){K.position.left=J._convertPositionTo("relative",{top:0,left:E-J.helperProportions.width}).left-J.margins.left}if(u){K.position.left=J._convertPositionTo("relative",{top:0,left:C}).left-J.margins.left}}var d=x||w||v||u;if(H.snapMode!="outer"){x=Math.abs(D-A)<=I;w=Math.abs(B-y)<=I;v=Math.abs(E-G)<=I;u=Math.abs(C-z)<=I;if(x){K.position.top=J._convertPositionTo("relative",{top:D,left:0}).top-J.margins.top}if(w){K.position.top=J._convertPositionTo("relative",{top:B-J.helperProportions.height,left:0}).top-J.margins.top}if(v){K.position.left=J._convertPositionTo("relative",{top:0,left:E}).left-J.margins.left}if(u){K.position.left=J._convertPositionTo("relative",{top:0,left:C-J.helperProportions.width}).left-J.margins.left}}if(!J.snapElements[F].snapping&&(x||w||v||u||d)){J.options.snap.snap&&J.options.snap.snap.call(J.element,L,a.extend(J._uiHash(),{snapItem:J.snapElements[F].item}))}J.snapElements[F].snapping=x||w||v||u||d}else{J.snapElements[F].snapping&&J.options.snap.release&&J.options.snap.release.call(J.element,L,a.extend(J._uiHash(),{snapItem:J.snapElements[F].item}));J.snapElements[F].snapping=false}}}});a.ui.plugin.add("draggable","stack",{start:function(){var d=a(this).data("draggable").options;d=a.makeArray(a(d.stack)).sort(function(e,b){return(parseInt(a(e).css("zIndex"),10)||0)-(parseInt(a(b).css("zIndex"),10)||0)});if(d.length){var c=parseInt(d[0].style.zIndex)||0;a(d).each(function(b){this.style.zIndex=c+b});this[0].style.zIndex=c+d.length}}});a.ui.plugin.add("draggable","zIndex",{start:function(d,c){d=a(c.helper);c=a(this).data("draggable").options;if(d.css("zIndex")){c._zIndex=d.css("zIndex")}d.css("zIndex",c.zIndex)},stop:function(d,c){d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);(function(a){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var d=this.options,c=d.accept;this.isover=0;this.isout=1;this.accept=a.isFunction(c)?c:function(b){return b.is(c)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[d.scope]=a.ui.ddmanager.droppables[d.scope]||[];a.ui.ddmanager.droppables[d.scope].push(this);d.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var d=a.ui.ddmanager.droppables[this.options.scope],c=0;c<d.length;c++){d[c]==this&&d.splice(c,1)}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(d,c){if(d=="accept"){this.accept=a.isFunction(c)?c:function(b){return b.is(c)}}a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(d){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass);c&&this._trigger("activate",d,this.ui(c))},_deactivate:function(d){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);c&&this._trigger("deactivate",d,this.ui(c))},_over:function(d){var c=a.ui.ddmanager.current;if(!(!c||(c.currentItem||c.element)[0]==this.element[0])){if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);this._trigger("over",d,this.ui(c))}}},_out:function(d){var c=a.ui.ddmanager.current;if(!(!c||(c.currentItem||c.element)[0]==this.element[0])){if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",d,this.ui(c))}}},_drop:function(f,d){var h=d||a.ui.ddmanager.current;if(!h||(h.currentItem||h.element)[0]==this.element[0]){return false}var g=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==h.options.scope&&b.accept.call(b.element[0],h.currentItem||h.element)&&a.ui.intersect(h,a.extend(b,{offset:b.element.offset()}),b.options.tolerance)){g=true;return false}});if(g){return false}if(this.accept.call(this.element[0],h.currentItem||h.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",f,this.ui(h));return this.element}return false},ui:function(b){return{draggable:b.currentItem||b.element,helper:b.helper,position:b.position,offset:b.positionAbs}}});a.extend(a.ui.droppable,{version:"1.8.9"});a.ui.intersect=function(v,u,t){if(!u.offset){return false}var s=(v.positionAbs||v.position.absolute).left,q=s+v.helperProportions.width,r=(v.positionAbs||v.position.absolute).top,p=r+v.helperProportions.height,o=u.offset.left,m=o+u.proportions.width,n=u.offset.top,d=n+u.proportions.height;switch(t){case"fit":return o<=s&&q<=m&&n<=r&&p<=d;case"intersect":return o<s+v.helperProportions.width/2&&q-v.helperProportions.width/2<m&&n<r+v.helperProportions.height/2&&p-v.helperProportions.height/2<d;case"pointer":return a.ui.isOver((v.positionAbs||v.position.absolute).top+(v.clickOffset||v.offset.click).top,(v.positionAbs||v.position.absolute).left+(v.clickOffset||v.offset.click).left,n,o,u.proportions.height,u.proportions.width);case"touch":return(r>=n&&r<=d||p>=n&&p<=d||r<n&&p>d)&&(s>=o&&s<=m||q>=o&&q<=m||s<o&&q>m);default:return false}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(i,d){var n=a.ui.ddmanager.droppables[i.options.scope]||[],m=d?d.type:null,k=(i.currentItem||i.element).find(":data(droppable)").andSelf(),l=0;i:for(;l<n.length;l++){if(!(n[l].options.disabled||i&&!n[l].accept.call(n[l].element[0],i.currentItem||i.element))){for(var j=0;j<k.length;j++){if(k[j]==n[l].element[0]){n[l].proportions.height=0;continue i}}n[l].visible=n[l].element.css("display")!="none";if(n[l].visible){n[l].offset=n[l].element.offset();n[l].proportions={width:n[l].element[0].offsetWidth,height:n[l].element[0].offsetHeight};m=="mousedown"&&n[l]._activate.call(n[l],d)}}}},drop:function(e,d){var f=false;a.each(a.ui.ddmanager.droppables[e.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&a.ui.intersect(e,this,this.options.tolerance)){f=f||this._drop.call(this,d)}if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)){this.isout=1;this.isover=0;this._deactivate.call(this,d)}}});return f},drag:function(d,c){d.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(d,c);a.each(a.ui.ddmanager.droppables[d.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var h=a.ui.intersect(d,this,this.options.tolerance);if(h=!h&&this.isover==1?"isout":h&&this.isover==0?"isover":null){var f;if(this.options.greedy){var b=this.element.parents(":data(droppable):eq(0)");if(b.length){f=a.data(b[0],"droppable");f.greedyChild=h=="isover"?1:0}}if(f&&h=="isover"){f.isover=0;f.isout=1;f._out.call(f,c)}this[h]=1;this[h=="isout"?"isover":"isout"]=0;this[h=="isover"?"_over":"_out"].call(this,c);if(f&&h=="isout"){f.isout=0;f.isover=1;f._over.call(f,c)}}}})}}})(jQuery);(function(c){c.widget("ui.resizable",c.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000},_create:function(){var e=this,h=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!h.aspectRatio,aspectRatio:h.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:h.helper||h.ghost||h.animate?h.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&c.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(c('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=h.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var l=this.handles.split(",");this.handles={};for(var k=0;k<l.length;k++){var j=c.trim(l[k]),i=c('<div class="ui-resizable-handle '+("ui-resizable-"+j)+'"></div>');/sw|se|ne|nw/.test(j)&&i.css({zIndex:++h.zIndex});"se"==j&&i.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[j]=".ui-resizable-"+j;this.element.append(i)}}this._renderAxis=function(m){m=m||this.element;for(var g in this.handles){if(this.handles[g].constructor==String){this.handles[g]=c(this.handles[g],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var f=c(this.handles[g],this.element),d=0;d=/sw|ne|nw|se|n|s/.test(g)?f.outerHeight():f.outerWidth();f=["padding",/ne|nw|n/.test(g)?"Top":/se|sw|s/.test(g)?"Bottom":/^e$/.test(g)?"Right":"Left"].join("");m.css(f,d);this._proportionallyResize()}c(this.handles[g])}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var d=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=d&&d[1]?d[1]:"se"}});if(h.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.after(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement);return this},_mouseCapture:function(d){var e=false;for(var f in this.handles){if(c(this.handles[f])[0]==d.target){e=true}}return !this.options.disabled&&e},_mouseStart:function(e){var g=this.options,j=this.element.position(),i=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(i.is(".ui-draggable")||/absolute/.test(i.css("position"))){i.css({position:"absolute",top:j.top,left:j.left})}c.browser.opera&&/relative/.test(i.css("position"))&&i.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();j=a(this.helper.css("left"));var h=a(this.helper.css("top"));if(g.containment){j+=c(g.containment).scrollLeft()||0;h+=c(g.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:h};this.size=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalSize=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalPosition={left:j,top:h};this.sizeDiff={width:i.outerWidth()-i.width(),height:i.outerHeight()-i.height()};this.originalMousePosition={left:e.pageX,top:e.pageY};this.aspectRatio=typeof g.aspectRatio=="number"?g.aspectRatio:this.originalSize.width/this.originalSize.height||1;g=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",g=="auto"?this.axis+"-resize":g);i.addClass("ui-resizable-resizing");this._propagate("start",e);return true},_mouseDrag:function(e){var f=this.helper,h=this.originalMousePosition,g=this._change[this.axis];if(!g){return false}h=g.apply(this,[e,e.pageX-h.left||0,e.pageY-h.top||0]);if(this._aspectRatio||e.shiftKey){h=this._updateRatio(h,e)}h=this._respectSize(h,e);this._propagate("resize",e);f.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(h);this._trigger("resize",e,this.ui());return false},_mouseStop:function(e){this.resizing=false;var h=this.options,l=this;if(this._helper){var k=this._proportionallyResizeElements,j=k.length&&/textarea/i.test(k[0].nodeName);k=j&&c.ui.hasScroll(k[0],"left")?0:l.sizeDiff.height;j={width:l.size.width-(j?0:l.sizeDiff.width),height:l.size.height-k};k=parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left)||null;var i=parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top)||null;h.animate||this.element.css(c.extend(j,{top:i,left:k}));l.helper.height(l.size.height);l.helper.width(l.size.width);this._helper&&!h.animate&&this._proportionallyResize()}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",e);this._helper&&this.helper.remove();return false},_updateCache:function(d){this.offset=this.helper.offset();if(b(d.left)){this.position.left=d.left}if(b(d.top)){this.position.top=d.top}if(b(d.height)){this.size.height=d.height}if(b(d.width)){this.size.width=d.width}},_updateRatio:function(e){var f=this.position,h=this.size,g=this.axis;if(e.height){e.width=h.height*this.aspectRatio}else{if(e.width){e.height=h.width/this.aspectRatio}}if(g=="sw"){e.left=f.left+(h.width-e.width);e.top=null}if(g=="nw"){e.top=f.top+(h.height-e.height);e.left=f.left+(h.width-e.width)}return e},_respectSize:function(s){var t=this.options,r=this.axis,q=b(s.width)&&t.maxWidth&&t.maxWidth<s.width,p=b(s.height)&&t.maxHeight&&t.maxHeight<s.height,o=b(s.width)&&t.minWidth&&t.minWidth>s.width,n=b(s.height)&&t.minHeight&&t.minHeight>s.height;if(o){s.width=t.minWidth}if(n){s.height=t.minHeight}if(q){s.width=t.maxWidth}if(p){s.height=t.maxHeight}var m=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,e=/sw|nw|w/.test(r);r=/nw|ne|n/.test(r);if(o&&e){s.left=m-t.minWidth}if(q&&e){s.left=m-t.maxWidth}if(n&&r){s.top=l-t.minHeight}if(p&&r){s.top=l-t.maxHeight}if((t=!s.width&&!s.height)&&!s.left&&s.top){s.top=null}else{if(t&&!s.top&&s.left){s.left=null}}return s},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){for(var e=this.helper||this.element,g=0;g<this._proportionallyResizeElements.length;g++){var j=this._proportionallyResizeElements[g];if(!this.borderDif){var i=[j.css("borderTopWidth"),j.css("borderRightWidth"),j.css("borderBottomWidth"),j.css("borderLeftWidth")],h=[j.css("paddingTop"),j.css("paddingRight"),j.css("paddingBottom"),j.css("paddingLeft")];this.borderDif=c.map(i,function(f,d){f=parseInt(f,10)||0;d=parseInt(h[d],10)||0;return f+d})}c.browser.msie&&(c(e).is(":hidden")||c(e).parents(":hidden").length)||j.css({height:e.height()-this.borderDif[0]-this.borderDif[2]||0,width:e.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var d=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var e=c.browser.msie&&c.browser.version<7,f=e?1:0;e=e?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+e,height:this.element.outerHeight()+e,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++d.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(d,e){return{width:this.originalSize.width+e}},w:function(d,e){return{left:this.originalPosition.left+e,width:this.originalSize.width-e}},n:function(d,e,f){return{top:this.originalPosition.top+f,height:this.originalSize.height-f}},s:function(d,e,f){return{height:this.originalSize.height+f}},se:function(d,e,f){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[d,e,f]))},sw:function(d,e,f){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[d,e,f]))},ne:function(d,e,f){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[d,e,f]))},nw:function(d,e,f){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[d,e,f]))}},_propagate:function(d,e){c.ui.plugin.call(this,d,[e,this.ui()]);d!="resize"&&this._trigger(d,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});c.extend(c.ui.resizable,{version:"1.8.9"});c.ui.plugin.add("resizable","alsoResize",{start:function(){var d=c(this).data("resizable").options,e=function(f){c(f).each(function(){var g=c(this);g.data("resizable-alsoresize",{width:parseInt(g.width(),10),height:parseInt(g.height(),10),left:parseInt(g.css("left"),10),top:parseInt(g.css("top"),10),position:g.css("position")})})};if(typeof d.alsoResize=="object"&&!d.alsoResize.parentNode){if(d.alsoResize.length){d.alsoResize=d.alsoResize[0];e(d.alsoResize)}else{c.each(d.alsoResize,function(f){e(f)})}}else{e(d.alsoResize)}},resize:function(e,i){var n=c(this).data("resizable");e=n.options;var m=n.originalSize,l=n.originalPosition,k={height:n.size.height-m.height||0,width:n.size.width-m.width||0,top:n.position.top-l.top||0,left:n.position.left-l.left||0},j=function(f,d){c(f).each(function(){var g=c(this),o=c(this).data("resizable-alsoresize"),s={},h=d&&d.length?d:g.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];c.each(h,function(q,p){if((q=(o[p]||0)+(k[p]||0))&&q>=0){s[p]=q||null}});if(c.browser.opera&&/relative/.test(g.css("position"))){n._revertToRelativePosition=true;g.css({position:"absolute",top:"auto",left:"auto"})}g.css(s)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?c.each(e.alsoResize,function(f,d){j(f,d)}):j(e.alsoResize)},stop:function(){var d=c(this).data("resizable"),e=d.options,f=function(g){c(g).each(function(){var h=c(this);h.css({position:h.data("resizable-alsoresize").position})})};if(d._revertToRelativePosition){d._revertToRelativePosition=false;typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?c.each(e.alsoResize,function(g){f(g)}):f(e.alsoResize)}c(this).removeData("resizable-alsoresize")}});c.ui.plugin.add("resizable","animate",{stop:function(e){var i=c(this).data("resizable"),n=i.options,m=i._proportionallyResizeElements,l=m.length&&/textarea/i.test(m[0].nodeName),k=l&&c.ui.hasScroll(m[0],"left")?0:i.sizeDiff.height;l={width:i.size.width-(l?0:i.sizeDiff.width),height:i.size.height-k};k=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null;var j=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(c.extend(l,j&&k?{top:j,left:k}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var d={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};m&&m.length&&c(m[0]).css({width:d.width,height:d.height});i._updateCache(d);i._propagate("resize",e)}})}});c.ui.plugin.add("resizable","containment",{start:function(){var e=c(this).data("resizable"),i=e.element,n=e.options.containment;if(i=n instanceof c?n.get(0):/parent/.test(n)?i.parent().get(0):n){e.containerElement=c(i);if(/document/.test(n)||n==document){e.containerOffset={left:0,top:0};e.containerPosition={left:0,top:0};e.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(i),l=[];c(["Top","Right","Left","Bottom"]).each(function(f,d){l[f]=a(m.css("padding"+d))});e.containerOffset=m.offset();e.containerPosition=m.position();e.containerSize={height:m.innerHeight()-l[3],width:m.innerWidth()-l[1]};n=e.containerOffset;var k=e.containerSize.height,j=e.containerSize.width;j=c.ui.hasScroll(i,"left")?i.scrollWidth:j;k=c.ui.hasScroll(i)?i.scrollHeight:k;e.parentData={element:i,left:n.left,top:n.top,width:j,height:k}}}},resize:function(e){var i=c(this).data("resizable"),n=i.options,m=i.containerOffset,l=i.position;e=i._aspectRatio||e.shiftKey;var k={top:0,left:0},j=i.containerElement;if(j[0]!=document&&/static/.test(j.css("position"))){k=m}if(l.left<(i._helper?m.left:0)){i.size.width+=i._helper?i.position.left-m.left:i.position.left-k.left;if(e){i.size.height=i.size.width/n.aspectRatio}i.position.left=n.helper?m.left:0}if(l.top<(i._helper?m.top:0)){i.size.height+=i._helper?i.position.top-m.top:i.position.top;if(e){i.size.width=i.size.height*n.aspectRatio}i.position.top=i._helper?m.top:0}i.offset.left=i.parentData.left+i.position.left;i.offset.top=i.parentData.top+i.position.top;n=Math.abs((i._helper?i.offset.left-k.left:i.offset.left-k.left)+i.sizeDiff.width);m=Math.abs((i._helper?i.offset.top-k.top:i.offset.top-m.top)+i.sizeDiff.height);l=i.containerElement.get(0)==i.element.parent().get(0);k=/relative|absolute/.test(i.containerElement.css("position"));if(l&&k){n-=i.parentData.left}if(n+i.size.width>=i.parentData.width){i.size.width=i.parentData.width-n;if(e){i.size.height=i.size.width/i.aspectRatio}}if(m+i.size.height>=i.parentData.height){i.size.height=i.parentData.height-m;if(e){i.size.width=i.size.height*i.aspectRatio}}},stop:function(){var e=c(this).data("resizable"),j=e.options,p=e.containerOffset,o=e.containerPosition,n=e.containerElement,m=c(e.helper),l=m.offset(),k=m.outerWidth()-e.sizeDiff.width;m=m.outerHeight()-e.sizeDiff.height;e._helper&&!j.animate&&/relative/.test(n.css("position"))&&c(this).css({left:l.left-o.left-p.left,width:k,height:m});e._helper&&!j.animate&&/static/.test(n.css("position"))&&c(this).css({left:l.left-o.left-p.left,width:k,height:m})}});c.ui.plugin.add("resizable","ghost",{start:function(){var d=c(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:"");d.ghost.appendTo(d.helper)},resize:function(){var d=c(this).data("resizable");d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(){var d=c(this).data("resizable");d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}});c.ui.plugin.add("resizable","grid",{resize:function(){var e=c(this).data("resizable"),i=e.options,n=e.size,m=e.originalSize,l=e.originalPosition,k=e.axis;i.grid=typeof i.grid=="number"?[i.grid,i.grid]:i.grid;var j=Math.round((n.width-m.width)/(i.grid[0]||1))*(i.grid[0]||1);i=Math.round((n.height-m.height)/(i.grid[1]||1))*(i.grid[1]||1);if(/^(se|s|e)$/.test(k)){e.size.width=m.width+j;e.size.height=m.height+i}else{if(/^(ne)$/.test(k)){e.size.width=m.width+j;e.size.height=m.height+i;e.position.top=l.top-i}else{if(/^(sw)$/.test(k)){e.size.width=m.width+j;e.size.height=m.height+i}else{e.size.width=m.width+j;e.size.height=m.height+i;e.position.top=l.top-i}e.position.left=l.left-j}}}});var a=function(d){return parseInt(d,10)||0},b=function(d){return !isNaN(parseInt(d,10))}})(jQuery);(function(a){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var d=this;this.element.addClass("ui-selectable");this.dragged=false;var b;this.refresh=function(){b=a(d.options.filter,d.element[0]);b.each(function(){var e=a(this),c=e.offset();a.data(this,"selectable-item",{element:this,$element:e,left:c.left,top:c.top,right:c.left+e.outerWidth(),bottom:c.top+e.outerHeight(),startselected:false,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})};this.refresh();this.selectees=b.addClass("ui-selectee");this._mouseInit();this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(g){var b=this;this.opos=[g.pageX,g.pageY];if(!this.options.disabled){var e=this.options;this.selectees=a(e.filter,this.element[0]);this._trigger("start",g);a(e.appendTo).append(this.helper);this.helper.css({left:g.clientX,top:g.clientY,width:0,height:0});e.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var c=a.data(this,"selectable-item");c.startselected=true;if(!g.metaKey){c.$element.removeClass("ui-selected");c.selected=false;c.$element.addClass("ui-unselecting");c.unselecting=true;b._trigger("unselecting",g,{unselecting:c.element})}});a(g.target).parents().andSelf().each(function(){var c=a.data(this,"selectable-item");if(c){var d=!g.metaKey||!c.$element.hasClass("ui-selected");c.$element.removeClass(d?"ui-unselecting":"ui-selected").addClass(d?"ui-selecting":"ui-unselecting");c.unselecting=!d;c.selecting=d;(c.selected=d)?b._trigger("selecting",g,{selecting:c.element}):b._trigger("unselecting",g,{unselecting:c.element});return false}})}},_mouseDrag:function(q){var o=this;this.dragged=true;if(!this.options.disabled){var p=this.options,e=this.opos[0],n=this.opos[1],m=q.pageX,l=q.pageY;if(e>m){var k=m;m=e;e=k}if(n>l){k=l;l=n;n=k}this.helper.css({left:e,top:n,width:m-e,height:l-n});this.selectees.each(function(){var b=a.data(this,"selectable-item");if(!(!b||b.element==o.element[0])){var c=false;if(p.tolerance=="touch"){c=!(b.left>m||b.right<e||b.top>l||b.bottom<n)}else{if(p.tolerance=="fit"){c=b.left>e&&b.right<m&&b.top>n&&b.bottom<l}}if(c){if(b.selected){b.$element.removeClass("ui-selected");b.selected=false}if(b.unselecting){b.$element.removeClass("ui-unselecting");b.unselecting=false}if(!b.selecting){b.$element.addClass("ui-selecting");b.selecting=true;o._trigger("selecting",q,{selecting:b.element})}}else{if(b.selecting){if(q.metaKey&&b.startselected){b.$element.removeClass("ui-selecting");b.selecting=false;b.$element.addClass("ui-selected");b.selected=true}else{b.$element.removeClass("ui-selecting");b.selecting=false;if(b.startselected){b.$element.addClass("ui-unselecting");b.unselecting=true}o._trigger("unselecting",q,{unselecting:b.element})}}if(b.selected){if(!q.metaKey&&!b.startselected){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;o._trigger("unselecting",q,{unselecting:b.element})}}}}});return false}},_mouseStop:function(d){var b=this;this.dragged=false;a(".ui-unselecting",this.element[0]).each(function(){var c=a.data(this,"selectable-item");c.$element.removeClass("ui-unselecting");c.unselecting=false;c.startselected=false;b._trigger("unselected",d,{unselected:c.element})});a(".ui-selecting",this.element[0]).each(function(){var c=a.data(this,"selectable-item");c.$element.removeClass("ui-selecting").addClass("ui-selected");c.selecting=false;c.selected=true;c.startselected=true;b._trigger("selected",d,{selected:c.element})});this._trigger("stop",d);this.helper.remove();return false}});a.extend(a.ui.selectable,{version:"1.8.9"})})(jQuery);(function(a){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000},_create:function(){this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--){this.items[b].item.removeData("sortable-item")}return this},_setOption:function(d,c){if(d==="disabled"){this.options[d]=c;this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")}else{a.Widget.prototype._setOption.apply(this,arguments)}},_mouseCapture:function(g,d){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(g);var j=null,i=this;a(g.target).parents().each(function(){if(a.data(this,"sortable-item")==i){j=a(this);return false}});if(a.data(g.target,"sortable-item")==i){j=a(g.target)}if(!j){return false}if(this.options.handle&&!d){var h=false;a(this.options.handle,j).find("*").andSelf().each(function(){if(this==g.target){h=true}});if(!h){return false}}this.currentItem=j;this._removeCurrentsFromItems();return true},_mouseStart:function(f,d,h){d=this.options;var g=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(f);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:f.pageX-this.offset.left,top:f.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(f);this.originalPageX=f.pageX;this.originalPageY=f.pageY;d.cursorAt&&this._adjustOffsetFromHelper(d.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();d.containment&&this._setContainment();if(d.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",d.cursor)}if(d.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",d.opacity)}if(d.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",d.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",f,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!h){for(h=this.containers.length-1;h>=0;h--){this.containers[h]._trigger("activate",f,g._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}a.ui.ddmanager&&!d.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,f);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(f);return true},_mouseDrag:function(g){this.position=this._generatePosition(g);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var d=this.options,j=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-g.pageY<d.scrollSensitivity){this.scrollParent[0].scrollTop=j=this.scrollParent[0].scrollTop+d.scrollSpeed}else{if(g.pageY-this.overflowOffset.top<d.scrollSensitivity){this.scrollParent[0].scrollTop=j=this.scrollParent[0].scrollTop-d.scrollSpeed}}if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-g.pageX<d.scrollSensitivity){this.scrollParent[0].scrollLeft=j=this.scrollParent[0].scrollLeft+d.scrollSpeed}else{if(g.pageX-this.overflowOffset.left<d.scrollSensitivity){this.scrollParent[0].scrollLeft=j=this.scrollParent[0].scrollLeft-d.scrollSpeed}}}else{if(g.pageY-a(document).scrollTop()<d.scrollSensitivity){j=a(document).scrollTop(a(document).scrollTop()-d.scrollSpeed)}else{if(a(window).height()-(g.pageY-a(document).scrollTop())<d.scrollSensitivity){j=a(document).scrollTop(a(document).scrollTop()+d.scrollSpeed)}}if(g.pageX-a(document).scrollLeft()<d.scrollSensitivity){j=a(document).scrollLeft(a(document).scrollLeft()-d.scrollSpeed)}else{if(a(window).width()-(g.pageX-a(document).scrollLeft())<d.scrollSensitivity){j=a(document).scrollLeft(a(document).scrollLeft()+d.scrollSpeed)}}}j!==false&&a.ui.ddmanager&&!d.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,g)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(d=this.items.length-1;d>=0;d--){j=this.items[d];var i=j.item[0],h=this._intersectsWithPointer(j);if(h){if(i!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=i&&!a.ui.contains(this.placeholder[0],i)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],i):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(j)){this._rearrange(g,j)}else{break}this._trigger("change",g,this._uiHash());break}}}this._contactContainers(g);a.ui.ddmanager&&a.ui.ddmanager.drag(this,g);this._trigger("sort",g,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(e,d){if(e){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,e);if(this.options.revert){var f=this;d=f.placeholder.offset();f.reverting=true;a(this.helper).animate({left:d.left-this.offset.parent.left-f.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:d.top-this.offset.parent.top-f.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){f._clear(e)})}else{this._clear(e,d)}return false}},cancel:function(){var d=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,d._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,d._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(e){var d=this._getItemsAsjQuery(e&&e.connected),f=[];e=e||{};a(d).each(function(){var b=(a(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[-=_](.+)/);if(b){f.push((e.key||b[1]+"[]")+"="+(e.key&&e.expression?b[1]:b[2]))}});!f.length&&e.key&&f.push(e.key+"=");return f.join("&")},toArray:function(e){var d=this._getItemsAsjQuery(e&&e.connected),f=[];e=e||{};d.each(function(){f.push(a(e.item||this).attr(e.attribute||"id")||"")});return f},_intersectsWith:function(v){var u=this.positionAbs.left,t=u+this.helperProportions.width,s=this.positionAbs.top,r=s+this.helperProportions.height,q=v.left,p=q+v.width,o=v.top,m=o+v.height,n=this.offset.click.top,d=this.offset.click.left;n=s+n>o&&s+n<m&&u+d>q&&u+d<p;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>v[this.floating?"width":"height"]?n:q<u+this.helperProportions.width/2&&t-this.helperProportions.width/2<p&&o<s+this.helperProportions.height/2&&r-this.helperProportions.height/2<m},_intersectsWithPointer:function(e){var d=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height);e=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width);d=d&&e;e=this._getDragVerticalDirection();var f=this._getDragHorizontalDirection();if(!d){return false}return this.floating?f&&f=="right"||e=="down"?2:1:e&&(e=="down"?2:1)},_intersectsWithSides:function(f){var d=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,f.top+f.height/2,f.height);f=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,f.left+f.width/2,f.width);var h=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return this.floating&&g?g=="right"&&f||g=="left"&&!f:h&&(h=="down"&&d||h=="up"&&!d)},_getDragVerticalDirection:function(){var b=this.positionAbs.top-this.lastPositionAbs.top;return b!=0&&(b>0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions();return this},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(i){var d=[],n=[],m=this._connectWith();if(m&&i){for(i=m.length-1;i>=0;i--){for(var l=a(m[i]),k=l.length-1;k>=0;k--){var j=a.data(l[k],"sortable");if(j&&j!=this&&!j.options.disabled){n.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}}}n.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(i=n.length-1;i>=0;i--){n[i][0].each(function(){d.push(this)})}return a(d)},_removeCurrentsFromItems:function(){for(var e=this.currentItem.find(":data(sortable-item)"),d=0;d<this.items.length;d++){for(var f=0;f<e.length;f++){e[f]==this.items[d].item[0]&&this.items.splice(d,1)}}},_refreshItems:function(j){this.items=[];this.containers=[this];var d=this.items,p=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],j,{item:this.currentItem}):a(this.options.items,this.element),this]],o=this._connectWith();if(o){for(var n=o.length-1;n>=0;n--){for(var m=a(o[n]),l=m.length-1;l>=0;l--){var k=a.data(m[l],"sortable");if(k&&k!=this&&!k.options.disabled){p.push([a.isFunction(k.options.items)?k.options.items.call(k.element[0],j,{item:this.currentItem}):a(k.options.items,k.element),k]);this.containers.push(k)}}}}for(n=p.length-1;n>=0;n--){j=p[n][1];o=p[n][0];l=0;for(m=o.length;l<m;l++){k=a(o[l]);k.data("sortable-item",j);d.push({item:k,instance:j,width:0,height:0,left:0,top:0})}}},refreshPositions:function(f){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var d=this.items.length-1;d>=0;d--){var h=this.items[d],g=this.options.toleranceElement?a(this.options.toleranceElement,h.item):h.item;if(!f){h.width=g.outerWidth();h.height=g.outerHeight()}g=g.offset();h.left=g.left;h.top=g.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(d=this.containers.length-1;d>=0;d--){g=this.containers[d].element.offset();this.containers[d].containerCache.left=g.left;this.containers[d].containerCache.top=g.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}return this},_createPlaceholder:function(f){var d=f||this,h=d.options;if(!h.placeholder||h.placeholder.constructor==String){var g=h.placeholder;h.placeholder={element:function(){var b=a(document.createElement(d.currentItem[0].nodeName)).addClass(g||d.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!g){b.style.visibility="hidden"}return b},update:function(c,b){if(!(g&&!h.forcePlaceholderSize)){b.height()||b.height(d.currentItem.innerHeight()-parseInt(d.currentItem.css("paddingTop")||0,10)-parseInt(d.currentItem.css("paddingBottom")||0,10));b.width()||b.width(d.currentItem.innerWidth()-parseInt(d.currentItem.css("paddingLeft")||0,10)-parseInt(d.currentItem.css("paddingRight")||0,10))}}}}d.placeholder=a(h.placeholder.element.call(d.element,d.currentItem));d.currentItem.after(d.placeholder);h.placeholder.update(d,d.placeholder)},_contactContainers:function(i){for(var d=null,n=null,m=this.containers.length-1;m>=0;m--){if(!a.ui.contains(this.currentItem[0],this.containers[m].element[0])){if(this._intersectsWith(this.containers[m].containerCache)){if(!(d&&a.ui.contains(this.containers[m].element[0],d.element[0]))){d=this.containers[m];n=m}}else{if(this.containers[m].containerCache.over){this.containers[m]._trigger("out",i,this._uiHash(this));this.containers[m].containerCache.over=0}}}}if(d){if(this.containers.length===1){this.containers[n]._trigger("over",i,this._uiHash(this));this.containers[n].containerCache.over=1}else{if(this.currentContainer!=this.containers[n]){d=10000;m=null;for(var l=this.positionAbs[this.containers[n].floating?"left":"top"],k=this.items.length-1;k>=0;k--){if(a.ui.contains(this.containers[n].element[0],this.items[k].item[0])){var j=this.items[k][this.containers[n].floating?"left":"top"];if(Math.abs(j-l)<d){d=Math.abs(j-l);m=this.items[k]}}}if(m||this.options.dropOnEmpty){this.currentContainer=this.containers[n];m?this._rearrange(i,m,null,true):this._rearrange(i,null,this.containers[n].element,true);this._trigger("change",i,this._uiHash());this.containers[n]._trigger("change",i,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[n]._trigger("over",i,this._uiHash(this));this.containers[n].containerCache.over=1}}}}},_createHelper:function(d){var c=this.options;d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[d,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]);if(d[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(d[0].style.width==""||c.forceHelperSize){d.width(this.currentItem.width())}if(d[0].style.height==""||c.forceHelperSize){d.height(this.currentItem.height())}return d},_adjustOffsetFromHelper:function(b){if(typeof b=="string"){b=b.split(" ")}if(a.isArray(b)){b={left:+b[0],top:+b[1]||0}}if("left" in b){this.offset.click.left=b.left+this.margins.left}if("right" in b){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if("top" in b){this.offset.click.top=b.top+this.margins.top}if("bottom" in b){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.currentItem.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!/^(document|window|parent)$/.test(e.containment)){var d=a(e.containment)[0];e=a(e.containment).offset();var f=a(d).css("overflow")!="hidden";this.containment=[e.left+(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0)-this.margins.top,e.left+(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(f,d){if(!d){d=this.position}f=f=="absolute"?1:-1;var h=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(h[0].tagName);return{top:d.top+this.offset.relative.top*f+this.offset.parent.top*f-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:h.scrollTop())*f),left:d.left+this.offset.relative.left*f+this.offset.parent.left*f-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:h.scrollLeft())*f)}},_generatePosition:function(h){var d=this.options,l=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,k=/(html|body)/i.test(l[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var j=h.pageX,i=h.pageY;if(this.originalPosition){if(this.containment){if(h.pageX-this.offset.click.left<this.containment[0]){j=this.containment[0]+this.offset.click.left}if(h.pageY-this.offset.click.top<this.containment[1]){i=this.containment[1]+this.offset.click.top}if(h.pageX-this.offset.click.left>this.containment[2]){j=this.containment[2]+this.offset.click.left}if(h.pageY-this.offset.click.top>this.containment[3]){i=this.containment[3]+this.offset.click.top}}if(d.grid){i=this.originalPageY+Math.round((i-this.originalPageY)/d.grid[1])*d.grid[1];i=this.containment?!(i-this.offset.click.top<this.containment[1]||i-this.offset.click.top>this.containment[3])?i:!(i-this.offset.click.top<this.containment[1])?i-d.grid[1]:i+d.grid[1]:i;j=this.originalPageX+Math.round((j-this.originalPageX)/d.grid[0])*d.grid[0];j=this.containment?!(j-this.offset.click.left<this.containment[0]||j-this.offset.click.left>this.containment[2])?j:!(j-this.offset.click.left<this.containment[0])?j-d.grid[0]:j+d.grid[0]:j}}return{top:i-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():k?0:l.scrollTop()),left:j-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():k?0:l.scrollLeft())}},_rearrange:function(h,d,l,k){l?l[0].appendChild(this.placeholder[0]):d.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?d.item[0]:d.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var j=this,i=this.counter;window.setTimeout(function(){i==j.counter&&j.refreshPositions(!k)},0)},_clear:function(f,d){this.reverting=false;var h=[];!this._noFinalSort&&this.currentItem[0].parentNode&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var g in this._storedCSS){if(this._storedCSS[g]=="auto"||this._storedCSS[g]=="static"){this._storedCSS[g]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}this.fromOutside&&!d&&h.push(function(b){this._trigger("receive",b,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!d){h.push(function(b){this._trigger("update",b,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){d||h.push(function(b){this._trigger("remove",b,this._uiHash())});for(g=this.containers.length-1;g>=0;g--){if(a.ui.contains(this.containers[g].element[0],this.currentItem[0])&&!d){h.push(function(b){return function(c){b._trigger("receive",c,this._uiHash(this))}}.call(this,this.containers[g]));h.push(function(b){return function(c){b._trigger("update",c,this._uiHash(this))}}.call(this,this.containers[g]))}}}for(g=this.containers.length-1;g>=0;g--){d||h.push(function(b){return function(c){b._trigger("deactivate",c,this._uiHash(this))}}.call(this,this.containers[g]));if(this.containers[g].containerCache.over){h.push(function(b){return function(c){b._trigger("out",c,this._uiHash(this))}}.call(this,this.containers[g]));this.containers[g].containerCache.over=0}}this._storedCursor&&a("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!d){this._trigger("beforeStop",f,this._uiHash());for(g=0;g<h.length;g++){h[g].call(this,f)}this._trigger("stop",f,this._uiHash())}return false}d||this._trigger("beforeStop",f,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!d){for(g=0;g<h.length;g++){h[g].call(this,f)}this._trigger("stop",f,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},_uiHash:function(d){var c=d||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:d?d.element:null}}});a.extend(a.ui.sortable,{version:"1.8.9"})})(jQuery);(function(a){a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var c=this,d=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");d.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");this.range=a([]);if(d.range){if(d.range===true){this.range=a("<div></div>");if(!d.values){d.values=[this._valueMin(),this._valueMin()]}if(d.values.length&&d.values.length!==2){d.values=[d.values[0],d.values[0]]}}else{this.range=a("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(d.range==="min"||d.range==="max"){this.range.addClass("ui-slider-range-"+d.range)}this.range.addClass("ui-widget-header")}a(".ui-slider-handle",this.element).length===0&&a("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");if(d.values&&d.values.length){for(;a(".ui-slider-handle",this.element).length<d.values.length;){a("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(b){b.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(d.disabled){a(this).blur()}else{a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)});this.handles.keydown(function(n){var m=true,l=a(this).data("index.ui-slider-handle"),j,k,b;if(!c.options.disabled){switch(n.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:m=false;if(!c._keySliding){c._keySliding=true;a(this).addClass("ui-state-active");j=c._start(n,l);if(j===false){return}}break}b=c.options.step;j=c.options.values&&c.options.values.length?(k=c.values(l)):(k=c.value());switch(n.keyCode){case a.ui.keyCode.HOME:k=c._valueMin();break;case a.ui.keyCode.END:k=c._valueMax();break;case a.ui.keyCode.PAGE_UP:k=c._trimAlignValue(j+(c._valueMax()-c._valueMin())/5);break;case a.ui.keyCode.PAGE_DOWN:k=c._trimAlignValue(j-(c._valueMax()-c._valueMin())/5);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(j===c._valueMax()){return}k=c._trimAlignValue(j+b);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(j===c._valueMin()){return}k=c._trimAlignValue(j-b);break}c._slide(n,l,k);return m}}).keyup(function(f){var b=a(this).data("index.ui-slider-handle");if(c._keySliding){c._keySliding=false;c._stop(f,b);c._change(f,b);a(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(d){var i=this.options,n,m,l,j,k;if(i.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();n=this._normValueFromMouse({x:d.pageX,y:d.pageY});m=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(c){var b=Math.abs(n-j.values(c));if(m>b){m=b;l=a(this);k=c}});if(i.range===true&&this.values(1)===i.min){k+=1;l=a(this.handles[k])}if(this._start(d,k)===false){return false}this._mouseSliding=true;j._handleIndex=k;l.addClass("ui-state-active").focus();i=l.offset();this._clickOffset=!a(d.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:d.pageX-i.left-l.width()/2,top:d.pageY-i.top-l.height()/2-(parseInt(l.css("borderTopWidth"),10)||0)-(parseInt(l.css("borderBottomWidth"),10)||0)+(parseInt(l.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(d,k,n);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(c){var d=this._normValueFromMouse({x:c.pageX,y:c.pageY});this._slide(c,this._handleIndex,d);return false},_mouseStop:function(c){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(c,this._handleIndex);this._change(c,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(c){var d;if(this.orientation==="horizontal"){d=this.elementSize.width;c=c.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{d=this.elementSize.height;c=c.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}d=c/d;if(d>1){d=1}if(d<0){d=0}if(this.orientation==="vertical"){d=1-d}c=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+d*c)},_start:function(d,e){var f={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){f.value=this.values(e);f.values=this.values()}return this._trigger("start",d,f)},_slide:function(d,f,h){var g;if(this.options.values&&this.options.values.length){g=this.values(f?0:1);if(this.options.values.length===2&&this.options.range===true&&(f===0&&h>g||f===1&&h<g)){h=g}if(h!==this.values(f)){g=this.values();g[f]=h;d=this._trigger("slide",d,{handle:this.handles[f],value:h,values:g});this.values(f?0:1);d!==false&&this.values(f,h,true)}}else{if(h!==this.value()){d=this._trigger("slide",d,{handle:this.handles[f],value:h});d!==false&&this.value(h)}}},_stop:function(d,e){var f={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){f.value=this.values(e);f.values=this.values()}this._trigger("stop",d,f)},_change:function(d,e){if(!this._keySliding&&!this._mouseSliding){var f={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){f.value=this.values(e);f.values=this.values()}this._trigger("change",d,f)}},value:function(c){if(arguments.length){this.options.value=this._trimAlignValue(c);this._refreshValue();this._change(null,0)}return this._value()},values:function(d,g){var j,i,h;if(arguments.length>1){this.options.values[d]=this._trimAlignValue(g);this._refreshValue();this._change(null,d)}if(arguments.length){if(a.isArray(arguments[0])){j=this.options.values;i=arguments[0];for(h=0;h<j.length;h+=1){j[h]=this._trimAlignValue(i[h]);this._change(null,h)}this._refreshValue()}else{return this.options.values&&this.options.values.length?this._values(d):this.value()}}else{return this._values()}},_setOption:function(d,f){var h,g=0;if(a.isArray(this.options.values)){g=this.options.values.length}a.Widget.prototype._setOption.apply(this,arguments);switch(d){case"disabled":if(f){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(h=0;h<g;h+=1){this._change(null,h)}this._animateOff=false;break}},_value:function(){var c=this.options.value;return c=this._trimAlignValue(c)},_values:function(d){var e,f;if(arguments.length){e=this.options.values[d];return e=this._trimAlignValue(e)}else{e=this.options.values.slice();for(f=0;f<e.length;f+=1){e[f]=this._trimAlignValue(e[f])}return e}},_trimAlignValue:function(d){if(d<=this._valueMin()){return this._valueMin()}if(d>=this._valueMax()){return this._valueMax()}var e=this.options.step>0?this.options.step:1,f=(d-this._valueMin())%e;alignValue=d-f;if(Math.abs(f)*2>=e){alignValue+=f>0?e:-e}return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var s=this.options.range,t=this.options,r=this,q=!this._animateOff?t.animate:false,p,n={},o,m,k,d;if(this.options.values&&this.options.values.length){this.handles.each(function(b){p=(r.values(b)-r._valueMin())/(r._valueMax()-r._valueMin())*100;n[r.orientation==="horizontal"?"left":"bottom"]=p+"%";a(this).stop(1,1)[q?"animate":"css"](n,t.animate);if(r.options.range===true){if(r.orientation==="horizontal"){if(b===0){r.range.stop(1,1)[q?"animate":"css"]({left:p+"%"},t.animate)}if(b===1){r.range[q?"animate":"css"]({width:p-o+"%"},{queue:false,duration:t.animate})}}else{if(b===0){r.range.stop(1,1)[q?"animate":"css"]({bottom:p+"%"},t.animate)}if(b===1){r.range[q?"animate":"css"]({height:p-o+"%"},{queue:false,duration:t.animate})}}}o=p})}else{m=this.value();k=this._valueMin();d=this._valueMax();p=d!==k?(m-k)/(d-k)*100:0;n[r.orientation==="horizontal"?"left":"bottom"]=p+"%";this.handle.stop(1,1)[q?"animate":"css"](n,t.animate);if(s==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[q?"animate":"css"]({width:p+"%"},t.animate)}if(s==="max"&&this.orientation==="horizontal"){this.range[q?"animate":"css"]({width:100-p+"%"},{queue:false,duration:t.animate})}if(s==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[q?"animate":"css"]({height:p+"%"},t.animate)}if(s==="max"&&this.orientation==="vertical"){this.range[q?"animate":"css"]({height:100-p+"%"},{queue:false,duration:t.animate})}}}});a.extend(a.ui.slider,{version:"1.8.9"})})(jQuery);(function(d,G){function K(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}function E(a,b){d.extend(a,b);for(var c in b){if(b[c]==null||b[c]==G){a[c]=b[c]}}return a}d.extend(d.ui,{datepicker:{version:"1.8.9"}});var y=(new Date).getTime();d.extend(K.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input"){this._connectDatepicker(a,i)}else{f&&this._inlineDatepicker(a,i)}},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both"){a.focus(this._showDatepicker)}if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++){if(f[g].length>h){h=f[g].length;i=g}}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos){this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else{if(e=="div"||e=="span"){b.removeClass(this.markerClassName).empty()}}}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(e=="div"||e=="span"){b.children("."+this._inlineClass).children().removeClass("ui-state-disabled")}}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(e=="div"||e=="span"){b.children("."+this._inlineClass).children().addClass("ui-state-disabled")}}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a){return false}for(var b=0;b<this._disabledInputs.length;b++){if(this._disabledInputs[b]==a){return true}}return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string"){return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},e.settings):this._get(e,b):null}var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true);E(e.settings,f);this._attachments(d(a),e);this._autoSize(e);this._setDateDatepicker(a,h);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing){switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]?d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey){d.datepicker._clearDate(a.target)}c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey){d.datepicker._gotoToday(a.target)}c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey){d.datepicker._adjustDate(a.target,e?+1:-1,"D")}c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey){d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M")}break;case 38:if(a.ctrlKey||a.metaKey){d.datepicker._adjustDate(a.target,-7,"D")}c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey){d.datepicker._adjustDate(a.target,e?-1:+1,"D")}c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey){d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M")}break;case 40:if(a.ctrlKey||a.metaKey){d.datepicker._adjustDate(a.target,+7,"D")}c=a.ctrlKey||a.metaKey;break;default:c=false}}else{if(a.keyCode==36&&a.ctrlKey){d.datepicker._showDatepicker(this)}else{c=false}}if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==G?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal){try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input"){a=d("input",a.parentNode)[0]}if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog){a.value=""}if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return !e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f){h()}b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);){a=a[b?"previousSibling":"nextSibling"]}a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker"))){if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose")){a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c){c.apply(a.input?a.input[0]:null,[b,a])}else{a.input&&a.input.trigger("change")}if(a.inline){this._updateDatepicker(a)}else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/86400000)/7)+1},parseDate:function(a,b,c){if(a==null||b==null){throw"Invalid arguments"}b=typeof b=="object"?b.toString():b+"";if(b==""){return null}var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=z+1<a.length&&a.charAt(z+1)==p)&&z++;return p},m=function(p){var v=o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&v?4:p=="o"?3:2)+"}");p=b.substring(s).match(p);if(!p){throw"Missing number at position "+s}s+=p[0].length;return parseInt(p[0],10)},n=function(p,v,H){p=o(p)?H:v;for(v=0;v<p.length;v++){if(b.substr(s,p[v].length).toLowerCase()==p[v].toLowerCase()){s+=p[v].length;return v+1}}throw"Unknown name at position "+s},r=function(){if(b.charAt(s)!=a.charAt(z)){throw"Unexpected literal at position "+s}s++},s=0,z=0;z<a.length;z++){if(k){if(a.charAt(z)=="'"&&!o("'")){k=false}else{r()}}else{switch(a.charAt(z)){case"d":l=m("d");break;case"D":n("D",f,h);break;case"o":u=m("o");break;case"m":j=m("m");break;case"M":j=n("M",i,g);break;case"y":c=m("y");break;case"@":var w=new Date(m("@"));c=w.getFullYear();j=w.getMonth()+1;l=w.getDate();break;case"!":w=new Date((m("!")-this._ticksTo1970)/10000);c=w.getFullYear();j=w.getMonth()+1;l=w.getDate();break;case"'":if(o("'")){r()}else{k=true}break;default:r()}}}if(c==-1){c=(new Date).getFullYear()}else{if(c<100){c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100)}}if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e){break}j++;l-=e}while(1)}w=this._daylightSavingAdjust(new Date(c,j-1,l));if(w.getFullYear()!=c||w.getMonth()+1!=j||w.getDate()!=l){throw"Invalid date"}return w},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*10000000,formatDate:function(a,b,c){if(!b){return""}var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o)){for(;m.length<n;){m="0"+m}}return m},j=function(o,m,n,r){return i(o)?r[m]:n[m]},l="",u=false;if(b){for(var k=0;k<a.length;k++){if(u){if(a.charAt(k)=="'"&&!i("'")){u=false}else{l+=a.charAt(k)}}else{switch(a.charAt(k)){case"d":l+=g("d",b.getDate(),2);break;case"D":l+=j("D",b.getDay(),e,f);break;case"o":l+=g("o",(b.getTime()-(new Date(b.getFullYear(),0,0)).getTime())/86400000,3);break;case"m":l+=g("m",b.getMonth()+1,2);break;case"M":l+=j("M",b.getMonth(),h,c);break;case"y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":l+=b.getTime();break;case"!":l+=b.getTime()*10000+this._ticksTo1970;break;case"'":if(i("'")){l+="'"}else{u=true}break;default:l+=a.charAt(k)}}}}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++){if(c){if(a.charAt(f)=="'"&&!e("'")){c=false}else{b+=a.charAt(f)}}else{switch(a.charAt(f)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":if(e("'")){b+="'"}else{c=true}break;default:b+=a.charAt(f)}}}return b},_get:function(a,b){return a.settings[b]!==G?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case"d":case"D":g+=parseInt(k[1],10);break;case"w":case"W":g+=parseInt(k[1],10)*7;break;case"m":case"M":l+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case"y":case"Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a){return null}a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c){this._notifyChange(a)}this._adjustInstDate(a);if(a.input){a.input.val(e?"":this._formatDate(a))}},_getDate:function(a){return !a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+y+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,r)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=this._get(a,"monthNames"),w=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),v=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),I="",C=0;C<i[0];C++){for(var M="",D=0;D<i[1];D++){var N=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",x="";if(l){x+='<div class="ui-datepicker-group';if(i[1]>1){switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}}x+='">'}x+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&C==0?c?f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,C>0||D>0,z,w)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var A=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var q=(t+h)%7;A+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+r[q]+'">'+s[q]+"</span></th>"}x+=A+"</tr></thead><tbody>";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth){a.selectedDay=Math.min(a.selectedDay,A)}t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O<A;O++){x+="<tr>";var P=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(q)+"</td>";for(t=0;t<7;t++){var F=p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,J=B&&!H||!F[0]||k&&q<k||o&&q>o;P+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(B?" ui-datepicker-other-month":"")+(q.getTime()==N.getTime()&&g==a.selectedMonth&&a._keyEvent||L.getTime()==q.getTime()&&L.getTime()==N.getTime()?" "+this._dayOverClass:"")+(J?" "+this._unselectableClass+" ui-state-disabled":"")+(B&&!v?"":" "+F[1]+(q.getTime()==u.getTime()?" "+this._currentClass:"")+(q.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!B||v)&&F[2]?' title="'+F[2]+'"':"")+(J?"":' onclick="DP_jQuery_'+y+".datepicker._selectDay('#"+a.id+"',"+q.getMonth()+","+q.getFullYear()+', this);return false;"')+">"+(B&&!v?"&#xa0;":J?'<span class="ui-state-default">'+q.getDate()+"</span>":'<a class="ui-state-default'+(q.getTime()==b.getTime()?" ui-state-highlight":"")+(q.getTime()==u.getTime()?" ui-state-active":"")+(B?" ui-priority-secondary":"")+'" href="#">'+q.getDate()+"</a>")+"</td>";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=P+"</tr>"}g++;if(g>11){g=0;m++}x+="</tbody></table>"+(l?"</div>"+(i[0]>0&&D==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j){o+='<span class="ui-datepicker-month">'+i[b]+"</span>"}else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";for(var n=0;n<12;n++){if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth())){o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>"}}o+="</select>"}u||(k+=o+(h||!(j&&l)?"&#xa0;":""));a.yearshtml="";if(h||!l){k+='<span class="ui-datepicker-year">'+c+"</span>"}else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++){a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>"}a.yearshtml+="</select>";if(d.browser.mozilla){k+='<select class="ui-datepicker-year"><option value="'+c+'" selected="selected">'+c+"</option></select>"}else{k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u){k+=(h||!(j&&l)?"&#xa0;":"")+o}k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y"){this._notifyChange(a)}},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b){b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])}},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget")){return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b))}if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b))}return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.9";window["DP_jQuery_"+y]=d})(jQuery);jQuery.effects||function(l,i){function e(j){var f;if(j&&j.constructor==Array&&j.length==3){return j}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(j)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(j)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(j)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(j)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(/rgba\(0, 0, 0, 0\)/.exec(j)){return d.transparent}return d[l.trim(j).toLowerCase()]}function x(k,j){var f;do{f=l.curCSS(k,j);if(f!=""&&f!="transparent"||l.nodeName(k,"body")){break}j="backgroundColor"}while(k=k.parentNode);return e(f)}function c(){var n=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,j={},f,m;if(n&&n.length&&n[0]&&n[n[0]]){for(var k=n.length;k--;){f=n[k];if(typeof n[f]=="string"){m=f.replace(/\-(\w)/g,function(p,o){return o.toUpperCase()});j[m]=n[f]}}}else{for(f in n){if(typeof n[f]==="string"){j[f]=n[f]}}}return j}function b(k){var j,f;for(j in k){f=k[j];if(f==null||l.isFunction(f)||j in w||/scrollbar/.test(j)||!/color/i.test(j)&&isNaN(parseFloat(f))){delete k[j]}}return k}function v(m,j){var f={_:0},k;for(k in j){if(m[k]!=j[k]){f[k]=j[k]}}return f}function h(m,j,f,k){if(typeof m=="object"){k=j;f=null;j=m;m=j.effect}if(l.isFunction(j)){k=j;f=null;j={}}if(typeof j=="number"||l.fx.speeds[j]){k=f;f=j;j={}}if(l.isFunction(f)){k=f;f=null}j=j||{};f=f||j.duration;f=l.fx.off?0:typeof f=="number"?f:f in l.fx.speeds?l.fx.speeds[f]:l.fx.speeds._default;k=k||j.complete;return[m,j,f,k]}function g(f){if(!f||typeof f==="number"||l.fx.speeds[f]){return true}if(typeof f==="string"&&!l.effects[f]){return true}return false}l.effects={};l.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(j,f){l.fx.step[f]=function(k){if(!k.colorInit){k.start=x(k.elem,f);k.end=e(k.end);k.colorInit=true}k.elem.style[f]="rgb("+Math.max(Math.min(parseInt(k.pos*(k.end[0]-k.start[0])+k.start[0],10),255),0)+","+Math.max(Math.min(parseInt(k.pos*(k.end[1]-k.start[1])+k.start[1],10),255),0)+","+Math.max(Math.min(parseInt(k.pos*(k.end[2]-k.start[2])+k.start[2],10),255),0)+")"}});var d={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},a=["add","remove","toggle"],w={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};l.effects.animateClass=function(m,j,f,k){if(l.isFunction(f)){k=f;f=null}return this.queue("fx",function(){var r=l(this),q=r.attr("style")||" ",p=b(c.call(this)),n,o=r.attr("className");l.each(a,function(s,t){m[t]&&r[t+"Class"](m[t])});n=b(c.call(this));r.attr("className",o);r.animate(v(p,n),j,f,function(){l.each(a,function(s,t){m[t]&&r[t+"Class"](m[t])});if(typeof r.attr("style")=="object"){r.attr("style").cssText="";r.attr("style").cssText=q}else{r.attr("style",q)}k&&k.apply(this,arguments)});p=l.queue(this);n=p.splice(p.length-1,1)[0];p.splice(1,0,n);l.dequeue(this)})};l.fn.extend({_addClass:l.fn.addClass,addClass:function(m,j,f,k){return j?l.effects.animateClass.apply(this,[{add:m},j,f,k]):this._addClass(m)},_removeClass:l.fn.removeClass,removeClass:function(m,j,f,k){return j?l.effects.animateClass.apply(this,[{remove:m},j,f,k]):this._removeClass(m)},_toggleClass:l.fn.toggleClass,toggleClass:function(n,j,f,m,k){return typeof j=="boolean"||j===i?f?l.effects.animateClass.apply(this,[j?{add:n}:{remove:n},f,m,k]):this._toggleClass(n,j):l.effects.animateClass.apply(this,[{toggle:n},j,f,m])},switchClass:function(n,j,f,m,k){return l.effects.animateClass.apply(this,[{add:j,remove:n},f,m,k])}});l.extend(l.effects,{version:"1.8.9",save:function(k,j){for(var f=0;f<j.length;f++){j[f]!==null&&k.data("ec.storage."+j[f],k[0].style[j[f]])}},restore:function(k,j){for(var f=0;f<j.length;f++){j[f]!==null&&k.css(j[f],k.data("ec.storage."+j[f]))}},setMode:function(j,f){if(f=="toggle"){f=j.is(":hidden")?"show":"hide"}return f},getBaseline:function(k,j){var f;switch(k[0]){case"top":f=0;break;case"middle":f=0.5;break;case"bottom":f=1;break;default:f=k[0]/j.height}switch(k[1]){case"left":k=0;break;case"center":k=0.5;break;case"right":k=1;break;default:k=k[1]/j.width}return{x:k,y:f}},createWrapper:function(k){if(k.parent().is(".ui-effects-wrapper")){return k.parent()}var j={width:k.outerWidth(true),height:k.outerHeight(true),"float":k.css("float")},f=l("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});k.wrap(f);f=k.parent();if(k.css("position")=="static"){f.css({position:"relative"});k.css({position:"relative"})}else{l.extend(j,{position:k.css("position"),zIndex:k.css("z-index")});l.each(["top","left","bottom","right"],function(n,m){j[m]=k.css(m);if(isNaN(parseInt(j[m],10))){j[m]="auto"}});k.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return f.css(j).show()},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(m,j,f,k){k=k||{};l.each(j,function(o,n){unit=m.cssUnit(n);if(unit[0]>0){k[n]=unit[0]*f+unit[1]}});return k}});l.fn.extend({effect:function(m){var j=h.apply(this,arguments),f={options:j[1],duration:j[2],callback:j[3]};j=f.options.mode;var k=l.effects[m];if(l.fx.off||!k){return j?this[j](f.duration,f.callback):this.each(function(){f.callback&&f.callback.call(this)})}return k.call(this,f)},_show:l.fn.show,show:function(j){if(g(j)){return this._show.apply(this,arguments)}else{var f=h.apply(this,arguments);f[1].mode="show";return this.effect.apply(this,f)}},_hide:l.fn.hide,hide:function(j){if(g(j)){return this._hide.apply(this,arguments)}else{var f=h.apply(this,arguments);f[1].mode="hide";return this.effect.apply(this,f)}},__toggle:l.fn.toggle,toggle:function(j){if(g(j)||typeof j==="boolean"||l.isFunction(j)){return this.__toggle.apply(this,arguments)}else{var f=h.apply(this,arguments);f[1].mode="toggle";return this.effect.apply(this,f)}},cssUnit:function(k){var j=this.css(k),f=[];l.each(["em","px","%","pt"],function(n,m){if(j.indexOf(m)>0){f=[parseFloat(j),m]}});return f}});l.easing.jswing=l.easing.swing;l.extend(l.easing,{def:"easeOutQuad",swing:function(n,j,f,m,k){return l.easing[l.easing.def](n,j,f,m,k)},easeInQuad:function(n,j,f,m,k){return m*(j/=k)*j+f},easeOutQuad:function(n,j,f,m,k){return -m*(j/=k)*(j-2)+f},easeInOutQuad:function(n,j,f,m,k){if((j/=k/2)<1){return m/2*j*j+f}return -m/2*(--j*(j-2)-1)+f},easeInCubic:function(n,j,f,m,k){return m*(j/=k)*j*j+f},easeOutCubic:function(n,j,f,m,k){return m*((j=j/k-1)*j*j+1)+f},easeInOutCubic:function(n,j,f,m,k){if((j/=k/2)<1){return m/2*j*j*j+f}return m/2*((j-=2)*j*j+2)+f},easeInQuart:function(n,j,f,m,k){return m*(j/=k)*j*j*j+f},easeOutQuart:function(n,j,f,m,k){return -m*((j=j/k-1)*j*j*j-1)+f},easeInOutQuart:function(n,j,f,m,k){if((j/=k/2)<1){return m/2*j*j*j*j+f}return -m/2*((j-=2)*j*j*j-2)+f},easeInQuint:function(n,j,f,m,k){return m*(j/=k)*j*j*j*j+f},easeOutQuint:function(n,j,f,m,k){return m*((j=j/k-1)*j*j*j*j+1)+f},easeInOutQuint:function(n,j,f,m,k){if((j/=k/2)<1){return m/2*j*j*j*j*j+f}return m/2*((j-=2)*j*j*j*j+2)+f},easeInSine:function(n,j,f,m,k){return -m*Math.cos(j/k*(Math.PI/2))+m+f},easeOutSine:function(n,j,f,m,k){return m*Math.sin(j/k*(Math.PI/2))+f},easeInOutSine:function(n,j,f,m,k){return -m/2*(Math.cos(Math.PI*j/k)-1)+f},easeInExpo:function(n,j,f,m,k){return j==0?f:m*Math.pow(2,10*(j/k-1))+f},easeOutExpo:function(n,j,f,m,k){return j==k?f+m:m*(-Math.pow(2,-10*j/k)+1)+f},easeInOutExpo:function(n,j,f,m,k){if(j==0){return f}if(j==k){return f+m}if((j/=k/2)<1){return m/2*Math.pow(2,10*(j-1))+f}return m/2*(-Math.pow(2,-10*--j)+2)+f},easeInCirc:function(n,j,f,m,k){return -m*(Math.sqrt(1-(j/=k)*j)-1)+f},easeOutCirc:function(n,j,f,m,k){return m*Math.sqrt(1-(j=j/k-1)*j)+f},easeInOutCirc:function(n,j,f,m,k){if((j/=k/2)<1){return -m/2*(Math.sqrt(1-j*j)-1)+f}return m/2*(Math.sqrt(1-(j-=2)*j)+1)+f},easeInElastic:function(p,j,f,o,n){p=1.70158;var m=0,k=o;if(j==0){return f}if((j/=n)==1){return f+o}m||(m=n*0.3);if(k<Math.abs(o)){k=o;p=m/4}else{p=m/(2*Math.PI)*Math.asin(o/k)}return -(k*Math.pow(2,10*(j-=1))*Math.sin((j*n-p)*2*Math.PI/m))+f},easeOutElastic:function(p,j,f,o,n){p=1.70158;var m=0,k=o;if(j==0){return f}if((j/=n)==1){return f+o}m||(m=n*0.3);if(k<Math.abs(o)){k=o;p=m/4}else{p=m/(2*Math.PI)*Math.asin(o/k)}return k*Math.pow(2,-10*j)*Math.sin((j*n-p)*2*Math.PI/m)+o+f},easeInOutElastic:function(p,j,f,o,n){p=1.70158;var m=0,k=o;if(j==0){return f}if((j/=n/2)==2){return f+o}m||(m=n*0.3*1.5);if(k<Math.abs(o)){k=o;p=m/4}else{p=m/(2*Math.PI)*Math.asin(o/k)}if(j<1){return -0.5*k*Math.pow(2,10*(j-=1))*Math.sin((j*n-p)*2*Math.PI/m)+f}return k*Math.pow(2,-10*(j-=1))*Math.sin((j*n-p)*2*Math.PI/m)*0.5+o+f},easeInBack:function(o,j,f,n,m,k){if(k==i){k=1.70158}return n*(j/=m)*j*((k+1)*j-k)+f},easeOutBack:function(o,j,f,n,m,k){if(k==i){k=1.70158}return n*((j=j/m-1)*j*((k+1)*j+k)+1)+f},easeInOutBack:function(o,j,f,n,m,k){if(k==i){k=1.70158}if((j/=m/2)<1){return n/2*j*j*(((k*=1.525)+1)*j-k)+f}return n/2*((j-=2)*j*(((k*=1.525)+1)*j+k)+2)+f},easeInBounce:function(n,j,f,m,k){return m-l.easing.easeOutBounce(n,k-j,0,m,k)+f},easeOutBounce:function(n,j,f,m,k){return(j/=k)<1/2.75?m*7.5625*j*j+f:j<2/2.75?m*(7.5625*(j-=1.5/2.75)*j+0.75)+f:j<2.5/2.75?m*(7.5625*(j-=2.25/2.75)*j+0.9375)+f:m*(7.5625*(j-=2.625/2.75)*j+0.984375)+f},easeInOutBounce:function(n,j,f,m,k){if(j<k/2){return l.easing.easeInBounce(n,j*2,0,m,k)*0.5+f}return l.easing.easeOutBounce(n,j*2-k,0,m,k)*0.5+m*0.5+f}})}(jQuery);
34
- this.JS=this.JS||{};JS.extend=function(e,d){d=d||{};for(var f in d){if(e[f]===d[f]){continue}e[f]=d[f]}return e};JS.extend(JS,{makeFunction:function(){return function(){return this.initialize?(this.initialize.apply(this,arguments)||this):this}},makeBridge:function(d){var c=function(){};c.prototype=d.prototype;return new c},bind:function(){var e=JS.array(arguments),d=e.shift(),f=e.shift()||null;return function(){return d.apply(f,e.concat(JS.array(arguments)))}},callsSuper:function(b){return b.SUPER===undefined?b.SUPER=/\bcallSuper\b/.test(b.toString()):b.SUPER},mask:function(d){var c=d.toString().replace(/callSuper/g,"super");d.toString=function(){return c};return d},array:function(e){if(!e){return[]}if(e.toArray){return e.toArray()}var d=e.length,f=[];while(d--){f[d]=e[d]}return f},indexOf:function(f,e){for(var h=0,g=f.length;h<g;h++){if(f[h]===e){return h}}return -1},isFn:function(b){return b instanceof Function},isType:function(d,c){if(!d||!c){return false}return(c instanceof Function&&d instanceof c)||(typeof c==="string"&&typeof d===c)||(d.isA&&d.isA(c))},ignore:function(d,c){return/^(include|extend)$/.test(d)&&typeof c==="object"}});JS.Module=JS.makeFunction();JS.extend(JS.Module.prototype,{END_WITHOUT_DOT:/([^\.])$/,initialize:function(e,d,f){this.__mod__=this;this.__inc__=[];this.__fns__={};this.__dep__=[];this.__mct__={};if(typeof e==="string"){this.__nom__=this.displayName=e}else{this.__nom__=this.displayName="";f=d;d=e}f=f||{};this.__res__=f._1||null;if(d){this.include(d,false)}if(JS.Module.__chainq__){JS.Module.__chainq__.push(this)}},setName:function(d){this.__nom__=this.displayName=d||"";for(var c in this.__mod__.__fns__){this.__name__(c)}if(d&&this.__meta__){this.__meta__.setName(d+".")}},__name__:function(d){if(!this.__nom__){return}var c=this.__mod__.__fns__[d]||{};d=this.__nom__.replace(this.END_WITHOUT_DOT,"$1#")+d;if(JS.isFn(c.setName)){return c.setName(d)}if(JS.isFn(c)){c.displayName=d}},define:function(g,e,j,i){var h=(i||{})._0||this;this.__fns__[g]=e;this.__name__(g);if(JS.Module._0&&h&&JS.isFn(e)){JS.Module._0(g,h)}if(j!==false){this.resolve()}},instanceMethod:function(d){var c=this.lookup(d).pop();return JS.isFn(c)?c:null},instanceMethods:function(h,g){var l=this.__mod__,g=g||[],k=l.ancestors(),i=k.length,j;for(j in l.__fns__){if(l.__fns__.hasOwnProperty(j)&&JS.isFn(l.__fns__[j])&&JS.indexOf(g,j)===-1){g.push(j)}}if(h===false){return g}while(i--){k[i].instanceMethods(false,g)}return g},include:function(t,s,r){s=(s!==false);if(!t){return s?this.resolve():this.uncache()}r=r||{};if(t.__mod__){t=t.__mod__}var q=t.include,o=t.extend,p=r._4||this,n,m,l,k;if(t.__inc__&&t.__fns__){this.__inc__.push(t);t.__dep__.push(this);if(r._2){t.extended&&t.extended(r._2)}else{t.included&&t.included(p)}}else{if(r._5){for(m in t){if(JS.ignore(m,t[m])){continue}this.define(m,t[m],false,{_0:p||r._2||this})}}else{if(typeof q==="object"||JS.isType(q,JS.Module)){n=[].concat(q);for(l=0,k=n.length;l<k;l++){p.include(n[l],s,r)}}if(typeof o==="object"||JS.isType(o,JS.Module)){n=[].concat(o);for(l=0,k=n.length;l<k;l++){p.extend(n[l],false)}p.extend()}r._5=true;return p.include(t,s,r)}}s?this.resolve():this.uncache()},includes:function(e){var d=this.__mod__,f=d.__inc__.length;if(Object===e||d===e||d.__res__===e.prototype){return true}while(f--){if(d.__inc__[f].includes(e)){return true}}return false},match:function(b){return b.isA&&b.isA(this)},ancestors:function(i){var h=this.__mod__,n=(i===undefined),m=(h.__res__||{}).klass,k=(m&&h.__res__===m.prototype)?m:h,l,j;if(n&&h.__anc__){return h.__anc__.slice()}i=i||[];for(l=0,j=h.__inc__.length;l<j;l++){h.__inc__[l].ancestors(i)}if(JS.indexOf(i,k)===-1){i.push(k)}if(n){h.__anc__=i.slice()}return i},lookup:function(j){var i=this.__mod__,p=i.__mct__;if(p[j]){return p[j].slice()}var o=i.ancestors(),m=[],n,l,k;for(n=0,l=o.length;n<l;n++){k=o[n].__mod__.__fns__[j];if(k){m.push(k)}}p[j]=m.slice();return m},make:function(e,d){if(!JS.isFn(d)||!JS.callsSuper(d)){return d}var f=this;return function(){return f.chain(this,e,arguments)}},chain:JS.mask(function(p,o,m){var n=this.lookup(o),l=n.length-1,k=p.callSuper,b=JS.array(m),a;p.callSuper=function(){var d=arguments.length;while(d--){b[d]=arguments[d]}l-=1;var c=n[l].apply(p,b);l+=1;return c};a=n.pop().apply(p,b);k?p.callSuper=k:delete p.callSuper;return a}),resolve:function(i){var h=this.__mod__,i=i||h,n=i.__res__,m,k,l,j;if(i===h){h.uncache(false);m=h.__dep__.length;while(m--){h.__dep__[m].resolve()}}if(!n){return}for(m=0,k=h.__inc__.length;m<k;m++){h.__inc__[m].resolve(i)}for(l in h.__fns__){j=i.make(l,h.__fns__[l]);if(n[l]!==j){n[l]=j}}},uncache:function(e){var d=this.__mod__,f=d.__dep__.length;d.__anc__=null;d.__mct__={};if(e===false){return}while(f--){d.__dep__[f].uncache()}}});JS.Class=JS.makeFunction();JS.extend(JS.Class.prototype=JS.makeBridge(JS.Module),{initialize:function(f,e,h){if(typeof f==="string"){this.__nom__=this.displayName=f}else{this.__nom__=this.displayName="";h=e;e=f}var g=JS.extend(JS.makeFunction(),this);g.klass=g.constructor=this.klass;if(!JS.isFn(e)){h=e;e=Object}g.inherit(e);g.include(h,false);g.resolve();do{e.inherited&&e.inherited(g)}while(e=e.superclass);return g},inherit:function(d){this.superclass=d;if(this.__eigen__&&d.__eigen__){this.extend(d.__eigen__(),true)}this.subclasses=[];(d.subclasses||[]).push(this);var c=this.prototype=JS.makeBridge(d);c.klass=c.constructor=this;this.__mod__=new JS.Module(this.__nom__,{},{_1:this.prototype});this.include(JS.Kernel,false);if(d!==Object){this.include(d.__mod__||new JS.Module(d.prototype,{_1:d.prototype}),false)}},include:function(f,e,h){if(!f){return}var g=this.__mod__,h=h||{};h._4=this;return g.include(f,e,h)},define:function(g,e,j,i){var h=this.__mod__;i=i||{};i._0=this;h.define(g,e,j,i)}});JS.Module=new JS.Class("Module",JS.Module.prototype);JS.Class=new JS.Class("Class",JS.Module,JS.Class.prototype);JS.Module.klass=JS.Module.constructor=JS.Class.klass=JS.Class.constructor=JS.Class;JS.extend(JS.Module,{_3:[],__chainq__:[],methodAdded:function(d,c){this._3.push([d,c])},_0:function(f,e){var h=this._3,g=h.length;while(g--){h[g][0].call(h[g][1]||null,f,e)}}});JS.Kernel=JS.extend(new JS.Module("Kernel",{__eigen__:function(){if(this.__meta__){return this.__meta__}var f=this.__nom__,e=this.klass.__nom__,h=f||(e?"#<"+e+">":""),g=this.__meta__=new JS.Module(h?h+".":"",{},{_1:this});g.include(this.klass.__mod__,false);return g},equals:function(b){return this===b},extend:function(d,c){return this.__eigen__().include(d,c,{_2:this})},hash:function(){return this.__hashcode__=this.__hashcode__||JS.Kernel.getHashCode()},isA:function(b){return this.__eigen__().includes(b)},method:function(e){var d=this,f=d.__mcache__=d.__mcache__||{};if((f[e]||{}).fn===d[e]){return f[e].bd}return(f[e]={fn:d[e],bd:JS.bind(d[e],d)}).bd},methods:function(){return this.__eigen__().instanceMethods(true)},tap:function(d,c){d.call(c||null,this);return this}}),{__hashIndex__:0,getHashCode:function(){this.__hashIndex__+=1;return(Math.floor(new Date().getTime()/1000)+this.__hashIndex__).toString(16)}});JS.Module.include(JS.Kernel);JS.extend(JS.Module,JS.Kernel.__fns__);JS.Class.include(JS.Kernel);JS.extend(JS.Class,JS.Kernel.__fns__);JS.Interface=new JS.Class({initialize:function(a){this.test=function(e,d){var f=a.length;while(f--){if(!JS.isFn(e[a[f]])){return d?a[f]:false}}return true}},extend:{ensure:function(){var f=JS.array(arguments),e=f.shift(),h,g;while(h=f.shift()){g=h.test(e,true);if(g!==true){throw new Error("object does not implement "+g+"()")}}}}});JS.Singleton=new JS.Class({initialize:function(e,d,f){return new (new JS.Class(e,d,f))}});
35
- if(typeof Crypto=="undefined"||!Crypto.util){(function(){var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var d=window.Crypto={};var a=d.util={rotl:function(h,g){return(h<<g)|(h>>>(32-g))},rotr:function(h,g){return(h<<(32-g))|(h>>>g)},endian:function(h){if(h.constructor==Number){return a.rotl(h,8)&16711935|a.rotl(h,24)&4278255360}for(var g=0;g<h.length;g++){h[g]=a.endian(h[g])}return h},randomBytes:function(h){for(var g=[];h>0;h--){g.push(Math.floor(Math.random()*256))}return g},bytesToWords:function(h){for(var k=[],j=0,g=0;j<h.length;j++,g+=8){k[g>>>5]|=h[j]<<(24-g%32)}return k},wordsToBytes:function(i){for(var h=[],g=0;g<i.length*32;g+=8){h.push((i[g>>>5]>>>(24-g%32))&255)}return h},bytesToHex:function(g){for(var j=[],h=0;h<g.length;h++){j.push((g[h]>>>4).toString(16));j.push((g[h]&15).toString(16))}return j.join("")},hexToBytes:function(h){for(var g=[],i=0;i<h.length;i+=2){g.push(parseInt(h.substr(i,2),16))}return g},bytesToBase64:function(h){if(typeof btoa=="function"){return btoa(e.bytesToString(h))}for(var g=[],l=0;l<h.length;l+=3){var m=(h[l]<<16)|(h[l+1]<<8)|h[l+2];for(var k=0;k<4;k++){if(l*8+k*6<=h.length*8){g.push(c.charAt((m>>>6*(3-k))&63))}else{g.push("=")}}}return g.join("")},base64ToBytes:function(h){if(typeof atob=="function"){return e.stringToBytes(atob(h))}h=h.replace(/[^A-Z0-9+\/]/ig,"");for(var g=[],j=0,k=0;j<h.length;k=++j%4){if(k==0){continue}g.push(((c.indexOf(h.charAt(j-1))&(Math.pow(2,-2*k+8)-1))<<(k*2))|(c.indexOf(h.charAt(j))>>>(6-k*2)))}return g}};var b=d.charenc={};var f=b.UTF8={stringToBytes:function(g){return e.stringToBytes(unescape(encodeURIComponent(g)))},bytesToString:function(g){return decodeURIComponent(escape(e.bytesToString(g)))}};var e=b.Binary={stringToBytes:function(j){for(var g=[],h=0;h<j.length;h++){g.push(j.charCodeAt(h)&255)}return g},bytesToString:function(g){for(var j=[],h=0;h<g.length;h++){j.push(String.fromCharCode(g[h]))}return j.join("")}}})()};
36
- (function(){var f=Crypto,a=f.util,b=f.charenc,e=b.UTF8,d=b.Binary;var c=f.SHA1=function(i,g){var h=a.wordsToBytes(c._sha1(i));return g&&g.asBytes?h:g&&g.asString?d.bytesToString(h):a.bytesToHex(h)};c._sha1=function(o){if(o.constructor==String){o=e.stringToBytes(o)}var v=a.bytesToWords(o),x=o.length*8,p=[],r=1732584193,q=-271733879,k=-1732584194,h=271733878,g=-1009589776;v[x>>5]|=128<<(24-x%32);v[((x+64>>>9)<<4)+15]=x;for(var z=0;z<v.length;z+=16){var E=r,D=q,C=k,B=h,A=g;for(var y=0;y<80;y++){if(y<16){p[y]=v[z+y]}else{var u=p[y-3]^p[y-8]^p[y-14]^p[y-16];p[y]=(u<<1)|(u>>>31)}var s=((r<<5)|(r>>>27))+g+(p[y]>>>0)+(y<20?(q&k|~q&h)+1518500249:y<40?(q^k^h)+1859775393:y<60?(q&k|q&h|k&h)-1894007588:(q^k^h)-899497514);g=h;h=k;k=(q<<30)|(q>>>2);q=r;r=s}r+=E;q+=D;k+=C;h+=B;g+=A}return[r,q,k,h,g]};c._blocksize=16;c._digestsize=20})();
37
- Spontaneous.Diff=(function(){var e=function(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1000;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32};var d=-1;var b=1;var a=0;e.Diff;e.prototype.diff_main=function(g,f,i,k){if(typeof k=="undefined"){if(this.Diff_Timeout<=0){k=Number.MAX_VALUE}else{k=(new Date).getTime()+this.Diff_Timeout*1000}}var n=k;if(g==null||f==null){throw new Error("Null input. (diff_main)")}if(g==f){if(g){return[[a,g]]}return[]}if(typeof i=="undefined"){i=true}var o=i;var j=this.diff_commonPrefix(g,f);var m=g.substring(0,j);g=g.substring(j);f=f.substring(j);j=this.diff_commonSuffix(g,f);var h=g.substring(g.length-j);g=g.substring(0,g.length-j);f=f.substring(0,f.length-j);var l=this.diff_compute_(g,f,o,n);if(m){l.unshift([a,m])}if(h){l.push([a,h])}this.diff_cleanupMerge(l);return l};e.prototype.diff_compute_=function(h,g,v,u){var o;if(!h){return[[b,g]]}if(!g){return[[d,h]]}var r=h.length>g.length?h:g;var j=h.length>g.length?g:h;var l=r.indexOf(j);if(l!=-1){o=[[b,r.substring(0,l)],[a,j],[b,r.substring(l+j.length)]];if(h.length>g.length){o[0][0]=o[2][0]=d}return o}if(j.length==1){return[[d,h],[b,g]]}r=j=null;var f=this.diff_halfMatch_(h,g);if(f){var q=f[0];var n=f[1];var t=f[2];var s=f[3];var k=f[4];var p=this.diff_main(q,t,v,u);var m=this.diff_main(n,s,v,u);return p.concat([[a,k]],m)}if(v&&h.length>100&&g.length>100){return this.diff_lineMode_(h,g,u)}return this.diff_bisect_(h,g,u)};e.prototype.diff_lineMode_=function(h,g,r){var o=this.diff_linesToChars_(h,g);h=(o[0]);g=(o[1]);var i=(o[2]);var l=this.diff_bisect_(h,g,r);this.diff_charsToLines_(l,i);this.diff_cleanupSemantic(l);l.push([a,""]);var f=0;var q=0;var p=0;var n="";var m="";while(f<l.length){switch(l[f][0]){case b:p++;m+=l[f][1];break;case d:q++;n+=l[f][1];break;case a:if(q>=1&&p>=1){var o=this.diff_main(n,m,false,r);l.splice(f-q-p,q+p);f=f-q-p;for(var k=o.length-1;k>=0;k--){l.splice(f,0,o[k])}f=f+o.length}p=0;q=0;n="";m="";break}f++}l.pop();return l};e.prototype.diff_bisect_=function(r,p,E){var A=r.length;var k=p.length;var l=Math.ceil((A+k)/2);var v=l;var s=2*l;var i=new Array(s);var g=new Array(s);for(var q=0;q<s;q++){i[q]=-1;g[q]=-1}i[v+1]=0;g[v+1]=0;var F=A-k;var m=(F%2!=0);var w=0;var t=0;var z=0;var y=0;for(var D=0;D<l;D++){if((new Date()).getTime()>E){break}for(var o=-D+w;o<=D-t;o+=2){var u=v+o;var C;if(o==-D||o!=D&&i[u-1]<i[u+1]){C=i[u+1]}else{C=i[u-1]+1}var j=C-o;while(C<A&&j<k&&r.charAt(C)==p.charAt(j)){C++;j++}i[u]=C;if(C>A){t+=2}else{if(j>k){w+=2}else{if(m){var f=v+F-o;if(f>=0&&f<s&&g[f]!=-1){var B=A-g[f];if(C>=B){return this.diff_bisectSplit_(r,p,C,j,E)}}}}}}for(var n=-D+z;n<=D-y;n+=2){var f=v+n;var B;if(n==-D||n!=D&&g[f-1]<g[f+1]){B=g[f+1]}else{B=g[f-1]+1}var h=B-n;while(B<A&&h<k&&r.charAt(A-B-1)==p.charAt(k-h-1)){B++;h++}g[f]=B;if(B>A){y+=2}else{if(h>k){z+=2}else{if(!m){var u=v+F-n;if(u>=0&&u<s&&i[u]!=-1){var C=i[u];var j=v+C-u;B=A-B;if(C>=B){return this.diff_bisectSplit_(r,p,C,j,E)}}}}}}}return[[d,r],[b,p]]};e.prototype.diff_bisectSplit_=function(i,h,n,m,p){var k=i.substring(0,n);var g=h.substring(0,m);var j=i.substring(n);var f=h.substring(m);var l=this.diff_main(k,g,false,p);var o=this.diff_main(j,f,false,p);return l.concat(o)};e.prototype.diff_linesToChars_=function(l,j){var i=[];var f={};i[0]="";function k(r){var p="";var n=0;var q=-1;var o=i.length;while(q<r.length-1){q=r.indexOf("\n",n);if(q==-1){q=r.length-1}var m=r.substring(n,q+1);n=q+1;if(f.hasOwnProperty?f.hasOwnProperty(m):(f[m]!==undefined)){p+=String.fromCharCode(f[m])}else{p+=String.fromCharCode(o);f[m]=o;i[o++]=m}}return p}var h=k(l);var g=k(j);return[h,g,i]};e.prototype.diff_charsToLines_=function(j,g){for(var f=0;f<j.length;f++){var h=j[f][1];var i=[];for(var k=0;k<h.length;k++){i[k]=g[h.charCodeAt(k)]}j[f][1]=i.join("")}};e.prototype.diff_commonPrefix=function(j,i){if(!j||!i||j.charAt(0)!=i.charAt(0)){return 0}var g=0;var k=Math.min(j.length,i.length);var f=k;var h=0;while(g<f){if(j.substring(h,f)==i.substring(h,f)){g=f;h=g}else{k=f}f=Math.floor((k-g)/2+g)}return f};e.prototype.diff_commonSuffix=function(i,h){if(!i||!h||i.charAt(i.length-1)!=h.charAt(h.length-1)){return 0}var g=0;var j=Math.min(i.length,h.length);var f=j;var k=0;while(g<f){if(i.substring(i.length-f,i.length-k)==h.substring(h.length-f,h.length-k)){g=f;k=g}else{j=f}f=Math.floor((j-g)/2+g)}return f};e.prototype.diff_commonOverlap_=function(g,f){var l=g.length;var j=f.length;if(l==0||j==0){return 0}if(l>j){g=g.substring(l-j)}else{if(l<j){f=f.substring(0,l)}}var m=Math.min(l,j);if(g==f){return m}var i=0;var h=1;while(true){var k=g.substring(m-h);var n=f.indexOf(k);if(n==-1){return i}h+=n;if(n==0||g.substring(m-h)==f.substring(0,h)){i=h;h++}}};e.prototype.diff_halfMatch_=function(h,g){if(this.Diff_Timeout<=0){return null}var o=h.length>g.length?h:g;var i=h.length>g.length?g:h;if(o.length<4||i.length*2<o.length){return null}var s=this;function p(A,t,w){var y=A.substring(w,w+Math.floor(A.length/4));var u=-1;var E="";var x,v,D,C;while((u=t.indexOf(y,u+1))!=-1){var z=s.diff_commonPrefix(A.substring(w),t.substring(u));var B=s.diff_commonSuffix(A.substring(0,w),t.substring(0,u));if(E.length<B+z){E=t.substring(u-B,u)+t.substring(u,u+z);x=A.substring(0,w-B);v=A.substring(w+z);D=t.substring(0,u-B);C=t.substring(u+z)}}if(E.length*2>=A.length){return[x,v,D,C,E]}else{return null}}var l=p(o,i,Math.ceil(o.length/4));var k=p(o,i,Math.ceil(o.length/2));var f;if(!l&&!k){return null}else{if(!k){f=l}else{if(!l){f=k}else{f=l[4].length>k[4].length?l:k}}}var n,m,r,q;if(h.length>g.length){n=f[0];m=f[1];r=f[2];q=f[3]}else{r=f[0];q=f[1];n=f[2];m=f[3]}var j=f[4];return[n,m,r,q,j]};e.prototype.diff_cleanupSemantic=function(p){var r=false;var o=[];var h=0;var i=null;var f=0;var n=0;var m=0;var l=0;var k=0;while(f<p.length){if(p[f][0]==a){o[h++]=f;n=l;m=k;l=0;k=0;i=(p[f][1])}else{if(p[f][0]==b){l+=p[f][1].length}else{k+=p[f][1].length}if(i!==null&&(i.length<=Math.max(n,m))&&(i.length<=Math.max(l,k))){p.splice(o[h-1],0,[d,i]);p[o[h-1]+1][0]=b;h--;h--;f=h>0?o[h-1]:-1;n=0;m=0;l=0;k=0;i=null;r=true}}f++}if(r){this.diff_cleanupMerge(p)}this.diff_cleanupSemanticLossless(p);f=1;while(f<p.length){if(p[f-1][0]==d&&p[f][0]==b){var j=(p[f-1][1]);var g=(p[f][1]);var q=this.diff_commonOverlap_(j,g);if(q>=j.length/2||q>=g.length/2){p.splice(f,0,[a,g.substring(0,q)]);p[f-1][1]=j.substring(0,j.length-q);p[f+1][1]=g.substring(q);f++}f++}f++}};e.prototype.diff_cleanupSemanticLossless=function(g){var j=/[^a-zA-Z0-9]/;var u=/\s/;var i=/[\r\n]/;var n=/\n\r?\n$/;var f=/^\r?\n\r?\n/;function w(y,x){if(!y||!x){return 5}var z=0;if(y.charAt(y.length-1).match(j)||x.charAt(0).match(j)){z++;if(y.charAt(y.length-1).match(u)||x.charAt(0).match(u)){z++;if(y.charAt(y.length-1).match(i)||x.charAt(0).match(i)){z++;if(y.match(n)||x.match(f)){z++}}}}return z}var r=1;while(r<g.length-1){if(g[r-1][0]==a&&g[r+1][0]==a){var l=(g[r-1][1]);var p=(g[r][1]);var k=(g[r+1][1]);var v=this.diff_commonSuffix(l,p);if(v){var h=p.substring(p.length-v);l=l.substring(0,l.length-v);p=h+p.substring(0,p.length-v);k=h+k}var s=l;var o=p;var q=k;var m=w(l,p)+w(p,k);while(p.charAt(0)===k.charAt(0)){l+=p.charAt(0);p=p.substring(1)+k.charAt(0);k=k.substring(1);var t=w(l,p)+w(p,k);if(t>=m){m=t;s=l;o=p;q=k}}if(g[r-1][1]!=s){if(s){g[r-1][1]=s}else{g.splice(r-1,1);r--}g[r][1]=o;if(q){g[r+1][1]=q}else{g.splice(r+1,1);r--}}}r++}};e.prototype.diff_cleanupEfficiency=function(l){var n=false;var k=[];var h=0;var i="";var f=0;var m=false;var o=false;var g=false;var j=false;while(f<l.length){if(l[f][0]==a){if(l[f][1].length<this.Diff_EditCost&&(g||j)){k[h++]=f;m=g;o=j;i=l[f][1]}else{h=0;i=""}g=j=false}else{if(l[f][0]==d){j=true}else{g=true}if(i&&((m&&o&&g&&j)||((i.length<this.Diff_EditCost/2)&&(m+o+g+j)==3))){l.splice(k[h-1],0,[d,i]);l[k[h-1]+1][0]=b;h--;i="";if(m&&o){g=j=true;h=0}else{h--;f=h>0?k[h-1]:-1;g=j=false}n=true}}f++}if(n){this.diff_cleanupMerge(l)}};e.prototype.diff_cleanupMerge=function(m){m.push([a,""]);var l=0;var k=0;var j=0;var h="";var g="";var f;while(l<m.length){switch(m[l][0]){case b:j++;g+=m[l][1];l++;break;case d:k++;h+=m[l][1];l++;break;case a:if(k+j>1){if(k!==0&&j!==0){f=this.diff_commonPrefix(g,h);if(f!==0){if((l-k-j)>0&&m[l-k-j-1][0]==a){m[l-k-j-1][1]+=g.substring(0,f)}else{m.splice(0,0,[a,g.substring(0,f)]);l++}g=g.substring(f);h=h.substring(f)}f=this.diff_commonSuffix(g,h);if(f!==0){m[l][1]=g.substring(g.length-f)+m[l][1];g=g.substring(0,g.length-f);h=h.substring(0,h.length-f)}}if(k===0){m.splice(l-k-j,k+j,[b,g])}else{if(j===0){m.splice(l-k-j,k+j,[d,h])}else{m.splice(l-k-j,k+j,[d,h],[b,g])}}l=l-k-j+(k?1:0)+(j?1:0)+1}else{if(l!==0&&m[l-1][0]==a){m[l-1][1]+=m[l][1];m.splice(l,1)}else{l++}}j=0;k=0;h="";g="";break}}if(m[m.length-1][1]===""){m.pop()}var i=false;l=1;while(l<m.length-1){if(m[l-1][0]==a&&m[l+1][0]==a){if(m[l][1].substring(m[l][1].length-m[l-1][1].length)==m[l-1][1]){m[l][1]=m[l-1][1]+m[l][1].substring(0,m[l][1].length-m[l-1][1].length);m[l+1][1]=m[l-1][1]+m[l+1][1];m.splice(l-1,1);i=true}else{if(m[l][1].substring(0,m[l+1][1].length)==m[l+1][1]){m[l-1][1]+=m[l+1][1];m[l][1]=m[l][1].substring(m[l+1][1].length)+m[l+1][1];m.splice(l+1,1);i=true}}}l++}if(i){this.diff_cleanupMerge(m)}};e.prototype.diff_xIndex=function(l,k){var i=0;var g=0;var j=0;var h=0;var f;for(f=0;f<l.length;f++){if(l[f][0]!==b){i+=l[f][1].length}if(l[f][0]!==d){g+=l[f][1].length}if(i>k){break}j=i;h=g}if(l.length!=f&&l[f][0]===d){return h}return h+(k-j)};e.prototype.diff_prettyHtml=function(m){var k=[];var h=0;var o=/&/g;var j=/</g;var f=/>/g;var n=/\n/g;for(var p=0;p<m.length;p++){var l=m[p][0];var g=m[p][1];var q=g.replace(o,"&amp;").replace(j,"&lt;").replace(f,"&gt;").replace(n,'<span class="para">&para;</span><br>');switch(l){case b:k[p]="<ins>"+q+"</ins>";break;case d:k[p]="<del>"+q+"</del>";break;case a:k[p]="<span>"+q+"</span>";break}if(l!==d){h+=g.length}}return k.join("")};e.prototype.diff_text1=function(h){var g=[];for(var f=0;f<h.length;f++){if(h[f][0]!==b){g[f]=h[f][1]}}return g.join("")};e.prototype.diff_text2=function(h){var g=[];for(var f=0;f<h.length;f++){if(h[f][0]!==d){g[f]=h[f][1]}}return g.join("")};e.prototype.diff_levenshtein=function(k){var j=0;var g=0;var i=0;for(var f=0;f<k.length;f++){var l=k[f][0];var h=k[f][1];switch(l){case b:g+=h.length;break;case d:i+=h.length;break;case a:j+=Math.max(g,i);g=0;i=0;break}}j+=Math.max(g,i);return j};e.prototype.diff_toDelta=function(h){var g=[];for(var f=0;f<h.length;f++){switch(h[f][0]){case b:g[f]="+"+encodeURI(h[f][1]);break;case d:g[f]="-"+h[f][1].length;break;case a:g[f]="="+h[f][1].length;break}}return g.join("\t").replace(/%20/g," ")};e.prototype.diff_fromDelta=function(g,p){var k=[];var j=0;var f=0;var m=p.split(/\t/g);for(var o=0;o<m.length;o++){var i=m[o].substring(1);switch(m[o].charAt(0)){case"+":try{k[j++]=[b,decodeURI(i)]}catch(l){throw new Error("Illegal escape in diff_fromDelta: "+i)}break;case"-":case"=":var h=parseInt(i,10);if(isNaN(h)||h<0){throw new Error("Invalid number in diff_fromDelta: "+i)}var q=g.substring(f,f+=h);if(m[o].charAt(0)=="="){k[j++]=[a,q]}else{k[j++]=[d,q]}break;default:if(m[o]){throw new Error("Invalid diff operation in diff_fromDelta: "+m[o])}}}if(f!=g.length){throw new Error("Delta length ("+f+") does not equal source text length ("+g.length+").")}return k};e.prototype.match_main=function(h,f,g){if(h==null||f==null||g==null){throw new Error("Null input. (match_main)")}g=Math.max(0,Math.min(g,h.length));if(h==f){return 0}else{if(!h.length){return -1}else{if(h.substring(g,g+f.length)==f){return g}else{return this.match_bitap_(h,f,g)}}}};e.prototype.match_bitap_=function(p,x,n){if(x.length>this.Match_MaxBits){throw new Error("Pattern too long for this browser.")}var q=this.match_alphabet_(x);var f=this;function g(C,j){var B=C/x.length;var s=Math.abs(n-j);if(!f.Match_Distance){return s?1:B}return B+(s/f.Match_Distance)}var t=this.Match_Threshold;var h=p.indexOf(x,n);if(h!=-1){t=Math.min(g(0,h),t);h=p.lastIndexOf(x,n+x.length);if(h!=-1){t=Math.min(g(0,h),t)}}var z=1<<(x.length-1);h=-1;var k,o;var l=x.length+p.length;var m;for(var y=0;y<x.length;y++){k=0;o=l;while(k<o){if(g(y,n+o)<=t){k=o}else{l=o}o=Math.floor((l-k)/2+k)}l=o;var i=Math.max(1,n-o+1);var r=Math.min(n+o,p.length)+x.length;var u=Array(r+2);u[r+1]=(1<<y)-1;for(var v=r;v>=i;v--){var A=q[p.charAt(v-1)];if(y===0){u[v]=((u[v+1]<<1)|1)&A}else{u[v]=((u[v+1]<<1)|1)&A|(((m[v+1]|m[v])<<1)|1)|m[v+1]}if(u[v]&z){var w=g(y,v-1);if(w<=t){t=w;h=v-1;if(h>n){i=Math.max(1,2*n-h)}else{break}}}}if(g(y+1,n)>t){break}m=u}return h};e.prototype.match_alphabet_=function(h){var g={};for(var f=0;f<h.length;f++){g[h.charAt(f)]=0}for(var f=0;f<h.length;f++){g[h.charAt(f)]|=1<<(h.length-f-1)}return g};e.prototype.patch_addContext_=function(k,j){if(j.length==0){return}var g=j.substring(k.start2,k.start2+k.length1);var i=0;while(j.indexOf(g)!=j.lastIndexOf(g)&&g.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin){i+=this.Patch_Margin;g=j.substring(k.start2-i,k.start2+k.length1+i)}i+=this.Patch_Margin;var f=j.substring(k.start2-i,k.start2);if(f){k.diffs.unshift([a,f])}var h=j.substring(k.start2+k.length1,k.start2+k.length1+i);if(h){k.diffs.push([a,h])}k.start1-=f.length;k.start2-=f.length;k.length1+=f.length+h.length;k.length2+=f.length+h.length};e.prototype.patch_make=function(s,g,t){var h,o;if(typeof s=="string"&&typeof g=="string"&&typeof t=="undefined"){h=(s);o=this.diff_main(h,(g),true);if(o.length>2){this.diff_cleanupSemantic(o);this.diff_cleanupEfficiency(o)}}else{if(s&&typeof s=="object"&&typeof g=="undefined"&&typeof t=="undefined"){o=(s);h=this.diff_text1(o)}else{if(typeof s=="string"&&g&&typeof g=="object"&&typeof t=="undefined"){h=(s);o=(g)}else{if(typeof s=="string"&&typeof g=="string"&&t&&typeof t=="object"){h=(s);o=(t)}else{throw new Error("Unknown call format to patch_make.")}}}}if(o.length===0){return[]}var f=[];var i=new c();var l=0;var n=0;var m=0;var k=h;var q=h;for(var r=0;r<o.length;r++){var j=o[r][0];var p=o[r][1];if(!l&&j!==a){i.start1=n;i.start2=m}switch(j){case b:i.diffs[l++]=o[r];i.length2+=p.length;q=q.substring(0,m)+p+q.substring(m);break;case d:i.length1+=p.length;i.diffs[l++]=o[r];q=q.substring(0,m)+q.substring(m+p.length);break;case a:if(p.length<=2*this.Patch_Margin&&l&&o.length!=r+1){i.diffs[l++]=o[r];i.length1+=p.length;i.length2+=p.length}else{if(p.length>=2*this.Patch_Margin){if(l){this.patch_addContext_(i,k);f.push(i);i=new c();l=0;k=q;n=m}}}break}if(j!==b){n+=p.length}if(j!==d){m+=p.length}}if(l){this.patch_addContext_(i,k);f.push(i)}return f};e.prototype.patch_deepCopy=function(h){var i=[];for(var g=0;g<h.length;g++){var k=h[g];var f=new c();f.diffs=[];for(var j=0;j<k.diffs.length;j++){f.diffs[j]=k.diffs[j].slice()}f.start1=k.start1;f.start2=k.start2;f.length1=k.length1;f.length2=k.length2;i[g]=f}return i};e.prototype.patch_apply=function(f,u){if(f.length==0){return[u,[]]}f=this.patch_deepCopy(f);var h=this.patch_addPadding(f);u=h+u+h;this.patch_splitMax(f);var t=0;var l=[];for(var s=0;s<f.length;s++){var g=f[s].start2+t;var j=this.diff_text1(f[s].diffs);var k;var p=-1;if(j.length>this.Match_MaxBits){k=this.match_main(u,j.substring(0,this.Match_MaxBits),g);if(k!=-1){p=this.match_main(u,j.substring(j.length-this.Match_MaxBits),g+j.length-this.Match_MaxBits);if(p==-1||k>=p){k=-1}}}else{k=this.match_main(u,j,g)}if(k==-1){l[s]=false;t-=f[s].length2-f[s].length1}else{l[s]=true;t=k-g;var i;if(p==-1){i=u.substring(k,k+j.length)}else{i=u.substring(k,p+this.Match_MaxBits)}if(j==i){u=u.substring(0,k)+this.diff_text2(f[s].diffs)+u.substring(k+j.length)}else{var n=this.diff_main(j,i,false);if(j.length>this.Match_MaxBits&&this.diff_levenshtein(n)/j.length>this.Patch_DeleteThreshold){l[s]=false}else{this.diff_cleanupSemanticLossless(n);var o=0;var m;for(var r=0;r<f[s].diffs.length;r++){var q=f[s].diffs[r];if(q[0]!==a){m=this.diff_xIndex(n,o)}if(q[0]===b){u=u.substring(0,k+m)+q[1]+u.substring(k+m)}else{if(q[0]===d){u=u.substring(0,k+m)+u.substring(k+this.diff_xIndex(n,o+q[1].length))}}if(q[0]!==d){o+=q[1].length}}}}}}u=u.substring(h.length,u.length-h.length);return[u,l]};e.prototype.patch_addPadding=function(i){var h=this.Patch_Margin;var g="";for(var f=1;f<=h;f++){g+=String.fromCharCode(f)}for(var f=0;f<i.length;f++){i[f].start1+=h;i[f].start2+=h}var l=i[0];var k=l.diffs;if(k.length==0||k[0][0]!=a){k.unshift([a,g]);l.start1-=h;l.start2-=h;l.length1+=h;l.length2+=h}else{if(h>k[0][1].length){var j=h-k[0][1].length;k[0][1]=g.substring(k[0][1].length)+k[0][1];l.start1-=j;l.start2-=j;l.length1+=j;l.length2+=j}}l=i[i.length-1];k=l.diffs;if(k.length==0||k[k.length-1][0]!=a){k.push([a,g]);l.length1+=h;l.length2+=h}else{if(h>k[k.length-1][1].length){var j=h-k[k.length-1][1].length;k[k.length-1][1]+=g.substring(0,j);l.length1+=j;l.length2+=j}}return g};e.prototype.patch_splitMax=function(f){var n=this.Match_MaxBits;for(var q=0;q<f.length;q++){if(f[q].length1>n){var k=f[q];f.splice(q--,1);var h=k.start1;var g=k.start2;var l="";while(k.diffs.length!==0){var j=new c();var o=true;j.start1=h-l.length;j.start2=g-l.length;if(l!==""){j.length1=j.length2=l.length;j.diffs.push([a,l])}while(k.diffs.length!==0&&j.length1<n-this.Patch_Margin){var m=k.diffs[0][0];var p=k.diffs[0][1];if(m===b){j.length2+=p.length;g+=p.length;j.diffs.push(k.diffs.shift());o=false}else{if(m===d&&j.diffs.length==1&&j.diffs[0][0]==a&&p.length>2*n){j.length1+=p.length;h+=p.length;o=false;j.diffs.push([m,p]);k.diffs.shift()}else{p=p.substring(0,n-j.length1-this.Patch_Margin);j.length1+=p.length;h+=p.length;if(m===a){j.length2+=p.length;g+=p.length}else{o=false}j.diffs.push([m,p]);if(p==k.diffs[0][1]){k.diffs.shift()}else{k.diffs[0][1]=k.diffs[0][1].substring(p.length)}}}}l=this.diff_text2(j.diffs);l=l.substring(l.length-this.Patch_Margin);var i=this.diff_text1(k.diffs).substring(0,this.Patch_Margin);if(i!==""){j.length1+=i.length;j.length2+=i.length;if(j.diffs.length!==0&&j.diffs[j.diffs.length-1][0]===a){j.diffs[j.diffs.length-1][1]+=i}else{j.diffs.push([a,i])}}if(!o){f.splice(++q,0,j)}}}}};e.prototype.patch_toText=function(g){var h=[];for(var f=0;f<g.length;f++){h[f]=g[f]}return h.join("")};e.prototype.patch_fromText=function(l){var f=[];if(!l){return f}var n=l.split("\n");var p=0;var g=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;while(p<n.length){var j=n[p].match(g);if(!j){throw new Error("Invalid patch string: "+n[p])}var h=new c();f.push(h);h.start1=parseInt(j[1],10);if(j[2]===""){h.start1--;h.length1=1}else{if(j[2]=="0"){h.length1=0}else{h.start1--;h.length1=parseInt(j[2],10)}}h.start2=parseInt(j[3],10);if(j[4]===""){h.start2--;h.length2=1}else{if(j[4]=="0"){h.length2=0}else{h.start2--;h.length2=parseInt(j[4],10)}}p++;while(p<n.length){var i=n[p].charAt(0);try{var o=decodeURI(n[p].substring(1))}catch(k){throw new Error("Illegal escape in patch_fromText: "+o)}if(i=="-"){h.diffs.push([d,o])}else{if(i=="+"){h.diffs.push([b,o])}else{if(i==" "){h.diffs.push([a,o])}else{if(i=="@"){break}else{if(i===""){}else{throw new Error('Invalid patch mode "'+i+'" in: '+o)}}}}}p++}}return f};function c(){this.diffs=[];this.start1=null;this.start2=null;this.length1=0;this.length2=0}c.prototype.toString=function(){var g,j;if(this.length1===0){g=this.start1+",0"}else{if(this.length1==1){g=this.start1+1}else{g=(this.start1+1)+","+this.length1}}if(this.length2===0){j=this.start2+",0"}else{if(this.length2==1){j=this.start2+1}else{j=(this.start2+1)+","+this.length2}}var h=["@@ -"+g+" +"+j+" @@\n"];var i;for(var f=0;f<this.diffs.length;f++){switch(this.diffs[f][0]){case b:i="+";break;case d:i="-";break;case a:i=" ";break}h[f+1]=i+encodeURI(this.diffs[f][1])+"\n"}return h.join("").replace(/%20/g," ")};return e}());
38
- if(!window.console){window.console={log:function(){},warn:function(){},error:function(){},}}else{}function $A(c){if(!c){return[]}if(c.toArray){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}(function(b){var c=0;if(!(typeof Function.prototype.bind==="function")){Function.prototype.bind=function(){var e=this,g=$A(arguments),f=g.shift();return function(){return e.apply(f,g.concat($A(arguments)))}}}b.extend(Function.prototype,{cache:function(g){var f=this,h=g||("__cached__"+(++c)),e;return function(){if(this[h]===e){this[h]=f.apply(this,arguments)||null}return this[h]}}});b.extend(Number.prototype,{to_filesize:function(){var e=1000,f=[" bytes"," KB"," MB"," GB"],g=Math.floor(Math.log(this)/Math.log(e));return this/(Math.pow(e,g))+f[g]}});var a=200,d=200;b.fn.appear=function(h){var f=this,g=f.siblings(),e=function(){f.animate({opacity:1},{duration:a,complete:h})};if(g.length==0){f.css({opacity:0}).show();e()}else{f.hide().css({opacity:0}).animate({height:"show"},{duration:d,complete:e})}};b.fn.disappear=function(f){var e=this;this.animate({opacity:0},{duration:a,complete:function(){e.animate({height:"hide"},{duration:d,complete:f})}})}}(jQuery));
39
- Spontaneous.page=function(){return Spontaneous.Editing.get("page")};
40
- Spontaneous.Properties=(function(c,b){var a=new JS.Module({_props_debug:false,_props_properties:function(){if(!this._props_property_store){this._props_property_store={}}return this._props_property_store},_props_listeners:function(){if(!this._props_listener_store){this._props_listener_store={}}return this._props_listener_store},_props_notify_changed:function(j){for(var g=0,d=j.length;g<d;g++){var f=j[g],k=this._props_properties()[f];var h=this._props_listeners_for(f);for(var e=0,m=h.length;e<m;e++){var l=h[e].callback;l(k)}}},_props_set_individual:function(d,e){if(this._props_set_individual_wo_callbacks(d,e)){this._props_notify_changed([d])}},_props_set_individual_wo_callbacks:function(d,e){if(this._props_debug){console.log("setting ",d,e)}orig_value=this._props_properties()[d];this._props_properties()[d]=e;var f=(e!==orig_value);return f},_props_set_multiple:function(e){var f=[],d;for(d in e){if(e.hasOwnProperty(d)){if(this._props_set_individual_wo_callbacks(d,e[d])){f.push(d)}}}this._props_notify_changed(f)},_props_listeners_for:function(d){return this._props_listeners()[d]||[]},_props_add_listener:function(e,f){var d=this._props_listeners()[e]||[];d.push({callback:f});this._props_listeners()[e]=d},get:function(d){return this._props_properties()[d]},set:function(){if(arguments.length===1&&typeof arguments[0]==="object"){this._props_set_multiple(arguments[0])}else{if(arguments.length===2){this._props_set_individual(arguments[0],arguments[1])}}},watch:function(d,e){return this._props_add_listener(d,e)},bind:function(d,e){return this._props_add_listener(d,e)},trigger:function(){var d=Array.prototype.slice.call(arguments);var h=d.shift(),g=this._props_listeners_for(h);for(var e=0,f=g.length;e<f;e++){g[e].callback.apply(null,d)}}});return a}(jQuery,Spontaneous));
41
- Spontaneous.Dom=(function(g,d){var b="div p iframe a span img select option label ul li dl dt dd table tr td h1 h2 h3 h4 header input button form textarea".split(" ");var f={body:function(){return g(document.body)},id:function(h){return"#"+h},px:function(h){return h+"px"},cmd_key_label:function(j,h){var i=((window.navigator.platform.indexOf("Mac")===0)?"Cmd":"Ctrl");return this.key_label(j,i+"+"+h)},key_label:function(j,h){var i='<span class="key-combo">('+h+")</span>";return j+" "+i},parse_selector:function(n){var k,j="",m=[],s={};n=n||"";if(typeof n==="string"){k=n.split(".")}else{if(g.isArray(n)){k=n}}for(var o=0,q=k.length;o<q;o++){var l=k[o];if(l===""){}else{if(l.indexOf("#")===0){j=l.substr(1)}else{if(l.indexOf(".")===0){var h=this.parse_selector(l);m.push(h["class"])}else{m.push(l)}}}}if(j!==""){s.id=j}if(m.length>0){s["class"]=m.join(" ")}return s}};var a=function(i){var h="<"+i+"/>";return function(j,l){if(typeof j==="object"){if(!g.isArray(j)){l=j;j=""}}var k=g.extend((l||{}),f.parse_selector(j));return g(h,k)}};for(var c=0,e=b.length;c<e;c++){f[b[c]]=a(b[c])}return f})(jQuery,Spontaneous);
42
- Spontaneous.Auth=(function(b,a){return{Key:{key:function(c){return c+"_api_key"},save:function(c,d){localStorage.setItem(this.key(c),d)},load:function(c){return localStorage.getItem(this.key(c))},remove:function(c){localStorage.removeItem(this.key(c));return false}}}}(jQuery,Spontaneous));
43
- Spontaneous.User=(function(c,b){var d=new JS.Class({initialize:function(e){this.attrs=e},name:function(){return this.attrs.name},email:function(){return this.attrs.email},login:function(){return this.attrs.login},is_developer:function(){return this.attrs.developer}});var a=new JS.Singleton({include:Spontaneous.Properties,load:function(){b.Ajax.get("/user",this.loaded.bind(this))},loaded:function(e){this.user=new d(e);this.set("user",this.user)},name:function(){return this.user.name()},email:function(){return this.user.email()},login:function(){return this.user.login()},is_developer:function(){return this.user.is_developer()}});return a}(jQuery,Spontaneous));
44
- Spontaneous.Popover=(function(d,b){var e=b.Dom;var a=0;var c=new JS.Class({initialize:function(f){this.id=(++a);this.view=f;this.view.set_manager(this);this.depth=0},open:function(g){var q=this.view;var t=c.div();var f=e.div(".pop-over");var n=e.div(".menuHandle");var m=e.header();var s=e.h3().text(q.title());var u=e.div().css("width",q.width());u.append(q.view());if(q.has_navigation){var j=e.a(".button.back").append(e.span(".pointer")).append(e.span(".label").text("Back")).css("visibility","hidden");m.append(j)}m.append(s);if(q.close_text()){var l=e.a(".button.close").text(q.close_text()).click(this.close.bind(this));m.append(l)}f.append(n).append(m).append(u);var h=q.position_from_event(g),r=30,k=10,i=-30,p=18;if(q.align==="right"){n.css("left",(q.width()-(k+r))+"px");i=-(q.width()-(k+r/2)+8)}p-=31-c.div().scrollTop();f.offset({top:(h.top+p),left:(h.left+i)});f.hide();t.append(f);this.wrapper=f;this.is_open=true;f.fadeIn(200,this.after_open.bind(this))},after_open:function(){this.view.after_open()},close:function(){c.close();return false},do_close:function(){var f=this.view;f.before_close();f.do_close();f.after_close();this.is_open=false;this.wrapper.fadeOut(100,function(){d(this).remove()})}});c.extend({_instance:false,div:function(){if(!this._div){this._div=d("#content")}return this._div},open:function(g,f){this.close();this._instance=new c(f);this._instance.open(g);return this._instance},close:function(){if(this._instance){this._instance.do_close();this._instance=null}}});d(document).bind("keydown.popover",function(f){if(f.keyCode===27){c.close()}});return c})(jQuery,Spontaneous);
45
- Spontaneous.PopoverView=(function(b,a){var c=a.Dom;var d=new JS.Class({initialize:function(){},set_manager:function(e){this.manager=e},view:function(){},align:"left",has_navigation:true,title:function(){return"Popover"},width:function(){return 400},position_from_event:function(e){return this.position_from_element(e)},position_from_element:function(f){var e=b(f.currentTarget),g=e.offset();g.top+=e.outerHeight();g.left+=e.outerWidth()/2;return g},position_from_mouse:function(e){return{top:e.clientX,left:e.clientY}},after_open:function(){},close_text:function(){return"Close"},close:function(){this.manager.close()},before_close:function(){},do_close:function(){},after_close:function(){}});return d})(jQuery,Spontaneous);
46
- Spontaneous.Ajax=(function(b,a){b.ajaxSetup({async:true,cache:false,dataType:"json",ifModified:true});return{namespace:"/@spontaneous",get:function(d,e){var c=function(f,h,g){if(h!=="success"){g=f;f={}}e(f,h,g)};b.ajax({url:this.request_url(d),success:c,data:this.api_access_key(),error:c})},post:function(d,f,g){var e=function(i,j,h){g(i,j,h)};var c=function(h,l,k){var i=false;try{i=b.parseJSON(h.responseText)}catch(j){}g(i,l,h)};f=b.extend(f,this.api_access_key());b.ajax({url:this.request_url(d),type:"post",data:f,success:e,error:c})},test_field_versions:function(f,e,l,c){var h={},k=0;for(var d=0,m=e.length;d<m;d++){var g=e[d],j="[fields]["+g.schema_id()+"]";if(g.is_modified()){h[j]=g.version();k++}}if(k===0){l()}this.post(["/version",f.id()].join("/"),h,function(p,o,x){if(o==="success"){l()}else{if(x.status===409){var u={};for(var q=0,w=e.length;q<w;q++){var r=e[q];u[r.schema_id()]=r}var t=[];for(var n in p){if(p.hasOwnProperty(n)){var v=p[n],s=u[n];t.push({field:s,version:v[0],values:{server_original:v[1],local_edited:s.edited_value(),local_original:s.original_value()}})}}c(t)}}})},api_access_key:function(){return{__key:Spontaneous.Auth.Key.load(a.site_id)}},request_url:function(c,e){var d=this.namespace+c;if(e){d+="?"+b.param(this.api_access_key())}return d}}}(jQuery,Spontaneous));
47
- Spontaneous.Types=(function(f,c){var e=c.Ajax,a={};var d=new JS.Class({initialize:function(m){this.data=m;this.title=m.title;var h=this.data.fields;this.field_prototypes={};this.field_names=[];for(var j=0,k=h.length;j<k;j++){var l=h[j];this.field_names.push(l.name);this.field_prototypes[l.name]=l}},allowed_types:function(){var j=[];if(this.data.allowed_types.length>0){for(var h=0,k=this.data.allowed_types.length;h<k;h++){j.push(Spontaneous.Types.type(this.data.allowed_types[h]))}}return j}});var b=new JS.Class({initialize:function(o){this.data=o;this.schema_id=o.id;this.type=o.type;this.title=o.title;this.title_field_name=o.title_field;this.field_prototypes={};this.field_names=[];this.box_prototypes={};this.box_ids=[];var j=this.data.fields,l=this.data.boxes;for(var k=0,m=j.length;k<m;k++){var n=j[k];this.field_names.push(n.name);this.field_prototypes[n.name]=n}for(var k=0,m=l.length;k<m;k++){var h=l[k];this.box_ids.push(h.id);this.box_prototypes[h.id]=new d(h)}},box_prototype:function(h){return this.box_prototypes[h]},allowed_types:function(){var j=[];if(this.data.allowed_types.length>0){for(var h=0,k=this.data.allowed_types.length;h<k;h++){j.push(Spontaneous.Types.type(this.data.allowed_types[h]))}}return j},is_page:function(){return this.data.is_page},is_alias:function(){return this.data.is_alias},edit_url:function(){return c.editor_protocol+"://open?url=file://"+this.data.source}});var g=new JS.Singleton({include:Spontaneous.Properties,init:function(i){var h=(function(j){return function(l){var k={};for(id in l){if(l.hasOwnProperty(id)){k[id]=new b(l[id])}}Spontaneous.Types.set("types",k);if(j){j.call(a)}}})(i);e.get("/types",h)},type:function(h){return this.get("types")[h]},box_prototype:function(){}});return g}(jQuery,Spontaneous));
48
- Spontaneous.Image=(function(c,b){var d=Spontaneous.Dom;var a=new JS.Class({initialize:function(e){this.field=e},fit:function(f,e){if(this.is_empty()){return d.span()}var g=this.fit_dimensions(f,e);return d.img({src:this.src()}).attr("width",g.width).attr("height",g.height)},fit_dimensions:function(g,e){var f=1;if(this.is_landscape()){if(this.width()>g){f=g/this.width()}}else{if(this.height()>e){f=e/this.height()}}return{width:(this.width()*f),height:(this.height()*f)}},fit_dimensions_inverse:function(g,e){var f=1;if(this.is_portrait()){if(this.width()>g){f=g/this.width()}}else{if(this.height()>e){f=e/this.height()}}return{width:(this.width()*f),height:(this.height()*f)}},icon:function(g,e){if(this.is_empty()){return d.span()}var h=this.fit_dimensions_inverse(g,e),f=d.div(".icon-wrap",{width:d.px(g),height:d.px(e)});f.append(d.img({src:this.src()}).css({left:d.px((g-h.width)/2),top:d.px((e-h.height)/2)}).attr("width",h.width).attr("height",h.height));return f},src:function(){return this.field.attributes.original.src},width:function(){if(this.is_empty()){return 0}return this.field.attributes.original.width},height:function(){if(this.is_empty()){return 0}return this.field.attributes.original.height},is_landscape:function(){return this.width()>=this.height()},is_portrait:function(){return this.height()>this.width()},is_empty:function(){return !this.field.attributes.original}});return a}());
49
- Spontaneous.Content=(function(c,b){var d=b.Dom;var a=new JS.Class({include:Spontaneous.Properties,initialize:function(e){this.content=e},uid:function(){return(this.container?this.container.uid():"")+"/"+this.content.id},id:function(){return this.content.id},is_page:function(){return this.type().is_page()},target:function(){return this.content.target},developer_description:function(){return this.type().type+"["+this.id()+"]"},developer_edit_url:function(){return this.type().edit_url()},type:function(){return b.Types.type(this.content.type)}.cache(),constantize:function(g){var j=g.split(/\./),h=window;for(var e=0,f=j.length;e<f;e++){h=h[j[e]]}return h},unload:function(){c.each(this.field_list(),function(e,g){g.unload()});c.each(this.entries(),function(f,g){g.unload()})},field_list:function(){var h=this.type(),l=h.field_prototypes,k=h.field_names;var e=this.fields(),j=[];for(var f=0,g=k.length;f<g;f++){j.push(e[k[f]])}return j}.cache(),text_fields:function(){var e=[],g=this.field_list();for(var h=0,j=g.length;h<j;h++){var k=g[h];if(!k.is_image()){e.push(k)}}return e},image_fields:function(){var e=[],g=this.field_list();for(var h=0,j=g.length;h<j;h++){var k=g[h];if(k.is_image()){e.push(k)}}return e},file_fields:function(){var e=[],g=this.field_list();for(var h=0,j=g.length;h<j;h++){var k=g[h];if(k.is_file()){e.push(k)}}return e},fields:function(){var h={},k=this.type(),o=k.field_prototypes;for(var g=0,n=this.content.fields.length;g<n;g++){var j=this.content.fields[g],m=o[j.name],e=this.constantize(m.type);if(!e){console.warn("Content#fields:","Field has invalid type",m.type,"content_id:",this.content.id,"type:","'"+k.title+"'","field_name:",j.name);e=Spontaneous.FieldTypes.StringField}var l=new e(this,j);h[j.name]=l}return h}.cache(),field:function(e){return this.fields()[e]},field_updated:function(f,e){this.save_field(f)},save_field:function(e){var f={field:{}};f.field[e.name]={value:e.value()};Spontaneous.Ajax.post(this.save_path(),f,this.save_complete.bind(this))},save_path:function(){return["/save",this.content.id].join("/")},save_complete:function(g){if(g){var e=g.fields;for(var h=0,j=e.length;h<j;h++){var f=e[h],k=this.field(f.name);k.update(f)}}},has_fields:function(){return(this.content.fields.length>0)},title:function(){return this.title_field().value()},title_field:function(){return this.fields()[this.type().title_field_name]},hidden:function(){return this.content.hidden},entries:function(){if(!this.content.entries){return[]}var j=[];for(var f=0,e=this.content.entries,g=e.length;f<g;f++){var h=this.wrap_entry(e[f]);j.push(h)}return j}.cache(),boxes:function(){var h=[];if(this.content.boxes){for(var f=0,e=this.content.boxes,g=e.length;f<g;f++){h.push(new b.Box(e[f],this))}}return h}.cache(),has_boxes:function(){return(this.boxes().length>0)},wrap_entry:function(e){var f=Spontaneous.Entry;if(e.is_page){f=Spontaneous.PageEntry}return new f(e,this)},allowed_types:function(){return this.type().allowed_types()},depth:function(){return this.content.depth},destroy:function(){Spontaneous.Ajax.post(["/destroy",this.content.id].join("/"),{},this.destroyed.bind(this))},toggle_visibility:function(){Spontaneous.Ajax.post(["/toggle",this.content.id].join("/"),{},this.visibility_toggled.bind(this))},visibility_toggled:function(e){console.log("visibility_toggled",e);this.set("hidden",e.hidden)},destroyed:function(){var e=b.Editing.get("page");this.trigger("destroyed",this);e.trigger("removed_entry",this)},reposition:function(e){Spontaneous.Ajax.post(["/content",this.content.id,"position",e].join("/"),{},function(){this.repositioned()}.bind(this))},repositioned:function(){this.trigger("repositioned")}});return a}(jQuery,Spontaneous));
50
- Spontaneous.Views=(function(b,a){var d=a.Dom;var c=new JS.Class({initialize:function(e){this.content=e},id:function(){return this.content.id()},uid:function(){return this.content.uid()},depth_class:function(){return"depth-"+this.content.depth()},depth:function(){return this.content.depth()},visibility_class:function(){return this.content.hidden()?"hidden":"visible"},boxes_class:function(){return this.content.has_boxes()?"boxes":"no-boxes"},has_fields:function(){return this.content.field_list().length>0},field_list:function(){return this.content.field_list()},image_fields:function(){return this.content.image_fields()},text_fields:function(){return this.content.text_fields()},file_fields:function(){return this.content.file_fields()},mouseover:function(e){},mouseout:function(e){},save_path:function(){return this.content.save_path()},create_edit_wrapper:function(i){var h={style:"position: relative; overflow: hidden;"};var f=d.div(h);var g=d.div({style:"position: absolute; height: 0; overflow: hidden;"});var j=d.div();var k=d.div(h);var e=d.div();g.append(j);e.append(i);k.append(e);f.append(g).append(k);this.editing_area={outer:f,write:g,write_inner:j,read:k,read_inner:e};return f},edit:function(t){var q=300,k=10,j=20,p=this.editing_area,i=p.outer,s=p.write,g=p.read,f=p.write_inner,n=p.read_inner;var e=new Spontaneous.EditPanel(this),m=e.view();g.css("z-index",j);s.css("z-index",k).css("height","auto").show();f.append(m);var l=f.outerHeight();i.add(g).animate({height:l},{queue:false,duration:q});s.css({position:"relative"});g.css({position:"absolute",top:0,right:0,left:0}).animate({top:l},{queue:false,duration:q,complete:function(){s.css({"z-index":j,position:"relative",height:"auto"});g.css({"z-index":k,position:"absolute"});i.css("height","auto");e.on_show(t)}})},edit_closing:false,edit_closed:function(){if(this.edit_closing){return}this.edit_closing=true;var p=300,j=10,i=20,n=this.editing_area,g=n.outer,q=n.write,e=n.read,f=n.write_inner,m=n.read_inner,k=m.outerHeight(),l=this;g.add(e).animate({height:k},{queue:false,duration:p});e.css({"z-index":i,height:k,top:f.outerHeight()+"px"}).animate({top:0},{queue:true,duration:p,complete:function(){q.css({position:"absolute","z-index":j});e.css({position:"relative",height:"auto","z-index":i});g.css("height","auto");f.empty();l.edit_closing=false}})},save_complete:function(e){this.content.save_complete(e)}});return{View:c}}(jQuery,Spontaneous));
51
- Spontaneous.Views.BoxView=(function(c,b){var d=b.Dom;var a=new JS.Class(Spontaneous.Views.View,{include:Spontaneous.Properties,initialize:function(e,f){this.callSuper(e);this.box=e;this.dom_container=f;this.box.bind("entry_added",this.insert_entry.bind(this))},name:function(){return this.box.name()},schema_id:function(){return this.box.schema_id()},activate:function(){c("> .slot-content",this.dom_container).hide();this.panel().show()},mouseover:function(){if(this.fields_preview){this.fields_preview.addClass("hover")}},mouseout:function(){if(this.fields_preview){this.fields_preview.removeClass("hover")}},panel:function(){if(!this._panel){var p=d.div(".slot-content");if(this.box.has_fields()){var o=d.div(".box-fields");var t=new Spontaneous.FieldPreview(this,"");var j=t.panel();j.prepend(d.div(".overlay"));var f=this.create_edit_wrapper(j);o.append(f);p.append(o);this.fields_preview=j}var k=this.box.allowed_types();var g=d.div(".slot-addable");var h=g;var m=function(w){h.removeClass("drop-active").addClass("uploading");w.stopPropagation();w.preventDefault();var i=w.dataTransfer.files;if(i.length>0){b.UploadManager.wrap(this,i)}return false}.bind(this);var n=function(i){c(this).addClass("drop-active");i.stopPropagation();i.preventDefault();return false}.bind(h);var v=function(i){i.stopPropagation();i.preventDefault();return false}.bind(h);var x=function(i){c(this).removeClass("drop-active");i.stopPropagation();i.preventDefault();return false}.bind(h);h.get(0).addEventListener("drop",m,true);h.bind("dragenter",n).bind("dragover",v).bind("dragleave",x);var s=this;c.each(k,function(z,A){var w=d.a().text(A.title),y;if(A.is_alias()){w.addClass("alias");y=function(i){var B=new Spontaneous.AddAliasDialogue(s,i);B.open()}.bind(s,A)}else{y=function(i){this.add_content(i,0)}.bind(s,A)}w.click(y);g.append(w)});g.append(d.span(".down"));p.append(g);var r=d.div(".slot-entries");for(var u=0,l=this.entries(),q=l.length;u<q;u++){var e=l[u];r.append(this.claim_entry(e))}r.sortable({items:"> ."+this.entry_class(),handle:".title-bar",axis:"y",distance:5,tolerance:"pointer",scrollSpeed:40,containment:"parent",stop:function(i,w){this.re_sort(w.item)}.bind(this)});p.append(r);p.hide();this.dom_container.append(p);this._panel=p;this._entry_container=r}return this._panel},re_sort:function(n){var g=this._entry_container.sortable("toArray"),f=n.attr("id"),k=0;for(var h=0,m=g.length;h<m;h++){if(g[h]===f){k=h;break}}var e=f.split("-")[1],l;for(var h=0,j=this.entries(),m=j.length;h<m;h++){if(j[h].id()==e){l=j[h];break}}l.reposition(k,function(i){this.sorted(i)}.bind(this))},sorted:function(e){},upload_complete:function(e){this.box.entry_added(e)},upload_progress:function(e,f){},entries:function(){var e=[];for(var g=0,f=this.box.entries(),h=f.length;g<h;g++){var j=f[g];e.push(this.view_for_entry(j))}return e}.cache(),view_for_entry:function(h){var g=b.Views.PieceView,f,e;if(h.is_page()){g=b.Views.PagePieceView}f=new g(h);return f},claim_entry:function(e){var f=e.panel();return f.attr("id",this.entry_id(e)).addClass(this.entry_class())},entry_id:function(e){return"entry-"+e.content.id()},entry_class:function(){return"container-"+this.box.schema_id()},save_path:function(){return["/savebox",this.id()].join("/")},add_content:function(f,e){this.box.add_entry(f,e)},add_alias:function(e,f){this.box.add_alias(e,f)},insert_entry:function(k,g){this.trigger("entry_added",k);var f=this.entries(),i=this.entry_wrappers(),l=this.view_for_entry(k),j=this.claim_entry(l);f.splice(g,0,l);if(i.length>0){this.entry_wrappers().slice(g,g+1).before(j)}else{this._entry_container.append(j)}j.hide().appear()},entry_wrappers:function(){return this._entry_container.find("> ."+this.entry_class())}});return a})(jQuery,Spontaneous);
52
- Spontaneous.Views.PageView=(function(c,b){var e=b.Dom,a=b.User;var d=function(g){this.page=g};d.prototype={panel:function(){this.panel=e.div("#page-info");this.title=c("<h1/>");this.set_title();this.panel.append(this.title);var g=e.div(".path");this.page.title_field().watch("value",function(k){this.set_title(k)}.bind(this));var j=e.h3(".path").text(this.page.get("path")).click(function(){if(this.page.get("path")!=="/"){this.open_url_editor()}}.bind(this));g.append(j);if(a.is_developer()){var i=e.h3(".developer.uid"+(!this.page.content.uid?".missing":"")).text("#"+(this.page.content.uid||"----")).click(function(){this.open_uid_editor()}.bind(this));var h=e.h3(".developer").append(e.a().attr("href",this.page.developer_edit_url()).text(this.page.developer_description()));g.append(i,h)}g.append(e.div(".edit"));this.page.watch("path",function(k){j.text(k)}.bind(this));this.panel.append(g);this.path_wrap=g;return this.panel},set_title:function(g){g=g||this.page.title();this.title.text(g);if(this.page.content.hidden){this.title.append(e.span().text(" (hidden)"))}},unavailable_loaded:function(g){var h={};for(var j=0,k=g.length;j<k;j++){h[g[j]]=true}this.unavailable=h},open_uid_editor:function(){this.panel.animate({height:"+=14"},200,function(){var g=c("h3",this.panel),k=c(".edit",this.panel);g.hide();k.hide().empty();var i=e.input({type:"text",autofocus:"autofocus"}).val(this.page.content.uid).select();var h=e.div(".input-error.uid-input");var m=e.div(".hash").text("#");var j=e.label().text("UID");var l=function(){this.save_uid(i.val())}.bind(this);h.append(m,i);k.append(j,h);k.append(e.a(".button.save").text("Save").click(l));k.append(e.a(".button.cancel").text("Cancel").click(this.close.bind(this)));i.keyup(function(o){if(o.keyCode===13){l()}else{var n=i.val();n=n.toLowerCase().replace(/['"]/g,"");n=n.replace(/[^a-z0-9_]/g,"_").replace(/(\_+|\s+)/g,"_").replace(/(^\-)/,"");i.val(n)}}.bind(this)).keydown(function(n){if(n.keyCode===27){this.close()}}.bind(this));k.fadeIn(200)}.bind(this))},save_uid:function(g){Spontaneous.Ajax.post("/uid/"+this.page.id(),{uid:g},this.uid_save_complete.bind(this))},uid_save_complete:function(i,h,l){if(h==="success"){var g=c("h3.uid",this.panel),k=c(".edit",this.panel),j=(i.uid==""?"----":i.uid);this.page.content.uid=i.uid;g.text("#"+j);this.close()}},open_url_editor:function(){this.unavailable=false;Spontaneous.Ajax.get(["/slug",this.page.id(),"unavailable"].join("/"),this.unavailable_loaded.bind(this));this.panel.animate({height:"+=14"},200,function(){var o=c("h3",this.panel),r=c(".edit",this.panel);o.hide();r.hide().empty();var t=[""],k=this.page.get("path").split("/"),j=k.pop();k.shift();r.append(e.span().text("/"));for(var l=0,s=k.length;l<s;l++){var h=k[l];t.push(h);r.append(e.a(".path").text(h).attr("href",t.join("/")).click(function(){b.Location.load_path(c(this).attr("href"));return false}));r.append(e.span().text("/"))}var g=e.span(".input-error");var q=e.input({type:"text",autofocus:"autofocus"}).val(j).select();var n=e.span().text("Duplicate URL").hide();g.append(q);g.append(n);r.append(g);var m=function(){this.save(q.val())}.bind(this);r.append(e.a(".button.save").text("Save").click(m));r.append(e.a(".button.cancel").text("Cancel").click(this.close.bind(this)));q.keyup(function(p){if(p.keyCode===13){m()}else{var i=this.input.val();i=i.toLowerCase().replace(/['"]/g,"").replace(/\&/,"and");i=i.replace(/[^\w0-9+]/g,"-").replace(/(\-+|\s+)/g,"-").replace(/(^\-)/,"");this.input.val(i);if(i===""){this.show_path_error("Invalid URL")}else{if(this.unavailable[i]){this.show_path_error()}else{this.hide_path_error()}}}}.bind(this)).keydown(function(i){if(i.keyCode===27){this.close()}}.bind(this));this.input=q;this.error=n;r.fadeIn(200)}.bind(this))},show_path_error:function(g){g=(g||"Duplicate URL");this.error.text(g).fadeIn(100);this.input.addClass("error")},hide_path_error:function(g){this.error.fadeOut(100);if(this.input.hasClass("error")){this.input.removeClass("error")}},save:function(g){Spontaneous.Ajax.post("/slug/"+this.page.id(),{slug:g},this.save_complete.bind(this))},save_complete:function(i,h,k){if(h==="success"){this.hide_path_error();var g=c("h3.path",this.panel),j=c(".edit",this.panel);this.page.set("path",i.path);g.text(i.path);this.close();Spontaneous.Location.set("path",this.page.get("path"))}else{if(k.status===409){this.show_path_error()}if(k.status===406){this.show_path_error("Invalid URL")}}},close:function(){var g=c("h3",this.panel),h=c(".edit",this.panel);g.show();h.hide();this.panel.animate({height:"-=14"},200)}};var f=new JS.Class(Spontaneous.Views.View,{initialize:function(g){this.page=g;this.callSuper(g)},panel:function(){this.panel=e.div("#page-content");this.panel.append(new d(this.page).panel());var g=e.div("#page-fields");var h=new Spontaneous.FieldPreview(this,"");var j=h.panel();j.prepend(e.div(".overlay"));var i=this.create_edit_wrapper(j);g.append(i);this.panel.append(g);this.panel.append(new Spontaneous.BoxContainer(this.page,"page-slots").panel());this.fields_preview=j;return this.panel},mouseover:function(){if(this.fields_preview){this.fields_preview.addClass("hover")}},mouseout:function(){if(this.fields_preview){this.fields_preview.removeClass("hover")}},depth:function(){return this.page.depth()}});return f}(jQuery,Spontaneous));
53
- Spontaneous.Views.PieceView=(function(f,e){var g=e.Dom,c=e.User;var b=0;var a=new JS.Class(Spontaneous.PopoverView,{initialize:function(h){this.parent_view=h},width:function(){return 208},align:"right",has_navigation:false,close_text:function(){return false},title:function(){return"Delete this "+(this.parent_view.content.is_page()?"Page?":"Piece?")},position_from_event:function(h){return this.position_from_element(h)},view:function(){var j=this.parent_view;var h=g.div("#popover-delete").click(function(){j.cancel_destroy();return false});var i=g.a(".ok").text("Delete").click(function(){j.destroy();return false});var k=g.a(".cancel").text("Cancel");h.append(k,i);return h}});var d=new JS.Class(e.Views.View,{initialize:function(i,h){this.callSuper(i);this.container=h},panel:function(){var i=g.div(["entry-wrap",this.depth_class(),this.visibility_class(),this.boxes_class()]);var k=g.div(".entry-contents");var m=g.div(".entry-inner");var h=g.div(".white-bg").mouseover(this.mouseover.bind(this)).mouseout(this.mouseout.bind(this)).click(this.edit.bind(this));m.append(h);if(this.content.depth()<4){m.append(g.div(".grey-bg"))}k.append(this.title_bar(k));if(this.content.type().is_alias()){k.append(this.alias_target_panel())}var p=g.div(".entry");var n=new Spontaneous.FieldPreview(this,"");if(n.has_fields()){var o=n.panel();p.append(o)}var l=new Spontaneous.BoxContainer(this.content);m.append(p);m.append(l.panel());var j=this.create_edit_wrapper(m);k.append(j);i.append(k,g.div(".entry-spacer"));this.wrapper=i;this.outline=h;this.fields_preview=o;return i},alias_target_panel:function(){var l=this.content,j=g.div(".alias-target"),i=l.alias_icon,k=function(){e.Location.load_id(l.target().id)},m=g.a().text(l.content.alias_title).click(k);if(i){var h=new Spontaneous.Image(i);j.append(h.icon(60,60).click(k))}return j.append(m)},title_bar:function(n){if(!this._title_bar){var j=c.is_developer()?g.a(".developer.source").attr("href",this.content.developer_edit_url()).text(this.content.developer_description()):(this.content.type().title);var i=g.div(".title-bar").append(j);var m=g.div(".actions",{xstyle:"display: none"});var k=g.a(".delete");var h=g.a(".visibility");m.append(k);m.append(h);i.append(m);var l;k.click(this.confirm_destroy.bind(this));this.content.watch("hidden",this.visibility_changed.bind(this));h.click(this.toggle_visibility.bind(this));this._title_bar=i}return this._title_bar},reposition:function(h,i){this.content.bind("repositioned",i);this.content.reposition(h)},toggle_visibility:function(){this.content.toggle_visibility()},visibility_changed:function(h){var i=200;this.wrapper.removeClass("visible hidden");if(h){this.wrapper.switchClass("visible","hidden",i)}else{this.wrapper.switchClass("hidden","visible",i)}},mouseover:function(){this.outline.addClass("active");if(this.fields_preview){this.fields_preview.addClass("hover")}},mouseout:function(){this.outline.removeClass("active");if(this.fields_preview){this.fields_preview.removeClass("hover")}},confirm_destroy:function(){if(this._dialogue&&!this._dialogue.is_open){this.close_destroy_dialogue()}if(!this._dialogue){this._dialogue=Spontaneous.Popover.open(event,new a(this))}else{this.close_destroy_dialogue()}},destroy:function(){this.close_destroy_dialogue();this.content.bind("destroyed",this.destroyed.bind(this));this.content.destroy()},cancel_destroy:function(){this.close_destroy_dialogue()},close_destroy_dialogue:function(){if(this._dialogue){this._dialogue.close();this._dialogue=null}},destroyed:function(){this.wrapper.disappear(function(){this.wrapper.remove()}.bind(this))}});return d}(jQuery,Spontaneous));
54
- Spontaneous.Views.PagePieceView=(function(c,b){var d=b.Dom;var a=new JS.Class(Spontaneous.Views.PieceView,{panel:function(){var l=d.div(["entry-wrap page no-boxes",this.depth_class(),this.visibility_class()]);var j=d.div(".entry-contents");var f=d.div(".entry-inner");var g=d.div(".white-bg").mouseover(this.mouseover.bind(this)).mouseout(this.mouseout.bind(this)).click(this.edit.bind(this));f.append(g);j.append(this.title_bar(j));if(this.content.type().is_alias()){j.append(this.alias_target_panel())}j.append(this.page_title_panel());var i=d.div(".entry");var e=new Spontaneous.FieldPreview(this,"");var h=e.panel();i.append(h);f.append(i);var k=this.create_edit_wrapper(f);j.append(k);l.append(j,d.div(".entry-spacer"));this.wrapper=l;this.outline=g;this.fields_preview=h;return l},page_title_panel:function(){var g=d.div(".page-title"),e=this,f=d.a().text(this.content.title()).click(function(){b.Location.load_id(e.id())});this.content.title_field().watch("value",function(h){f.text(h)}.bind(this));g.append(f);return g}});return a}(jQuery,Spontaneous));
55
- Spontaneous.Entry=(function(d,c){var e=c.Dom,b=c.User;var a=new JS.Class(Spontaneous.Content,{initialize:function(g,f){this.container=f;this.callSuper(g)},});return a})(jQuery,Spontaneous);
56
- Spontaneous.PageEntry=(function(c,b){var d=b.Dom;var a=new JS.Class(Spontaneous.Content,{});return a})(jQuery,Spontaneous);
57
- Spontaneous.Box=(function(c,b){var d=b.Dom;var a=new JS.Class(Spontaneous.Content,{initialize:function(f,e){this.callSuper(f);this.container=e},name:function(){return this.type().title},type:function(){if(!this._type){this._type=this.container.type().box_prototype(this.content.id)}return this._type},id:function(){return this.container.id()+"/"+this.schema_id()},schema_id:function(){return this.type().data.id},depth:function(){return"box"},mouseover:function(){if(this.fields_preview){this.fields_preview.addClass("hover")}},mouseout:function(){if(this.fields_preview){this.fields_preview.removeClass("hover")}},re_sort:function(n){var g=this._entry_container.sortable("toArray"),f=n.attr("id"),k=0;for(var h=0,m=g.length;h<m;h++){if(g[h]===f){k=h;break}}var e=f.split("-")[1],l;for(var h=0,j=this.entries(),m=j.length;h<m;h++){if(j[h].id()==e){l=j[h];break}}l.reposition(k,function(i){this.sorted(i)}.bind(this))},sorted:function(e){},upload_complete:function(e){this.insert_entry(this.wrap_entry(e.entry),e.position)},upload_progress:function(e,f){},entry_id:function(e){return"entry-"+e.id()},entry_class:function(){return"container-"+this.schema_id()},add_entry:function(f,e){Spontaneous.Ajax.post(["/add",this.id(),f.schema_id].join("/"),{},this.entry_added.bind(this))},add_alias:function(e,f){b.Ajax.post(["/alias",this.id()].join("/"),{alias_id:f.schema_id,target_id:e},this.entry_added.bind(this))},entry_added:function(g){var f=g.position,j=g.entry,h=this.wrap_entry(j);this.content.entries.splice(f,0,j);this.entries().splice(f,0,h);var i=b.Editing.get("page");i.trigger("entry_added",h,f);this.trigger("entry_added",h,f)},save_path:function(){return["/savebox",this.id()].join("/")},entry_wrappers:function(){return this._entry_container.find("> ."+this.entry_class())}});return a})(jQuery,Spontaneous);
58
- Spontaneous.Page=(function(d,c){var e=c.Dom,a=c.User;var b=new JS.Class(Spontaneous.Content,{initialize:function(f){this.callSuper(f);this.set("path",f.path)},save_complete:function(f){this.callSuper(f);this.set("slug",f.slug);this.set("path",f.path)},depth:function(){return 0},entries:function(){var k=[];for(var g=0,f=this.boxes(),h=f.length;g<h;g++){var j=f[g];k=k.concat(j.entries())}return k},children:function(){var j=[];for(var g=0,f=this.entries(),h=f.length;g<h;g++){var k=f[g];if(k.is_page()){j.push(k)}}return j}});return b}(jQuery,Spontaneous));
59
- Spontaneous.FieldTypes={};
60
- Spontaneous.FieldTypes.StringField=(function(d,a){var e=a.Dom;var c=new JS.Class({initialize:function(f,g){this.dialogue=f;this.conflict=g;this.server_version=g.version;this.values=g.values;this.differ=new a.Diff()},panel:function(){var k=e.div(".string-field-conflict.labels.differences"),q=e.div(),n=e.div(".string-field-conflict.changes.differences"),p=e.div(".original.diff"),h=e.div(".final.diff");var m=e.div(".diff").text("Changes made by other person");var f=e.div(".diff").text("Their changes merged with yours");var i=this.diff(this.values.local_original,this.values.server_original);var g=this.diff(this.values.local_original,this.values.local_edited);var o=this.differ.patch_apply(g.patches,this.values.server_original);var l=this.diff(this.values.local_original,o[0]);var r=this.differ.diff_prettyHtml(i.diff);var j=this.differ.diff_prettyHtml(l.diff);p.append(r).click(function(){this.useValue(this.values.server_original);p.add(h).removeClass("selected");p.addClass("selected")}.bind(this));h.append(j).click(function(){this.useValue(o[0]);p.add(h).removeClass("selected");h.addClass("selected")}.bind(this));k.append(m,f);n.append(p,h);q.append(k,n);return q},diff:function(g,i){var h=this.differ.diff_main(g,i,false);this.differ.diff_cleanupSemantic(h);var f=this.differ.patch_make(g,i,h);return{diff:h,patches:f}},useValue:function(f){this.use_value=f;this.dialogue.resolve_value(this.conflict,f)}});var b=new JS.Class({include:Spontaneous.Properties,initialize:function(f,h){this.content=f;this.name=h.name;var g=f.type();this.type=g.field_prototypes[this.name];this.title=this.type.title;this.update(h)},uid:function(){return this.content.uid()+"["+this.name+"]"},set_value:function(f){},unload:function(){},update:function(f){this.data=f;this.set("value",f.processed_value);this.set("unprocessed_value",f.unprocessed_value)},preview:function(){return this.get("value")},activate:function(f){f.find('a[href^="/"]').click(function(){a.Location.load_path(d(this).attr("href"));return false})},value:function(){return this.get("value")},unprocessed_value:function(){return this.data.unprocessed_value},is_image:function(){return false},is_file:function(){return false},id:function(){return this.content.id()},css_id:function(){return"field-"+this.name+"-"+this.id()},form_name:function(){return this.input_name("unprocessed_value")},version_name:function(){return this.input_name("version")},input_name:function(f){return"field["+this.schema_id()+"]["+f+"]"},schema_id:function(){return this.type.schema_id},version:function(){return this.data.version},set_version:function(f){this.data.version=f},label:function(){return this.title},input:function(){if(!this._input){this._input=e.input(e.id(this.css_id()),{type:"text",name:this.form_name(),value:this.unprocessed_value()})}return this._input},edited_value:function(){return this.input().val()},is_modified:function(){return true},original_value:function(){return this.unprocessed_value()},set_edited_value:function(f){this.input().val(f)},cancel_edit:function(){},close_edit:function(){this._input=null;this._version_input=null},edit:function(){return this.input()},toolbar:function(){return false},footer:function(){return false},focus:function(){this.input().focus().select()},accepts_focus:true,on_focus:function(){this.input().parents(".field").first().addClass("focus")},on_blur:function(){this.input().parents(".field").first().removeClass("focus")},conflict_view:function(f,g){return new c(f,g)}});b.ConflictView=c;return b})(jQuery,Spontaneous);
61
- Spontaneous.FieldTypes.FileField=(function(c,b){var d=b.Dom;var a=new JS.Class(Spontaneous.FieldTypes.StringField,{selected_files:false,preview:function(){Spontaneous.UploadManager.register(this);return this.callSuper()},unload:function(){this.callSuper();this.input=null;this._progress_bar=null;Spontaneous.UploadManager.unregister(this)},upload_complete:function(e){console.log("upload complete",e);this.set_version(e.version);this.selected_files=null;this.disable_progress()},disable_progress:function(){this.progress_bar().parent().hide();this.drop_target.removeClass("uploading")},upload_progress:function(e,f){if(!this.drop_target.hasClass("uploading")){this.drop_target.addClass("uploading")}this.progress_bar().parent().show();this.progress_bar().css("width",((e/f)*100)+"%")},is_file:function(){return true},get_input:function(){this.input=d.input({type:"file",name:this.form_name(),accept:"image/*"});return this.input},accepts_focus:false,save:function(){if(!this.selected_files){return}var g=this.selected_files;if(g&&g.length>0){this.drop_target.addClass("uploading");this.progress_bar().parent().show();var e=new FormData();var f=g[0];b.UploadManager.replace(this,f)}this.selected_files=false},is_modified:function(){var e=this.selected_files;return(e&&e.length>0)},original_value:function(){this.processed_value()},set_edited_value:function(e){console.log("set_edited_value",e,this.edited_value(),this.original_value());if(e===this.edited_value()){}else{this.selected_files=null;this.set("value",e)}}});return a})(jQuery,Spontaneous);
62
- Spontaneous.FieldTypes.ImageField=(function(d,b){var e=b.Dom;var c=new JS.Class(b.FieldTypes.StringField.ConflictView,{panel:function(){var l=e.div(".image-field-conflict.labels.differences"),h=e.div(),f=e.div(".image-field-conflict.changes.differences"),g=e.div(".original.diff"),k=e.div(".final.diff");var j=e.div(".diff").text("Server version");var i=e.div(".diff").text("Your version");g.append(e.img().attr("src",this.values.server_original)).click(function(){this.useValue(this.values.server_original);k.add(g).removeClass("selected");g.addClass("selected")}.bind(this));k.append(e.img().attr("src",this.values.local_edited)).click(function(){this.useValue(this.values.local_edited);k.add(g).removeClass("selected");k.addClass("selected")}.bind(this));l.append(j,i);f.append(g,k);h.append(l,f);return h}});var a=new JS.Class(Spontaneous.FieldTypes.FileField,{is_image:function(){return true},unload:function(){this.callSuper();this.image=null;this._progress_bar=null},progress_bar:function(){if(!this._progress_bar){var g=e.div(".drop-upload-outer").hide();var f=e.div(".drop-upload-inner").css("width",0);g.append(f);this._progress_bar=f}return this._progress_bar},upload_complete:function(f){this.callSuper(f)},upload_progress:function(f,g){this.spinner().stop();this.waiting.find(":visible").hide();this.callSuper()},preview:function(){Spontaneous.UploadManager.register(this);var l=this.get("value"),h=null,i=45;if(l===""){h=e.img(".missing-image",{src:"/@spontaneous/static/px.gif"})}else{h=e.img({src:l})}h.error(function(){d(this).addClass("missing")});h.load(function(){var q=this.width/this.height,t=d(this),p=t.height(),s=0;if(q>=1&&p<=i){var s=(i-p)/2}t.css("top",e.px(s))});this.image=h;var n=e.div(".image-outer");var j=e.div(".image-drop");var o=e.div(".waiting").hide();n.append(h);n.append(o);n.append(j);j.append(this.progress_bar().parent());this.waiting=o;var f=function(s){s.stopPropagation();s.preventDefault();j.removeClass("drop-active").addClass("uploading");var r=s.dataTransfer.files;this.waiting.show();this.spinner().indeterminate();if(r.length>0){this.selected_files=r;var q=r[0],p=window.URL.createObjectURL(q);this._edited_value=p;this.image.__start_upload=true;this.image.bind("load",function(){if(this.image.__start_upload){this.image.__start_upload=false;b.Ajax.test_field_versions(this.content,[this],this.upload_values.bind(this),this.upload_conflict.bind(this))}}.bind(this));this.image.attr("src",p);window.URL.revokeObjectURL(p)}return false}.bind(this);var k=function(p){p.stopPropagation();p.preventDefault();d(this).addClass("drop-active");return false}.bind(j);var g=function(p){p.stopPropagation();p.preventDefault();return false}.bind(j);var m=function(p){p.stopPropagation();p.preventDefault();d(this).removeClass("drop-active");return false}.bind(j);j.get(0).addEventListener("drop",f,true);j.bind("dragenter",k).bind("dragover",g).bind("dragleave",m);this.drop_target=j;this.preview_img=h;return n},upload_values:function(){var f=this.selected_files[0];b.UploadManager.replace(this,f)},upload_conflict:function(g){console.log("conflicted_fields",g);var f=new b.ConflictedFieldDialogue(this,g);f.open()},conflicts_resolved:function(f){console.log("conflicts_resolved",f);var g=f[0];this.set_edited_value(g.value);this.set_version(g.version);if(this.is_modified()){this.upload_values()}else{this.disable_progress()}},disable_progress:function(){this.spinner().stop();this.callSuper()},spinner:function(){if(!this._spinner){this._spinner=Spontaneous.Progress(this.waiting[0],16,{spinner_fg_color:"#fff",period:800});this._spinner.init()}return this._spinner},upload_complete:function(g){this.callSuper(g);if(g){console.log("upload complete",g);this.set("value",g.src);if(this.image){var f=new Image();f.onload=function(){this.image.attr("src",g.src)}.bind(this);f.src=g.src}}},width:function(){if(this.data.values&&this.data.values.original){return this.data.values.original.width}return 0},height:function(){if(this.data.values&&this.data.values.original){return this.data.values.original.height}return 0},edit:function(){var l=e.div({style:"position:relative;"});var j=this.value();var B=e.img({src:j}).load(function(){if(this.width>=this.height){l.addClass("landscape")}else{l.removeClass("landscape")}});var x,f,y,w;x=e.div(".info");f=e.div(".sizes");filename_info=e.div(".filename");y=e.div(".filesize");w=e.div(".dimensions");f.append(y,w);x.append(filename_info);x.append(f);var i=function(C,s){if(C&&s){w.text(C+"x"+s)}else{w.text("")}};var q=function(C,D,E,s){filename_info.text(C);y.text(parseFloat(D,10).to_filesize());i(E,s)};var h=function(D){if(D.length>0){var C=D[0],s=window.URL.createObjectURL(C);B.attr("src",s).removeClass("empty");this.selected_files=D;B.attr("src",s);this._edited_value=s;this.image.attr("src",s);window.URL.revokeObjectURL(s);q(C.fileName,C.fileSize,null,null)}}.bind(this);var v=function(){var s=this.input[0].files;h(s)}.bind(this);var o=this.get_input().change(v);var A=function(){o.trigger("click");return false};if(j==""){B.addClass("empty")}var g=e.div(".image-drop").click(A);var n=e.div(".actions");var r=this.data.values.original;n.append(o);l.append(g);var k=function(C){C.stopPropagation();C.preventDefault();g.removeClass("drop-active");var s=C.dataTransfer.files;h(s);return false}.bind(this);var m=function(s){s.stopPropagation();s.preventDefault();d(this).addClass("drop-active");return false}.bind(g);var u=function(s){s.stopPropagation();s.preventDefault();return false}.bind(g);var z=function(s){s.stopPropagation();s.preventDefault();d(this).removeClass("drop-active");return false}.bind(g);g.get(0).addEventListener("drop",k,true);g.bind("dragenter",m).bind("dragover",u).bind("dragleave",z);l.append(B,n,x);if(r){var p=r.src.split("/"),t=p[p.length-1];q(t,r.filesize,r.width,r.height)}this.preview_img=B;return l},edited_value:function(){return this.input().val()},cancel_edit:function(){this.image.attr("src",this.get("value"))},conflict_view:function(f,g){return new c(f,g)},original_value:function(){return this.value()},edited_value:function(){return this._edited_value},set_edited_value:function(f){this.preview_img.attr("src",f);this.callSuper(f)}});a.ConflictView=c;return a})(jQuery,Spontaneous);
63
- Spontaneous.FieldTypes.MarkdownField=(function(h,f){var e=f.Dom;var i=new JS.Class({name:"",pre:"",post:"",extend:{get_state:function(q){var w=q[0].selectionStart,p=q[0].selectionEnd,u=q.val(),t=u.substr(0,w),r=u.substr(w,(p-w)),v=u.substr(p),s;s={start:w,end:p,before:t,middle:r,selection:r,after:v};return s}},initialize:function(p){this.input=p.bind("keydown.markdown",function(r){var q=String.fromCharCode(r.keyCode);if((r.ctrlKey||r.metaKey)&&q===this.key_shortcut()){this.execute(r);return false}}.bind(this))},key_shortcut:function(){return""},execute:function(p){this.wrap()},wrap:function(){var r=this.input,u=this.fix_selection(),x=u.start,p=u.end,v=u.before,t=u.selection,w=u.after,q;if(this.matches_selection(t)){q=this.remove(t)}else{q=this.surround(t)}r.val(v+q+w);r[0].selectionStart=x;r[0].selectionEnd=x+q.length},get_state:function(){return i.get_state(this.input)},fix_selection_whitespace:function(s){var r=s.selection,p,q;p=/^( +)/.exec(r);if(p){q=p[1].length;s.start+=q;s.selection=r.substr(q)}p=/( +)$/.exec(r);if(p){q=p[1].length;s.end-=q;s.selection=r.substr(0,r.length-q)}return s},expand_selection:function(q){q=this.fix_selection_whitespace(q);var w=q.selection,u,s=q.start,v=q.end,p=this.pre.replace(/\*/g,"\\*"),z=this.post.replace(/\*/g,"\\*");u=(new RegExp("(?:^| )("+p+"[^("+p+")]*)$","m")).exec(q.before);if(u){s-=u[1].length;w=u[1]+w}u=(new RegExp("^([^("+z+")]*?"+z+")[^("+z+")w ]*?( |$)","")).exec(q.after);if(u){v+=u[1].length;w+=u[1]}if((v-s)>0){if(w.indexOf(this.pre)!==0){var t;for(var x=0,y=this.pre.length;x<y;x++){t=q.before.substr(-(x+1))+w;if(t.indexOf(this.pre)===0){s-=(x+1);w=t;break}}}if(w.substr(-this.post.length)!==this.post){var t;for(var x=0,y=this.post.length;x<y;x++){t=w+q.after.substr(0,(x+1));if(t.substr(-this.post.length)===this.post){v+=(x+1);w=t;break}}}}else{var r="\\s\\b\\.,";u=(new RegExp("(?:["+r+"]|^)([^"+r+"]+)$","")).exec(q.before);if(u){s-=u[1].length;w=u[1]+w}u=(new RegExp("^([^"+r+"]*)(?:["+r+"]|$)","")).exec(q.after);if(u){v+=u[1].length;w+=u[1]}}return{start:s,end:v,selection:w}},fix_selection:function(){var p=this.get_state(),q;if(!this.matches_selection(p.selection)){q=this.expand_selection(p);h.extend(p,q);p=this.update_state(p)}return p},update_state:function(p){this.input[0].setSelectionRange(p.start,p.end);return this.get_state()},surround:function(p){return this.pre+p+this.post},remove:function(p){return p.substr(this.pre.length,p.length-this.pre.length-this.post.length)},value:function(){return this.input.val()},button:function(){if(!this._button){var p=e.a(this.name.toLowerCase()).click(function(q){this.execute(q);return false}.bind(this)).text(this.name);this._button=p}return this._button},respond_to_selection:function(p){this.deactivate();if(this.matches_selection(p.selection)||this.matches_selection(this.expand_selection(p).selection)){this.activate();return true}else{this.deactivate();return false}},activate:function(){this.button().addClass("active")},deactivate:function(){this.button().removeClass("active")},matches_removal:function(p){return this.matches_selection(p)},matches_selection:function(p){return(p.indexOf(this.pre)===0&&p.lastIndexOf(this.post)===(p.length-this.post.length))}});var o=new JS.Class(i,{name:"Bold",pre:"**",post:"**",key_shortcut:function(){return"B"},});var j=new JS.Class(i,{name:"Italic",pre:"_",post:"_",key_shortcut:function(){return"I"},});var b=new JS.Class(i,{name:"UL",pre:"*",post:"",br:/\r?\n/,strip_bullet:/^ *(\d+\.|\*) */,is_list_entry:/(?:\r?\n)( *\*{1} +.+?)$/,surround:function(s){var p=s.split(this.br);for(var q=0,r=p.length;q<r;q++){if(/^\s*$/.test(p[q])){}else{p[q]=this.bullet_for(q)+p[q].replace(this.strip_bullet,"")}}return p.join("\n")},remove:function(s){var p=s.split(this.br);for(var q=0,r=p.length;q<r;q++){p[q]=p[q].replace(this.strip_bullet,"")}return p.join("\n")},expand_selection:function(t){var s=(t.selection||""),p,u=t.start,q=t.end,r=/\r?\n/;p=this.strip_bullet.exec(s);if(!p){p=this.is_list_entry.exec(t.before);if(p){u-=p[1].length;s=p[1]+s;p=/^(.*?)(?:\r?\n)/.exec(t.after);if(p){q+=p[1].length;s+=p[1]}}}return{selection:s,start:u,end:q}},bullet_for:function(p){return"* "},matches_selection:function(p){return/^ *\* +/.test(p)}});var d=new JS.Class(b,{name:"OL",is_list_entry:/(?:\r?\n)( *\d+\..+?)$/,bullet_for:function(p){return(p+1)+". "},matches_selection:function(p){return/^ *\d+\./.test(p)}});var m=new JS.Class(i,{name:"H1",pre:"",post:"=",scale:1,key_shortcut:function(){return"1"},surround:function(u){if(this.matches_removal(u)){u=this.remove(u)}var p="",v=Math.floor(this.input.attr("cols")*0.5),q=/([\r\n]+)$/,t=q.exec(u),s;t=(!t||(t===s)?"":t[1]);for(var r=0;r<v;r++){p+=this.post}return u.replace(q,"")+"\n"+p+t},remove:function(t){var q=new RegExp("[\r\n][=-]+"),p=t.replace(q,"");return p.replace(/ +$/,"")},matches_removal:function(p){return(new RegExp("[\r\n][=\\-]+[\r\n ]*$")).exec(p)},matches_selection:function(p){return(new RegExp("[\r\n]?"+this.post+"+[\r\n ]*$","m")).exec(p)},expand_selection:function(q){var z=(q.selection||""),w,t=q.start,y=q.end,D=/\r?\n/,B=false;w=/[\r\n]([=-]+)$/.exec(q.before);n=/^([=-]+)[\r\n]/.exec(q.after);if(w||n){w=/(?:[\n]|^)(.+[\n]+([=-]+))$/.exec(q.before);if(w){var G=w[1];t-=G.length;z=G+z}if(n){var G=n[1];y+=G.length;z+=G}B=true}if(!B){w=/(.+)$/.exec(q.before);if(w){var G=w[1];t-=G.length;z=w[1]+z}w=/^(.+)/.exec(q.after);if(w){var G=w[1];y+=G.length;z+=w[1]}var F=z.split(D),u=new RegExp("^[=-]+$"),E=false;for(var A=0,C=F.length;A<C;A++){var x=F[A];if(u.test(x)){E=true;break}}if(!E){F=q.after.split(D,2);for(var A=0,C=F.length;A<C;A++){var x=F[A];if(u.test(x)){y+=x.length+A;z+=x;break}}}else{var p=new RegExp("^([=-]+)"),w=p.exec(q.after);if(w){var v=w[1];y+=v.length;z+=w[1]}}}return{selection:z,start:t,end:y}}});var k=new JS.Class(m,{name:"H2",post:"-",scale:1.2,key_shortcut:function(){return"2"},});var l=new JS.Class(Spontaneous.PopoverView,{initialize:function(r,p,q){this.editor=r;this.link_text=p;this.url=q;this.callSuper()},width:function(){return 300},title:function(){return"Insert Link"},close_text:function(){return"Cancel"},view:function(){var s=this,p=e.div(".pop-insert-link"),u,r;var q=function(w,z,y){var v,x=e[(y||"input")]({type:"text"}).keypress(function(A){if(A.charCode===13){s.insert_link_and_close(u,r);return false}}).val(z);v=e.label().append(e.span().text(w)).append(x);return v};u=q("Text",this.link_text);r=q("URL",this.url,"textarea");r.find("textarea").attr("rows",3);cancel=e.a(".button.cancel").text("Clear").click(function(){this.insert_link_and_close(u,r.val(""));return false}.bind(this)),insert=e.a(".button").text("OK").click(function(){this.insert_link_and_close(u,r);return false}.bind(this));p.append(e.p().append(u)).append(e.p().append(r));var t=e.div(".buttons");r=r.find(":input");u=u.find(":input");this.text_input=u;this.url_input=r;this.page_browser=new g(this.url,this);p.append(this.page_browser.view());p.append(t.append(cancel).append(insert));this.wrapper=p;return p},insert_link:function(q,p){this.editor.insert_link(q.val(),p.val())},insert_link_and_close:function(q,p){this.insert_link(q,p);this.close()},cancel:function(){this.close()},after_open:function(){this.wrapper.find("textarea").select()},after_close:function(){this.editor.dialogue_closed()},page_selected:function(p){this.url_input.val(p.path)}});var g=new JS.Class({initialize:function(p,q){this.parent=q;this.location=p;this.browser=new Spontaneous.PageBrowser(this.location);this.browser.set_manager(this)},view:function(){var p=e.div();text=e.span().text("Page Browser"),inner=e.div(".link-page-browser");inner.append(e.label().append(text)).append(this.browser.view());p.append(inner);return p},page_list_loaded:function(p){},page_selected:function(p){this.parent.page_selected(p)},next_level:function(p){this.location=p}});var a=new JS.Class(i,{name:"Link",link_matcher:/^\[([^\]]+)\]\(([^\)]+)\)$/,execute:function(r){var y=this.input,A=this.fix_selection(),t=A.start,v=A.end,x=A.before,B=A.middle,q=A.after,w,u=this.link_matcher.exec(B),z=B,p;if(u){z=u[1];p=u[2]}if(!this._dialogue){this._dialogue=Spontaneous.Popover.open(r,new l(this,z,this.preprocess_url(z,p)))}else{this._dialogue.close();this._dialogue=null}this.input.focus();return false},expand_selection:function(s){s=this.fix_selection_whitespace(s);var r=s.selection,p,t=s.start,q=s.end;p=/(\[[^\)]*?)$/.exec(s.before);if(p){t-=p[1].length;r=p[1]+r}p=/^([^\)\[]*?\))/.exec(s.after);if(p){q+=p[1].length;r+=p[1]}return{selection:r,start:t,end:q}},preprocess_url:function(q,p){if(!p){p=this.postprocess_url(String(q))||""}return p},postprocess_url:function(p){if(p){if(/^(https?|mailto|ftp|javscript):/.test(p)){p=p}else{if(/^[a-z-]+\.([a-z-]+\.)*[a-z]{2,}(\/[^ ]*)*$/i.exec(p)){p="http://"+p}else{if(/^[^ @]+@([a-z-]+\.)+[a-z]{2,}$/i.exec(p)){p="mailto:"+p}else{return false}}}}return p},dialogue_closed:function(){this._dialogue=null;this.input.focus()},insert_link:function(r,p){p=this.postprocess_url(p)||p;var q=function(s){return this.surround_with_link(r,p)}.bind(this);this.surround=q;this.remove=q;this.wrap()},surround_with_link:function(q,p){if(p===""){return q}else{return"["+q+"]("+p+")"}},remove_link:function(q){var p=this.link_matcher.exec(q);return p[1]},matches_selection:function(p){return this.link_matcher.exec(p)}});var c=new JS.Class(Spontaneous.FieldTypes.StringField,{actions:[o,j,m,k,b,d,a],input:function(){if(!this._input){this._input=e.textarea(e.id(this.css_id()),{name:this.form_name(),rows:10,cols:90}).val(this.unprocessed_value())}return this._input},on_focus:function(){if(!this.expanded){var p=this.input(),s=p.innerHeight();p.data("original-height",s);var t=p[0].scrollHeight,q=500,r=Math.min(t,q);if(Math.abs(r-s)>20){p.animate({height:r});this.expanded=true}}this.callSuper()},on_blur:function(){if(this.expanded){var p=this.input();p.animate({height:p.data("original-height")});this.expanded=false}this.callSuper()},toolbar:function(){if(!this._toolbar){this._wrapper=e.div([e.id("editor-"+this.css_id()),".markdown-editor"]);this._toolbar=e.div(".md-toolbar");this.commands=[];var p=this.input();for(var q=0,u=this.actions,r=u.length;q<r;q++){var t=u[q],s=new t(p);this.commands.push(s);this._toolbar.append(s.button())}this._wrapper.append(this._toolbar);p.css("height","")}return this._wrapper},edit:function(){this.expanded=false;var p=this.input();p.unbind("select.markdown").unbind("click.markdown").unbind("keyup.markdown");p.bind("select.markdown",this.on_select.bind(this));p.bind("click.markdown",this.on_select.bind(this));p.bind("keyup.markdown",this.on_select.bind(this));return p},close_edit:function(){this._input=null;this._toolbar=null;this.commands=[];this.expanded=false;this.callSuper()},on_select:function(p){var q=i.get_state(this.input());h.each(this.commands,function(){this.respond_to_selection(q)})}});c.extend({TextCommand:i,Bold:o,Italic:j,UL:b,OL:d,H1:m,H2:k,Link:a});return c})(jQuery,Spontaneous);
64
- Spontaneous.FieldTypes.DateField=(function(c,a){var d=a.Dom;var b=new JS.Class(Spontaneous.FieldTypes.StringField,{});return b})(jQuery,Spontaneous);
65
- Spontaneous.ContentArea=(function(c,b){var d=b.Dom;var a=new JS.Singleton({include:Spontaneous.Properties,wrap:null,preview:null,editing:null,mode:"edit",init:function(){this.wrap=d.div("#content");this.preview=b.Preview.init(this.wrap);this.editing=b.Editing.init(this.wrap);return this.wrap},location_changed:function(e){this.goto_page(e)},display:function(e){this.mode=e;this.current().display(b.Location.location())},current:function(){if(this.mode==="preview"){this.editing.hide();this.preview.show();return this.preview}else{if(this.mode==="edit"){this.preview.hide();this.editing.show();return this.editing}}},goto_page:function(e){this.current().goto_page(e)}});return a})(jQuery,Spontaneous);
66
- Spontaneous.Preview=(function(d,b){var f=b.Dom,a=0;var e=function(){return"?__click="+(++a)};var c=new JS.Singleton({include:Spontaneous.Properties,element:function(){return wrap},title:function(){return this.get("title")||""},init:function(g){this.iframe=f.iframe("#preview_pane",{src:"about:blank"});this.iframe.hide();g.append(this.iframe);return this},display:function(g){var h=b.Location.get("path");this.iframe.show().fadeOut(0);this.iframe.bind("load.preview",function(){var i=this;d(this.contentWindow.document).ready(function(){d(i).fadeIn(100)});b.Preview.set({title:this.contentWindow.document.title,path:this.contentWindow.location.pathname});b.Location.load_path(this.contentWindow.location.pathname)});this.goto_path(h)},goto_path:function(g){if(g){g+=e();this.iframe[0].contentWindow.location.href=g}},goto_page:function(g){if(g){this.goto_path(g.path)}},hide:function(){this.iframe.unbind("load.preview").hide()},show:function(){this.iframe.show()}});return c})(jQuery,Spontaneous);
67
- Spontaneous.Editing=(function(c,b){var e=b.Dom,a=b.Page;var d=new JS.Singleton({include:Spontaneous.Properties,init:function(f){this.container=e.div("#data_pane");this.container.hide();f.append(this.container);return this},display:function(f){this.goto_page(f)},goto_page:function(f){if(!f){return}this.container.show().fadeOut(0);b.Ajax.get("/page/{id}".replace("{id}",f.id),this.page_loaded.bind(this));this.set("location",f)},page_loaded:function(g){var f=this.get("page");if(f){f.unload()}f=new a(g);view=new b.Views.PageView(f);this.container.empty();this.container.append(view.panel());this.set("page",f);this.container.fadeIn(300)},hide:function(){this.container.hide()},show:function(){this.container.show()}});return d})(jQuery,Spontaneous);
68
- Spontaneous.Location=(function(e,c){var d=c.Ajax;var b=new JS.Class({initialize:function(f){this.page_id=false;this.mode=null;if(f){this.hash=f.substr(1);this.parse_hash()}},parse_hash:function(){var f=this.hash.split("@"),h=f[0],i=f[1];var g=h.split("/");g.shift();if(g.length>0){this.page_id=g[0]}this.mode=i},restore:function(){if(this.mode){Spontaneous.Location.view_mode_changed(this.mode);Spontaneous.TopBar.set_mode(this.mode)}if(this.page_id){Spontaneous.Location.load_id(this.page_id)}else{Spontaneous.Location.load_path("/")}},to_hash:function(){return"#/"+(this.page_id||"")+(this.mode?("@"+this.mode):"")}});b.extend({restore:function(){var f=new b(window.location.hash);f.restore()},page:function(f,h){var g=new b;g.page_id=f.id;g.mode=h;window.location.hash=g.to_hash()}});var a=new JS.Singleton({include:Spontaneous.Properties,init:function(g){var f=function(){g();this.location_loaded()}.bind(this);g();b.restore();e(window).bind("hashchange",b.restore)},page_loaded:function(f){},slot_changed:function(f){},view_mode_changed:function(f){this.set("view_mode",f);if(this.get("location")){this.update_state(this.get("location"),f)}},load_map:function(){},location_loaded:function(g,f,i){if(f!=="success"){if(i.status===406){var h=new Spontaneous.AddHomeDialogue(Spontaneous.Types.get("types"));h.open()}}else{this.set("location",g);this.set("path",g.path);this.update_state(g,this.get("view_mode"))}},update_state:function(f,g){b.page(f,g)},load_id:function(g){var f=this.location();if(!f||g!=f.id){this.find_id(g)}},load_path:function(f){this.find_path(f)},url:function(){var f=this.location();return(f?f.url:"/about")},location:function(){return this.get("location")},update:function(f){this.set("location",f);this.path_from_url(f.url)},current_path:function(){return this.path_from_url(this.url())},find_path:function(f){console.log("find_path",this.location(),f);if(this.location()&&f===this.location().path){return this.location()}d.get("/location"+f,this.location_loaded.bind(this))},find_id:function(f){if(this.location()&&f===this.location().id){return this.location()}d.get("/map/"+f,this.location_loaded.bind(this))},path_from_url:function(g){var f=this.get("map"),j=f.children,p=[],m,o,l=g.split("/").slice(1),n=0;p.push({selected:0,pages:[f],root:true});while(n<l.length){for(m=0,o=j.length;m<o;m++){var h=j[m],k=h.url.split("/").slice(-1)[0];if(k===l[n]){p.push({selected:m,pages:j});j=h.children;break}}n+=1}return p}});return a})(jQuery,Spontaneous);
69
- Spontaneous.State=(function(e,c){var d=c.Ajax;var b=new JS.Class({initialize:function(f){this.content=f;this.state=this.load()},load:function(){var f=(localStorage.getItem(this.storage_key())||"{}");try{return JSON.parse(f)}catch(g){return{}}},save:function(){localStorage.setItem(this.storage_key(),this.toString())},storage_key:function(){return"content-state-"+this.content.id()},activate_box:function(f){this.state.box=f.id()},active_box:function(){return this.state.box},activate_slot:function(f){this.state.slot=f.id()},active_slot:function(){return this.state.slot},toString:function(){return JSON.stringify(this.state)}});var a=new JS.Singleton({get:function(g){var f=new b(g);return f},activate_box:function(h,g){var f=this.get(h);f.activate_box(g);f.save()},active_box:function(g){var f=this.get(g);return f.active_box()},activate_slot:function(g,h){var f=this.get(g);f.activate_slot(h);f.save()},active_slot:function(g){var f=this.get(g);return f.active_slot()}});return a}(jQuery,Spontaneous));
70
- Spontaneous.TopBar=(function(d,c){var b=c.Dom;var i=function(j){this.page=j;this.id=j.id;this.url=j.url;this.title=j.title};i.prototype={element:function(){var j=b.li(".root");var k=b.a({href:this.url}).text(this.title).data("page",this.page);k.click(function(){var l=d(this).data("page");c.Location.load_id(l.id);return false});j.append(k);this.link=k;return j},set_title:function(j){this.link.text(j)}};var a=function(j){this.page=j;this.id=j.id;this.title=j.title;this.path=j.path};a.prototype={element:function(){var j=b.li().append(d("<a/>").data("page",this.page).click(function(){var k=d(this).data("page");c.Location.load_id(k.id)}).text(this.title));return j}};var e=function(l){this.page=l;this.id=l.id;this.path=l.path;this.title=l.title;this.pages=l.generation.sort(function(q,p){var o=q.title,n=p.title;if(o==n){return 0}return(o<n?-1:1)});for(var j=0,k=this.pages.length;j<k;j++){var m=this.pages[j];if(m.id===this.id){this.selected=j;break}}};e.prototype={element:function(){var k=b.li();var j=b.select();j.change(function(){var p=d(this.options[this.selectedIndex]).data("page");c.Location.load_id(p.id);return false});for(var l=0,n=this.pages.length;l<n;l++){var o=this.pages[l],m=b.option({value:o.id,selected:(l==this.selected)}).text(o.title).data("page",o);if(o.id===this.id){this.title_option=m}j.append(m)}k.append(j);return k},set_title:function(j){this.title_option.text(j)}};var h=function(j){this.children=j};h.prototype={element:function(){var k=b.li();var j=b.select(".unselected");this.li=k;this.select=j;j.append(b.option().text(this.status_text()));j.change(function(){var o=d(this.options[this.selectedIndex]).data("page");if(o){c.Location.load_id(o.id())}return false});for(var l=0,m=this.children.length;l<m;l++){var n=this.children[l];j.append(this.option_for_entry(n))}k.append(j);return k},status_text:function(){if(this.children.length===0){this.select.hide()}else{this.select.show()}return"("+(this.children.length)+" pages)"},option_for_entry:function(k){var j=b.option({value:k.id()}).text(k.title()).data("page",k);k.title_field().watch("value",function(l){j.text(l)}.bind(this));return j},update_status:function(){var j=this.select.find("option:first-child");j.text(this.status_text());return j},add_page:function(k,j){this.children.splice(0,0,k);var l=this.update_status();l.after(this.option_for_entry(k))},remove_page:function(o){var l=0;for(var m=0,n=this.children.length;m<n;m++){if(this.children[m].id()===o.id()){l=m;break}}this.children.splice(l,1);this.update_status();var k=this.select.find("option:gt(0)"),j;k.each(function(){if(d(this).data("page").id()===o.id()){d(this).remove()}})}};var g=new JS.Class({rapid_check:2000,normal_check:10000,initialize:function(){this.status=false;this.set_interval(this.normal_check);this.check_status()},check_status:function(){c.Ajax.get("/publish/status",this.status_recieved.bind(this))},status_recieved:function(j,k){if(k==="success"&&j!=this.status){this.update_status(j)}window.setTimeout(this.check_status.bind(this),this.timer_interval)},update_status:function(j){if(j===null||j===""){return}var l=j.status,k=j.progress;if(this.in_progress&&(l==this.current_action&&k==this.current_progress)){return}this.current_action=l;this.current_progress=k;if(l===null||l===""||l==="complete"||l==="error"){if(this.in_progress){this.in_progress=false;this.progress().stop();this.set_interval(this.normal_check);this.set_label("Publish");this.button().switchClass("progress","");this.current_action=this.current_progress=null}if(l==="error"){alert("There was a problem publishing: "+k)}}else{this.publishing_state();if(l==="rendering"){this.progress().update(k)}else{this.progress().indeterminate()}}},publishing_started:function(){this.publishing_state();this.progress().indeterminate()},publishing_state:function(){this.set_interval(this.rapid_check);this.set_label("Publishing");var j=this.button();this.current_action=this.current_progress=null;if(!j.hasClass("progress")){j.switchClass("","progress")}this.in_progress=true},set_label:function(j){if(j!==this._label_text){this._label_text=j;this._label.text(j)}},button:function(){if(!this._button){this._progress_container=b.span("#publish-progress");this._label=b.span();this._button=b.a("#open-publish").append(this._progress_container).append(this._label);this.set_label("Publish");this._button.click(function(){if(!this.in_progress){c.Publishing.open_dialogue()}}.bind(this))}return this._button},progress:function(){if(!this._progress){this._progress=Spontaneous.Progress("publish-progress",15,{spinner_fg_color:"#ccc",progress_fg_color:"#666"});this._progress.init()}return this._progress},set_interval:function(j){this.timer_interval=j}});var f=new JS.Singleton({include:Spontaneous.Properties,location:"/",panel:function(){this.wrap=b.div("#top");this.location=b.ul("#navigation");this.location.append(b.li().append(b.a()));this.mode_switch=b.a("#switch-mode").text(this.opposite_mode(c.ContentArea.mode)).click(function(){c.TopBar.toggle_modes()});this.publish_button=new g();this.wrap.append(this.location);this.wrap.append(this.publish_button.button());this.wrap.append(this.mode_switch);return this.wrap},init:function(){if(!this.get("mode")){this.set("mode",c.ContentArea.mode)}c.Editing.watch("page",this.page_loaded.bind(this))},page_loaded:function(k){if(k){var j=new h(k.children());this.location.append(j.element());k.bind("entry_added",function(m,l){if(m.is_page()){j.add_page(m,l)}});k.bind("removed_entry",function(l){if(l.is_page()){j.remove_page(l)}});k.title_field().watch("value",function(l){this.navigation_current.set_title(l);this.set_browser_title(l)}.bind(this));this.children_node=j}},set_mode:function(j){this.set("mode",j);this.mode_switch.text(this.opposite_mode(j))},toggle_modes:function(){this.set_mode(this.opposite_mode(this.get("mode")))},opposite_mode:function(j){if(j==="preview"){return"edit"}else{if(j==="edit"){return"preview"}}},publishing_started:function(){this.publish_button.publishing_started()},set_browser_title:function(j){document.title=c.site_domain+" | Editing: '"+j+"'"},location_changed:function(j){this.set_browser_title(j.title);this.set("location",j);this.update_navigation()},update_navigation:function(){var k=[];var t=this.get("location");var r=this.location;var v=t.ancestors;var s,p=false,l,j,n;if(v.length===0){s=t;p=true}else{s=v.shift()}l=new i(s);k.push(l);for(var o=0,u=v.length;o<u;o++){var q=v[o];var m=new a(q);k.push(m)}if(!p){n=new e(t);k.push(n)}else{n=l}d("li:gt(0)",r).remove();for(var o=0,u=k.length;o<u;o++){var m=k[o];r.append(m.element())}this.navigation_current=n;this.page_loaded=function(w){}}});return f})(jQuery,Spontaneous);
71
- Spontaneous.FieldPreview=(function(b,a){var d=a.Dom;var c=new JS.Class({initialize:function(f,e){this.view=f;this.wrap_id=e},depth_class:function(){return"depth-"+this.view.depth()},has_fields:function(){return this.view.has_fields()},panel:function(){var e=d.div([d.id(this.wrap_id),"fields-preview",this.depth_class()]);e.append(this.fields_panel(this.view.text_fields(),"text"));e.append(this.fields_panel(this.view.image_fields(),"image",true));if(this.view.mouseover){e.mouseover(this.view.mouseover.bind(this.view))}if(this.view.mouseout){e.mouseout(this.view.mouseout.bind(this.view))}e.click(function(){this.view.edit(this.field_to_edit)}.bind(this));return e},fields_panel:function(e,g,h){var i=d.ul(".fields-preview-"+g),f=this;if(e.length===0){i.addClass("empty")}b.each(e,function(l,n){var j=d.li();var k=d.div(".name").text(n.title);var m=d.div(".value").html(n.preview());j.click(function(){f.field_to_edit=n});n.activate(m);if(!h){n.watch("value",function(p,o){b(this).html(p.preview())}.bind(m,n))}j.append(k).append(m);i.append(j)});return i}});return c})(jQuery,Spontaneous);
72
- Spontaneous.BoxContainer=(function(c,b){var d=b.Dom;var a=new JS.Class(b.Views.View,{initialize:function(f,e){this.callSuper(f);this.wrap_id=e;this.box_content_container=d.div()},panel:function(){var f=d.div([d.id(this.wrap_id),"slots"]);f.append(this.tab_bar());f.append(this.box_content_container);var e=Spontaneous.State.active_box(this.content);this.activate_id(e);return f},tab_bar:function(){if(this.boxes().length===0){return""}if(!this._tab_bar){var l=d.ul(".slot-tabs");for(var g=0,f=this.boxes(),h=f.length;g<h;g++){var k=f[g];var e=d.li();e.text(k.name());e.append(d.span(".down"));var j=function(i){this.activate(i,true)}.bind(this,g);e.click(j);l.append(e)}this._tab_bar=l}return this._tab_bar},activate:function(g,e){var f=this.boxes()[g];if(f===this._active_box){return}c("li",this.tab_bar()).removeClass("active");c("li:nth-child("+(g+1)+")",this.tab_bar()).addClass("active");f.activate();this._active_box=f;if(e){Spontaneous.State.activate_box(this.content,f);this.content.set("box",f)}},activate_id:function(j){if(j){for(var f=0,e=this.boxes(),h=e.length;f<h;f++){var g=e[f];if(e[f].id()===j){this.activate(f);return}}}this.activate(0)},boxes:function(){if(!this._boxes){var h=[],g=this.box_content_container;var e=function(f,j){h.push(new Spontaneous.Views.BoxView(j,g))}.bind(this);c.each(this.content.boxes(),e);this._boxes=h}return this._boxes}});return a})(jQuery,Spontaneous);
73
- Spontaneous.Progress=(function(c,b){var a=function(g,e,d){var h={spinner_fg_color:"#000000",spinner_bg_color:null,progress_fg_color:"#000000",progress_bg_color:false,spinner_alpha:1,progress_alpha:1,period:550,segments:12,segment_length:0.47,segment_width:0.6,trail_length:1.1,rounded:true,shaded:false,};if(typeof d=="undefined"){d={}}var f={};for(k in h){f[k]=h[k]}for(k in d){f[k]=d[k]}return{container:g,size:e,_canvas:false,defaults:h,options:f,_color:{},init:function(){var i=this.canvas()},context:function(){return this.canvas().getContext("2d")},colour:function(j,i,m){var n=j+"_"+i+"_color";if(typeof m=="undefined"){m=this.options[j+"_alpha"]}if(!this._color[n]){this._color[n]=this._parse_color(this.options[n])}return"rgba("+this._color[n][0]+", "+this._color[n][1]+", "+this._color[n][2]+", "+m+")"},canvas:function(){var j;if(this.container&&!this._canvas){j=document.createElement("canvas");j.width=this.size;j.height=this.size;var i=null;if(typeof this.container=="string"){this.container=document.getElementById(this.container)}this.container.appendChild(j);this._canvas=j}return this._canvas},_percent:false,update:function(n){this._indeterminate=false;n=Math.max(0.1,parseFloat(n));this._percent=n;var m=this.context();var j=this.size/2;var i=this.size/2;m.clearRect(0,0,this.size,this.size);var o;if(this.options.progress_bg_color){o=this.colour("progress","bg");m.beginPath();m.moveTo(i,i);m.arc(i,i,j,Math.PI*-0.5,Math.PI*2,false);m.closePath();m.fillStyle=o;m.fill()}o=this.colour("progress","fg");var l=(parseFloat(n)/100);m.beginPath();m.moveTo(i,i);m.arc(i,i,j,Math.PI*-0.5,Math.PI*(-0.5+2*l),false);m.lineTo(i,i);m.closePath();m.fillStyle=o;m.fill()},_redraw:function(){if(this._percent){this.update(this._percent)}},_indeterminate:false,_indeterminate_interval:false,indeterminate:function(){if(this._indeterminate){return}this._indeterminate=true;var j=this;var i=function(){j._update_indeterminate()};this._draw_indeterminate();this._indeterminate_interval=setInterval(i,parseFloat(this.options.period)/this.options.segments)},spin:function(){this.indeterminate()},start:function(){this.indeterminate()},_spin_angle:0,_spin_increment:function(){return 2/this.options.segments},_update_indeterminate:function(){if(!this._indeterminate){this.pause();return}this._spin_angle+=this._spin_increment();this._draw_indeterminate()},_draw_indeterminate:function(){var u=this.context();var s=this._radius();var j=this._center();var o=this._spin_increment();u.clearRect(0,0,this.size,this.size);var n=s-(s*this.options.segment_length);var l=((2*Math.PI*n)/this.options.segments)*this.options.segment_width;var m=s;if(this.options.rounded){m-=l/2}for(var r=0;r<this.options.segments;r++){var q=(o*r);var t=Math.PI*(1-this._spin_angle+q);u.beginPath();if(this.options.rounded){this._draw_rounded(u,j,n,m,t,l)}else{this._draw_square(u,j,n,m,t,l)}u.closePath();u.fillStyle=this._fill(u,r);u.fill()}},_draw_rounded:function(t,o,n,m,r,l){var q=Math.sin(r);var s=Math.cos(r);var j=Math.PI-r;var i=2*Math.PI-r;t.arc(o+n*q,o+n*s,l/2,j,i,false);t.arc(o+m*q,o+m*s,l/2,i,j,false)},_draw_square:function(u,C,x,w,D,t){var i=Math.sin(D);var m=Math.cos(D);var s=(t/2)*m;var r=(t/2)*i;var B=C+x*i;var q=C+x*m;var A=C+x*i+s;var o=C+x*m-r;var z=C+w*i+s;var n=C+w*m-r;var y=C+w*i-s;var l=C+w*m+r;var v=C+x*i-s;var j=C+x*m+r;u.moveTo(A,o);u.lineTo(z,n);u.lineTo(y,l);u.lineTo(v,j)},_fill:function(j,l){if(this.options.shaded){return this._shaded_fill(j,l)}else{return this._solid_fill(j,l)}},_solid_fill:function(j,l){return this.colour("spinner","fg",this._alpha_for_segment(l))},_shaded_fill:function(j,l){var n=this._center();var m=j.createRadialGradient(n,n,0,n,n,this._radius());m.addColorStop(0.3,this.colour("spinner","fg",0));m.addColorStop(1,this.colour("spinner","fg",this._alpha_for_segment(l)));return m},_alpha_for_segment:function(l){var i=(l/this.options.segments);var j=Math.max(0,this.options.spinner_alpha*((1/(5*((i/this.options.trail_length)+(1/5.8))))-0.168));return j},_radius:function(){return this.size/2},_center:function(){return this._radius()},_parse_color:function(m){if(m.charAt(0)=="#"){m=m.substr(1,6)}m=m.replace(/ /g,"");m=m.toLowerCase();var n=[];if(m.length==3){for(var l=0;l<3;l++){n[n.length]=m.charAt(l)+m.charAt(l)}}else{for(var l=0;l<3;l++){n[n.length]=m.substr(l*2,2)}}var j=[];for(var l=0;l<n.length;l++){j[l]=parseInt(n[l],16)}return j},pause:function(){this._indeterminate=false;clearInterval(this._indeterminate_interval)},stop:function(){this.pause();this.clear()},clear:function(){this.context().clearRect(0,0,this.size,this.size)},_disappear_interval:null,disappear:function(m){if(typeof m==="undefined"){m=1000}var n=this;var l=this.options.spinner_alpha;var j=(new Date()).valueOf()+m;var i=function(){if(n.options.spinner_alpha<=0){clearInterval(n._disappear_interval);n.stop();n.options.spinner_alpha=l}else{var o=(new Date()).valueOf(),p=(j-o)/m;n.options.spinner_alpha=l*p}};this._disappear_interval=setInterval(i,50)},set_options:function(i){this.options=i;this._color={};this._spin_angle=0;if(this._indeterminate){this.stop();this.indeterminate()}else{this._redraw()}}}};return a})(jQuery,Spontaneous);
74
- Spontaneous.StatusBar=(function(c,b){var d=b.Dom;var a={showing:false,init:function(){this.container=d.div("#status-bar").hide();b.UploadManager.init(this);return this.container},hide:function(){if(!this.showing){return}this.showing=false;var e=200;window.setTimeout(function(){this.container.animate({height:0},e,function(){}.bind(this))}.bind(this),500)},show:function(){if(this.showing){return}this.showing=true;var f=200,e=32;this.container.css("height",0+"px");this.container.show();this.container.animate({height:e},f)},progress_container:function(){if(!this._progress_container){var e=d.div("#progress-container");this.container.append(e);this._progress_container=e}return this._progress_container}};return a})(jQuery,Spontaneous);
75
- Spontaneous.Upload=(function(c,b){var d=(new Date()).valueOf();var a=new JS.Class({initialize:function(f,g,e){this.manager=f;this.field_name=g.schema_id();this.uid=g.uid();this.target=g;this.target_id=g.id();if(g.version){this.target_version=g.version()}this._position=0;this.failure_count=0;this.file=e;this.name=this.file.fileName;this._total=this.file.size;this.upload_id=d++},position:function(){return Math.min(this._total,this._position)},total:function(){return this._total},start:function(){var e=new FormData();e.append("file",this.file);e.append("field",this.field_name);if(this.target_version){e.append("version",this.target_version)}this.post("/file/replace/"+this.target_id,e)},post:function(e,f){this.xhr=new XMLHttpRequest();this.upload=this.xhr.upload;this.xhr.open("POST",this.namespaced_path(e),true);this.upload.onprogress=this.onprogress.bind(this);this.upload.onload=this.onload.bind(this);this.upload.onloadend=this.onloadend.bind(this);this.upload.onerror=this.onerror.bind(this);this.xhr.onreadystatechange=this.onreadystatechange.bind(this);this.started=(new Date()).valueOf();this.xhr.send(f)},namespaced_path:function(e){return b.Ajax.request_url(e,true)},onprogress:function(f){var e=f.position;this._position=e;this.time=(new Date()).valueOf()-this.started;this.manager.upload_progress(this)},onload:function(e){},onloadend:function(e){this.manager.upload_failed(this)},onreadystatechange:function(f){var g=f.currentTarget;if(g.readyState==4){if(g.status===200){if(!this.complete){var e=JSON.parse(g.responseText);this.manager.upload_complete(this,e);this.complete=true}}else{if(g.status===409){this.manager.upload_conflict(this,f)}}}},onerror:function(e){this.failure_count++;this.manager.upload_failed(this)}});return a}(jQuery,Spontaneous));
76
- Spontaneous.ShardedUpload=(function(d,b){var f=b.Dom;var e=(new Date()).valueOf();var a=new JS.Class({initialize:function(i,h,g){this.uploader=i;this.index=h;this.blob=g;this.progress=0;this.size=this.blob.size},start:function(){var g=new FileReader();g.onload=function(h){this.compute_hash(g.result)}.bind(this);g.onerror=function(h){console.error("error",h)};g.readAsArrayBuffer(this.blob)},compute_hash:function(i){var g=new Uint8Array(i);var h=Crypto.SHA1(g);this.hash=h;this.begin_upload();this.failure_count=0},remote_path:function(){return b.Ajax.request_url(["shard",this.hash].join("/"),true)},begin_upload:function(){b.Ajax.get(["/shard",this.hash].join("/"),this.status_complete.bind(this))},status_complete:function(h,g,i){if(g==="success"){this.complete()}else{this.upload()}},retry:function(){if(this.hash){this.upload()}else{this.start()}},upload:function(){var h=new FormData(),i=b.Ajax.request_url(["/shard",this.hash].join("/"),true);h.append("file",this.blob);var j=new XMLHttpRequest(),g=j.upload;j.open("POST",i,true);g.onprogress=this.onprogress.bind(this);g.onload=this.onload.bind(this);g.onloadend=this.onloadend.bind(this);g.onerror=this.onerror.bind(this);j.onreadystatechange=this.onreadystatechange.bind(this);this.started=(new Date()).valueOf();j.send(h)},complete:function(){this.blob=null;this.uploader.shard_complete(this)},failed:function(){this.failure_count+=1;this.uploader.shard_failed(this)},onprogress:function(h){var g=h.position;this.progress=g;this.time=(new Date()).valueOf()-this.started;this.uploader.upload_progress(this)},onload:function(g){},onloadend:function(g){console.error("Shard#onloadend: shard upload failed",g)},onreadystatechange:function(g){var h=g.currentTarget;if(h.readyState==4){if(h.status===200){this.complete()}else{this.failed()}}},onerror:function(g){console.error("Shard#onerror: shard upload error",g)}});var c=new JS.Class(Spontaneous.Upload,{slice_size:524288,initialize:function(h,i,g){this.callSuper();this.completed=[];this.failed=[];this.current=null},start:function(){this.started=(new Date()).valueOf();this.start_with_index(0)},start_with_index:function(g){if(g<this.shard_count()){var h=new a(this,g,this.slice(g));this.current=h;h.start()}else{if(this.failed.length===0){this.finalize()}else{var h=this.failed.pop();console.warn("retrying failed shard",h);this.current=h;h.retry()}}},finalize:function(){var g=new FormData();g.append("field",this.field_name);g.append("version",this.target_version);g.append("shards",this.hashes().join(","));g.append("mime_type",this.mime_type());g.append("filename",this.file.fileName);this.post(this.path(),g)},path:function(){return["/shard/replace",this.target_id].join("/")},hashes:function(){var g=[];for(var h=0,j=this.completed.length;h<j;h++){g.push(this.completed[h].hash)}return g},upload_progress:function(g){this.time=(new Date()).valueOf()-this.started;this.manager.upload_progress(this)},position:function(){var g=0;for(var h=0,k=this.completed,j=k.length;h<j;h++){if(k[h]){g+=k[h].size}}g+=this.current.progress;g=Math.min(g,this.total());return g},mime_type:function(){return this.file.type},total:function(){return this.file.size},shard_complete:function(g){this.manager.upload_progress(this);this.completed[g.index]=g;this.start_with_index(g.index+1)},shard_failed:function(g){console.error("shard failed",g,g.index);this.failed.push(g);this.start_with_index(g.index+1)},shard_count:function(){return Math.ceil(this.file.size/this.slice_size)},slice:function(g){return this.file.slice(g*this.slice_size,(g+1)*this.slice_size)}});c.extend({supported:function(){return((typeof window.File.prototype.slice==="function")&&(typeof window.FileReader!=="undefined")&&(typeof window.Uint8Array!=="undefined"))}});return c}(jQuery,Spontaneous));
77
- Spontaneous.UploadManager=(function(g,c){var h=c.Dom;var b=c.Upload;var a=new JS.Class(b,{start:function(){var i=new FormData();i.append("file",this.file);this.post(["/file/wrap",this.target_id].join("/"),i)}});var e=new JS.Class(c.ShardedUpload,{path:function(){return["/shard/wrap",this.target_id].join("/")},});var d=new JS.Class(b,{initialize:function(j,k,l,i){this.callSuper(j,k,l);this.form_data=this.file;this._total=i;this.name="Saving..."},start:function(){this.post(this.target.save_path(),this.form_data)}});var f={init:function(i){this.status_bar=i;this.pending=[];this.completed=[];this.failed=[];this.current=null;this.updater=null;this.total_time=0;this.total_data=0;this.targets={}},add:function(j,i){this.pending.push(i);this.register(j)},register:function(i){this.targets[i.uid()]=i},unregister:function(i){delete this.targets[i.uid()]},replace:function(k,i){var j=b;if(c.ShardedUpload.supported()){console.log("Using sharded uploader");j=c.ShardedUpload}this.add(k,new j(this,k,i));if(!this.current){this.next()}},wrap:function(p,o){for(var m=0,n=o.length;m<n;m++){var l=o[m],j,k=a;if(c.ShardedUpload.supported()){console.log("Using sharded uploader");k=e}j=new k(this,p,l);this.add(p,j)}if(!this.current){this.next()}},form:function(k,l,i){var j=new d(this,k,l,i);this.add(k,j);if(!this.current){this.next()}},next:function(){if(this.current){return}if(this.pending.length===0){if(this.failed.length===0){this.finished()}else{var j=this.failed.pop(),i=Math.pow(2,j.failure_count);console.log("UploadManager.next","scheduling re-try of failed upload after",i,"seconds");this.pending.push(j);window.setTimeout(function(){console.log("UploadManager.next","re-trying failed upload");this.next()}.bind(this),i*1000)}return}this.init_progress_bar();this.current=this.pending.shift();this.bars.name.text(this.current.name);this.current.start()},finished:function(){this.completed=[];this.status_bar.hide()},init_progress_bar:function(){this.status_bar.show();if(this.progress_showing){return}var n=this.status_bar.progress_container();var l=h.div("#progress-bars");var m=h.div("#progress-total.bar");var i=h.div("#progress-individual.bar");var j=h.div("#progress-name");var k=h.div("#progress-stats");l.append(i);l.append(m);n.append(l);n.append(j).append(k);this.bars={total:m,individual:i,name:j,stats:k};this.progress_showing=true},data_total:function(){var l=0;for(var j=0,k=this.completed.length;j<k;j++){l+=this.completed[j].total()}for(var j=0,k=this.pending.length;j<k;j++){l+=this.pending[j].total()}if(this.current){l+=this.current.total()}return l},data_completed:function(){var l=0;for(var j=0,k=this.completed.length;j<k;j++){l+=this.completed[j].total()}if(this.current){l+=this.current.position()}return l},update_progress_bars:function(){var j=this.data_total(),i=this.data_completed();i=Math.min(j,i);this.set_bar_length("total",i,j);if(this.current){this.set_bar_length("individual",this.current.position,this.current.total);this.bars.stats.text([this.rate(),"Kb/s",this.time_estimate()].join(" "))}else{this.set_bar_length("individual",0,0)}},rate:function(){var i=this.total_time,j=this.total_data;if(this.current){i+=this.current.time;j+=this.current.position()}return Math.round(((j/1024)/(i/1000)*10)/10)},time_estimate:function(){var i=this.data_total()-this.data_completed();var j=(i/1024)/this.rate();return(Math.round(j))+"s"},set_bar_length:function(m,i,l){var k=this.bars[m],j=(i/l)*100;k.css("width",j+"%")},upload_progress:function(i){if(i!==this.current){console.warn("UploadManager#upload_progress","completed upload does not match current")}var j=this.targets[i.uid];if(j){j.upload_progress(i.position(),i.total())}this.update_progress_bars()},upload_complete:function(j,i){if(j!==this.current){console.warn("UploadManager#upload_complete","completed upload does not match current")}this.completed.push(this.current);this.total_time+=this.current.time;this.total_data+=this.current.position();var k=this.targets[j.uid];if(k){k.upload_complete(i)}this.current=null;this.next()},upload_failed:function(i,j){if(i!==this.current){console.warn("UploadManager#upload_complete","completed upload does not match current")}this.failed.push(this.current);var k=this.targets[i.uid];if(k){k.upload_failed(j)}this.current=null;console.error("UploadManager#upload_failed",i,this.failed);this.next()},upload_conflict:function(i,j){if(i!==this.current){console.warn("UploadManager#upload_complete","completed upload does not match current")}var k=this.targets[i.uid];if(k){k.upload_conflict(g.parseJSON(j.currentTarget.response))}this.current=null;console.error("UploadManager#upload_conflict",i,j);this.next()},FormUpload:d,WrapUpload:a};return f}(jQuery,Spontaneous));
78
- Spontaneous.Dialogue=(function(e,d){var f=d.Dom;var c=new JS.Class({initialize:function(g,h,i){this.label=g;this.action=h;this.is_default=i;this.disabled=false},html:function(){var h=f.a(this.css_class()).html(this.label);if(typeof this.action==="function"){var g=this;h.click(function(){if(!g.disabled){g.action()}return false})}this.button=h;return h},css_class:function(){return["button",(this.is_default?"default":""),this.label.toLowerCase().split(" ")[0]].join(" ")},disable:function(){this.set_disabled(true)},enable:function(){this.set_disabled(false)},set_disabled:function(g){this.disabled=g;this.button.removeClass("disabled");if(this.disabled){this.button.addClass("disabled")}}});var a=new JS.Class(c,{initialize:function(g,h){this.callSuper(g+' <span class="key-combo">(Esc)</span>',function(){Spontaneous.Dialogue.cancel()},h)},css_class:function(){return this.callSuper().replace(" cancel","")+" cancel"}});var b=new JS.Class({open:function(){Spontaneous.Dialogue.open(this)},close:function(){Spontaneous.Dialogue.close(this)},width:function(){return"50%"},title:function(){return"Dialogue"},class_name:function(){return""},buttons:function(){},cleanup:function(){},cancel_button:function(){return new a(this.cancel_label())},cancel_label:function(){return"Cancel"},disable_button:function(g){Spontaneous.Dialogue.disable_button(g)}});b.extend({_overlay:false,_open:false,_z_index:1000,_instance:false,open:function(h){if(this._open||!h){return}this._instance=h;e("body").css("overflow","hidden");this.overlay().fadeIn(200);var l=this.container(),i=this._actions,g;var j=h.buttons(),k={};i.empty().append(f.div(".spacer"));g=h.cancel_button();if(g){k.cancel=g;k[h.cancel_label().toLowerCase()]=g;i.append(g.html());e(document).bind("keydown.dialogue",function(m){if(m.keyCode===27){this.cancel()}}.bind(this))}if(j){e.each(j,function(m,p){var n,o=false;if(typeof p==="function"){n=p}else{if(e.isArray(p)){n=p[0];o=p[1]}else{n=p.action;o=p.is_default}}g=new c(m,n,o);i.append(g.html());k[m.toLowerCase()]=g})}this.button_map=k;this._body.empty().append(h.body());l.fadeIn(200);this._open=true},disable_button:function(g){var h=this.button_map[g.toLowerCase()];h.disable()},close:function(){if(!this._instance||!this._open){return}this._instance.cleanup();this.container().remove();this.overlay().fadeOut(200,function(){e("body").css("overflow","auto")});this._instance=this._container=this._open=false;e(document).unbind("keydown.dialogue")},cancel:function(){return this.close()},container:function(){if(!this._container){var h=this._instance;var k=f.div("#dialogue-wrap").css("z-index",this.z_index()).hide();var j=f.div("#dialogue-outer").css("width",h.width()).addClass(h.class_name());var n=f.div("#dialogue-control-wrap");var i=f.div("#dialogue-controls");var m=f.div(".dialogue-actions");var g=f.div("#dialogue-body");var l=f.div("#dialogue-title").append(h.title());i.append(m);n.append(i);j.append(l);j.append(g);j.append(n);k.append(j);e("#content").append(k);this._actions=m;this._title=l;this._container=k;this._body=g}return this._container},overlay:function(){if(!this._overlay){var g=f.div("#dialogue-overlay").css("z-index",this.z_index()).hide();e("#content").append(g);this._overlay=g}return this._overlay},z_index:function(){return ++this._z_index}});return b})(jQuery,Spontaneous);
79
- Spontaneous.EditDialogue=(function(c,b){var d=b.Dom,a=Spontaneous.Dialogue;var e=new JS.Class(a,{initialize:function(f){this.content=f},buttons:function(){var f="Save ("+((window.navigator.platform.indexOf("Mac")===0)?"Cmd":"Ctrl")+"+s)",g={};g[f]=this.save.bind(this);return g},id:function(){return this.content.id()},uid:function(){return this.content.uid()+"!editing"},save:function(){var f=this.form.serializeArray();var h=new FormData();var g=0;c.each(f,function(k,j){h.append(j.name,j.value);g+=(j.name.length+j.value.length)});c("> *",this.form).animate({opacity:0.3},400,function(){Spontaneous.UploadManager.form(this,h,g);c.each(this.content.file_fields(),function(){this.save()})}.bind(this));return false},upload_progress:function(f,g){console.log("EditDialogue.upload_progress",f,g)},upload_complete:function(h){var f=h.fields;for(var j=0,k=f.length;j<k;j++){var g=f[j],l=this.content.field(g.name);l.update(g)}this.close()},cleanup:function(){b.Popover.close();var f=this.content.field_list();for(var g=0,h=f.length;g<h;g++){var j=f[g];j.close_edit()}c(":input",this.form).add(document).unbind("keydown.savedialog")},body:function(){var g=d.form("#editing",{enctype:"multipart/form-data",method:"post"});var p=d.div();p.append(d.div(".field-group-bg.text"));p.append(d.div(".field-group-bg.image"));var l=d.div(".field-group.text");var j=d.div(".field-group.image");var f=this.content.text_fields();var k=d.input({type:"submit"});for(var h=0,o=f.length;h<o;h++){var m=f[h];l.append(this.field_edit(m))}p.append(l);var n=this.content.image_fields();for(var h=0,o=n.length;h<o;h++){var m=n[h];j.append(this.field_edit(m))}p.append(j);p.append(k);g.append(p);__dialogue=this;c("input, textarea",g).focus(function(){__dialogue.field_focus(this)}).blur(function(){});g.submit(this.save.bind(this));this.form=g;c(":input",this.form).add(document).bind("keydown.savedialog",function(q){var i=83;if((q.ctrlKey||q.metaKey)&&q.keyCode===i){this.save();return false}}.bind(this));return this.form},field_focus:function(f){var k=this.content.text_fields(),j=false;for(var g=0,h=k.length;g<h;g++){var l=k[g];if(l.input()[0]===f){j=l;break}}if(j===this.active_field){return}if(this.active_field){this.active_field.on_blur()}if(j){this.active_field=j;this.active_field.on_focus()}},field_edit:function(h){var i=d.div(".field");i.append(d.label(".name",{"for":h.css_id()}).html(h.label()));var g=h.toolbar();if(g){i.append(d.div(".toolbar").html(g))}var f=h.edit();i.append(d.div(".value").html(f));var j=h.footer();if(j){i.append(d.div(".footer").html(j))}return i}});return e})(jQuery,Spontaneous);
80
- Spontaneous.EditPanel=(function(d,b){var e=b.Dom,a=Spontaneous.Dialogue;var c=new JS.Class(a,{initialize:function(f){this.parent_view=f},buttons:function(){var f="Save ("+((window.navigator.platform.indexOf("Mac")===0)?"Cmd":"Ctrl")+"+s)",g={};g[f]=this.save.bind(this);return g},id:function(){return this.parent_view.id()},schema_id:function(){},uid:function(){return this.parent_view.uid()+"!editing"},save:function(){var f=this.parent_view.field_list();console.log("save",f);b.Ajax.test_field_versions(this.parent_view,f,this.upload_values.bind(this),this.upload_conflict.bind(this));return false},upload_values:function(){var f=this.form.serializeArray();var h=new FormData();var g=0;d.each(f,function(k,j){h.append(j.name,j.value);g+=(j.name.length+j.value.length)});d("> *",this.form).animate({opacity:0.3},400);if(f.length>0){Spontaneous.UploadManager.form(this,h,g)}else{this.close()}d.each(this.parent_view.file_fields(),function(){this.save()})},save_path:function(){return this.parent_view.save_path()},upload_progress:function(f,g){},upload_complete:function(f){this.parent_view.save_complete(f);this.close()},upload_failed:function(f){},upload_conflict:function(g){console.log("conflicted_fields",g);var f=new b.ConflictedFieldDialogue(this,g);f.open()},conflicts_resolved:function(h){console.log("conflicts resolved",h);var g=this.parent_view.field_list(),f={};for(var j=0,k=h.length;j<k;j++){var l=h[j];f[l.field.schema_id()]=l}for(var j=0,k=g.length;j<k;j++){var m=g[j],l=f[m.schema_id()];if(l){console.log(">>> conflicts_resolved",m,l.version);m.set_edited_value(l.value);m.set_version(l.version)}}},cancel:function(){var f=this.parent_view.field_list();for(var g=0,h=f.length;g<h;g++){f[g].cancel_edit()}this.close();return false},close:function(){b.Popover.close();var f=this.parent_view.field_list();for(var g=0,h=f.length;g<h;g++){f[g].close_edit()}d(":input",this.form).add(document).unbind("keydown.savedialog");if(typeof this.parent_view.edit_closed==="function"){this.parent_view.edit_closed()}},view:function(){var g=this.save.bind(this);var j=this.cancel.bind(this);var l=function(x){var w=e.a(".button.save").html(e.cmd_key_label("Save","s")).click(g);var v=e.a(".button.cancel").html(e.key_label("Cancel","Esc")).click(j);var y=e.div(".indent");var u=e.div(".buttons").append(v).append(w);var i=e.div(".editing-toolbar").append(y).append(u);if(x){i.addClass(x)}return i};var h=e.form([".editing-panel",this.parent_view.depth_class()],{enctype:"multipart/form-data",method:"post"});var q=l();var t=e.div(".editing-fields");var o=e.div(".field-group.text");var m=e.div(".field-group.image");var f=this.parent_view.text_fields();var n=e.input({type:"submit"});h.append(q);for(var k=0,s=f.length;k<s;k++){var p=f[k];o.append(this.field_edit(p))}if(f.length>0){t.append(o)}var r=this.parent_view.image_fields();for(var k=0,s=r.length;k<s;k++){var p=r[k];m.append(this.field_edit(p))}if(r.length>0){t.append(m)}t.append(n);h.append(t);h.append(e.div(".clear"));h.append(l("bottom"));__dialogue=this;d("input, textarea",h).focus(function(){__dialogue.field_focus(this)}).blur(function(){});h.submit(this.save.bind(this));this.form=h;d(":input",this.form).add(document).bind("keydown.savedialog",function(v){var u=83,i=27;if((v.ctrlKey||v.metaKey)&&v.keyCode===u){this.save();return false}else{if(v.keyCode===i){j()}}}.bind(this));return this.form},on_show:function(f){if(!f||!(f.focus)||!f.accepts_focus){f=null}var f=f||this.parent_view.text_fields()[0];if(f){f.focus()}},field_focus:function(f){var k=this.parent_view.text_fields(),j=false;for(var g=0,h=k.length;g<h;g++){var l=k[g];if(l.input()[0]===f){j=l;break}}if(j===this.active_field){return}if(this.active_field){this.active_field.on_blur()}if(j){this.active_field=j;this.active_field.on_focus()}},field_edit:function(i){var j=e.div(".field");var f=e.label(".name",{"for":i.css_id()}).html(i.label());if(i.type.comment){var l=e.span(".comment").text("("+i.type.comment+")");f.append(l)}j.append(f);var h=i.toolbar();if(h){j.append(e.div(".toolbar").html(h))}var g=i.edit();j.append(e.div(".value").append(g));var k=i.footer();if(k){j.append(e.div(".footer").html(k))}return j}});return c})(jQuery,Spontaneous);
81
- Spontaneous.AddHomeDialogue=(function(d,c){var e=c.Dom,b=Spontaneous.Dialogue;var a=new JS.Class(b,{initialize:function(f){this.types=f},title:function(){return"Create site home page"},width:function(){return"50%"},buttons:function(){var f={};f.Create=this.create_home.bind(this);return f},uid:function(){return this.content.uid()+"!editing"},create_home:function(){if(this.type){c.Ajax.post("/root",{type:this.type.schema_id},this.home_created.bind(this))}},home_created:function(f){window.location.href=c.Ajax.namespace},select_type:function(f){this.type=f},body:function(){var g=e.div("#create-home-dialogue"),j=e.div(),f=e.p(".instructions"),i=this.types,h=this;f.html('You don\'t have a home page. Please choose a type below and hit <span class="button">Create</span> to add one');d.each(i,function(k,l){if(l.is_page()){var m=e.div(".type").text(l.title).click(function(){d(".type",j).removeClass("selected");h.select_type(l);d(this).addClass("selected")});j.append(m)}});g.append(f,j);return g},cancel_button:function(){return false},});return a})(jQuery,Spontaneous);
82
- Spontaneous.PageBrowser=(function(c,a){var d=a.Dom;var b=new JS.Class(Spontaneous.PopoverView,{initialize:function(e){e=String(e||"");if(/^\//.test(e)){this.origin=e||"/";this.selected=this.origin}else{this.selected=false;this.origin="/"}this.page_list=this.origin_list();this.ancestor_list=this.origin_ancestors()},origin_list:function(){return function(e){return e.generation}},children_list:function(){return function(e){return e.children}},origin_ancestors:function(){return function(e){return e.ancestors}},children_ancestors:function(){return function(e){return e.ancestors.concat(e)}},get_page_list:function(){var e;if(typeof this.origin==="string"){e="/location"+this.origin}else{e="/map/"+this.origin.id}a.Ajax.get(e,this.page_list_loaded.bind(this))},view:function(){var f=d.div(".page-browser"),e=d.div(".page-list");ancestors=d.div(".page-ancestors");f.append(ancestors).append(e);this.wrapper=f;this.table=e;this.ancestors=ancestors;this.get_page_list();return f},page_list_loaded:function(e,f){if(f==="success"){this.table.empty();this.location=e;this.manager.page_list_loaded(this);var k=this.page_list(this.location),r=this.table;for(var j=0,p=k.length;j<p;j++){var m=k[j];r.append(this.get_entry(m))}this.ancestors.empty();var h=this,l=d.ul(),s=this.ancestor_list(this.location);this.depth=s.length;var q=function(g){return function(i){h.ancestor_selected(g);return false}};for(var j=0,p=s.length;j<p;j++){var n=s[j],o=d.li().append(d.a().text(n.title)).append(d.span().text("/")).click(q(n));l.append(o)}if(s.length===0){l.append(d.li().append(d.a().text("Choose a page...")))}this.ancestors.append(l)}},get_entry:function(i){var e=this,g=function(l){return function(){e.page_selected(l);c(this).addClass("active")}};var h=function(){e.next_level(i);return false};var k=d.div(".page").click(g(i)),j=d.a().text(i.title);if(i.children>0){var f=d.span();f.click(h);k.append(f)}k.append(j);if(this.selected&&(i.path===this.selected)){k.addClass("active")}return k},ancestor_selected:function(e){this.page_list=this.origin_list();this.ancestor_list=this.origin_ancestors();this.origin=e;this.get_page_list()},next_level:function(e){this.page_list=this.children_list();this.ancestor_list=this.children_ancestors();this.origin=e;this.get_page_list()},page_selected:function(f){var e=this.table;c(".page",e).removeClass("active");this.selected=f.path;this.manager.page_selected(f)},title:function(){return"Choose Page"},width:function(){return 400},});return b})(jQuery,Spontaneous);
83
- Spontaneous.AddAliasDialogue=(function(d,b){var e=b.Dom,a=Spontaneous.Dialogue;var c=new JS.Class(a,{initialize:function(g,f){this.box_view=g;this.box_view.bind("entry_added",this.alias_added.bind(this));this.type=f},title:function(){return"Add alias to &ldquo;"+this.box_view.name()+"&rdquo;"},buttons:function(){var f={};f.Add=this.add_alias.bind(this);return f},uid:function(){return this.content.uid()+"!add-alias"},add_alias:function(){if(this.target){this.box_view.add_alias(this.target.id,this.type)}},alias_added:function(){this.close()},select_target:function(f){this.target=f},body:function(){var h=e.div("#add-alias-dialogue"),j=e.div(),f=e.p(".instructions"),g=this.targets,i=this;f.html("Choose a target:");h.append(f,j);Spontaneous.Ajax.get(["/targets",this.type.schema_id].join("/"),this.targets_loaded.bind(this));this._outer=j;return h},targets_loaded:function(f){var h=this._outer,g=this;this.targets=f;d.each(f,function(j,k){var l=e.div(".type").text(k.title).click(function(){d(".type",h).removeClass("selected");g.select_target(k);d(this).addClass("selected")});h.append(l)})}});return c})(jQuery,Spontaneous);
84
- Spontaneous.ConflictedFieldDialogue=(function(c,b){var e=b.Dom,a=Spontaneous.Dialogue;var d=new JS.Class(a,{initialize:function(f,g){this.parent_view=f;this.conflicted_fields=g;this.active_conflict=0;this.wrap=e.div("#conflicted-fields-dialogue")},title:function(){return"Conflicted Fields"},width:function(){return"90%"},buttons:function(){var f={};f.Use=this.conflict_resolved.bind(this);return f},resolve_value:function(g,f){g.value=f},conflict_resolved:function(){var f=this.current_conflict();if(f&&f.value){this.show_next_conflict()}},uid:function(){return this.content.uid()+"!editing"},create_home:function(){if(this.type){b.Ajax.post("/root",{type:this.type.schema_id},this.home_created.bind(this))}},home_created:function(f){window.location.href=b.Ajax.namespace},select_type:function(f){this.type=f},current_conflict:function(){return this.conflicted_fields[this.active_conflict]},next_conflict:function(){this.active_conflict+=1;return this.current_conflict()},conflict_panel:function(h){h.empty();var i=this.current_conflict(),j=i.field,f=e.p(".instructions");f.html("The field '"+j.label()+"' has been modified by another person. Please select which version you want to use.");var g=j.conflict_view(this,i);h.append(f);h.append(g.panel());this.conflict_view=g;return h},body:function(){panel=this.conflict_panel(this.wrap);return this.wrap},show_next_conflict:function(){var f=this.next_conflict();if(f){this.conflict_panel(this.wrap)}else{console.log("closing conflict view",this.conflicted_fields);this.parent_view.conflicts_resolved(this.conflicted_fields);this.close()}},cancel_button:function(){return false},});return d})(jQuery,Spontaneous);
85
- Spontaneous.Publishing=(function(f,d){var g=d.Dom,a=Spontaneous.Dialogue;var c=new JS.Class(a,{initialize:function(h){this.change_sets=[]},width:function(){return"90%"},title:function(){return"Publish Changes"},class_name:function(){return"publishing"},body:function(){var h=g.div("#publishing-dialogue").text("publishing");this.wrapper=h;Spontaneous.Ajax.get(["/publish","changes"].join("/"),this.change_list_loaded.bind(this));return h},buttons:function(){btns={};btns.Publish=this.publish.bind(this);return btns},publish:function(){var l=[],k=this.changes_to_publish();for(var h=0,j=k.length;h<j;h++){l.push(k[h].id)}if(l.length>0){Spontaneous.Ajax.post(["/publish","publish"].join("/"),{change_set_ids:l},this.publish_requested.bind(this))}else{}},publish_requested:function(){Spontaneous.TopBar.publishing_started();this.close()},change_list_loaded:function(k){var r=this.wrapper,v=this;r.empty();var q=g.div("#changes.change-list"),u=g.div("#to-publish.change-list");r.append(q,u);if(k.length===0){var o=g.p(".publish-up-to-date").text("The site is up to date");r.append(o);this.disable_button("Publish")}else{var x=g.a(".button").text("Publish All").click(function(){this.set_publish_all(true)}.bind(this));var h=g.a(".button").text("Clear All").click(function(){this.set_publish_all(false)}.bind(this));var j=g.div(".actions").append(g.div().text("Modified pages")).append(x);var p=g.div(".actions").append(g.div().text("Publish pages")).append(h);var t=g.div(".change-sets"),m=g.div(".change-sets");q.append(j,t);u.append(p,m);for(var l=0,s=k.length;l<s;l++){var n=new e(l,this,k[l]);this.change_sets.push(n);t.append(n.panel())}m.append(g.div(".instructions").text("Add pages to publish from the list on the left"));this.changed_entries=t;this.publish_entries=m}},set_publish_all:function(h){this.publish_all=h;f.each(this.change_sets,function(){this.select(h)})},change_set_state:function(k,j){var l="cs-"+k.id,h,i=this;if(j){this.publish_entries.find(".instructions").hide();h=k.selected_panel(l).hide();this.publish_entries.prepend(h);k.panel().disappear();h.appear()}else{h=this.publish_entries.find("#"+l);h.disappear(function(){h.remove();var m=i.publish_entries;if(m.find(".change-set").length==0){m.find(".instructions").fadeIn()}});k.panel().appear()}},selected:function(){var l=[],k;for(var h=0,j=this.change_sets.length;h<j;h++){k=this.change_sets[h];if(k.selected){l.push(k)}}return l},changes_to_publish:function(){var m=[],l=this.selected(),k;for(var h=0,j=l.length;h<j;h++){k=l[h];m=m.concat(k.change.changes)}return m}});var e=new JS.Class({initialize:function(j,h,i){this.id=j;this.dialogue=h;this.change=i;this.selected=false},panel:function(){if(!this._panel){var j=g.div(".change-set"),k=g.div(".inner"),n=g.div(".pages"),o=g.div(".add").append(g.span().text("+")),h=this.pages();for(var l=0,m=h.length;l<m;l++){n.append(g.div(".title").text(h[l].title).append(g.div(".url").text(h[l].path)))}o.click(function(){this.select_toggle()}.bind(this));k.append(n,o);j.append(k);this.wrapper=j;this._panel=j}return this._panel},selected_panel:function(i){var h=this.panel().clone().attr("id",i);h.find(".add").click(this.select_toggle.bind(this)).find("span").text("-");return h},select:function(h){if(h===this.selected){return}this.selected=h;this.dialogue.change_set_state(this,this.selected)},select_toggle:function(){this.select(!this.selected)},update_view:function(){if(this.selected){this.wrapper.addClass("selected")}else{this.wrapper.removeClass("selected")}},pages:function(){if(!this._pages){this._pages=this.change.pages.sort(function(k,j){var i=k.depth,h=j.depth;if(i==h){return 0}return(i<h?-1:1)})}return this._pages}});var b=new JS.Singleton({open_dialogue:function(){a.open(new c())}});return b})(jQuery,Spontaneous);
86
- Spontaneous.Init=(function(b,a){return function(){var d=a.Location,f=a.TopBar,e=a.ContentArea,c=a.Dom.body();d.watch("location",f.location_changed.bind(f));d.watch("location",e.location_changed.bind(e));f.watch("mode",e.display.bind(e));f.watch("mode",d.view_mode_changed.bind(d));a.Editing.watch("page",d.page_loaded.bind(d));c.append(f.panel());c.append(e.init());c.append(a.StatusBar.init());a.User.load();a.Types.init(function(){d.init(function(){f.init()})})}}(jQuery,Spontaneous));
87
- jQuery(Spontaneous.Init);
88
- // YUI compression via shine.magnetised.info
@@ -1,3 +0,0 @@
1
- Spontaneous.Auth=(function(b,a){return{Key:{key:function(c){return c+"_api_key"},save:function(c,d){localStorage.setItem(this.key(c),d)},load:function(c){return localStorage.getItem(this.key(c))},remove:function(c){localStorage.removeItem(this.key(c));return false}}}}(jQuery,Spontaneous));
2
- (function(a){a(function(){a("#login form input").focus(function(){var b=a(this);a("span",b.parent()).addClass("faded")}).blur(function(){var b=a(this);if(b.val()===""){a("span",b.parent()).removeClass("faded").show()}}).keydown(function(){var b=a(this);a("span",b.parent()).hide()}).keyup(function(){var b=a(this);if(b.val()===""){a("span",b.parent()).show()}else{a("span",b.parent()).hide()}}).each(function(){var b=a(this);if(b.val()!==""){a("span",b.parent()).hide()}});a("#login form").submit(function(){var b=a(this);a.ajax({url:b.attr("action"),type:"POST",data:b.serialize(),success:function(c){if(c.key){Spontaneous.Auth.Key.save(Spontaneous.site_id,c.key);window.location.href=c.redirect}},error:function(){a("#failure-message").fadeOut(function(){a("#failed-name").text(a("#user-login").val());a(this).fadeIn()});a("#error-message:hidden").slideDown(200)},dataType:"json"});return false});a("#login form input#user-login").focus()})}(jQuery));
3
- // YUI compression via shine.magnetised.info
@@ -1,2 +0,0 @@
1
- (function(){var n=window,q=document;var p=" -webkit- -moz- -o- -ms- -khtml- ".split(" ");try{function j(e,i,f,c){e.style.cssText=p.join(i+":"+f+";")+(c||"")}function o(e,i,f,c){i+=":";e.style.cssText=(i+p.join(f+";"+i)).slice(0,-i.length)+(c||"")}var x=q.documentElement,v=q.createElement("div"),t=q.createElement("div"),h;o(v,"display","box","width:42px;padding:0;");j(t,"box-flex","1","width:10px;");v.appendChild(t);x.appendChild(v);h=t.offsetWidth;v.removeChild(t);x.removeChild(v);if(h!==42){throw (h)+" Flexible Box Model not supported"}var g=new XMLHttpRequest();if(!g.upload){throw"XMLHttpRequestUpload not supported"}try{var r=new FormData()}catch(s){throw"FormData not supported"}if(!n.File){throw"File API not supported"}var b="createObjectURL",d="revokeObjectURL";if(!n.URL){if(n.webkitURL){n.URL=n.webkitURL}else{n.URL={};if(n.createBlobURL){n.URL[b]=function(c){return n.createBlobURL(c)}}else{if(n[b]){n.URL[b]=function(c){return n[b](c)}}else{n.URL[b]=function(c){return""}}}if(n.revokeBlobURL){n.URL[d]=function(c){return n.revokeBlobURL(c)}}else{if(n[d]){n.URL[d]=function(c){return n[d](c)}}else{n.URL[d]=function(c){return""}}}}}var l=n.File.prototype;if(!l.slice){var u=["webkitSlice","mozSlice"];for(var m=0,k=u.length;m<k;m++){var a=u[m];if(l[a]){l.slice=l[a]}}if(!l.slice){}}try{var m=localStorage.getItem}catch(s){throw"Local Storage not supported"}}catch(s){n.location.href="/@spontaneous/unsupported?msg="+n.encodeURI(s)}}());
2
- // YUI compression via shine.magnetised.info
Binary file
@@ -1,93 +0,0 @@
1
- JS.Command = new JS.Class('Command', {
2
- initialize: function(functions) {
3
- if (JS.isFn(functions))
4
- functions = {execute: functions};
5
- this._functions = functions;
6
- this._stack = this._functions.stack || null;
7
- },
8
-
9
- execute: function(push) {
10
- if (this._stack) this._stack._restart();
11
- var exec = this._functions.execute;
12
- if (exec) exec.apply(this);
13
- if (this._stack && push !== false) this._stack.push(this);
14
- },
15
-
16
- undo: function() {
17
- var exec = this._functions.undo;
18
- if (exec) exec.apply(this);
19
- },
20
-
21
- extend: {
22
- Stack: new JS.Class({
23
- include: [JS.Observable || {}, JS.Enumerable || {}],
24
-
25
- initialize: function(options) {
26
- options = options || {};
27
- this._redo = options.redo || null;
28
- this.clear();
29
- },
30
-
31
- forEach: function(block, context) {
32
- if (!block) return this.enumFor('forEach');
33
- block = JS.Enumerable.toFn(block);
34
-
35
- for (var i = 0, n = this._stack.length; i < n; i++) {
36
- if (this._stack[i] !== undefined)
37
- block.call(context || null, this._stack[i], i);
38
- }
39
- return this;
40
- },
41
-
42
- clear: function() {
43
- this._stack = [];
44
- this.length = this.pointer = 0;
45
- },
46
-
47
- _restart: function() {
48
- if (this.pointer === 0 && this._redo && this._redo.execute)
49
- this._redo.execute();
50
- },
51
-
52
- push: function(command) {
53
- this._stack.splice(this.pointer, this.length);
54
- this._stack.push(command);
55
- this.length = this.pointer = this._stack.length;
56
- if (this.notifyObservers) this.notifyObservers(this);
57
- },
58
-
59
- stepTo: function(position) {
60
- if (position < 0 || position > this.length) return;
61
- var i, n;
62
-
63
- switch (true) {
64
- case position > this.pointer :
65
- for (i = this.pointer, n = position; i < n; i++)
66
- this._stack[i].execute(false);
67
- break;
68
-
69
- case position < this.pointer :
70
- if (this._redo && this._redo.execute) {
71
- this._redo.execute();
72
- for (i = 0, n = position; i < n; i++)
73
- this._stack[i].execute(false);
74
- } else {
75
- for (i = 0, n = this.pointer - position; i < n; i++)
76
- this._stack[this.pointer - i - 1].undo();
77
- }
78
- break;
79
- }
80
- this.pointer = position;
81
- if (this.notifyObservers) this.notifyObservers(this);
82
- },
83
-
84
- undo: function() {
85
- this.stepTo(this.pointer - 1);
86
- },
87
-
88
- redo: function() {
89
- this.stepTo(this.pointer + 1);
90
- }
91
- })
92
- }
93
- });